英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论