Skip to content

Instantly share code, notes, and snippets.

@janosgyerik
Last active December 24, 2016 04:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janosgyerik/8556496 to your computer and use it in GitHub Desktop.
Save janosgyerik/8556496 to your computer and use it in GitHub Desktop.
Things only Vim can do easily
  1. Works even under the most spartan conditions (in a simple remote shell window such as xterm, putty), with syntax highlighting, function folding, tabs, buffers, and all that lightning fast
  2. Delete lines matching pattern: g/pattern/d
  3. Delete lines not matching pattern: g!/pattern/d
  4. Sort buffer: :%sort
  5. Filter buffer through command :%!sort -u
  6. Delete from current line until end of file (try with a large file!)
  7. Increment numeric values: C-a, C-x
  8. Complete line pattern C-x C-l
  9. Convert a DOS file (with CRLF line endings) to UNIX: :set ff=unix (and then save it)
  10. Multiple marks, with m + register name, for example ma. Jump to a mark using ' + register name, for example 'a
  11. Macros: record keystrokes, assign them to a particular key on the keyboard, and then play them back one or more times later. (With certain macros, the C-a trick above also comes in handy!)
  12. Edit binary files (with a little help from xxd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment