sponsor Vim development Vim logo Vim Book Ad

ctxabbr : Context-sensitive abbreviations

 script karma  Rating 4/1, Downloaded by 1793  Comments, bugs, improvements  Vim wiki

created by
Kana Natsuno
script type
*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

- Vim 7.2 or later

Latest version:
install details

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vim-ctxabbr-0.0.2.zip 0.0.2 2009-01-10 7.0 Kana Natsuno - Support buffer-local abbreviations.
- Add |ctxabbr#reset()|.
vim-ctxabbr-0.0.1.zip 0.0.1 2009-01-10 7.0 Kana Natsuno - Remove unintentionally remained :echomsg for debugging.
- |ctxabbr#define()|: Add "!" condition.
vim-ctxabbr-0.0.0.zip 0.0.0 2009-01-09 7.0 Kana Natsuno Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
Vim at Github