ctxabbr


Ⅰ. 插件描述

Vim plugin: Context-sensitive abbreviations

Ⅱ. 基本信息

创建日期:  2009-01-09
使用用户:  1
Github星:  2
插件作者:  Kana Natsuno

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

ctxabbr is a Vim plugin to provide a convenient way to define a variant of
normal |abbreviations|, called as "context-sensitive abbreviations".
Normal abbreviations are short words which will be replaced with the words
they stand for whenever you enter the short words.
But sometimes, it is useful to replace such abbreviations
with some text according to the context - text around the cursor.

For example,

call ctxabbr#define('sc', 'System.Collections', '<using')

With the above setting, whenever you enter "sc", it is replaced with
"System.Collections" if it is entered after a word "using", or
"sc" otherwise.  It is illustrated as follows:

using sc       ==>    using System.Collections
// sc sc sc    ==>    // sc sc sc

Requirements:

  • Vim 7.2 or later

Latest version:
http://github.com/kana/vim-ctxabbr

添加新评论