Vim Tips Wiki
Advertisement
Tip 1541 Printable Monobook Previous Next

[[Vim_Tips_Wiki:New_tips{{{subpage}}}#Fast jump to next PHP variable on current line|created]] December 10, 2007 · complexity basic · author V silent · version 7.0


Put these lines in your vimrc:

noremap L f$
noremap H F$

Then press L to jump to the next $variable on the current line.

Press H to jump to the previous $variable.

Comments

 TO DO 

  • The tip should start with an example so the problem can be understood by general readers.
  • The first solution offered should be the standard Vim technique: Press f$ for the first jump, and ; or , for any subsequent jumps.
  • Then offer the mappings as a proposed improvement.
  • Note that L and H are already mapped. L will take you to the last line in the window, H to the first: :help L, :help H.
  • For the mapping, you may want to use the ctrl or meta (alt) key, or some key sequence (<leader> may be useful - see :help mapleader).

Advertisement