On Sep 11, 9:08 am, Spiros Bousbouras wrote: > > I presented a simplified version of what I want. I actually have > several abbreviations and I want <C-y> to work with all of them. > For example > > :iabbrev CUC <NL>cucumber > :iabbrev TOM <NL>tomato > > CUC<C-y> > where '<C-y>' means pressing Ctrl-y , must insert a newline and > then 'cucumber'. > TOM<C-y> must insert a newline and then 'tomato'. And so forth for > all the other abbreviations.
I see now that what I just posted may still be misleading. The reason I need <C-y> is that after it does the expansion then it will do some additional stuff. That's why I can't just enter the abbreviation itself. But my problem is how to get <C-y> to expand the abbreviation correctly. > So my best effort so far is > > :inoremap <C-y> <ESC>B"gd$a<C-r>=substitute(maparg(@g , "i" , 1) , > '<' . 'NL>' , "\n" , "")<CR> > > It is possible that my abbreviations will contain other special > characters beside <NL> so I'd rather not have to substitute for > each case. -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php