I have:

au BufRead,BufNewFile *.tex set filetype=tex
au BufRead,BufNewFile *.tex inoreabbrev ß \ss{}
au BufRead,BufNewFile *.tex inoreabbrev ö \"{o}
au BufRead,BufNewFile *.tex inoreabbrev ä \"{a}
au BufRead,BufNewFile *.tex inoreabbrev ü \"{u}

in my filetype.vim. When I open a TeX file and type :ab:

i  ü           * \"{u}                                                 
i  ä           * \"{a}                                                
i  ö           * \"{o}                                                
i  ß           * \ss{}

Press ENTER or type command to continue 
  • My abbreviations work in command line mode, results in :\ss{};
  • but they don't in insert mode.

Why do my abbreviations only work in command line mode, but not in insert mode?

  • 4
    Can you post the rest of your .vimrc file? Also, are you typing another key after the abbreviation in order to fire it? – fruglemonkey Mar 13 '16 at 1:48
  • 1
    I used the space for firing it. my nvim config: github.com/toogley/dotfiles/tree/… – toogley Mar 13 '16 at 15:20

EDIT the answer below doesn't count for the current release 0.2, both examples work there.

It seems that neovim was a bit buggy on this topic.

" works in neovim
:ab ms Microsoft

" doesn't work in neovim
:ab ß \ss{}      

=> my solution was to move back to vim for now.

(my nvim config)

  • 1
    In general, you don't want to type comments after abbreviations like this. Sooner or later, it will be interpreted as the right-hand side of an abbreviation since " is also used to quote strings. You're best off just giving comments their own line to sit on ;-) – Martin Tournoij Mar 13 '16 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.