This is part of my vimrc--
function! Abbreviations()
let a:code=input("Which Abbreviation: ")
"gen
if(a:code=="gen")
source ~/.vim/Abbreviations/GeneralAbbreviations.vim
endif
"math
if(a:code=="math")
source ~/.vim/Abbreviations/MathAbbreviations.vim
endif
endfunction
function! SourceAbbreviations()
:execute ":normal! :source $MYVIMRC\<cr>:call Abbreviations()\<cr>gen\<cr>:call Abbreviations()\<cr>math\<cr>"
endfunction
nnoremap <buffer> <localleader>e :call SourceAbbreviations()<cr>
As you can see the function SourceAbbreviations()
has to call other functions. When I do :call SourceAbbreviations()
it shows an error. However, if I remove :source $MYVIMRC\<cr>
from the function SourceAbbreviations()
, it works. So, what's actually wrong in this case?