生活随笔
收集整理的這篇文章主要介紹了
vim for python
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
貼出我的gvim配置文件,,基本給出了注釋,感覺還是挺好的哈哈。一些插件,自行百度~
set nocompatible
set nu
syntax enable
syntax on "打開高亮
colorscheme desert
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswinfiletype plugin onset diffexpr=MyDiff()
function MyDiff()let opt = '-a --binary 'if &diffopt =~ 'icase' | let opt = opt . '-i ' | endifif &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endiflet arg1 = v:fname_inif arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endiflet arg2 = v:fname_newif arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endiflet arg3 = v:fname_outif arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endiflet eq = ''if $VIMRUNTIME =~ ' 'if &sh =~ '\<cmd'let cmd = '""' . $VIMRUNTIME . '\diff"'let eq = '"'elselet cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'endifelselet cmd = $VIMRUNTIME . '\diff'endifsilent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunctionset ts=4
set ai
set sw=4set foldenable
set foldmethod=indent "設(shè)置折疊set background=dark "設(shè)置背景黑色nmap <F2> :NERDTreeToggle<CR>let g:pydiction_location = 'F:\Program Files (x86)\Vim\vim74\tools\pydiction\complete-dict'
let g:pydiction_menu_height = 20 "這是設(shè)置tab補(bǔ)全插件map <C-n> :tabnew<CR>
"設(shè)置c-n新建標(biāo)簽"c-tab切換標(biāo)簽,alt+數(shù)字鍵切換到相應(yīng)標(biāo)簽
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 zc
else colorscheme desert"torte
endif "Toggle Menu and Toolbar
"默認(rèn)不顯示菜單,按F10顯示菜單
set guioptions-=m
set guioptions-=T
map <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>"設(shè)置搜索
set hlsearch
set 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文件,則同時(shí)打開編譯信息窗口 "進(jìn)行Tlist的設(shè)置
filetype on
let Tlist_Show_Menu = 1
"TlistUpdate可以更新tags
map <F3> :silent! Tlist<CR> "按下F3就可以呼出Taglist
let Tlist_Ctags_Cmd='ctags' "因?yàn)槲覀兎旁诃h(huán)境變量里,所以可以直接執(zhí)行
let Tlist_Use_Right_Window=0 "讓窗口顯示在右邊,0的話就是顯示在左邊
let Tlist_Show_One_File=1 "讓taglist可以同時(shí)展示多個(gè)文件的函數(shù)列表,如果想只有1個(gè),設(shè)置為1
let Tlist_File_Fold_Auto_Close=1 "非當(dāng)前文件,函數(shù)列表折疊隱藏
let Tlist_Exit_OnlyWindow=1 "當(dāng)taglist是最后一個(gè)分割窗口時(shí),自動(dòng)退出vim
let Tlist_Process_File_Always=0 "是否一直處理tags.1:處理;0:不處理
"let Tlist_Inc_Winwidth= "設(shè)置幫助語(yǔ)言
set helplang=cn,en
"把gui的工具欄去掉(要去掉,把等號(hào)前面的加號(hào)變成一個(gè)減號(hào)即可)
"set guioptions+=T
"把gui的右邊的滑動(dòng)條去掉
"set guioptions+=r
"把gui的左邊的滑動(dòng)條去掉
"set guioptions-=L
"把gui的菜單去掉
"set guioptions+=m
轉(zhuǎn)載于:https://www.cnblogs.com/shengrang/p/3843491.html
總結(jié)
以上是生活随笔為你收集整理的vim for python的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。