gpt4 book ai didi

vim - 如何在 Vim 中为不同语言设置不同的选项卡设置?

转载 作者:行者123 更新时间:2023-12-02 23:50:57 27 4
gpt4 key购买 nike

在我的.vimrc我有两个空格的通用制表符设置,我想在每种语言的基础上覆盖它(即,Python 等为四个,否则使用默认值),但我很难找到任何好的举个例子。

最佳答案

这些其他答案似乎太复杂了。不要在 ~/.vim 树中搞乱更多的目录和文件,只需将以下内容添加到 ~/.vimrc 中即可。

autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4

(您可以使用 l33t 并将参数缩写为 et ts=4 sw=4 sts=4)。我发现这个在 Setting Vim whitespace preferences by filetype

关于vim - 如何在 Vim 中为不同语言设置不同的选项卡设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/891805/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com