String replace global in VI
:%s/search_string/replacement_string/gdelete All lines in a file
dGdelete first 30 lines in a file
1G
30ddTo go to first line of file
gg
or
1G
To go to last line of file
G
To copy all contents of a file to clipboard
:%y+
or go to first line of file and copy
gg"*yG
Paste from clipboard
"*p
* is a register. you can also use +