PracticalVim Tip39 - yszheda/wiki GitHub Wiki

Table of Contents

Tip 39: Divide Your Workspace into Split Window

Return to the top: <> %toc

  • a _window_ is a viewport onto a buffer

References

Creating Split Windows

| Command | Effect | | `S` | Split the current window horizontally, reusing the current buffer in the new window | | `v` | Split the current window vertically, reusing the current buffer in the new window | | `:sp[lit] {file}` | Split the current window horizontally, loading {file} into the new window | | `:vsp[lit] {file}` | Split the current window vertically, loading {file} into the new window |

Changing the Focus Between Windows

| Command | Effect | | `w` | Cycle between open windows | | `h` | Focus the window to the left | | `j` | Focus the window below | | `k` | Focus the window above | | `l` | Focus the window to the right |

  • ``: equivalent to `w`

References:


  • use mouse in gvim (check the 'mouse' option)

References:

Closing Windows

| Ex Command | Normal Command | Effect | | `:cl[ose]` | `c` | Close the active window | | `:on[ly]` | `o` | Keep only the active window, closing all others |

Resizing and Rearranging Windows

| Keystrokes | Buffer Contents | | `=` | Equalize width and height of all windows | | `_` | Maximize height of the active window | | `|` | Maximize width of the active window | | `[N]_` | Set active window height to [N] rows | | `[N]|` | Set active window width to [N] columns |

References:

Rearranging windows

References:

⚠️ **GitHub.com Fallback** ⚠️