0

I have this autocmd in my .vimrc:

autocmd Filetype markdown inoremap <buffer> <CR> <C-o>:call AutoUMDList()<CR>

When I open a markdown file, enter Insert mode and press <CR>, I get the following error:

E15: Invalid expression: ^O:call AutoUMDList()^M
E15: Invalid expression: ^O:call AutoUMDList()^M
Press ENTER or type command to continue

But if I go in Insert mode and type <C-o>:call AutoUMDList()<CR> it works!

Also, if I type the following in Command mode it also works:

:inoremap <buffer> <CR> <C-o>:call AutoUMDList()<CR>

What is going on here please?! I don't understand why my autocmd won't work...

Robert Audi
  • 8,019
  • 9
  • 45
  • 67
  • I can execute the command `autocmd Filetype markdown inoremap :call AutoUMDList()` without errors in Vim 7.4-32. – Bohr Oct 07 '13 at 00:02
  • Me too; do you make modifications to `:set cpoptions`, or do you have `:set compatible`?! – Ingo Karkat Oct 07 '13 at 06:47
  • My `cpoptions` are as follows: `cpoptions=aAceFsB` and I have `set nocompatible` as the first line of my `.vimrc`... – Robert Audi Oct 07 '13 at 08:40

0 Answers0