I have a bash script that runs (something like) the following command:
vim -E <<EOT
call Myfunc()
EOT
where Myfunc() is defined in my .vimrc. I’ve discovered that using the heredoc (but not simply calling it with -E and entering commands manually) causes vim to skip loading my .vimrc, consequently setting compatible mode (causing other problems down the road).
I can load my .vimrc manually if I have to, but I’m assuming I don’t know a priori where it is, so I’d like to let vim do the work.
Does using the heredoc make vim set some other option (-u NORC, say), which I can just unset to get normal behaviour?
I’m in Vim 7.3, if it matters.
Giving arguments to vim through a heredoc is equivalent to taking input from stdin:
This starts vim in silent mode (see
:help -s-ex) and only loads plugins specified by the-uargument. To load all plugins, write the ex command to a file and use that file for input:(I added
qa:to force vim to exit after runningMyfunc().)