Hello, Vimmers. I noticed that abbreviations are not expanded by a character which are generated by key mappings which cannot be remapped. There is no description on this behavior in :help as far as I read. So that it should be noted in :help Abbreviations.
Anyway, I wish there were a pseudo key to expand abbreviation
even if it is generated by unremappable key mappings. For
example, some users use the following key mapping to insert
a line break even if ins-completion-menu is visible:
inoremap <expr> <CR> pumvisible() ? "\<C-y>\<CR>" : "\<CR>"
But with this key mapping, abbreviations are not expanded by
<CR>. It's uncomfortable.
I wrote a patch to add such pseudo key <AbbrExpand>. See the
attached file for the detail. With <AbbrExpand>, the above
mapping can be fixed as the following:
inoremap <expr> <CR> pumvisible() ? "\<C-y>\<CR>" : "\<AbbrExpand>\<CR>"
What do you think about this? Useful, or not?
--
To Vim, or not to Vim.
kana <http://whileimautomaton.net/>
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
abbrexpand.patch
Description: Binary data
