Tip #55: previous buffer
tip karma |
Rating 84/33, Viewed by 2637
|
created: |
|
March 27, 2001 21:33 |
|
complexity: |
|
basic |
author: |
|
[email protected] |
|
as of Vim: |
|
5.7 |
One of the keys to vim is buffer management. If I have to use another IDE that makes me click on a tab every time I want to look at another file I'm going to go postal.
So of course you know about :ls which lists all the current open buffers. This gets a little unweildly once you have a full project open so you can also use :b <any snipit of text> <tab> to complete to an open buffer. This is really nice because you can type any fragment of a file name and it will complete to the matching file. (i.e. RequestManager.java can be completed using "tma"<tab> or "req"<tab> or "r.java"<tab>).
Now for awhile I was also using :bn and :bp which jumps you to the next and previous buffer respectively. I found I was often frustrated because I wanted :bp to be the previous buffer I was in, not the previous buffer in the list. So (drum roll) the reason I wrote this tip was because of:
:b#
jump to the previous buffer you were in. Very very handy. The only thing nicer are tag, but that's a tip for another time.
:help buffers
:help bn
:help bp
If anybody knows where to get help on # in this context please add notes.
<<View a Java Class File Decompiled thru Vim |
how to avoid obliterating window layout >>
Additional Notes
|