olegdeleon
olegdeleon

Reputation: 13

How to remove row lines in vim?

How do i remove the row lines at the start of the line? I typed the command

:s/^/# /

while in command mode and it suddenly appeared. I typed the command again, but it's still in my editor. I was trying to comment out a few blocks of code. This is the stackoverflow page I was following: What's a quick way to comment/uncomment lines in Vim?

Please see the image below to see what I'm pertaining to. Thanks in advance!

image

Upvotes: 1

Views: 108

Answers (1)

Ingo Karkat
Ingo Karkat

Reputation: 172510

Vim highlights the current search pattern; this is the 'incsearch' option; either you have it explicitly turned on in your ~/.vimrc, or you use a recent Vim 8 version that has this enabled by the defaults.

Check with :hi IncSearch; it should show the same white-underscore-onblack formatting as your screenshot. You can also use a :hi command to customize this (or choose a different colorscheme).

To turn this off, use

:nohlsearch

You can shorten that to :noh; some people also define a mapping to quickly clear this. Alternatively, you can also search for something else.

Upvotes: 2

Related Questions