https://github.com/hrsh7th/vim-searchx
The extended search motion.
https://github.com/hrsh7th/vim-searchx
Last synced: 8 months ago
JSON representation
The extended search motion.
- Host: GitHub
- URL: https://github.com/hrsh7th/vim-searchx
- Owner: hrsh7th
- Created: 2021-12-28T12:26:06.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-29T09:57:05.000Z (about 1 year ago)
- Last Synced: 2025-01-03T08:13:56.193Z (9 months ago)
- Language: Vim Script
- Homepage:
- Size: 61.5 KB
- Stars: 77
- Watchers: 2
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vim-searchx
The extended search motion.
- Jump to the specific match via marker (like easymotion)
- Move cursor during searching
- Input converter
- Improved jumplist management### Settings
```vim
" Overwrite / and ?.
nnoremap ? call searchx#start({ 'dir': 0 })
nnoremap / call searchx#start({ 'dir': 1 })
xnoremap ? call searchx#start({ 'dir': 0 })
xnoremap / call searchx#start({ 'dir': 1 })
cnoremap ; call searchx#select()" Move to next/prev match.
nnoremap N call searchx#prev_dir()
nnoremap n call searchx#next_dir()
xnoremap N call searchx#prev_dir()
xnoremap n call searchx#next_dir()
nnoremap call searchx#prev()
nnoremap call searchx#next()
xnoremap call searchx#prev()
xnoremap call searchx#next()
cnoremap call searchx#prev()
cnoremap call searchx#next()" Clear highlights
nnoremap call searchx#clear()let g:searchx = {}
" Auto jump if the recent input matches to any marker.
let g:searchx.auto_accept = v:true" The scrolloff value for moving to next/prev.
let g:searchx.scrolloff = &scrolloff" To enable scrolling animation.
let g:searchx.scrolltime = 500" To enable auto nohlsearch after cursor is moved
let g:searchx.nohlsearch = {}
let g:searchx.nohlsearch.jump = v:true" Marker characters.
let g:searchx.markers = split('ABCDEFGHIJKLMNOPQRSTUVWXYZ', '.\zs')" Convert search pattern.
function g:searchx.convert(input) abort
if a:input !~# '\k'
return '\V' .. a:input
endif
return a:input[0] .. substitute(a:input[1:], '\\\@