M_1*_*M_1 73 python vim configuration spaces
我很难设置VIM(7.1.xxx)来编辑python文件.缩进似乎被打破(最佳4个空格).我已经按照我通过Google找到的一些教程进行了操作.仍然没有效果:/请帮助.
Dar*_*mas 65
我在我的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
Run Code Online (Sandbox Code Playgroud)
(编辑为仅显示与缩进/制表符相关的内容)
tha*_*nos 13
我用:
$ cat ~/.vimrc
syntax on
set showmatch
set ts=4
set sts=4
set sw=4
set autoindent
set smartindent
set smarttab
set expandtab
set number
Run Code Online (Sandbox Code Playgroud)
但是我要尝试达人的参赛作品
Ted*_*lay 12
一个更简单的选项:只需在/ etc/vim/vimrc文件中取消注释配置的以下部分(最初被注释掉):
if has("autocmd")
filetype plugin indent on
endif
Run Code Online (Sandbox Code Playgroud)
我在 python 存储库中使用 vimrc,其中包括:
http://svn.python.org/projects/python/trunk/Misc/Vim/vimrc
我也加
set softtabstop=4
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
87640 次 |
| 最近记录: |