filetype plugin indent on
"关闭兼容模式
set nocompatible
"外部修改时自动读取
set autoread
"设置鼠标
set mouse=a
"设置历史
set history=400
"设置mapleader
let mapleader=","
let g:mapleader=","
let g:C_MapLeader=","
"设置Tlist
"let Tlist_Show_One_File=1
"let Tlist_Auto_Open=1
let Tlist_Exit_OnlyWindow=1
let Tlist_Use_SingleClick=1
let Tlist_Auto_Highlight_Tag=1
let tlist_make_settings='make;m:makros;t:targets'
let tlist_qmake_settings='qmake;t:SystemVariables'
"显示行号
set number
"显示光标位置
set ruler
"增强命令行补全
set wildmenu
"设置命令行高度
set cmdheight=1
"减少刷新和重画
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
set guifont=terminus\ 10
"自动补全
set completeopt=longest,menu
set laststatus=2
"语法高亮
syntax enable
"设置颜色主题
set t_Co=256
colorscheme darkblue
"高亮当前行
set cursorline
if has("gui_running")
colorscheme slate
hi cursorline guibg=#333333
hi CursorColumn guibg=#333333
endif
"高亮菜单
hi Pmenu guibg=#333333
hi PmenuSel guibg=#555555 guifg=#ffffff
set autochdir
"生成Ctags
"map
"map
set tags+=/home/feng/.vim/tags/gtk.ctags
set tags+=/home/feng/.vim/tags/python.ctags
if has("autocmd")
filetype plugin indent on
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType ruby set omnifunc=rubycomplete#Complete
autocmd FileType c set omnifunc=ccomplete#Complete
autocmd FileType ada set omnifunc=adacomplete#Complete
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType sql set omnifunc=sqlcomplete#Complete
endif
let line = getline('.') " curline
let substr = strpart(line, -1, col('.')+1) " from start to cursor
let substr = matchstr(substr, "[^ \t]*$") " word till cursor
if (strlen(substr)==0) " nothing to match on empty string
return "\
endif
let has_period = match(substr, '\.') != -1 " position of period, if any
let has_slash = match(substr, '\/') != -1 " position of slash, if any
if (!has_period && !has_slash)
return "\
elseif ( has_slash )
return "\
else
return "\
endif
endfunction
inoremap
"noremap
"inoremap
nnoremap
"快速保存
nmap
"快速重载.vimrc
"map s :source ~/.vimrc
"快速编辑.vimrc
map
"当.vimrc改变时,自动重载
autocmd! bufwritepost vimrc source ~/.vimrc
"Paste toggle - when pasting something in, don't indent.
set pastetoggle=
"去除空行
map
"Super paste
inoremap
"切换Tab
map
map
map
map
"切换buffer
map bn :bnext
map bp :bprevious
if has("autocmd")
filetyp plugin indent on
autocmd FileType python setlocal et | setlocal sta | setlocal sw=4
autocmd FileType python compiler pyunit
autocmd FileType python setlocal makeprg=python\ %
endif
"快速运行
au FileType python map
au FileType python map
"快速补全
au FileType python inoremap $r return
au FileType python inoremap $s self
au FileType python inoremap $c ####kla
au FileType python inoremap $i import
au FileType python inoremap $p print
au FileType python inoremap $d """"""O
" FencView
let g:fencview_autodetect=0