Skip to content

Instantly share code, notes, and snippets.

@vcavallo
Last active October 19, 2017 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vcavallo/c3147fca261c78bd9c4a3648089b22e8 to your computer and use it in GitHub Desktop.
Save vcavallo/c3147fca261c78bd9c4a3648089b22e8 to your computer and use it in GitHub Desktop.
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)
endfunction
" optionally map it to a key:
" nnoremap <leader>c :call CenterPane()<cr>
@vcavallo
Copy link
Author

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