Detecting Vim Exit Status Reason

At startup:

vim /tmp/blah :q echo $? 

I get exit status 1 . This breaks various things, including Git. If I started vim without my vimrc:

 vim -u NONE /tmp/blah :q echo $? 

I get exit status 0 . I use Pathogen, so it also effectively disables plugins. Does anyone have a suggestion to effectively determine the cause of exit status? I know that you can quickly start Vim and enter the file. Should I search for something specific in this file?

If there is a way to find the exact line that determines the exit status, I would love to know about it, since the search around has not greatly increased.

+4
source share
1 answer

Finally, this command helped :cq[uit] . So, after verbose logging, find \<cq\%[uit]\> .

Update: There are also ways to change the exit status using vim compiled with support for some interpreters: at least the following work:

 python import sys python sys.exit(1) " (same for python3) perl exit 1 

I do not know other languages ​​to write here examples of code that will exit vim with a different exit status. Also note that such commands inside files received with :pyfile :rubyfile and others :*file should also work, as well as this code in modules not distributed using the plugin.

I think the most efficient way here is to disable the plugins until you find the source of the problem.

+2
source

All Articles