我现在正在尝试切换到 VIM,并希望让它像 Python 的 IDE 一样自动缩进。我有以下 .vimrc 文件
syntax on
set number
autocmd FileType tex,latex,python set showmatch
nnoremap j gj
nnoremap k gk
"Python Settings
autocmd FileType python set softtabstop=4
autocmd FileType python set tabstop=4
autocmd FileType python set autoindent
autocmd FileType python set expandtab
autocmd FileType python set textwidth=80
autocmd FileType python set smartindent
autocmd FileType python set shiftwidth=4
autocmd FileType python map <buffer> <F2> :w<CR>:exec '! python' shellescape(@%, 1)<CR>
autocmd FileType python imap <buffer> <F2> <esc>:w<CR>:exec '! python' …Run Code Online (Sandbox Code Playgroud)