Skip to content

Instantly share code, notes, and snippets.

@geek182
Last active May 20, 2018 11:54
Show Gist options
  • Save geek182/da37728ce3ddc4fe8b5016ba1c86cc3f to your computer and use it in GitHub Desktop.
Save geek182/da37728ce3ddc4fe8b5016ba1c86cc3f to your computer and use it in GitHub Desktop.
vim-survival-kit
#Search and replace
:s/foo/bar/g Change each 'foo' to 'bar' in the current line.
:%s/foo/bar/g Change each 'foo' to 'bar' in all the lines.
:5,12s/foo/bar/g Change each 'foo' to 'bar' for all lines from line 5 to line 12 (inclusive).
Comment all lines: :%s/^/#
Comment lines 10 - 15: :10,15s/^/#
Comment line 10 to current line: :10,.s/^/#
Comment line 10 to end: :10,$s/^/#
#delete
#Delete Line 10 to 15
:10,15d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment