vim for python

来源:互联网 发布:python mimetext 中文 编辑:程序博客网 时间:2024/06/16 22:11

贴出我的gvim配置文件,,基本给出了注释,感觉还是挺好的哈哈。一些插件,自行百度~


set nocompatibleset nusyntax enablesyntax on "打开高亮colorscheme desertsource $VIMRUNTIME/vimrc_example.vimsource $VIMRUNTIME/mswin.vimbehave mswinfiletype plugin onset diffexpr=MyDiff()function MyDiff()  let opt = '-a --binary '  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif  let arg1 = v:fname_in  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif  let arg2 = v:fname_new  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif  let arg3 = v:fname_out  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif  let eq = ''  if $VIMRUNTIME =~ ' '    if &sh =~ '\<cmd'      let cmd = '""' . $VIMRUNTIME . '\diff"'      let eq = '"'    else      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'    endif  else    let cmd = $VIMRUNTIME . '\diff'  endif  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eqendfunctionset ts=4set aiset sw=4set foldenableset foldmethod=indent    "设置折叠set background=dark   "设置背景黑色nmap <F2> :NERDTreeToggle<CR>let g:pydiction_location = 'F:\Program Files (x86)\Vim\vim74\tools\pydiction\complete-dict'  let g:pydiction_menu_height = 20  "这是设置tab补全插件map <C-n> :tabnew<CR>"设置c-n新建标签"c-tab切换标签,alt+数字键切换到相应标签if has("gui_running")      :map <silent> <C-S> :if expand("%") == ""<CR>:browse confirm w<CR>:else<CR>:confirm w<CR>:endif<CR>      noremap <M-1> 1gt      noremap <M-2> 2gt      noremap <M-3> 3gt      noremap <M-4> 4gt      noremap <M-5> 5gt      noremap <M-6> 6gt      noremap <M-7> 7gt      noremap <M-8> 8gt      noremap <M-9> 9gt      noremap <M-0> 10gt      noremap <C-TAB> gt      noremap <C-F4> <ESC>:bd<CR>      noremap qt <ESC>:bd<CR>      au BufEnter * simalt ~x "maximum the initial window zcelse      colorscheme desert"torte endif "Toggle Menu and Toolbar"默认不显示菜单,按F10显示菜单set guioptions-=mset guioptions-=Tmap <silent> <F10> :if &guioptions =~# 'T' <Bar>        \set guioptions-=T <Bar>        \set guioptions-=m <bar>    \else <Bar>        \set guioptions+=T <Bar>        \set guioptions+=m <Bar>    \endif<CR>"设置搜索set hlsearchset incsearch autocmd BufRead,BufNewFile *.py set makeprg=python\ -c\ \"import\ py_compile,sys;\ sys.stderr=sys.stdout;\ py_compile.compile(r'%')\"  autocmd BufRead,BufNewFile *.py set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m  autocmd BufRead,BufNewFile *.py nmap <F5> :!python %<CR>  autocmd BufRead,BufNewFile *.py nmap <F6> :make<CR>  autocmd BufRead,BufNewFile *.py copen "如果是py文件,则同时打开编译信息窗口  "进行Tlist的设置  filetype on  let Tlist_Show_Menu = 1  "TlistUpdate可以更新tags  map <F3> :silent! Tlist<CR>  "按下F3就可以呼出Taglist  let Tlist_Ctags_Cmd='ctags' "因为我们放在环境变量里,所以可以直接执行  let Tlist_Use_Right_Window=0 "让窗口显示在右边,0的话就是显示在左边  let Tlist_Show_One_File=1 "让taglist可以同时展示多个文件的函数列表,如果想只有1个,设置为1  let Tlist_File_Fold_Auto_Close=1 "非当前文件,函数列表折叠隐藏  let Tlist_Exit_OnlyWindow=1 "当taglist是最后一个分割窗口时,自动退出vim  let Tlist_Process_File_Always=0 "是否一直处理tags.1:处理;0:不处理  "let Tlist_Inc_Winwidth=  "设置帮助语言set helplang=cn,en"把gui的工具栏去掉(要去掉,把等号前面的加号变成一个减号即可)"set guioptions+=T"把gui的右边的滑动条去掉"set guioptions+=r"把gui的左边的滑动条去掉"set guioptions-=L"把gui的菜单去掉"set guioptions+=m


0 0