Cannot be used together with henrik/vim-indexed-search or google/vim-searchindex
Jeansen opened this issue ยท 3 comments
I cannot use vim-slash together with
https://github.com/google/vim-searchindex
or
https://github.com/henrik/vim-indexed-search
Both plugins stop working. vim-searchindex does not show anything and vim-indexed-search just shows the initial values, but does not update.
I am not sure if this because of the way those plugins are written (maybe they have a bug) or the way vim-slash is written. But since I have to start somewhere, I start here :)
vim-slash
and the plugins you mentioned probably remap the same keys to do their work. So whatever plugin is sourced last wins, I suppose.
I don't think there's a simple solution. If you really want both functionalities, you could try a plugin I wrote. I only did it for a personal use, so unfortunately there's no documentation, and no configuration option.
However, it should provide the same functionalities than vim-slash
(enable-disable 'hlsearch'
automatically, make current match blink, allow to search visual selection with *
). It also provides an indicator for the number of matches in the command-line. The results are cached like in vim-searchindex
.
It also populates the command-line automatically after executing certain commands. For example, after :ls
, it types :b
(to let you visit an arbitrary buffer); after :oldfiles
, it types :e #<
(to let you visit an arbitrary old file); after :changes
it types :norm! g;
(to let you jump to an arbitrary entry in the change list); and so on.
The code is commented, so it could help you understand how it works. You could fork it if you don't like some parts.
To change the duration of the blinking of the current match after a search, look for the lines:
let s:blink = { 'ticks': 4, 'delay': 50 }
... and:
let [ s:blink.ticks, s:blink.delay ] = [ 4, 50 ]
And change the values however you want. 4
is the number of ticks, and 50
is the delay in milliseconds between 2 ticks.
Yes, probably there are some conflicts of mappings. And as @lacygoill pointed out there is no simple solution to such problems. Since I don't use the plugin, I'm not interested in finding the solution, and I'd like to keep vim-slash as small and simple as possible.
@lacygoill Thank you for your elaborate post. I will have a look at your plugin.
@junegunn Fine with me and I totally understand. Anyway, thank you for writing this and all those other great plugins. ๐