String replace global in VI
:%s/search_string/replacement_string/g
delete All lines in a file
dG
delete first 30 lines in a file
1G
30dd
To 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 +