How to fix this error "E122: MyDiff function already exists, adds !, To replace it" after I fix the vimrc file?

I am using portable gVim for Windows. This error is E122: Function MyDiff already exists, add ! to replace itdisplayed after I fix this file vimrc.

I am trying to fix this by replacing function MyDiff()with function MyDiff()!in my vimrcfile. The error has disappeared. But next time I launched the gvim application. An error message box is displayed Error detected while processing vimrc: line x. Perhaps I will replace the wrong thing. Any help would be greatly appreciated?

+4
source share
1 answer

As explained in :help :function, you must add the command !to the command :function:

function! MyDiff()
+8
source

Source: https://habr.com/ru/post/1655859/


All Articles