I was wondering how to turn off the search highlight in vi as it’s distracting when trying to code through yellow blobs of highlighting. [code]:nohlsearch[/code] and the highlighting disappears. Ideal.
I was just editing a file in vi on my iPad using diet coda. Hadn’t saved it and the app crashed. Boo. Tried to open the .swp file, oops, don’t do that. Instead, use: [code]vi -r file[/code] Open the file as if it existed, but using the -r flag (recover, suprisingly) vi will look for […]
There are some by handy shortcuts in vi, to say the least, it’s a very comprehensive program. So here is how to turn on line numbers in vi and how to goto line in vi. To turn line numbers on, do [code]:set number[/code] To jump to a specific line, a colon followed by the number […]
sometimes you are editing a file and need to quickly do something back on the command line. the usual practice would be to save the file, exit to the shell, do your stuff, then reopen the file again… instead, when in vi, do :sh this will send you back to your command line, where you […]
the amount of times i have been editing away at a file in vi and gone to save it only to realise i’m not root… if my edits were all in one block, i’d usually end up copying the text with my mouse, closing the file, su to root, open it up, paste, zzz…. so. […]