日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

windows下的gvim配置

發布時間:2023/12/13 windows 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 windows下的gvim配置 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

首要任務是下載安裝Gvim7.3?。

安裝完后,gvim菜單中文出現亂碼,在_vimrcset文件中增加:

" 配置多語言環境,解決中文亂碼問題

if has("multi_byte")?
??? " UTF-8 編碼?
??? set encoding=utf-8?
??? set termencoding=utf-8?
??? set formatoptions+=mM?
??? set fencs=utf-8,gbk?
??? if v:lang =~? '^/(zh/)/|/(ja/)/|/(ko/)'?
??????? set ambiwidth=double?
??? endif?
??? if has("win32")?
??????? source $VIMRUNTIME/delmenu.vim?
??????? source $VIMRUNTIME/menu.vim?
??????? language messages zh_CN.utf-8?
??? endif?
else?
??? echoerr "Sorry, this version of (g)vim was not compiled with +multi_byte"?
endif

3、設置語法高亮

編輯安裝目錄下的_vimrc文件(例如:我的在D:\Program Files\Vim)

???? 加入以下內容:

?????set nu!

???? colorscheme desert?
???? syntax enable?
???? syntax on

用 taglist 實現代碼導航
解決了目錄和文件導航問題,我們還要為代碼之間的跳轉提供輔助手段,taglist 就是這樣一個插件。taglist 可以列出已打開文件中定義的類、函數、常量,甚至變量。

下載地址: http://www.vim.org/scripts/script.php?script_id=273
下載文件:taglist_45.zip

壓縮包需要完整解壓縮到 $VIMvimfiles 目錄,并且用 :helptags $VIMvimfilesdoc 命令索引 taglist 插件的幫助文檔。taglist 插件需要依賴 ctags 程序才能工作。目前常用的 ctags 版本是 Exuberant Ctags。

下載地址: http://ctags.sourceforge.net/
下載文件:ec57w32.zip

只需要把壓縮包中的 ctags.exe 復制到 $VIMvim72 目錄中即可。ctags.exe 應該和 gvim.exe 在一個目錄。 ?
最后在 _vimrc 添加下列內容,設置好 taglist 插件:

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Plugin configuration
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" taglist

let Tlist_Show_One_File=1?
let Tlist_Exit_OnlyWindow=1

let Tlist_Auto_Highlight_Tag = 1
let Tlist_Auto_Open = 1
let Tlist_Auto_Update = 1
let Tlist_Close_On_Select = 0
let Tlist_Compact_Format = 0
let Tlist_Display_Prototype = 0
let Tlist_Display_Tag_Scope = 1
let Tlist_Enable_Fold_Column = 0
let Tlist_Exit_OnlyWindow = 0
let Tlist_File_Fold_Auto_Close = 0
let Tlist_GainFocus_On_ToggleOpen = 1
let Tlist_Hightlight_Tag_On_BufEnter = 1
let Tlist_Inc_Winwidth = 0
let Tlist_Max_Submenu_Items = 1
let Tlist_Max_Tag_Length = 30
let Tlist_Process_File_Always = 0
let Tlist_Show_Menu = 0
let Tlist_Show_One_File = 0
let Tlist_Sort_Type = "order"
let Tlist_Use_Horiz_Window = 0
let Tlist_Use_Right_Window = 1
let Tlist_WinWidth = 40let Tlist_Show_One_File=1?
let Tlist_Exit_OnlyWindow=1
let tlist_php_settings = 'php;c:class;i:interfaces;d:constant;f:function'

gvim?代碼自動提示?插件

插件名:AutoComplPop?

下載地址:http://www.vim.org/scripts/script.php?script_id=1879

gvim?代碼模板補全?插件

插件名:snipMate?

下載地址:http://www.vim.org/scripts/script.php?script_id=2540

?

通過vim字典補全,實現php函數名自動補全?字典到網上搜索下載

將下面內容加入.vimrc文件中即可

au?FileType?php?call?AddPHPFuncList()

function?AddPHPFuncList()

????set?dictionary-=$VIM/vimfiles/extra/php_funclist.txt?dictionary+=$VIM/vimfiles/extra/php_funclist.txt

????set?complete-=k?complete+=k

endfunction

使用方式(關鍵字+<tab>

?

"代碼自動補全??(按快捷鍵Ctrl+X+O

set?autoindent

autocmd?FileType?python?set?omnifunc=pythoncomplete#Complete

autocmd?FileType?javascrīpt?set?omnifunc=javascrīptcomplete#CompleteJS

autocmd?FileType?html?set?omnifunc=htmlcomplete#CompleteTags

autocmd?FileType?css?set?omnifunc=csscomplete#CompleteCSS

autocmd?FileType?xml?set?omnifunc=xmlcomplete#CompleteTags

autocmd?FileType?php?set?omnifunc=phpcomplete#CompletePHP

autocmd?FileType?c?set?omnifunc=ccomplete#Complete

?

關鍵字補全?(快捷鍵?Ctrl+P

?

vim中實現括號和引號自動補全

將下面內容加入.vimrc文件中即可

?

inoremap?(?()<Esc>i

inoremap?[?[]<Esc>i

inoremap?{?{<CR>}<Esc>O

autocmd?Syntax?html,vim?inoremap?<?<lt>><Esc>i|?inoremap?>?<c-r>=ClosePair('>')<CR>

inoremap?)?<c-r>=ClosePair(')')<CR>

inoremap?]?<c-r>=ClosePair(']')<CR>

inoremap?}?<c-r>=CloseBracket()<CR>

inoremap?"?<c-r>=QuoteDelim('"')<CR>

inoremap?'?<c-r>=QuoteDelim("'")<CR>

?

function?ClosePair(char)

?if?getline('.')[col('.')?-?1]?==?a:char

?return?"\<Right>"

?else

?return?a:char

?endif

endf

?

function?CloseBracket()

?if?match(getline(line('.')?+?1),?'\s*}')?<?0

?return?"\<CR>}"

?else

?return?"\<Esc>j0f}a"

?endif

endf

?

function?QuoteDelim(char)

?let?line?=?getline('.')

?let?col?=?col('.')

?if?line[col?-?2]?==?"\\"

?"Inserting?a?quoted?quotation?mark?into?the?string

?return?a:char

?elseif?line[col?-?1]?==?a:char

?"Escaping?out?of?the?string

?return?"\<Right>"

?else

?"Starting?a?string

?return?a:char.a:char."\<Esc>i"

?endif

endf


創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的windows下的gvim配置的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。