Disclaimer: this plugin has many issues that cannot be easily fixed. I suggest that you try simpler alternatives like vim-evanesco or vim-slash.
Improved /
-search for Vim.
Use your favorite plugin manager. vim-oblique requires vim-pseudocl.
With vim-plug:
Plug 'junegunn/vim-pseudocl'
Plug 'junegunn/vim-oblique'
vim-oblique overrides the following keys by default:
Default Key | <Plug> map |
Description |
---|---|---|
/ |
<Plug>(Oblique-/) |
Forward search |
? |
<Plug>(Oblique-?) |
Backward search |
z/ |
<Plug>(Oblique-F/) |
Forward fuzzy-search |
z? |
<Plug>(Oblique-F?) |
Backward fuzzy-search |
n |
<Plug>(Oblique-n) |
Repeat the last search |
N |
<Plug>(Oblique-N) |
Repeat the last search in the opposite direction |
<Plug>(Oblique-n!) |
Repeat the last search (always forward) | |
<Plug>(Oblique-N!) |
Repeat the last search (always backward) | |
* |
<Plug>(Oblique-*) |
Forward star-search (in normal and visual mode) |
# |
<Plug>(Oblique-#) |
Backward star-search (in normal and visual mode) |
g* |
<Plug>(Oblique-g*) |
Forward star-search (no word boundary match) |
g# |
<Plug>(Oblique-g#) |
Backward star-search (no word boundary match) |
(Unlike the default star-search, the overridden version will not move the cursor)
Use the <Plug>
maps in the above table to customize the maps.
g:oblique#min_length
(default: 3)
g:oblique#incsearch_highlight_all
(default: 0)
incsearch
)g:oblique#clear_highlight
(default: 1)
g:oblique#prefix
(default: '')
g:oblique#enable_cmap
(default: 1)
You can customize the behavior of vim-oblique by registering custom actions to
the following events of User
group.
Event | When |
---|---|
Oblique |
/ , ? , z/ , z? |
ObliqueStar |
* , # , g* , g# |
ObliqueRepeat |
n , N |
The following example will move your cursor line to the middle of the screen after search.
autocmd! User Oblique normal! zz
autocmd! User ObliqueStar normal! zz
autocmd! User ObliqueRepeat normal! zz
Define the following highlight groups to change the color:
ObliquePrompt
(default: linked to Label
)ObliqueLine
(default: linked to None
)ObliqueCurrentMatch
(default: linked to IncSearch
)ObliqueCurrentIncSearch
(default: linked to IncSearch
)hi! def link ObliqueCurrentMatch Keyword
hi! def link ObliquePrompt Structure
hi! def link ObliqueLine String
MIT