0

After I visual select something and

:'<,'>s/^/#/

There is a highlight of very first column from start of the file to the end. How to disable this behavior in vim?

This works for any type of visual editing.

enter image description here

FreeBSD 10.1 default vim package.

% vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 17 2014 05:29:46)
Included patches: 1-207, 209-355, 357-542
kAldown
  • 610
  • 2
  • 8
  • 27
  • This was answered over at superuser: http://superuser.com/questions/61516/how-do-i-keep-vim-from-highlighting-matches-after-a-replace and also Unix & Linux http://unix.stackexchange.com/questions/22027/vim-dont-highlight-search-term-after-a-search-replace Neither has a really great solution – Michael Berkowski Dec 22 '14 at 12:32
  • Personally, I map `` to `:noh` so I just hit `,,` to switch it off. I don't know of a way to prevent it entirely. – Michael Berkowski Dec 22 '14 at 12:33
  • Yes, but I dont want to permanently disable hlsearch (I search a lot), and I don't want push something after. This behavior found only on FreeBSD, and not Linux (CentOS or Ubuntu). – kAldown Dec 22 '14 at 12:35
  • Are you certain it doesn't happen on Linux? I have experienced this on Linux for many years – Michael Berkowski Dec 22 '14 at 12:59
  • I think yes. I have 2 vps and couple of vagrants with rpm and deb Linuxes. But started to use vim even on my FreeBSD desktop (previously vi was more than enough) and noticed, that vim on my laptop makes me angry :D – kAldown Dec 22 '14 at 13:01
  • Yes, you were right. I think it's useless to blame *BSD binary for this behavior. Interesting, that I noticed this only now. =( – kAldown Dec 22 '14 at 13:13

0 Answers0