Vim tricks

  • Q in normal mode to execute the last recorded macro
  • use \{-} as non-greedy regex symbol
  • use \_. to match any character including newline (multi-line)
  • use \Vpattern (very non-magic) to match the pattern literally, only ^ and $ will have special meaning
  • classic negative/positive lookahead/behind:
lookbehind lookahead
positive \(atom\)\@<= \(atom\)\@=
negative \(atom\)\@<! \(atom\)\@!

You may also like...

Using two-way merge/conflict tool in (n)vim