安裝plug (https://github.com/junegunn/v...python
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent...
編輯~/.vimrc文件(不存在,則建立)git
" Specify a directory for plugins " - For Neovim: ~/.local/share/nvim/plugged " - Avoid using standard Vim directory names like 'plugin' call plug#begin('~/.vim/plugged') " Multiple Plug commands can be written in a single line using | separators Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' " Initialize plugin system call plug#end()
:PlugInstall
加載插件vim 須要開啓對 python 的支持,經過如下兩個方式來驗證你的 vim 是否支持 python 接口,支持一種便可github
:echo has("python") " 若是你用的是 python 2.7 :echo has("python3") " 若是你用的是 python 3.3 或者 3.4
當咱們打開 vim 的時候, UltiSnips 會搜尋 $VIM 路徑下的全部名字爲 UltiSnips 的文件夾,而後根據文檔類型來尋找對應的 snips。配置$VIMvim
export VIM=~/.vim
驗證vim a.cpp
,輸入main。按tab鍵,自動補全則成功api
int main(int argc, char *argv[]) { return 0; }
vim a.yaml
apiVersion: v1 kind: Service metadata: name: frontend namespace: default labels: app: someApp tier: frontend spec: ports: - port: 80 selector: app: someApp tier: frontend