search

Home  >  Q&A  >  body text

The background of the first column of all rows in vim turns dark blue, how to restore it to normal?

The color scheme is set to colorscheme desert

It seems that after executing a command like: 4,11s/^/#/g, it will look like the picture below.

This problem exists in both normal and editing modes.

How can I get back to normal?

===============

According to weakish's reply, the highlighting is caused by the content selected by the replacement command highlighting, so just use set nohls.
However, let @/ ="" also has the same effect. Can you explain the meaning of this sentence?

ringa_leeringa_lee2773 days ago842

reply all(6)I'll reply

  • PHP中文网

    PHP中文网2017-05-16 16:43:38

    This is normal behavior. Because you executed :4,11s/^/#/g, this operation is to match the beginning of the line, so all lines will be highlighted.

    Enter the following command to cancel highlighting.

    :let @/ = ""
    

    If you never want to see highlighted search results, then delete the following line in .vimrc.gvimrc

    set hls
    

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-16 16:43:38

    :let @{reg-name} = {expr1} :let-register :let-@
    Write the result of the expression {expr1} in register
    {reg-name}. {reg-name} must be a single letter, and
    must be the name of a writable register (see
    |registers|). "@@" can be used for the unnamed
    register, "@/" for the search pattern.
    If the result of {expr1} ends in a or , the
    register will be linewise, otherwise it will be set to
    characterwise.
    This can be used to clear the last search pattern: >
    :let @/ = ""
    < This is different from searching for an empty string,
    that would match everywhere.

    这是vim的帮助文档,相信你能看懂吧:This can be used to clear the last search pattern

    reply
    0
  • ringa_lee

    ringa_lee2017-05-16 16:43:38

    :nohl

    xxxxxxxxxxxxxxxxxxxxxxxxx

    reply
    0
  • 某草草

    某草草2017-05-16 16:43:38

    no high light search
    :nohls

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-16 16:43:38

    :noh Enter
    Unhighlight found results.

    reply
    0
  • 为情所困

    为情所困2017-05-16 16:43:38

    If I use it, I just search for a random string. There is no need to remember such details as: /sadjfldsjglkfdjgh so that the first line will not be highlighted.

    reply
    0
  • Cancelreply