Monday, November 15, 2010

Vim Tabs

If you are not used with the buffer concept as the buffers do not necessarily visible, and you also want to focus on the current file, you have the tabs in Vim just as you have in Editplus or Notepad++ or most of modern text editors. Here is my vim with two tabs each holding its own windows. Yes, it's important that each tab can hold multiple windows, isn't it cool or what!



Here is how you can work with tabs in Vim.

Create a new tab:

  • - vim -p file1 file2... : Open multiple files each in one tab.
  • - :tabnew [filename] : Crate a new tab, empty or possibly open a file at the same time.
  • - Ctrl-w T : If you have multiple windows opened in one tab, use this command to put the current window into a new tab.


Navigate between tabs:

  • - :tabs : list all opened tabs
  • - :tabn, :tabp: go to next or previous tab. Less convenient. 
  • - gt : go to next tab. Better.

No comments:

Post a Comment