Why is vim drawing underlines on the place of tabs and how to avoid this?

前端 未结 3 1775
有刺的猬
有刺的猬 2020-12-06 00:46

Without any specific regularity my vim displays underlines on the place of tabs (see below).

Sometimes it also happens to the text: I type and it\'s underlined.

3条回答
  •  眼角桃花
    2020-12-06 01:15

    It's probably one of two things, either:

    • You have 'list' set: (try :set list? and if this says list, try :set nolist)
    • You have some syntax highlighting configuration that highlights tabs as underlined. Add the following mapping, then put the cursor on the tab and press . If it shows a highlighting group, type hi GROUPNAME to confirm the highlighting (with GROUPNAME replaced by the last named group in angle brackets). Then adjust your colour scheme to get rid of the underline.

    Mapping to identify highlight group:

    map  :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" . " FG:" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"fg#") . " BG:" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"bg#")
    

提交回复
热议问题