當我打開Python文件時,我的縮進會發生變化。我有以下vimrc設置:VIM:打開Python文件時縮進會發生變化
set number
colorscheme wombat256mod
set guifont=Consolas\ 11
set linespace=2
filetype on
filetype plugin on
au BufRead,BufNewFile *py,*pyw,*.c,*.h set tabstop=4
au BufRead,BufNewFile *.py,*pyw set shiftwidth=4
au BufRead,BufNewFile *.py,*.pyw set expandtab
fu Select_c_style()
if search('^\t', 'n', 150)
set shiftwidth=8
set noexpandtab
el
set shiftwidth=4
set expandtab
en
endf
au BufRead,BufNewFile *.c,*.h call Select_c_style()
au BufRead,BufNewFile Makefile* set noexpandtab
highlight BadWhitespace ctermbg=red guibg=red
au BufRead,BufNewFile *.py,*.pyw match BadWhitespace /^\t\+/
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h set textwidth=79
au BufRead,BufNewFile *.c,*.h set formatoptions-=c formatoptions-=o formatoptions-=r
au BufNewFile *.py,*.pyw,*.c,*.h set fileformat=unix
let python_highlight_all=1
syntax on
filetype indent on
set autoindent
任何人看到的東西,可以導致它?
例如,我打開一個* .html文件的縮進是一個選項卡。但是,一旦我打開任何Python文件並返回到html文件,縮進切換到python偏好設置。
你有一行_ton_行設置縮進 - 爲什麼你把它們放在那裏,如果你不知道他們做了什麼? – alternative 2010-09-04 20:18:23