I would like to add an alias (for convenience sake) that would allow me to edit my bashrc, and if changes were made, source it, but if no changes were made, don't source (in case I changed my mind).
I initially tried
alias vb='vi ~/.bashrc && source ~/.bashrc' but then I realized that even just quitting out of vi
:q! probably still returns a success return value which is why it still sources.
Is there some way to make an alias such that quitting vi without making any changes to the file doesn't source .bashrc but if something is changed, it does?