I have a VIM function in
.vimrc that is called by a few abbreviations. I would like to move those abbreviations to PHP-specific, C-specific, and a few other file-type specific files, but they no longer see the functions in
.vimrc as in scope. How can I increase the scope of functions in
EDIT: I've tried this:
- bruno:~$ cat .vimrc set nocompatible filetype plugin on function! Hello() return "hello" endfunction - bruno:~$ cat .vim/after/ftplugin/php.vim abbr xyz <C-R>=Hello<CR>
However, I only get
E121: Undefined variable: Hello when typing "xyz" in a .php file. I added the prefix
g: to both the function declaration and to the function call, but that did not help either. Nor did it help to add the prefix only to the function declaration. This is on VIM 7.3, Kubuntu 12.10.