代码改变世界

关于 vim 的插件 snipmate 以及它的安装方式(使用国内源)

2020-05-31 16:26  jetwill  阅读(1069)  评论(0编辑  收藏  举报

snipmate 是一个类似代码补全的东西,更好的地方在于自定义补全的内容。

  1. 最新的 snipmate 是在 https://github.com/garbas/vim-snipmate 而不是在官网,官网很久没更新了
  2. snipmate 的安装方式 官方推荐的是 Pathogen 安装方式,注意,你得首先安装 https://github.com/tpope/vim-pathogen
    关于 pathogen 的安装,可以参考作者的这篇博文

之后就可以按照官方例子安装 snipmate 了
官方的安装说明是:

% cd ~/.vim/bundle
% git clone https://github.com/tomtom/tlib_vim.git
% git clone https://github.com/MarcWeber/vim-addon-mw-utils.git
% git clone https://github.com/garbas/vim-snipmate.git

由于在国内访问 github 速度奇慢无比,我就在 码云 gitee 找了替代品。

cd ~/.vim/bundle
git clone https://gitee.com/mamamiyear/tlib_vim.git
git clone https://gitee.com/vim_runtime_plugins/vim-addon-mw-utils.git
git clone https://gitee.com/vim_runtime_plugins/vim-snipmate.git

特别值得强调的是 新版的snipmate 已经不带任何snippet模板,需要自己去下载或者自己编辑,官方推荐的地址是

https://github.com/honza/vim-snippets

我从 github 往 gitee 导入了第三方库 vim-snippets。

git clone https://gitee.com/chenjo/vim-snippets.git

参考文章:
https://gitee.com/help/articles/4284#article-header0
Gitee快速导入GitHub仓库及同步更新
https://www.cnblogs.com/jicheng1014/p/3347220.html