Question

I get the old buffers to be opened when I press

Ctrl-O

I want only to browse buffers which I have opened in the current Vim session.

How can you browse fast between current buffers in Vim with Ctrl-O?

Was it helpful?

Solution

unfortunately I don't know how to make CTRL-O to behave the way you'd like. But I can offer you a couple of tips that might be helpful to you.

  1. You can use g; and g, to jump to the places where you have made a change, but only in the current buffer.

    I know this is not the same as CTRL-O/I, since this is only about "changes", and it only tracks the current buffer, but it might be useful anyway.

  2. You can quickly navigate your opened buffers with a mapping in your .vimrc like this:

    nmap <special> <C-Up> :bnext<CR>
    nmap <special> <C-Down> :bprevious<CR>
    

I know this doesn't really answer your question, but I thought that maybe these couple of tips might help a little with your vimming.


Edit: I wanted to add, that since you are interested in fast browsing of buffers, I personally recommend a little plugin called QuickBuf:

http://www.vim.org/scripts/script.php?script_id=1910

I map it in my .vimrc as this:

let g:qb_hotkey = ",b"

Try it, it way faster than typing :ls and another neat thing is that you can move on the list with j/k and press <enter> to select the buffer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top