My friend Cody drinks a lot of Red Juice. When bought from Costco, two 96 fluid ounce bottles of Red Juice come paired like this:
That red connector between the bottles creates a handle for easy transportation. Most people dispose of these connectors and consume the Red Juice with the help…
Often you’ll be working on a file and need to open the file to a specific line (say to crush an annoying bug). Normally an initiate might open the file and then type :42 (or whatever the line number is). However, rather than waste all those keystrokes, you can jump straight to a line with the + option on the command line, like such:
vim +42 marvin.cpp
This way you can jump straight to line 42 in marvin.cpp without having to use extra keystrokes!
I’m pretty sure that it doesn’t save any keystrokes, unless you put it after the file name and get a free space from a tab completion. But, it is still quite useful in cases where an error message has a line number because you may not be able to see the line number after you’ve started Vim.
Ready for the holidays with new features: a Unicode/browser font toggle and a featured trees RSS feed.
Oh, and man… never ever let Vim write a backup file! They did that in the 70’s. Use modern ways for tracking your changes, for God’s sake.
If you’re editing anything important, it should be in version control. Vim’s defaults are awful messy, leaving .swp files everywhere if the editor isn’t closed properly. This can save you a lot of time.
set nobackup
set noswapfile
While it is true that you don’t need backup files if you are using version control, it won’t help you if you haven’t saved the work you’ve done editing and something horrible happens like your computer crashes or your ssh connection dies. So, a better option for keeping the mess of .swp files down is to concentrate them somewhere with set directory:
set directory=~/.vimswap//,/var/tmp//,/tmp//
I learned this particular Vim trick from my friend Jay.