I have the following configuration in my vimrc file.
inoremap <C-A> <Plug>InsertComment
And somewhere in my vim folder I defined
inoremap <silent> <Plug>InsertComment <ESC>:call INSERT_MY_COMMENT
The mapping worked really well after I configured it. But somehow recently it stopped functioning. And whenever I can to use the Key-bind in the insert mode, instead calling the function that I mapped, vim will just paste the entire
<Plug>InsertComment thing to my buffer.
I tried to debug and found out that if I map
inoremap <C-A> <ESC>:call INSERT_MY_COMMENT
it still works as desired, which means there must be something wrong with the
But I really have no clue on why
<Plug> would stop being interpreted by vim as a handle to call other plugins.
I also tried to manually copy and paste
inoremap <silent> <Plug>InsertComment <ESC>:call INSERT_MY_COMMENT inoremap <C-A> <Plug>InsertComment
in to vim's command line, just to make sure the configurations have not accidentally been unset. But still, vim wouldn't accept that as a function, but rather copy the plain text to buffer.