kub1x
kub1x

Reputation: 3572

How to close vim editor with non-zero return value?

I have an alias bed="vim ~/.bashrc && . ~/.bashrc" in my .bashrc. Now every now and then I'd like to run bed but return the vim with an exit status 1 so the source command doesn't execute.

Upvotes: 15

Views: 2500

Answers (1)

Ealhad
Ealhad

Reputation: 2240

Found the answer here : How do I exit Vim?

You can do :cq to exit with a exit code 1 or :cq 2 to exit with exit code 2.

Upvotes: 24

Related Questions