An open API service indexing awesome lists of open source software.

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.

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:], '\\\@