2015-07-08 7 views
5

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 
+0

क्या आपके पास editorconfig बाइनरी स्थापित है? चूंकि आप बाहरी_command – xuhdev

+0

हाँ का उपयोग करते हैं, 'editorconfig -v' echo "EditorConfig C Core Version 0.12.0"। –

+1

क्या आप 'EditorConfigReload'' आज़मा सकते हैं और देख सकते हैं कि यह काम करता है या नहीं। कृपया मौजूदा फाइलों को आजमाएं। – xuhdev

उत्तर

1

ऐसा नहीं है कि एक और प्लगइन editorconfig प्लगइन अधिभावी है संभव है।

यह मेरे साथ हुआ। मैं https://github.com/Raimondi/YAIFA (फिर भी एक और इंडेंट फाइंडर, लगभग) स्थापित करने के बारे में भूल गया था। यदि संभवतः प्लगइन कार्यक्षमता इसके नाम से पार्स करना आसान था, तो शायद मुझे अपने मामले में समस्या मिलती।

0

आप यह देखने के लिए कि कौन सी प्लगइन आपके लिए सेट है, आप :verbose set tabstop? का उपयोग करना चाह सकते हैं।

यदि यह Last set from ... नहीं कहता है, तो यह डिफ़ॉल्ट विकल्प का उपयोग करता है।

और फिर, editorconfig में संबंधित सेटिंग्स नहीं हैं, और आप यह जांचना चाहेंगे कि .editorconfig का उपयोग किया जाता है।

संबंधित मुद्दे