Skip to content

vim-ripgrep pollutes :history with let hlsearch=1 #50

Description

@tankorsmash

call feedkeys(":let &hlsearch=1\<CR>", 'n')

I'm enjoying vim-ripgrep quite a bit but I noticed that since installing, hlsearch was being set and unset quite a bit and I wasn't sure why. I tracked it down to the line above.

If you replace it with

call matchadd('keyword', a:txt)

it'll highlight it without messing with the search at all, at the cost of not being able to cycle through all the matches manually. This was my first mess with syntax highlighting so I'm not sure if this is a one-stop solution for every use case but it worked for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions