ncm2-ultisnips


Ⅰ. 插件描述

[EXPERIMENTAL]

Ⅱ. 基本信息

创建日期:  2018-07-02
使用用户:  81
Github星:  38
插件作者:  ncm2

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'ncm2/ncm2-ultisnips'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'ncm2/ncm2-ultisnips'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'ncm2/ncm2-ultisnips'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/ncm2/ncm2-ultisnips

Ⅳ. 文档说明

UltiSnips integration for
ncm2.

rec

Features

  • snippet completion source
  • trigger dynamic snippet of completed item, e.g. parameter expansion.

Reaurements

  • user_data found in vim8/nvim's documentation :help complete-item

Install

" based on ultisnips
Plug 'ncm2/ncm2-ultisnips'
Plug 'SirVer/ultisnips'

Vimrc Example

" Press enter key to trigger snippet expansion
" The parameters are the same as `:help feedkeys()`
inoremap <silent> <expr> <CR> ncm2_ultisnips#expand_or("\<CR>", 'n')

" c-j c-k for moving in snippet
" let g:UltiSnipsExpandTrigger        = "<Plug>(ultisnips_expand)"
let g:UltiSnipsJumpForwardTrigger    = "<c-j>"
let g:UltiSnipsJumpBackwardTrigger    = "<c-k>"
let g:UltiSnipsRemoveSelectModeMappings = 0

:help UltiSnips for more information on using UltiSnips.

API

If you need more control over the completed item's snippet expansion, you
might need these two APIs to help program your key mapping.

ncm2_ultisnips#completed_is_snippet()

Checks whether the v:completed_item is also a snippet.

<Plug>(ncm2_ultisnips_expand_completed)

Use this key to expand the completed snippet.

添加新评论