|
| 1 | +goyo.txt goyo Last change: April 1 2017 |
| 2 | +GOYO - TABLE OF CONTENTS *goyo* *goyo-toc* |
| 3 | +============================================================================== |
| 4 | + |
| 5 | + goyo.vim (고요) |
| 6 | + Installation |
| 7 | + Usage |
| 8 | + Dimension expression |
| 9 | + Configuration |
| 10 | + Callbacks |
| 11 | + Inspiration |
| 12 | + Pros. |
| 13 | + License |
| 14 | + |
| 15 | +GOYO.VIM (고요) *goyo* |
| 16 | +============================================================================== |
| 17 | + |
| 18 | +Distraction-free writing in Vim. |
| 19 | + |
| 20 | +https://raw.github.com/junegunn/i/master/goyo.png |
| 21 | + |
| 22 | +(Color scheme: {seoul256}{1}) |
| 23 | + |
| 24 | +Best served with {limelight.vim}{2}. |
| 25 | + |
| 26 | + {1} https://github.com/junegunn/seoul256.vim |
| 27 | + {2} https://github.com/junegunn/limelight.vim |
| 28 | + |
| 29 | + |
| 30 | +INSTALLATION *goyo-installation* |
| 31 | +============================================================================== |
| 32 | + |
| 33 | +Use your favorite plugin manager. |
| 34 | + |
| 35 | + *:PlugInstall* |
| 36 | + |
| 37 | + - {vim-plug}{3} |
| 38 | + 1. Add `Plug 'junegunn/goyo.vim'` to .vimrc |
| 39 | + 2. Run `:PlugInstall` |
| 40 | + |
| 41 | + {3} https://github.com/junegunn/vim-plug |
| 42 | + |
| 43 | + |
| 44 | +USAGE *goyo-usage* |
| 45 | +============================================================================== |
| 46 | + |
| 47 | + *:Goyo* |
| 48 | + |
| 49 | + - `:Goyo` |
| 50 | + - Toggle Goyo |
| 51 | + - `:Goyo [dimension]` |
| 52 | + - Turn on or resize Goyo |
| 53 | + - `:Goyo!` |
| 54 | + - Turn Goyo off |
| 55 | + |
| 56 | +The window can be resized with the usual count]<CTRL-W + `>`, `<`, `+`, `-` |
| 57 | +keys. |
| 58 | + |
| 59 | + |
| 60 | +< Dimension expression >______________________________________________________~ |
| 61 | + *goyo-dimension-expression* |
| 62 | + |
| 63 | +The expected format of a dimension expression is |
| 64 | +`[WIDTH][XOFFSET][x[HEIGHT][YOFFSET]]`. `XOFFSET` and `YOFFSET` should be |
| 65 | +prefixed by `+` or `-`. Each component can be given in percentage. |
| 66 | +> |
| 67 | + " Width |
| 68 | + Goyo 120 |
| 69 | +
|
| 70 | + " Height |
| 71 | + Goyo x30 |
| 72 | +
|
| 73 | + " Both |
| 74 | + Goyo 120x30 |
| 75 | +
|
| 76 | + " In percentage |
| 77 | + Goyo 120x50% |
| 78 | +
|
| 79 | + " With offsets |
| 80 | + Goyo 50%+25%x50%-25% |
| 81 | +< |
| 82 | + |
| 83 | +CONFIGURATION *goyo-configuration* |
| 84 | +============================================================================== |
| 85 | + |
| 86 | + *g:goyo_width* *g:goyo_height* *g:goyo_linenr* |
| 87 | + |
| 88 | + - `g:goyo_width` (default: 80) |
| 89 | + - `g:goyo_height` (default: 85%) |
| 90 | + - `g:goyo_linenr` (default: 0) |
| 91 | + |
| 92 | + |
| 93 | +< Callbacks >_________________________________________________________________~ |
| 94 | + *goyo-callbacks* |
| 95 | + |
| 96 | +By default, {vim-airline}{4}, {vim-powerline}{5}, {powerline}{6}, |
| 97 | +{lightline.vim}{7}, {vim-signify}{8}, and {vim-gitgutter}{9} are temporarily |
| 98 | +disabled while in Goyo mode. |
| 99 | + |
| 100 | +If you have other plugins that you want to disable/enable, or if you want to |
| 101 | +change the default settings of Goyo window, you can set up custom routines to |
| 102 | +be triggered on `GoyoEnter` and `GoyoLeave` events. |
| 103 | +> |
| 104 | + function! s:goyo_enter() |
| 105 | + silent !tmux set status off |
| 106 | + silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z |
| 107 | + set noshowmode |
| 108 | + set noshowcmd |
| 109 | + set scrolloff=999 |
| 110 | + Limelight |
| 111 | + " ... |
| 112 | + endfunction |
| 113 | +
|
| 114 | + function! s:goyo_leave() |
| 115 | + silent !tmux set status on |
| 116 | + silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z |
| 117 | + set showmode |
| 118 | + set showcmd |
| 119 | + set scrolloff=5 |
| 120 | + Limelight! |
| 121 | + " ... |
| 122 | + endfunction |
| 123 | +
|
| 124 | + autocmd! User GoyoEnter nested call <SID>goyo_enter() |
| 125 | + autocmd! User GoyoLeave nested call <SID>goyo_leave() |
| 126 | +< |
| 127 | +More examples can be found here: {Customization}{10} |
| 128 | + |
| 129 | + {4} https://github.com/bling/vim-airline |
| 130 | + {5} https://github.com/Lokaltog/vim-powerline |
| 131 | + {6} https://github.com/Lokaltog/powerline |
| 132 | + {7} https://github.com/itchyny/lightline.vim |
| 133 | + {8} https://github.com/mhinz/vim-signify |
| 134 | + {9} https://github.com/airblade/vim-gitgutter |
| 135 | + {10} https://github.com/junegunn/goyo.vim/wiki/Customization |
| 136 | + |
| 137 | + |
| 138 | +INSPIRATION *goyo-inspiration* |
| 139 | +============================================================================== |
| 140 | + |
| 141 | + - {LiteDFM}{11} |
| 142 | + - {VimRoom}{12} |
| 143 | + |
| 144 | + {11} https://github.com/bilalq/lite-dfm |
| 145 | + {12} http://projects.mikewest.org/vimroom/ |
| 146 | + |
| 147 | + |
| 148 | +PROS. *goyo-pros* |
| 149 | +============================================================================== |
| 150 | + |
| 151 | + 1. Works well with splits. Doesn't mess up with the current window arrangement |
| 152 | + 2. Works well with popular statusline plugins |
| 153 | + 3. Prevents accessing the empty windows around the central buffer |
| 154 | + 4. Can be closed with any of `:q[uit]`, `:clo[se]`, `:tabc[lose]`, or `:Goyo` |
| 155 | + 5. Can dynamically change the width of the window |
| 156 | + 6. Adjusts its colors when color scheme is changed |
| 157 | + 7. Realigns the window when the terminal (or window) is resized or when the size |
| 158 | + of the font is changed |
| 159 | + 8. Correctly hides colorcolumns and Emojis in statusline |
| 160 | + 9. Highly customizable with callbacks |
| 161 | + |
| 162 | + |
| 163 | +LICENSE *goyo-license* |
| 164 | +============================================================================== |
| 165 | + |
| 166 | +MIT |
| 167 | + |
| 168 | + |
| 169 | +============================================================================== |
| 170 | +vim:tw=78:sw=2:ts=2:ft=help:norl:nowrap: |
0 commit comments