15

I'm trying to switch from MacVim to VSCode and I use VSCode Vim extension. The most annoying thing I found so far is: if I search with / command - I can't disable a highlighting of search results.

Could you pls help me to find a way how to hide search result highlighting after I've done with search?

3 Answers 3

13

I've found an answer:

in settings.json

"vim.normalModeKeyBindingsNonRecursive": [ { "before":["<C-n>"], "after":[], "commands": [ { "command": ":nohl" } ] } ] 
Sign up to request clarification or add additional context in comments.

2 Comments

another version: "vim.normalModeKeyBindingsNonRecursive": [{ "before": ["<leader>", "/"], "after": [], "commands": [":nohl"] }]
If you want to toggle the highlighting, you can replace :nohl with :set hlsearch!
12

Alternately, you can also just set vim.hlsearch to false.

Comments

8

You can also just bind it to escape, which isn't bound to anything in normal mode.

"vim.normalModeKeyBindingsNonRecursive": [ { "before": [ "<Esc>" ], "commands": [ ":nohl" ], } ] 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.