Vim Splits - Move Faster and More Naturally

Adarsh Pandit April 18, 2013 vim Most of us are Vim users and have tweaked our favorite editor for speed and convenience. See thoughtbot’s dotfiles . One of my favorite tools is the window split. Here is a quick splits overview and configurations to use them more effectively. Photo credit: Andrew Ressa on Flickr Create a vertical split using :vsp and horizontal with :sp . By default, they duplicate the current buffer. This command also takes a filename: :vsp ~/.vimrc You can specify the new split height by prefixing with a number: :10sp ~/.zshrc Close the split like you would close vim: :q We can use different key mappings for easy navigation between splits to save a keystroke. So instead of ctrl-w then j , it’s just ctrl-j : nnoremap <C-J> <C-W><C-J> nnoremap <C-K> <C-W><C-K> nnoremap <C-L> <C-W><C-L> nnoremap <C-H> <C-W><C-H> Open new split panes to...

Linked on 2015-05-13 21:46:01 | Similar Links