Age | Commit message (Collapse) | Author |
|
|
|
|
|
* Create a help file with plugin documentation
* Generate help tags
|
|
The `silent!` command I was using didn't silence the `:nohlsearch`
output after pressing `<CR>`. Use `<silent>` in the mapping instead to
silence it, allowing the Nohai search commands to produce output similar
to the regular `/` and `?` commands.
|
|
Don't define the default `g/` and `g?` mappings if there are already
Nohai mappings or if those are already defined.
Add a `g:nohai_no_maps` variable to disable plugin mappings.
|
|
In addition to the default, don't load the plugin if the `CmdlineEnter`
and `CmdlineLeave` autocmd events don't exist.
Learned that these events were introduced in Vim 8.0.1206:
https://vi.stackexchange.com/questions/15875/how-to-test-if-certain-event-is-supported
|
|
|
|
|
|
Seemed like I should make the name more explicit.
|
|
* The `s:Nohai()` function is unnecessary, as it does the same thing as
`s:AddMapping()`. Call `s:AddMapping()` directly instead.
* Don't bother checking `cmdwin_char`. Because we limit the
`CmdlineEnter` `autocmd` to `/` and `?`, the `s:AddMapping()` function
will only ever be called on `/` and `?`, thus checking its value in a
condition is redundant.
|
|
Now that the plugin is working as intended, get these old implementation
ideas and iterations out of the way to allow me to see the code more
clearly and work out what else can be improved.
|
|
Previously I was deactivating the <CR> mapping in the rhs of the <CR>
mapping. However, you can also exit command mode without pressing <CR>
(e.g., with <C-c>). In that case, the <CR> mapping would still be
active, causing regular search commands to nohlsearch on completion.
Now, use a `CmdlineLeave` `autocmd` instead to remove the mapping and
autocmd. This ensures the plugin always cleans up after itself when the
search line is exited.
|
|
Turns out `?` needs to be escaped in the character class pattern. This
fixes backwards nohlsearch searching.
|
|
A little convoluted here from the iterative changes, but managed to get
nohilight searching working alongside regular searching.
Backward searching isn't working, a connection in the pipeline is
missing somewhere.
I think this can be simplified quite a lot, but nice to have something
working.
|
|
Trying to put together the pieces to take what I have and make it
accessible via new mappings, leaving the existing search mappings
intact.
|
|
Sort of working. Seems like the right approach.
|
|
Came up with this in 2016, but at the time didn't see a way to get it
working. Committing what I had for reference.
|