Vim for PHP

From xoa
Jump to: navigation, search

Vim for PHP: Andrei somebody http://www.gravitonic.com/talks/

use hjkl instead of arrow keys

0 moves to beginning of line

marks can be used as range modifiers, like =`a to reformat from here to a mark.

<Ctrl-R>= does expression eval

  • f/Fx move to first "x"
  • t/Tx moves to first "x" but stops just before it
  • \c forces case-insenstive in searching
  • \C forces sensitive

Text objects

  • ambient = greedy, inner = non-greedy
  • ci{ = change everything inside braces
  • ci' = change everything inside quotes
  • ci' = change inside double quotes

Macros with q and @

Block mode

  • A<text><esc> = append something at the end of every line
  • I<text><Esc> = insert before every line

Ctrl-X and Ctrl-F does completion on stuff. He finds it so useful he remapped <Tab> to it.

Ctrl-W Ctrl-] does tag open in a new window