Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

New answers tagged

1

Is there some buffer-local option I can set that allows the buffer to changes but specifies "this is a temporary buffer, but never ever ask me to save changes"? The most essential one is buftype=nofile. Also, :h special-buffers recommends using noswapfile (nowadays often switched off globally) and bufhidden=hide (so a buffer can be reused after :quit-ting ...


2

The situation with buffers is quite complicated. Use :ls (of :buffers) to inspect them. There can be the following states: Active buffer --- both loaded into RAM and shown in (at least one) window. This is what you normally got after :e filename, :buffer N and so on. (flagged "a" by :ls; also when it's in active window, it's flagged by "%") Hidden buffer --...


3

A buffer is listed if it's in the buffer list, you can see it in :h :buffers , you can refer to it with :h :buffer , :h :bnext , etc . It's controled by setting :h 'buflisted' . A buffer is loaded if the corresponding file is loaded into memory. Not all buffers should be listed, e.g. help type buffer is not listed, as no one wants to refer to it with :h :...


1

You can also use Ctrl + o to go to the previous buffer, going backwards. You can keep pressing the same command to go to the previous, previous buffer. You can also use Ctrl + i to go to the next buffer, going forward. I.e, if you had pressed Ctrl + o to go to the previous buffer, you can use Ctrl + i to go to the first/original buffer.


2

A 'scratch' buffer is just an informal term for a place to type arbitrary temporary content. Following the accepted answer and another question, I created the following function in my vimrc. The function creates a blank buffer in the current window and names it 'scratch'. The scratch buffer is not protected if you try to quit. It will be discarded without ...


Top 50 recent answers are included