published on

easy buffer switching in Vim

I love buffers in vim. I’ve been less of a fan of buffer switching ever since I changed my vimrc to not require the initial like so:

nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l 

I recently added this to speed up switching between buffers:

nnoremap <c-n> :bnext<cr>
nnoremap <c-p> :bprev<cr> 

I figured the c-n and c-p were aliases for j and k, so there we go.