grep current word

While pairing a coworker remarked that I’m able to jump around in vim quite quickly. While I use a number of techniques to jump around, including gf, rails-vim A, R and their family. I came up with a variation on the ever handy *. Using the star will jump to the next occurrence of the word under the cursor. This jump jump is limited to the current file. I thought it might be handy to have a leader command to quickly be able to Ggrep for <cword> (the word under the cursor).

Continue reading »

Project local vimrc

I recently began freelancing again, which means working on many different projects. Diverse projects bring diverse needs with respect to vim configuration. For example commands to fire off tests can vary based on testing framework or file system layout.

Continue reading »

Show relative line numbers

Many operations in Vim can be executed over a given number of lines. For example, d3j will delete the current line, plus the 3 below it. You may find yourself reading the line numbers and then subtracting two numbers in your head to decide how many lines to execute a command over. But there is a better way.

Continue reading »