vim-snipexp


Ⅰ. 插件描述

snippet expander

Ⅱ. 基本信息

创建日期:  2020-02-15
使用用户:  1
Github星:  1
插件作者:  Naruhiko Nishino

Ⅲ. 安装方法

使用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 |
endif

def statement

before

de<C-f>

after

def! |():
enddef

while statement

before

wh<C-f>

after

while |
endwhile

function statement

before

fu<C-f>

after

function! |() abort
endfunction

for statement

before

fo<C-f>

after

for | in
endfor

augroup statement

before

au<C-f>

after

augroup |
  autocmd!
augroup END

try 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 If

For statement

before

Fo<C-f>

after

For | In
Next

Select Case statement

before

Se<C-f>

after

Select Case |
End Select

With statement

before

Wi<C-f>

after

With |
End With

Class statement

before

Cl<C-f>

after

Class |
End Class

Class statement

before

St<C-f>

after

Structure |
End Structure

Sub statement

before

Su<C-f>

after

Sub |()
End Sub

Function statement

before

Fu<C-f>

after

Function |() As 
End Function

</details>

添加新评论