editorconfig-vim प्लगइन स्थापित करने के लिए मैंने Vundle का उपयोग किया। यह सही ढंग से लोड होता है और :scriptnames
में सूचीबद्ध है। लेकिन जब मैं एक नई फाइल बनाता हूं, तो कहें, x.js
, इंडेंटेशन सेटिंग्स ~/.editorconfig
फ़ाइल (हालांकि, .editorconfig
सीडब्ल्यूडी में) से नहीं चुनी गई हैं, और मेरे पास 0 -में परिभाषित किए गए 4-स्पेस के बजाय 2-स्पेस इंडेंटेशन है।मैं विम सम्मान कैसे कर सकता हूं .editorconfig?
मैं क्या गलत करता हूं? क्या मुझे EditorConfig कॉन्फ़िगरेशन कार्य करने के लिए ~/.vimrc
में एक निश्चित कमांड का आह्वान करना चाहिए?
मेरे ~/.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
config:
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 बाइनरी स्थापित है? चूंकि आप बाहरी_command – xuhdev
हाँ का उपयोग करते हैं, 'editorconfig -v' echo "EditorConfig C Core Version 0.12.0"। –
क्या आप 'EditorConfigReload'' आज़मा सकते हैं और देख सकते हैं कि यह काम करता है या नहीं। कृपया मौजूदा फाइलों को आजमाएं। – xuhdev