【问题标题】:Vim Javascript Indentation Inside A Function函数内的 Vim Javascript 缩进
【发布时间】:2016-08-24 06:26:15
【问题描述】:

我使用 MacVim 作为主编辑器已有一段时间了。我主要用于javascript,具体来说是express.js,而困扰我的一件事是它的缩进。

我希望缩进这样做:

app.get('/', function(req, res) {
    res.send("Hello, world!");  
});

但现在它正在这样做:

app.get('/', function(req, res) {
        res.send("Hello, world!");
            });

我不知道它为什么这样做。更多信息,这是我的 .vimrc:

execute pathogen#infect()
set tabstop=4
set smartindent
set autoindent

我还通过 Pathogen 安装了 this。请帮我。谢谢。

【问题讨论】:

  • filetype plugin indent on 添加到您的vimrc
  • 文件类型或文件扩展名是什么。你确定编辑器知道它是一个 Javascript 文件吗?
  • 谢谢@dNitro!在我将filetype plugin indent 添加到我的 vimrc 后,问题现在已解决。

标签: javascript node.js express vim macvim


【解决方案1】:

filetype plugin indent on 添加到您的vimrc

【讨论】:

    猜你喜欢
    • 2011-12-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-15
    • 2013-03-20
    • 1970-01-01
    相关资源
    最近更新 更多