vi editor is great even trough ssh sessions!
vi
command is usually an alias or symbolic link to the vim program.If you type a number before any of these commands, then the command will be executed that many times. This number is called a repetition count or simply count. For example, 5h will move left five characters. You can use repetition counts with many vi commands.
When you want to write and exit from a file consider you permissions, the bellow command write out the current file using sudo::w !sudo tee %
:w – Write a file (actually buffer). !sudo – Call shell with sudo command. tee – The output of write (vim :w) command redirected using tee. % – The % is nothing but current file name.
:edit
) reload the file from the disk:!cmd Run a shell command, shows you the output and prompts you before returning to your current buffer.
:help
or :help keyword
and vim will open help for keyword.