History Report a problem
Article Edit this page Discussion

Move through the buffer list without wrecking your window/tab layout

From Vim Tips Wiki

(Redirected from VimTip1242)
Jump to: navigation, search
 

Tip 1242Previous TipNext Tip

Created: May 24, 2006 Complexity: intermediate Author: Anon Minimum version: n/a Karma: 12/9 Imported from: Tip#1242


I have too many ways to move between buffers. The :ls command lists all the buffers and their buffer numbers; :b<number> replaces the contents of the current window with the requested buffer; :gt moves to the next tab; and I configured <leader>w to move to the next window (within a tab). That's a lot of options.

Generally, I want a way to move between 'files' without disturbing my current window and tab layout. As I finally learned, a combination of :sb and 'switchbuf' makes this possible.

The :sb <buffer> (split buffer) command usually opens a new window with the requested buffer. You can give the command a buffer number or a filename. With the set switchbuf=usetab option, you can tell Vim to first search the tab and window list for the requested buffer - if the buffer exists is in a window or tab, the focus goes right to that window. The :sbn (split buffer next), when used with switchbuf, lets me flip through the list of my open files.

[edit] Comments


Rate this article:

Share this article:

Hubs Highlights International Sites Wikia messages
Entertainment
Gaming
Cartoons & Comics
Science Fiction
Hobbies
Sports
See all...
Grand Theft Auto
Terminator Wiki
Legend of Zelda Wiki
Flash Gordon
Everquest II Wiki
Yo-Yo Wiki
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions


Vote for featured Wikia!

Send this article to a friend
"Move through the buffer list without wrecking your window/tab layout"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation