Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/PeterRincker/vim-searchlight
Highlights the current search match
https://github.com/PeterRincker/vim-searchlight
highlighting search vim vim-plugin
Last synced: 3 months ago
JSON representation
Highlights the current search match
- Host: GitHub
- URL: https://github.com/PeterRincker/vim-searchlight
- Owner: PeterRincker
- Created: 2019-02-16T00:14:24.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-03T16:07:23.000Z (3 months ago)
- Last Synced: 2024-08-03T17:27:02.674Z (3 months ago)
- Topics: highlighting, search, vim, vim-plugin
- Language: Vim Script
- Homepage:
- Size: 316 KB
- Stars: 53
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vim-searchlight
Searchlight = Search + Highlight
Vim-searchlight highlights Vim's current search match.
![alt text](/example.gif)
## CurSearch
Vim 8.2.4724+ supports `CurSearch`, as well as NeoVim 0.10+. In this case the `Searchlight` highlight group is linked to `CurSearch` and the rest of the plugin is disabled.
## Requirements
Searchlight requires `'hlsearch'` to be active and Vim 8+ with timer support. It is tested on Vim 8.1.
## Experimental
Searchlight is an experiment. Your mileage my vary. Might not work with other plugins or your `vimrc`.
## Installation
Follow your favorite plugin/runtimepath manager's instructions.
If you choose manual installation, use Vim's packages. Clone into one of the following directories:
$HOME/.vim/pack/bundle/start/ on Unix-like systems
$HOME\vimfiles\pack\bundle\start\ on Windows## Commands
Use `:Searchlight` to enable and `:Searchlight!` to disable.
## Customization
Searchlight uses the `Searchlight` highlight group. It defaults to `ErrorMsg`. Change by doing:
highlight link Searchlight Incsearch
Searchlight's highlighting can be triggered manually via `:1Searchlight`. This might be required for some mappings or plugin compatibility.
Searchlight is activated by default on startup. To prevent this set `g:searchlight_disable_on_startup`. e.g.
let g:searchlight_disable_on_startup = 1
## Background
This is an experiment to implement current search highlighting without any mappings. Thank-you to both [vim-searchhi](https://github.com/qxxxb/vim-searchhi) & [vim-searchant](https://github.com/timakro/vim-searchant) which inspired this plugin.
## Known Issues
When using any search command like: `*`, `#`, etc at the beginning of a match and it is the only match and therefore will not cause the cursor to move, will not trigger searchlight.
One solution would be to trigger an update with mappings like so:
nnoremap * *:1Searchlight
nnoremap # #:1SearchlightHowever, this goes against the goal of having no mappings. Sad panda