Hiding tab characters in Vim

huangapple go评论138阅读模式
英文:

Hiding tab characters in Vim

问题

我刚开始学习Go语言,在运行go fmt命令时,发现我的代码中出现了制表符^I字符:

package main
import "fmt"

func main() {
    ^Ifmt.Println("Hello world!")
}

有没有办法可以配置Vim,不显示这些字符,同时保留文件中的制表符呢?

英文:

I've just begun learning Go, and upon running go fmt, I am finding tab ^I characters appear in my code:

package main
import "fmt"

func main() {
  ^Ifmt.Println("Hello world!")
}

Is there a way I can configure Vim to not display these characters, while still preserving the tabs in the file itself?

答案1

得分: 1

根据Amadan的建议,我编辑了:verbose set list?返回的文件,对我来说是~/.vim/init/options.vim。删除set list解决了我的问题。

英文:

Following Amadan's suggestion, I edited the file that :verbose set list? returned, which for me is ~/.vim/init/options.vim. Removing set list solved the problem for me

答案2

得分: 0

只需在配置文件中删除这一行即可:
:set listchars=tab:\(whatever chracter)\

set list 可能在字符编辑时有用。我不建议在不知道你在做什么的情况下随意删除它。

英文:

Just remove this line in your configuration file:
:set listchars=tab:\(whatever chracter)\

set list may be useful later for character editing. I wouldn't recommend just deleting it without knowing what you are doing.

huangapple
  • 本文由 发表于 2016年8月23日 11:35:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/39091918.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定