Add a vim function for centering the buffer

This commit is contained in:
Michael Campagnaro 2017-07-10 11:11:32 -04:00
parent 1f8f7b6c99
commit a3cff8895e

22
vimrc
View File

@ -409,11 +409,33 @@ inoremap <s-tab> <c-n>
" 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 <leader>c :call CenterPane()<cr>
function! RemoveCenterPane()
wincmd w
close
endfunction
nnoremap <leader>cw :call RemoveCenterPane()<cr>
"////////////////////////////////////////////////////////////////
" TEXT ALIGNMENT PLUGIN
"////////////////////////////////////////////////////////////////
let b:lion_squeeze_spaces = 1
"////////////////////////////////////////////////////////////////
" STATUS LINE
"////////////////////////////////////////////////////////////////