aboutsummaryrefslogtreecommitdiffstats
path: root/plugin
AgeCommit message (Collapse)Author
2019-12-14Add license (GNU GPLv3+)Teddy Wing
2019-12-14Add guards around the default mappingsTeddy Wing
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.
2019-12-14plugin/nohai.vim: Add a load guardTeddy Wing
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
2019-12-14Move functions to autoload/Teddy Wing
2019-12-14Add descriptions to script functionsTeddy Wing
2019-12-14Rename `s:CR()` to `s:CRAndNohlsearch()`Teddy Wing
Seemed like I should make the name more explicit.
2019-12-14Remove unnecessary code in `CmdlineEnter` commandTeddy Wing
* 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.
2019-12-14Remove old comments and debug `echom`sTeddy Wing
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.
2019-12-14Deactivate nohlsearch when exiting command line without <CR>Teddy Wing
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.
2019-12-14Escape `?` in `CmdlineEnter` autocmdTeddy Wing
Turns out `?` needs to be escaped in the character class pattern. This fixes backwards nohlsearch searching.
2019-12-14Mostly working nohilight searching, works with regular searchTeddy Wing
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.
2019-12-11Ideas for custom mappingsTeddy Wing
Trying to put together the pieces to take what I have and make it accessible via new mappings, leaving the existing search mappings intact.
2019-12-05New idea for 'nohlslash' search commandsTeddy Wing
Sort of working. Seems like the right approach.