Skip to content

Instantly share code, notes, and snippets.

@denitram
Last active June 16, 2018 06:55
Show Gist options
  • Save denitram/2853276 to your computer and use it in GitHub Desktop.
Save denitram/2853276 to your computer and use it in GitHub Desktop.
vi -- handy tips
Copy lines 1-2 /paste after 3
:1,2t3
Move lines 4-5 /paste after 6
:4,5m6
Save lines to new file
:10,15w file
Delete blanke lines
:g/^$/d
Making a list of numbers
:put =range(1,20)
Add line numbers to source code in vim
:%!nl
Start numbering with n
:%nl -v n
Replace all characters up to first comma
:%s/^[^,]*,//
Show Hidden Characters
:set list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment