Tôi đã sử dụng Vundle để cài đặt plugin editorconfig-vim. Nó tải đúng và được liệt kê trong :scriptnames
. Nhưng khi tôi tạo một tệp mới, giả sử, x.js
, cài đặt thụt đầu dòng không được chọn từ ~/.editorconfig
tệp (mặc dù không có .editorconfig
trong CWD) và tôi có thụt lề 2 dấu cách thay vì 4-không gian như tôi đã xác định trong ~/.editorconfig
của mình.Làm thế nào để tôi thực hiện sự tôn trọng Vim .editorconfig?
Tôi làm gì sai? Tôi có nên gọi một lệnh nhất định trong ~/.vimrc
để làm cho cấu hình EditorConfig hoạt động không?
My ~/.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
Và ~/.vimrc
cấu hình của tôi:
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
Bạn đã cài đặt nhị phân trình chỉnh sửa chưa? vì bạn sử dụng external_command – xuhdev
Có, 'editorconfig -v' lặp lại" EditorConfig C Core Version 0.12.0 ". –
Bạn có thể thử ': EditorConfigReload' và xem nó có hoạt động hay không. Ngoài ra, hãy thử các tệp hiện có. – xuhdev