Hidden features of your Vim plugins

Hidden features of your Vim plugins

We have a lot of Vim plugins from which we usually use only their main functionality. But if you read through their documentation, you may uncover secret gems that might be useful.

376e4eb9dc6c2e33d1330262edc4f109?s=128

Janko Marohnić

October 24, 2014
Tweet

Transcript

  1. Hidden features of your Vim plugins janko-m @jankomarohnic

  2. vim-commentary

  3. None
  4. gc

  5. None
  6. gcu

  7. None
  8. vim-eunuch

  9. • :Remove • deletes the file • deletes the buffer

    • :Move • moves the file • “moves” the buffer • :Mkdir • creates current’s buffer directory
  10. • :SudoEdit
 :SudoWrite • “handy when you forgot to use

    sudo to invoke Vim”
  11. vim-fugitive

  12. • “A Git wrapper so awesome it should be illegal”

    • :Gstatus • opens an interactive `git status`window • :Glog • loads commit messages into quickfix • :Gblame • opens an interactive `git blame` window
  13. • :Gmerge • without arguments loads conflicted files into a

    quickfix
  14. vim-unimpaired

  15. • Very intuitive mappings for common actions • List traversal

    • [q – :cnext
 ]q – :cprevious • Quickfix, Buffer, Location, Tag list • [n – next conflict marker
 ]n – previous conflict marker • Option toggling • [ow ]ow – toggle ‘wrap’ • [os ]os – toggle ‘spell’ • [or ]or – toggle ‘relativenumber’
  16. • [x – XML (HTML) encode
 ]x – XML (HTML)

    decode • [u – URL encode
 ]u – URL decode • [y – C String encode
 ]y – C String decode
  17. None
  18. [x

  19. None
  20. None
  21. None
  22. [u

  23. None
  24. vim-surround

  25. • Surrounds text with delimiters • “text”
 ‘text’
 (text)
 {text}


    [text]
 … • Create/change/delete “surroundings” • works with Vim’s “text objects” • Intuitive mappings • ysiw” = you surround inner word with “ • ds” = delete surrounding “ • csip[{ = change surrounding of inner paragraph from [ to {
  26. None
  27. None
  28. Shift-S + t

  29. None
  30. None
  31. vim-projectionist

  32. • Connection between files • Alternate (:A) • app/models/user.rb ⟷

    spec/models/user_spec.rb • Related (:R) • app/models/user.rb ⟷ db/schema.rb • Assign compilers • :make → rspec|cucumber|bundle
  33. :Econtroller home

  34. :Emodel user

  35. :Eservice register_user

  36. None
  37. :Econtroller home

  38. Read documentation It’s usually really awesome in Vim world