Я использую vim 7.4.Отступ изменений на новой вкладке vim
Моих настроек отступа питона является по умолчанию: SETLOCAL expandtab shiftwidth = 4 softtabstop = 4 табуляция = 8
Этой линия была взята из /usr/share/vim/vim74/ftplugin/python.vim, которую я Жду» t изменить.
Когда я открываю vim с помощью команды «vim file1.py», тогда ключ табуляции создает 4 пробела, как ожидалось. Но когда я открываю второй файл на другой вкладке с помощью cmd: ": tabe file2.py", тогда ключ табуляции создает 8 пробелов.
Как это исправить?
Моя .vimrc показано ниже:
syntax on " Enable syntax highlighting
filetype on " Enable filetype detection
filetype indent on " Enable filetype-specific indenting
filetype plugin on " Enable filetype-specific plugins
set showmatch " Show matching brackets
set nu " Show line numbers
set expandtab " use spaces instead of tab chars
" open replace dialog for replacing selection
vnoremap <C-r> "hy:%s/<C-r>h//gc<left><left><left>
" With the following (for example, in vimrc), you can visually select text then press ~ to convert the text to UPPER CASE, then to lower case, then to Title Case. Keep pressing ~ until you get the case you want.
function! TwiddleCase(str)
if a:str ==# toupper(a:str)
let result = tolower(a:str)
elseif a:str ==# tolower(a:str)
let result = substitute(a:str,'\(\<\w\+\>\)', '\u\1', 'g')
else
let result = toupper(a:str)
endif
return result
endfunction
vnoremap ~ ygv"=TwiddleCase(@")<CR>Pgv
:let mapleader = "-"
:let maplocalleader = "\\"
Спасибо. Я заменил 'setlocal' на 'set' в моем /usr/share/vim/vim74/ftplugin/python.vim. Он работает так, как ожидалось. – cesarsalgado