Ⅰ. 插件描述
frontend forⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/vim-snipplr'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/vim-snipplr'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/vim-snipplr'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/vim-snipplr
Ⅳ. 文档说明
snipplr.vim
Snipplr.vim is frontend for http://www.snipplr.com/
You can open your favoritted snippet or get snippet you specified by ID or URL.
Require Ruby to work(not require +ruby feature).
Currently work on *nix only.
INSTALL
cp plugin/snipplr.vim $HOME/.vim/plugin/
cp syntax/snipplrlist.vim $HOME/.vim/syntax/
copy bin/snipplr.rb to one of the directory in $PATH
SETUP
Create account on http://www.snipplr.com/
You can find API KEY at buttom of "Setting" page.
then save API KEY as ~/.snipplr/api_key
GLOVAL VARIABLE
You can exclusively set path for snipplr.rb in .vimrc
let g:snipplr_rb = '$HOME/.vim/bundle/snipplr/bin/snipplr.rb'
Command
snipplr.rb save snippets once get as ~/.snipplr/db.yml.
You can avoid cache with exlamation(!) version command.
SnipplrGet
In opend snippet buffer you can use 'i' to view informatin about that snippet.
:SnipplrGet 1234
:SnipplrGet http://snipplr.com/view/1234/sample
SnipplrList
:SnipplrList
:SnipplrList!
SnipplrFind
To this comman work, you have to install fuzzyfinder
:SnipplrFind
:SnipplrFind!
KeyMapping Example
nnoremap <silent> <Space>sl :<C-u>SnipplrFind<CR>
nnoremap <silent> <Space>sr :<C-u>SnipplrFind!<CR>
TODO
parametarize cache dir and api_key location etc..
query with metadata(tag, user.. etc)
post snippet from vim buffer
more informative syntax highlight with predefined keyword for lang name
dynamically change window height for snipplr list
merge more than one cache data to one cache(which is comvenient for
collabolate with coworker