From 9b3ec982a4a91e8cb41bedcd2c1fa844043e35f8 Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 5 May 2014 04:26:11 -0400 Subject: [PATCH] Goyo is configured to toggle with , 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. --- vim/config/keyboard.vim | 1 + vim/config/plugins.vim | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/vim/config/keyboard.vim b/vim/config/keyboard.vim index cd5dd1e..054ac74 100644 --- a/vim/config/keyboard.vim +++ b/vim/config/keyboard.vim @@ -29,6 +29,7 @@ " p | (A) -> comment the current paragraph " + | (V) -> increase the selected region " _ | (V) -> decrease the selected region +" | (N) -> center content and hide everything else " " (surround) " S" | (V) -> surround selection with quotes diff --git a/vim/config/plugins.vim b/vim/config/plugins.vim index d683849..8f23d9d 100644 --- a/vim/config/plugins.vim +++ b/vim/config/plugins.vim @@ -30,6 +30,18 @@ endif "}}} +"GOYO: {{{ + nnoremap :Goyo + 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: {{{ let g:gundo_right=1 let g:gundo_width=35