I've created a key mapping to clear search highlights by pressing .
.
map . :nohlsearch
However, pressing .
only enters the nohlsearch
command, requiring me to press Enter to execute the command. Is there a way to have the keybinding both enter and execute the command?
Add <CR>
to the end, like this:
map . :nohlsearch<CR>
The <CR>
is a "carriage return", which is the same as what pressing Enter does.