Ⅰ. 插件描述
snippet expanderⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'rbtnn/vim-snipexp'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'rbtnn/vim-snipexp'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'rbtnn/vim-snipexp'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/rbtnn/vim-snipexp
Ⅳ. 文档说明
# vim-snipexp
This plugin provides to expand a snippet.
Concepts
- This plugin supports Vim and Neovim.
- This plugin does not provide to customize user-settings, due to avoid confusion of what a snippet trigger expands.
Before using
map a key to snipexp#expand() such as following code on your .vimrc:
inoremap <nowait><expr><C-f> snipexp#expand()Behaviors of Vim script
<details>
if statement
before
if<C-f>after
if |
endifdef statement
before
de<C-f>after
def! |():
enddefwhile statement
before
wh<C-f>after
while |
endwhilefunction statement
before
fu<C-f>after
function! |() abort
endfunctionfor statement
before
fo<C-f>after
for | in
endforaugroup statement
before
au<C-f>after
augroup |
autocmd!
augroup ENDtry statement
before
tr<C-f>after
try|
catch
echoerr v:exception
echoerr v:throwpoint
finally
endtry</details>
Behaviors of C, C++ and C
<details>
switch statement
before
sw<C-f>after
switch (|)
{
}enum statement
before
en<C-f>after
enum |
{
};if statement
before
if<C-f>after
if (|)
{
}while statement
before
wh<C-f>after
while (|)
{
}for statement
before
fo<C-f>after
for (|)
{
}namespace statement (C++, C# only)
before
na<C-f>after
namespace |
{
}class statement (C++, C# only)
before
cl<C-f>after
class |
{
}</details>
Behaviors of Rust
<details>
fn statement
before
fn<C-f>after
fn |() {
}if statement
before
if<C-f>after
if | {
}for statement
before
fo<C-f>after
for | in {
}match statement
before
ma<C-f>after
match | {
}loop statement
before
lo<C-f>after
loop {|
}enum statement
before
en<C-f>after
enum | {
}</details>
Behaviors of VB
<details>
If statement
before
If<C-f>after
If | Then
End IfFor statement
before
Fo<C-f>after
For | In
NextSelect Case statement
before
Se<C-f>after
Select Case |
End SelectWith statement
before
Wi<C-f>after
With |
End WithClass statement
before
Cl<C-f>after
Class |
End ClassClass statement
before
St<C-f>after
Structure |
End StructureSub statement
before
Su<C-f>after
Sub |()
End SubFunction statement
before
Fu<C-f>after
Function |() As
End Function</details>