https://github.com/jceb/vim-shootingstar
Like the magic * but starts matching at the cursor position
https://github.com/jceb/vim-shootingstar
cursor magic neovim-plugin star vim-plugin
Last synced: 5 months ago
JSON representation
Like the magic * but starts matching at the cursor position
- Host: GitHub
- URL: https://github.com/jceb/vim-shootingstar
- Owner: jceb
- Created: 2013-06-09T18:18:36.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2013-12-15T10:36:38.000Z (over 12 years ago)
- Last Synced: 2025-03-22T21:02:22.298Z (about 1 year ago)
- Topics: cursor, magic, neovim-plugin, star, vim-plugin
- Language: VimL
- Homepage: http://www.vim.org/scripts/script.php?script_id=4616
- Size: 156 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
vim-shootingstar
================
Like the magic * but start matching at the cursor position.
Installation
------------
I recommend installing [pathogen.vim](https://github.com/tpope/vim-pathogen), and then execute the following commands:
cd ~/.vim/bundle
git clone https://github.com/jceb/vim-shootingstar.git
Usage
-----
* Given your cursor (`|`) is here: `shoo|ting start`
* Pressing `*` (e.g `\*`) will search for the term `ting` if it's part of the word `\`
* In vim search syntax this is equivalent to: `/\`
Supported keybindings
* * and # for searching forward/backward for the exact word
* g* and 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 introducing just an extra character infront of the magic `*`.
License
-------
Copyright © Jan Christoph Ebersbach. Distributed under the same terms as Vim itself. See :help license