Vi Cheat sheet

  • write read only file with root privileges
:w !sudo tee %

  • Press the ESC key. At the : prompt type the following command to run on line numbers
:set number

To turn off line numbering, type the following command at the : prompt again

:set nonumber

  • go to file under cursor
gf

  • split window vertically
:vsp

or

:vsp filename