Questions tagged [abbreviations]

Vim can handle abbreviations to replace some text by some other text. Question about creating these abbreviations and how to make them work.

Filter by
Sorted by
Tagged with
32
votes
1answer
10k views

What are the differences between the map, noremap, abbrev and noreabbrev commands?

These commands transform one set of keystrokes to another in some way, but I am somewhat fuzzy on which one is most appropriate for some situation. In addition, there are the ! variants of them as ...
8
votes
4answers
878 views

Backspace in insert abbreviation

To work, abbreviations need to be separated by whitespace. E.g., if I have an iab fo FOOBAR then typing whatfo will not trigger the abbreviation. There are some obvious sensible reasons for this. ...
7
votes
1answer
523 views

How to make command-line abbreviations that only trigger at begining of line

I have a custom save function, and bound it to :w by using an abbreviation: cabbrev w call SaveBuffer() This works, but I ran into issues when I wanted to reference window local variables because w: ...
3
votes
1answer
150 views

Wrong abbreviation expansion

I have these abbreviations in my .vimrc: iab seq sequent iab seqs sequents seqs expands to sequents i seq sequent in a tex file (I have installed vim-latex). In an empty buffer seqs expands ...
5
votes
2answers
1k views

Is there a way to set an abbreviation in a modeline so it is always available local to one file buffer?

I have a handful of files (LaTeX documents) that have one specific proper name that is really obnoxious to type out but used frequently. I've eased the pain of this with an abbreviation like so: iab ...
10
votes
2answers
302 views

Context sensitive insert mode mapping or abbreviation

I'm planning to implement some utility mappings for my LaTeX plugin to simplify typing of mathematics. For instance, I want to create abbreviations similar to `a : \alpha `b : \beta -> : \to => ...
3
votes
3answers
159 views

Substitute an insert-mode input immediately

I would like to type begin! in insert mode and having it immediately replaced by: begin [cursor here] end I considered mappings: :inoremap begin! begin end<Left><Left><Left><...
2
votes
2answers
78 views

abbrev for multiwords

How to add abbrevs made of more than one word? I've been trying: iabbrev a aquilo àquilo iabbrev a aquele àquele iabbrev a aquela àquela What I want to do is have the two words "a aquilo" expand to ...