History Report a problem
Article Edit this page Discussion

How to avoid obliterating window layout

From Vim Tips Wiki

(Redirected from VimTip58)
Jump to: navigation, search
 

Tip 58Previous TipNext Tip

Created: March 28, 2001 Complexity: intermediate Author: scotch Minimum version: 5.7 Karma: 8/6 Imported from: Tip#58


If you take the time to lay out several windows with Vim (especially vertically in version 6), you may be bummed when you hit an errant key and find that all but what one window disappears.

What happens: while navigating between windows, you hit <C-W>j, <C-W>k, etc. At some point you accidentally hit <C-W> but then don't follow with a window command.

Now hitting 'o' to start insert mode issues a command equivalent to :only, and closes all windows execept for the one you are in (unless some windows have unsaved changes in them).

How to avoid this: petition the vim-dev mailing list about how :only is sufficient for the infrequenty use this might get (j/k).

Really: use mapping to disable the <C-W>o functionality; put this in your .vimrc:

nnoremap <C-W>O :echo "sucker"<CR>
nnoremap <C-W>o :echo "sucker"<CR>
nnoremap <C-W><C-O> :echo "sucker"<CR>

[edit] References

[edit] Comments

See tip VimTip199 for a way to map these keys to a maximize window - return to split structure function.


Another solution is given by ZoomWin which makes <c-w>o toggle between the multi-window display and a single window.


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
Send this article to a friend
"How to avoid obliterating window layout"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation