sponsor Vim development Vim logo Vim Book Ad

incbufswitch.vim : Switch buffers using an incremental search

 script karma  Rating 39/13, Downloaded by 1732  Comments, bugs, improvements  Vim wiki

created by
Michael Denio
 
script type
utility
 
description
Switch to a different buffer in the current window by incrementally typing the name.

Usage:

(1) Define a normal key mapping to :IncBufSwitch or leave the default of <C-S>
(2) In normal mode, start typing the name of the buffer you want to switch to.
(3) Press <BS> if make an error
(4) Press <TAB> to find the next matching buffer
(5) Press either <CR> or <ESC> when you are done

For example, if you have the following files in memory:

foo.c, bar.c, baz.c, structs.h

and you are currently editing foo.c.

Example 1: You press <C-S> and type s<CR>.  You are now editing structs.h.
Example 2: You press <C-S> and type b.  Buffer switches to bar.c.  If you press <TAB> baz.c enters the window.

The project I work on has a LOT of files.  It is not uncommon to have 20-30 files in memory at any given time.  I find that this allows me to switch amongst them much faster.

Let me know of any ideas or problems.
 
install details
(1) Drop in your plugin directory

(2) The default key mapping of <C-S> will get you started.  If you like, define your own mapping and the script will use that.  See the script header for details.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
incbufswitch.vim 1.1 2003-06-24 6.0 Michael Denio Added <TAB> command to find next matching buffer, <ESC> now returns to originating buffer.
incbufswitch.vim 1.0 2003-06-18 6.0 Michael Denio Initial upload
ip used for rating: 107.23.85.179

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github