Using neovim
. Since hlsearch
is on, after the search and replace operation the strings are highlighted. Pressing <C-l>
clears the highlight.
I have this keymap to convert a line to title caps:
map('n', 'tc', ':s/\\v<(.)(\\w*)/\\u\\1\\L\\2/g<cr><C-l>', default_opts)
The above works except for clearing the highlighting.
If I use from within neovim
:
:nmap tc :s/\v<(.)(\w*)/\u\1\L\2/g<cr><C-l>
things work properly.
What is wrong with the earlier sequence?
:noh
is there for that.