Instantly share code, notes, and snippets.

What would you like to do?
vimscript function to center a lone pane in the window
" centers the current pane as the middle 2 of 4 imaginary columns
" should be called in a window with a single pane
function CenterPane()
lefta vnew
wincmd w
exec 'vertical resize '. string(&columns * 0.75)
" optionally map it to a key:
" nnoremap <leader>c :call CenterPane()<cr>

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment