search

Home  >  Q&A  >  body text

vim removes the highlighting of '_' characters

  1. When I was using vim to edit text recently, I encountered a red background highlight of '_' in a word. How can I cancel this?

  2. .vimrc theme:elfford.

  3. When I edit *.md files, there are always highlights as shown in the picture below. How to remove them?

PHP中文网PHP中文网2743 days ago655

reply all(2)I'll reply

  • 某草草

    某草草2017-05-16 16:36:22

    I use vim-markdown, which doesn’t seem to have this problem

    This is mostly a matter of grammar recognition. It stands to reason that the underline here should be recognized according to the text.

    You can do this, first move the cursor to the underlined position in vim, and execute above :echo synIDattr(synID(line("."),col("."),0),"name"

    This will output the grammar recognition mark of the current position. . Remember the output. Is it possible that you are reporting an error or something? I guess

    My output is mkdNonListItemBlock,命令行里(bash之类的)执行 grep -r 'mkdNonListItemBlock' .,就会输出这个语法识别所在的文件。我的就是对应 ~/.vim/plugged/vim-markdown/syntax/markdown.vim

    Of course you can solve this problem by escaping, markdown itself also has escaping. . But in your case there is no need to escape. . When multiple people collaborate, escaping _ 还是 ** 之间用 __ will cause unnecessary diff. It is recommended that you use the vim-markdown plug-in to solve the problem

    reply
    0
  • 高洛峰

    高洛峰2017-05-16 16:36:22

    The problem is currently solved:

    No other configuration has been modified. In fact, when we edit markdown files, we often cause other abnormal displays due to the syntax of markdown. For my above problem, just escape the underline _ character.

    At the same time, when this underline appears * 或 ** 或 ** 之间的时候, 也会出现其他样式的问题, 这时候对于下划线,可以__use two underlines to solve the style problem.

    reply
    0
  • Cancelreply