Saturday, June 11, 2011

Understanding VIM : [Tabs] Tutorial-5

It's quite possible that you may be working on several projects at once, having tabs set up can be a cool way to multi-task without having to see all of your files at once.
If you want to start Vim with more than one file, run vim -p filename1 filename2. This will open each file in its own tab.
Already in a Vim session? You can open a new tab with :tabnew filename to open (or create) a file.
To switch to the next (right) tab use gt in command mode. To switch to the previous (left) tab, use gT.
To close a tab you can use :q. If you're editing one file in a tab and use :wq Or you can use :tabc to save & close it.

    * vim -p filename1 filename2 to open multiple files in tabs from the command line.
    * :tabnew to open a new tab.
    * gt to switch to the next tab.
    * gT to switch to the previous tab.
    * :tabc to close a tab.

You can also combine tabs and viewports -- so you can have a session with multiple viewports in each tab, if you like. Mix and match, Vim is very flexible and if you can think of something that Vim would logically need to do, odds are that it does.

There is, of course, always more. Use Vim's :help function to read more about the various tab commands and functions.

Mastering these techniques will definitely increase your productive with Vim. In the next installments more advanced techniques will be covered. In the meantime, you might also want to check out the vimtutor command (terminal command). It will walk you through some of the more common functions in Vim.

5 comments:

  1. These kind of articles are always attractive and I am happy to find so many good point here in the post writing is simply great thanks for sharing. http://scarprin.biz/

    ReplyDelete
  2. I realise this is off topic but while your blog looks nice it would be far better if you'll be able to use lighter colors too in the design. This will encourage a lot more readers come to check it out more often! http://celabrightreviews.com

    ReplyDelete
  3. Vim tutorial Cheat Sheet , Learn VIM in 5 miunute
    https://www.youtube.com/watch?v=7BDh4bDqG8Y

    ReplyDelete
  4. It is very rare these days to find blogs that provide information someone is looking for. I am glad to see that your blog share valued information that can help to many readers. Thanks and keep writing!
    Sell House Quick San Antonio

    ReplyDelete