Abbreviations only on shortcut
From Vim Tips Wiki
Tip 481 • Previous Tip • Next Tip
Created: June 3, 2003 Complexity: basic Author: maurice Minimum version: 6.0 Karma: 14/11 Imported from: Tip#481
This is just a more flexible completion.
I made the following (example) to have a unique abbreviation:
iabbrev date^A <c-r>=strftime("%F")<cr>
Note that ^A is Control-A (insert with <c-v><c-a>).
This is to avoid the completion if you really want to write 'date'.
And now this mapping:
inoremap <c-b> <c-v><c-a><c-[>a
Now type date<c-b> in insert-mode and you will get the date.
[edit] Comments
So why not just use this?
iabbrev date^B <c-r>=strftime("%F")<cr>
Admittedly, it requires you to do something after the control-b (such as another key or escape), but you would do precisely the same thing anyway with the original procedure.
