forTruce
forTruce

Reputation: 849

Substitutions to a visual block leave highlights - Vim

I just started using vim a few hours ago and am working on a project. Having a decent amount of fun and frustration alike -- mostly fun though :).

I am running into an odd situation though which might be due to using Janus, but any help would be much appreciated.

When I visually select several lines using shift-v + j then do a replace on those lines to comment them :s/^/#, it successfully does what I would expect and replace the start of the lines of the visual block with #. However, at the same time it highlighted every ^ in my file (basically the first char of every line is now highlighted).

A similar thing happened when I did another substitution of :s/^/<TAB> to shift a block of code over for indention. The added tabs on each of those lines are highlighted the same.

Neither of these highlights has gone away even after I go on editing. Why is it doing that? What can I do to get it to stop? What are some easier ways to achieve what I was doing if there are any?

Thanks!

Upvotes: 1

Views: 119

Answers (1)

Rook
Rook

Reputation: 62538

I don't use Janus (nor know what it is), but :nohl (for nohighlight) will get rid of all the highlighting, after a search & substitute.

Upvotes: 4

Related Questions