Vim Tips Wiki
Register
(Move categories to tip template)
(Remove html character entities)
 
Line 2: Line 2:
 
{{TipImported
 
{{TipImported
 
|id=402
 
|id=402
|previous=401
+
|previous=400
 
|next=404
 
|next=404
 
|created=January 14, 2003
 
|created=January 14, 2003
Line 22: Line 22:
 
<pre>
 
<pre>
 
"Jump between windows
 
"Jump between windows
map &lt;space&gt; &lt;c-W&gt;w
+
map <Space> <c-W>w
 
"Open window wide
 
"Open window wide
map &lt;space&gt;&lt;space&gt; :call OpenSplittedWindowWide()&lt;cr&gt;
+
map <Space><Space> :call OpenSplittedWindowWide()<CR>
 
function OpenSplittedWindowWide()
 
function OpenSplittedWindowWide()
 
normal ^W|
 
normal ^W|
Line 34: Line 34:
   
 
==Comments==
 
==Comments==
:map &lt;space&gt;&lt;space&gt; &lt;c-W&gt;w&lt;c-W&gt;_
+
:map <Space><Space> <c-W>w<c-W>_
   
 
will do the job of swichting and maximizing split windows
 
will do the job of swichting and maximizing split windows
Line 46: Line 46:
   
 
<pre>
 
<pre>
map &lt;C-J&gt; &lt;C-W&gt;j&lt;C-W&gt;_
+
map <C-J> <C-W>j<C-W>_
map &lt;C-K&gt; &lt;C-W&gt;k&lt;C-W&gt;_
+
map <C-K> <C-W>k<C-W>_
 
</pre>
 
</pre>
   
Line 57: Line 57:
   
 
<pre>
 
<pre>
map &lt;c-space&gt; &lt;c-w&gt;w&lt;c-w&gt;_
+
map <c-space> <c-w>w<c-w>_
map &lt;s-space&gt; &lt;c-w&gt;W&lt;c-w&gt;_
+
map &lt;s-space> <c-w>W<c-w>_
 
</pre>
 
</pre>
   
Line 65: Line 65:
   
 
<pre>
 
<pre>
map &lt;C-space&gt; &lt;esc&gt;&lt;C-W&gt;&lt;C-W&gt;
+
map <C-space> <Esc><C-W><C-W>
imap &lt;S-space&gt; &lt;esc&gt;
+
imap &lt;S-space> <Esc>
nmap &lt;S-space&gt; &lt;esc&gt;:
+
nmap &lt;S-space> <Esc>:
 
</pre>
 
</pre>
   

Latest revision as of 02:51, 29 September 2008

Tip 402 Printable Monobook 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).

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.