bchj2a
Last Updated: February 25, 2016
·
913
· jabclab
4f4bf0fbd4cc6de6159d78f9f9fb3aa6

Edit .bashrc in vim and then immediately source it

I was tired of forever doing:

$ vim ~/.bashrc
$ . ~/.bashrc

So created an alias as follows:

alias brc='vim ~/.bashrc && . ~/.bashrc'

i.e. if vim ~/.bashrc exits with status code 0, i.e. [[ $? = 0 ]], then we'll source (.) ~/.bashrc therefore picking up the changes :-)

Say Thanks
Respond