Tip #821: Simplest buffer explorer ever
tip karma |
Rating 22/9, Viewed by 1198
|
created: |
|
November 16, 2004 1:15 |
|
complexity: |
|
basic |
author: |
|
Kartik Agaram |
|
as of Vim: |
|
5.7 |
In the footsteps of vimscript #42 and vimscript #159, here's perhaps the simplest way to select a buffer from the list of all buffers:
nnoremap :e :ls<CR>:e<Space>
Just type ':e' and continue typing '#' and the number of a filename from the list (or a new filename).
A minor drawback is that ':' now doesn't show up immediately (vim waits some time to see if you'll complete the mapping), but I got used to this with no trouble at all. I imagine it'll be the same for most people who type fast - you won't notice that ':' and the next character you type show up together rather than in sequence.
I always get nervous with mappings involving ':' or '/' but this one's created no problems in a couple of months.
<<VimTip is a one-stop resource to vim. Keep it in your $VIM directory |
add java import statements easily (assume using ctags) >>
Additional Notes
|