Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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.

Janko Marohnić

October 24, 2014
Tweet

More Decks by Janko Marohnić

Other Decks in Programming

Transcript

  1. gc

  2. gcu

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

    • :Move • moves the file • “moves” the buffer • :Mkdir • creates current’s buffer directory
  4. • “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
  5. • 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’
  6. • [x – XML (HTML) encode
 ]x – XML (HTML)

    decode • [u – URL encode
 ]u – URL decode • [y – C String encode
 ]y – C String decode
  7. [x

  8. [u

  9. • 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 {
  10. • 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