Quickly switching buffers in Vim normal mode

Add this to your .vimrc

map gn :bnext<cr>
map gp :bprevious<cr>
map gd :bdelete<cr>  

" I personally use <leader> 
map <leader>n :bnext<cr>
map <leader>p :bprevious<cr>
map <leader>d :bdelete<cr>

Note that you are remapping gp and gd, but maybe you don’t care about that (:help gp, :help gd).

For more information on how to map key strokes see :help map-overview and :help map.txt.

Btw, I personally use <leader> instead of g in the mapping. My <leader> is set to ;. This puts my <leader> key on the home row which makes me willing to map all kinds of stuff using <leader>. :help mapleader if you want to change your <leader> key.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)