17 Vim Tips

Posted by Arkham on October 5th, 2009

vim_bar

  1. <Ctrl>-o – Switch from insert mode to command mode for one single command.
  2. vim +linenumber file – Open file at line number.
  3. vim +/pattern file – Open file at first occurence of pattern.
  4. :next files – Open a list of files, each in a new buffer.
  5. :up[date] – Save a modified file.
  6. “byy + “bp – Copy a line inside named buffer “b” and paste it.
  7. <Ctrl>-] – Follow green links in documentation pages.
  8. <Ctrl>-t – Go back to the previous documentation page.
  9. >ap – Indent whole paragraph.
  10. 10dd + 2. – Delete 10 lines, repeat twice (delete 20 lines more).
  11. VU – Make the whole line uppercase.
  12. V10j + : + !sort – sort alphabetically next 10 lines.
  13. :!uname -a – Display system information.
  14. :! wc % – Display information about current file.
  15. :r!uname -a – Insert system information into the next line.
  16. gg=G – Reformat whole file.
  17. <Ctrl>-n – Start autocompletion.

This entry was posted on Monday, October 5th, 2009 at 02:06 and is filed under computers. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Tags: , , , ,

2 Responses to “17 Vim Tips”

  1. dark Says:

    You forgot the most important one: “don’t use it”.

  2. Arkham Says:

    When I need a test editor, I always use vim.
    When I need an OS, I sometimes use emacs.