These are the commands i always use in vi.
#################################### # Moving the cursor in file buffer # #################################### 0 #Go to the first character of the current line $ #Go to the last character of the current line H #Go to the first line of the current page M #Go to the middle line of the current page L #Go to the bottom line of the current page gg #Go to the first line of the file G #Go to the last line of the file <n> #Go to the nth line of the file #################################### # Text editing # #################################### yy #Copy the current line <n>yy #Copy nth rows of lines starting from current line P #Paste text above the current line p #Paste text below the current line u #Undo ctrl+r #Redo . #Repeat last action dw #Delete the word which contains the cursor dd #Delete the current line <n>dd #Delete the nth rows of lines starting from current line
Done =)
Reference: vi cheatsheet from apolzon / meticulous_vim
