sponsor Vim development Vim logo Vim Book Ad

shootingstar : Like the magic * but start matching at the cursor position

 script karma  Rating 1/1, Downloaded by 1457  Comments, bugs, improvements  Vim wiki

created by
Jan Christoph Ebersbach
 
script type
utility
 
description
* Given your cursor (|) is here: shoo|ting start
*  Pressing \* will search for the term ting if it's part of the word \<shooting\>
*  In vim search syntax this is equivalent to: /\<shoo\zsting\>

Supported keybindings
* <Leader>* and <Leader># for searching forward/backward for the exact word
* <Leader>g* and <Leader>g# for searching forward/backward without stopping at word boundaries

Why would I need that? Peronsally, I'm using the * often when I want to refactor code, e.g. change the name of a variable or function. Often I just want to change a certain part of the name and it would come very handy if the search would be able to place the cursor right there. I'm too lazy to pull up the original search term and edit it, so I end up typing the whole name during the change. This little plugin solves exactly the described issue by introducting just one extra keystroke infront of the magic *.


License

Copyright © Jan Christoph Ebersbach. Distributed under the same terms as Vim itself. See :help license
 
install details
I recommend installing pathogen.vim, and than execute the following commands:

cd ~/.vim/bundle
git clone git://github.com/jceb/vim-shootingstar.git

Or download the source directly from github: https://github.com/jceb/vim-shootingstar
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
shootingstar.vim 0.2 2013-06-30 7.0 Jan Christoph Ebersbach * replace backslash by <Leader>
* add g*/g# keybindings
shootingstar.vim 0.1 2013-06-09 7.0 Jan Christoph Ebersbach Initial upload
ip used for rating: 3.15.221.67

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github