V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Ironsongming
V2EX  ›  Vim

vim 有什么设置可以区分 tab 和空格( 4 个)

  •  
  •   Ironsongming · Sep 22, 2015 · 5440 views
    This topic created in 3872 days ago, the information mentioned may be changed or developed.

    写 python 的时候, tab 和 4 个空格好难区分,这样代码出问题好难排错,有没有什么设置可以显示出是 tab ?

    Supplement 1  ·  Sep 22, 2015
    set listchars=tab:\|\ ,trail:-,extends:>,precedes:< 正解, Thanks
    9 replies    2015-09-23 10:03:42 +08:00
    Cooky
        1
    Cooky  
       Sep 22, 2015
    set expandtab
    asj
        2
    asj  
       Sep 22, 2015 via iPad
    全文替换 tab 为 4 个空格,然后禁用 tab
    beyondsoft
        3
    beyondsoft  
       Sep 22, 2015
    请参考我这个 go 类型的


    au FileType go setlocal noexpandtab shiftwidth=4 tabstop=4 softtabstop=4 nolist
    ensonmj
        4
    ensonmj  
       Sep 22, 2015   ❤️ 1
    set listchars=tab:\|\ ,trail:-,extends:>,precedes:<
    Ironsongming
        5
    Ironsongming  
    OP
       Sep 22, 2015
    @beyondsoft
    @asj
    @Cooky
    我不是想用空格替换掉 tab ,有没方法可以显示出是一个 tab ,好像 window 上有个文本编辑的工具输入了一个 tab ,就会有一个箭头显示的
    blueset
        6
    blueset  
       Sep 22, 2015   ❤️ 1
    Cooky
        7
    Cooky  
       Sep 22, 2015
    @Ironsongming 试试这个,包你喜欢
    set list
    set listchars=tab:##
    hi SpecialKey ctermfg=66 guifg=#649A9A guibg=#649A9A
    spark
        8
    spark  
       Sep 23, 2015
    jun4rui
        9
    jun4rui  
       Sep 23, 2015 via Android
    显示 whitespace 啊,一眼就看出来了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5613 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 69ms · UTC 06:11 · PVG 14:11 · LAX 23:11 · JFK 02:11
    ♥ Do have faith in what you're doing.