diff --git a/vimrc b/vimrc index 3010e05..42a159c 100644 --- a/vimrc +++ b/vimrc @@ -409,11 +409,33 @@ inoremap " LAYOUT """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +"//////////////////////////////////////////////////////////////// +" CENTER THE BUFFER +"//////////////////////////////////////////////////////////////// + + function! CenterPane() + " centers the current pane as the middle 2 of 4 imaginary columns + " should be called in a window with a single pane + " Taken from https://dev.to/vinneycavallo/easily-center-content-in-vim + lefta vnew + wincmd w + exec 'vertical resize '. string(&columns * 0.75) + endfunction +nnoremap c :call CenterPane() + +function! RemoveCenterPane() + wincmd w + close +endfunction +nnoremap cw :call RemoveCenterPane() + + "//////////////////////////////////////////////////////////////// " TEXT ALIGNMENT PLUGIN "//////////////////////////////////////////////////////////////// let b:lion_squeeze_spaces = 1 + "//////////////////////////////////////////////////////////////// " STATUS LINE "////////////////////////////////////////////////////////////////