Skip to content

Instantly share code, notes, and snippets.

@vcavallo vcavallo/vim-centerpane
Last active Oct 19, 2017

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.

Copy link
Owner Author

commented Oct 19, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.