Vim

This notes contains useful tips for using Vim or editing and I use spf13-vim.

  • spf13-vim is a distribution of vim plugins and resources for Vim.
  • Install spf13-vim: curl http://j.mp/spf13-vim3 -L -o - | sh

Plugins

Surround

Managing all the ‘”[{}]“’ etc.

  • Characters meaning
    • operations
      • d delete
      • c change
      • y add?
    • s represents surrounding
    • S for visual mode surroundings
    • text object (vim editing)
      • w word
      • iw in word
      • aw all word, including space(s)
    • surroundings
      • ( left bracket will give a space between it and content
      • ) right won’t
      • b = )
  • Examples
    • yss) surround a line of content with ()
    • ysiw<div> surround a word like this <div>nice</div>
    • VS<div> surround a line with <div></div>

Emmet

Emmet is a plugin for many popular text editors which greatly improves HTML & CSS workflow.

Shortcut key: Ctrl + y + ,