Vim logo vim online Vim Book Ad

basic Tip #402: Just using space-bar: jump between splitted windows and open them wide

 tip karma   Rating 11/8, Viewed by 656 

created:   January 14, 2003 9:30      complexity:   basic
author:   Klaus Horsten      as of Vim:   6.0

Jump between splitted 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).
-------------------------------
The first tip is not new I know it - to jump between windows using the space-bar.
But the combination jumping and opening wide with just using the space-bar this is new.
If not, please apologize, I cannot know all the tips and possibilites published.

 rate this tip  Life Changing Helpful Unfulfilling 

<<A mapping for easy switching between buffers | Request for tip - interleaving '.' and '@:' >>

Additional Notes

[email protected], January 14, 2003 18:50
yowzer.  That is too nice.
[email protected], January 15, 2003 5:47
:map <space><space> <c-W>w<c-W>_ will do the job of swichting and maximaizing splitted windows
Klaus Horsten <[email protected]>, January 16, 2003 7:30
>:map <space><space> <c-W>w<c-W>_ will do the job of swichting and maximaizing splitted windows

Only for horinzontal open windows not for vertically open ones.

Klaus
[email protected], January 16, 2003 11:52
Fantastic.

Dieter
[email protected], January 24, 2003 2:25
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"
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 [email protected] after searching the archive. Help Bram help Uganda.
SourceForge Logo