मैं हर दिन कई अलग-अलग प्रोग्रामिंग भाषाओं का उपयोग करता हूं, और मैं प्रत्येक के लिए अलग-अलग टैब चौड़ाई (रिक्त स्थान) रखना चाहता हूं। उदाहरण के लिए: मैं रुबी के लिए "मानक" 2 रिक्त स्थान का उपयोग करता हूं, लेकिन हमारे सभी मौजूदा मैटलैब कोड 4 रिक्त स्थान का उपयोग करते हैं।विटा में Matlab के लिए Autocommands?
मैं अपने निजी ~/.vimrc
से है:
augroup lang_perl
au!
set tabstop=4 " tabstop length N in spaces
set shiftwidth=4 " make >> and friends (<<, ^T, ^D) shift N, not the default 8
set expandtab " Use spaces instead of tabs
augroup END
augroup lang_ruby
au!
set tabstop=2 " tabstop length N in spaces
set shiftwidth=2 " make >> and friends (<<, ^T, ^D) shift N, not the default 8
set expandtab " Use spaces instead of tabs
augroup END
उन काम है, लेकिन निम्नलिखित नहीं करता है:
augroup lang_matlab
au!
set tabstop=4 " tabstop length N in spaces
set shiftwidth=4 " make >> and friends (<<, ^T, ^D) shift N, not the default 8
set expandtab " Use spaces instead of tabs
augroup END
मैं सच में समझ में नहीं आता कि कैसे है कि मैं कर रहा हूँ augroup lang_ruby
आंकड़े बाहर एक रूबी फ़ाइल संपादित करना। (मेरी खोज ftdetect
लाई, लेकिन समाधान स्पष्ट नहीं था।) ऐसा लगता है कि vim
ऐसा नहीं लगता है कि मैं augroup lang_matlab
का उपयोग कर मैटलैब को संपादित कर रहा हूं। मैं यह काम करने के लिए क्या बदलूं?
जब आप एक matlab (.m) फ़ाइल संपादित कर रहे हैं, और आप 'फ़ाइल सेट टाइप करें' टाइप करते हैं, तो क्या यह 'filetype = matlab'' के साथ प्रतिक्रिया करता है? यह संभव है कि यह आपकी .m फ़ाइलों को दूसरी भाषा के रूप में पहचान रहा हो। – jagill