History
Article Edit this page Discussion

Press space to jump between windows and to expand them

From Vim Tips Wiki

(Redirected from VimTip402)
Jump to: navigation, search

Tip 402 Previous Next Created: January 14, 2003 Complexity: basic Author: Klaus Horsten Version: 6.0


Jump between split windows and open them wide. Use only the space-bar for this.

Press space-bar once and you jump to the next window.

Press it twice and the window opens wide for better reading - this works for horizontal and vertically open windows.

Put this in your vimrc:

"Jump between windows
map <Space> <c-W>w
"Open window wide
map <Space><Space> :call OpenSplittedWindowWide()<CR>
function OpenSplittedWindowWide()
  normal ^W|
  normal ^W20+
endfunction

Note: ^W must be generated by vim (must be one character).

[edit] Comments

:map <Space><Space> <c-W>w<c-W>_

will do the job of swichting and maximizing split windows

Only for horizontal open windows, not for vertically open ones.


A more intuitive (for Vi) way of switching between horizontal splits, is using the 'j' and 'k' keys

Following an earlier issued tip, I use the following mappings:

map <C-J> <C-W>j<C-W>_
map <C-K> <C-W>k<C-W>_

This maps Ctrl-j to "go down 1 window and maximize it" This maps Ctrl-k to "go up 1 window and maximize it"


Great tip! I combined CTRL-i/j and the space so CTRL-space and SHIFT-space to move to the next and previous split, respectively.

map <c-space> <c-w>w<c-w>_
map <s-space> <c-w>W<c-w>_

I use -

map <C-space> <Esc><C-W><C-W>
imap <S-space> <Esc>
nmap <S-space> <Esc>:

This way, I can quit to the command mode using just the Shift-Spacebar combination from insert mode.


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
Doctor Who
Legend of Zelda Wiki
Terminator Wiki
Everquest II Wiki
Mystery Science Theater 3000
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions
Send this article to a friend
"Press space to jump between windows and to expand them"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation