【发布时间】:2015-09-26 12:40:28
【问题描述】:
我使用Vundle 安装editorconfig-vim 插件。它正确加载并列在:scriptnames 中。但是当我创建一个新文件时,比如x.js,缩进设置不是从~/.editorconfig文件中选择的(尽管在CWD中没有.editorconfig),而且我有2个空格而不是4个空格在我的~/.editorconfig 中定义。
我做错了什么?我应该在~/.vimrc 中调用某个命令来使EditorConfig 配置工作吗?
我的~/.editorconfig:
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4
[{package.json,.travis.yml,Gruntfile.js,gulpfile.js,webpack.config.js}]
indent_style = space
indent_size = 2
还有我的~/.vimrc 配置:
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'tomasr/molokai'
Plugin 'moll/vim-node'
Plugin 'jelera/vim-javascript-syntax'
Plugin 'pangloss/vim-javascript'
Plugin 'editorconfig/editorconfig-vim'
call vundle#end() " required
filetype plugin indent on " required
" set tw=80
" set wrap linebreak nolist
let g:jsx_ext_required = 0 " Allow JSX in normal JS files
let g:syntastic_javascript_checkers = ['eslint']
let g:EditorConfig_core_mode = 'external_command'
syntax on
set number
set ruler
colorscheme molokai
【问题讨论】:
-
您是否安装了 editorconfig 二进制文件?因为你使用 external_command
-
是的,
editorconfig -v回显“EditorConfig C 核心版本 0.12.0”。 -
你可以试试
:EditorConfigReload看看它是否有效。也请尝试现有文件。
标签: vim vundle editorconfig