Goyo is configured to toggle with <Leader><Space>, and to set its width

using either the filetype's textwidth value, or if none is set either 78
columns or the widest line if any are longer than that.
This commit is contained in:
Kevin 2014-05-05 04:26:11 -04:00
parent 366bdb715c
commit 9b3ec982a4
2 changed files with 13 additions and 0 deletions

View file

@ -29,6 +29,7 @@
" <Ctrl-_>p | (A) -> comment the current paragraph " <Ctrl-_>p | (A) -> comment the current paragraph
" + | (V) -> increase the selected region " + | (V) -> increase the selected region
" _ | (V) -> decrease the selected region " _ | (V) -> decrease the selected region
" <Leader><Space> | (N) -> center content and hide everything else
" "
" (surround) " (surround)
" S" | (V) -> surround selection with quotes " S" | (V) -> surround selection with quotes

View file

@ -30,6 +30,18 @@
endif endif
"}}} "}}}
"GOYO: {{{
nnoremap <Leader><Space> :Goyo<CR>
autocmd VimEnter,Filetype *
\ let g:goyo_width = &textwidth |
\ if (g:goyo_width == 0) |
\ let g:goyo_width = max(map(getline(1,'$'), 'len(v:val)')) |
\ if (g:goyo_width < 78) |
\ let g:goyo_width = 78 |
\ endif |
\ endif
"}}}
"GUNDO: {{{ "GUNDO: {{{
let g:gundo_right=1 let g:gundo_right=1
let g:gundo_width=35 let g:gundo_width=35