安装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