0

So I'm coding in VIM, and I ran into a strange problem. I closed out of my source code, but when I opened it back up, a lot of my curly brackets are highlighted in yellow, and I can't seem to fix it. The closing brackets are matched up with opening brackets, so I don't see what the issue is.

Here is a picture of the problem: http://puu.sh/mNEPE/1e64db4c52.png

How can I fix this?

Atri
  • 5,511
  • 5
  • 30
  • 40
Benzel
  • 63
  • 8
  • 1
    Possible duplicate of [How do you make vim unhighlight what you searched for?](http://stackoverflow.com/questions/99161/how-do-you-make-vim-unhighlight-what-you-searched-for) – Atri Jan 29 '16 at 03:44
  • Go back a screen; there's a problem with the bracketing in the previous function, for which there's a highlighted `}` at the top of what you show. – Jonathan Leffler Jan 29 '16 at 05:55

3 Answers3

1

Did you do a search for the closing bracket?

Try the following, in command mode

:set nohlsearch 
Matt Adams
  • 21
  • 2
  • I have no clue how I accidentally managed to do that, but I guess so. When I type in :set nohlsearch it gets rid of the highlighting, only until I write and close the code and then reopen it, at which point the highlighting returns. – Benzel Jan 29 '16 at 03:32
  • @Benzel strange. You might have a plug-in of a setting in your .vimrc file that is causing the highlights to turn back on when opening your file. – Matt Adams Jan 29 '16 at 03:38
  • As a shortcut, you could use `:noh` – Atri Jan 29 '16 at 03:43
  • Thank you @Atri this seemed to fix it. – Benzel Jan 29 '16 at 05:06
  • Perhaps you pressed `*` or `#` in normal mode. That will search for the symbol under the cursor. – George Hilliard Jan 29 '16 at 05:54
0

You can use :noh to turn off highlighting of previously searched term.

Atri
  • 5,511
  • 5
  • 30
  • 40
0

You can do set nohl that will turn off the highlighting for the session. Reopening will highlight again.

To fix that, search anything that you don't like, for instance /""

dlmeetei
  • 9,905
  • 3
  • 31
  • 38