Showing posts with label vi options. Show all posts
Showing posts with label vi options. Show all posts

Vi Editor Short cut Keys

Vi Editor Short cut Keys
1. To replace the word in the file
%s/old_word/new_word/
2. To replace the word throughout in the file
%s/old_word/new_word/g
3.To scroll Forward the screen
ctl+f
4.To scroll Forward half the screen
ctl+d
5.To scroll backward the screen
ctl+b
6.To sroll half backward the screen
ctl+u
7.To Know where you are in the file
ctl+g
8.To scroll forward a word
w
9.To scroll backward a word
b
10.To scroll end of the word
e
11 To delete the line
dd
12.To delete 'n' number of character
nx
12.To delete a line
dd
13. To open multiple file at a time
vi file1 file2 file3
14. How to scroll between multiple files in vi?
n - used to scroll the next files
rw -used to rewind to first file
15. How to delete a word
dw - delete a word
16.How to yank and paste
yy - used to yank lines
nyy - used to yank n number of link
p - used to paste the yanked lines