vim python配置
http://my.oschina.net/renwofei423/blog/17338我的配置:
"pydiction 1.2 python auto complete
filetype plugin on
let g:pydiction_location = '~/.vim/tools/pydiction/complete-dict'
"defalut g:pydiction_menu_height == 15
"let g:pydiction_menu_height = 20
syntax enable
syntax on
set nu
set t_Co=256
set background=dark
colorscheme molokai
"关闭兼容模式
"set nocompatible
""外部修改时自动读取
set autoread
"设置鼠标
"set mouse=a
""设置历史
set history=400
"设置mapleader
"let mapleader=","
"let g:mapleader=","
""显示行号
set number
"显示光标位置
"set ruler
""增强命令行补全
set wildmenu
"设置命令行高度
"set cmdheight=2
""减少刷新和重画
set lz
"设置退格键
"set backspace=eol,start,indent
""设置跨行键
set whichwrap+=<,>,h,l
"搜索时忽略大小写
"set ignorecase
""搜索时高亮关键字
set hlsearch
"设置magic
"set magic
""关闭提示音
set noerrorbells
set novisualbell
set vb t_vb=
"自动匹配括号
"set showmatch
"set mat=2
""设置Tab键
set expandtab
set smarttab
set tabstop=4
set shiftwidth=4
"自动缩进与智能缩进
set autoindent
set smartindent
""换行不截断单词
set linebreak
"C风格缩进
"set cindent
""语法高亮
syntax enable
为了vim更好的支持python写代码,修改tab默认4个空格有两种设置方法:
1. vim /etc/vimrc
1set ts=4
2set sw=4
2. vim /etc/vimrc
1set ts=4
2set expandtab
3set autoindent
推荐使用第二种,按tab键时产生的是4个空格,这种方式具有最好的兼容性。
Eclipse设置软tab(用4个空格字符代替)及默认utf-8文件编码(unix)
为这两个目的对Eclipse做了如下的 兼容性的配置:说明:
以下设置都在菜单“Window -> Preferences”中,截图为英文版Eclipse,中文版可对照相对应的菜单选项。
首先设置文本编辑时候经常需要用到的Tab键缩进,
用4个空格字符来代替,
以确保用vi或vim打开的时候缩进的格式仍然正确。
具体设置步骤如下:
1、打开选项:General -> Editors -> Text Editors
在右侧找到Displayed tab width:
把下面的“Insert spaces for tabs” 勾选上,
点OK保存之后,新建一个html文件输入几个tab键并按左右方向键移动光标测试一下,
发现原来的tab已经被替换成了4个空格字符。
页:
[1]