teggy
teggy

Reputation: 6315

Vim: loop through buffer with shortcut

I currently have map << <C-^> in my .vimrc to go back to previous buffer. But ideally, I would like to be able to keep pressing << to keep going back on the buffers. Is there a way to map << to loop through all buffers backwards and map >> to loop through all buffers forward?

Upvotes: 0

Views: 446

Answers (1)

sudo bangbang
sudo bangbang

Reputation: 28179

The commands you need to map are bprevious and bnext which are respectively buffer previous and buffer next.

:nnoremap << :bp<cr>
:nnoremap >> :bn<cr>

Upvotes: 2

Related Questions