PracticalVim Tip40 - yszheda/wiki GitHub Wiki

Table of Contents

Tip 40: Organize Your Window Layouts with Tab Pages

Return to the top: <> %toc

  • a _tab page_ is a container that can hold a collection of windows

References

How to Use Tabs

  • `:lcd {path}`: set the working directory locally for the current window.
  • `:windo lcd {path}`: set the working directory locally for all windows in the current tab page.
References

Opening and Closing Tabs

| Command | Effect | | `:tabe[dit] {filename}` | Open {filename} in a new tab | | `T` | Move the current window into its own tab | | `:tabc[lose]` | Close the current tab page and all of its windows | | `:tabo[nly]` | Keep the current tab page, closing all others |

Switching Between Tabs

| Ex Command | Normal Command | Effect | | `:tabn[ext] {N}` | `{N}gt` | Switch to tab page number {N} | | `:tabn[ext]` | `gt` | Switch to the next tab page | | `:tabp[revious]` | `gT` | Switch to the previous tab page |

Rearranging Tabs

  • `:tabmove [N]`
* `:tabmove 0`: the current tab page is moved to the begging * `:tabmove`: the current tab page is moved to the end
  • use mouse in gvim
⚠️ **GitHub.com Fallback** ⚠️