如何正确设置VIM自动缩进编辑Python文件 – * .py

前端之家收集整理的这篇文章主要介绍了如何正确设置VIM自动缩进编辑Python文件 – * .py前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有麻烦设置VIM(7.1.xxx)编辑python文件
缩进似乎被打破(最佳4个空格)。
我遵循了我通过Google找到的一些教程。仍然没有效果:/
请帮忙。
我在我的macbook上使用这个:
" configure expanding of tabs for varIoUs file types
au BufRead,BufNewFile *.py set expandtab
au BufRead,BufNewFile *.c set noexpandtab
au BufRead,BufNewFile *.h set noexpandtab
au BufRead,BufNewFile Makefile* set noexpandtab

" --------------------------------------------------------------------------------
" configure editor with tabs and nice stuff...
" --------------------------------------------------------------------------------
set expandtab           " enter spaces when tab is pressed
set textwidth=120       " break lines when line length increases
set tabstop=4           " use 4 spaces to represent tab
set softtabstop=4
set shiftwidth=4        " number of spaces to use for auto indent
set autoindent          " copy indent from current line when starting a new line

" make backspaces more powerfull
set backspace=indent,eol,start

set ruler                           " show line and column number
Syntax on               " Syntax highlighting
set showcmd             " show (partial) command in status line

(编辑只显示与缩进/制表符相关的东西)

猜你在找的Bash相关文章