Home

Vim Tip: Useful Buffers Commands

  • Feb. 8th, 2007 at 6:48 PM
EvilPHish evil fish shlomi fish

Vim supports the concept of buffers, which are basically separate files that you can edit simultaneously in the same editor instance. I normally used the commands :bn (next buffer), :bp (previous buffer) and :bd (delete buffer), but I discovered other useful ones a few days ago.

One can display a list of buffers using the :buffers command, which can also be abbreviated as :ls. Besides each buffer is a number. One can then use the :b $NUMBER command to switch to that buffer. Note that if you're using gvim then the Buffers drop-down menu (Alt+B) will display a list of buffers with their numbers and will allow you to select a buffer to switch.

I'm off to a friend's wedding. Happy vimming!

Latest Month

August 2008
S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627282930
31      

Tags