Closed chusiang closed 7 years ago
應把 workstation (Desktop) 與 lighting (server) 的版本拆開,有很多 plugin 跟設定是只有在 workstation 才需要用到的。
先附上相關的 vimrc。
" ## YouCompleteMe (code-completion)
NeoBundle 'Valloric/YouCompleteMe'
let g:ycm_filetype_blacklist = {
\ 'tagbar' : 1,
\ 'qf' : 1,
\ 'notes' : 1,
\ 'markdown' : 1,
\ 'unite' : 1,
\ 'text' : 1,
\ 'vimwiki' : 1,
\ 'gitcommit' : 1,
\}
let g:ycm_global_ycm_extra_conf = "~/.vim/.ycm_extra_conf.py"
" ## Ultisnips (auto-complete)
NeoBundle 'sirver/ultisnips'
let g:UltiSnipsSnippetDirectories=["UltiSnips", "ultisnips_my"]
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
" better key bindings for UltiSnipsExpandTrigger
let g:UltiSnipsExpandTrigger="<c-tab>"
let g:UltiSnipsListSnippets="<c-s-tab>"
NeoBundle 'honza/vim-snippets'
使用操作差異:
<Tab>
即可自動補齊,但現在需改用 <Ctrl> + <Tab>
。<Ctrl> + n
, <Ctrl> + p
來上下移動項目 (item)。<Ctrl> + <Shift> + <Tab>
列出所有的 Snippets,並使用數字 (1, 2, 3 ...) 來選取。Mac上用YCM可能會炸
https://github.com/Valloric/ycmd/issues/411
炸了我就切回 vim-snipmate 模式囉,話說為了提升點功力卻要付出愈來愈多的代價了。XD
換了 YCM 後,在 OSX 10.11 上就不會遇到與嘸蝦米輸入法自動補上奇怪字完的衝突問題,待 lighting 的版本整理好即可關閉此 issue。
在 console 裡使用 Vim 遇上 YouCompleteMe unavailable: requires Vim 7.3.584+ 問題,可以試著用別名來設 vi。
$ vi ~/.bashrc
...
alias vi='vim'
Finish it at 82993d6, and I will release it at v3.0.0.
Before build the YCM on CentOS 7, we need install some packages.
原先用的自動補齊 (auto-complete) 套件 vim-snipmate (vim-addon-mw-utils, tlib_vim, vim-snippets) 已有些不敷使用,故預計換成 YouCompleteMe + UltiSnips 的架構。
但由於 YouCompleteMe + UltiSnips 不適合部署至 server 上,故應另開個 branch 保持其輕量性。
Setup
Complete it !
Reference