Vi Cheat sheet

Linux Dec 29, 2020

  • 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

Tags

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.