微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何正确设置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

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

原文地址:https://www.jb51.cc/vim/391736.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐