List of useful functions in VI
| Commands |
Descriptions |
| a |
Append text from current position |
| i |
Insert text from current position |
| x |
Delete a single character from current position |
| dd |
Delete a single line from current position |
| / |
Start a search by entering the search string after the / . When the / is pressed again , the same search string can be looked for again by just pressing enter |
| :q |
Quits from the editor |
| :w |
Saves the current changes to the files |
| :wq |
Writes and then quits from the editor |
| :q! |
Quits without saving changes/the file |
| 1G |
Jump to the top of the file |
| G |
Jump to the bottom of the file |
| yy or Y |
Copy line to paste |
| p |
Paste after cursor |
| P |
Paste before cursor |
| ~ |
changes the case on the highlighted character (note: while not in edit mode)
|
| cw |
change word - sit on the first letter of a word, type cw, this will change the last letter of the word to a $ to indicate the ending of the selected word, type the replacement word and press ESC to change |
|