Dynamic loading of some scripts

This commit is contained in:
Geoffrey Frogeye 2017-06-14 09:26:25 +02:00
parent c129191829
commit e17af8c95c

32
bashrc
View file

@ -115,17 +115,31 @@ export PATH="$HOME/.scripts/:$PATH"
[ -f /etc/bash_completion ] && . /etc/bash_completion [ -f /etc/bash_completion ] && . /etc/bash_completion
# Bad day mood-saver # Bad day mood-saver
if which thefuck &> /dev/null; then fuck() {
alias fuck='TF_CMD=$(TF_ALIAS=fuck PYTHONIOENCODING=utf-8 TF_SHELL_ALIASES=$(alias) thefuck $(fc -ln -1)) && eval $TF_CMD && history -s $TF_CMD' if which thefuck &> /dev/null
alias FUCK='fuck' then
fi eval $(thefuck --alias)
fuck
else
echo "thefuck is not installed on this system."
fi
}
alias FUCK='fuck'
# Node Version Manager
nvm() {
if [ -s "$NVM_DIR/nvm.sh" ]
then
. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
export NVM_DIR="$HOME/.nvm"
nvm
else
echo "NVM is not installed on this system."
fi
}
# Command not found handlers # Command not found handlers
[ -r /usr/share/doc/pkgfile/command-not-found.bash ] && . /usr/share/doc/pkgfile/command-not-found.bash # Arch [ -r /usr/share/doc/pkgfile/command-not-found.bash ] && . /usr/share/doc/pkgfile/command-not-found.bash # Arch
[ -r /etc/profile.d/cnf.sh ] && . /etc/profile.d/cnf.sh # Arch (alternative, for Manjaro mostly) [ -r /etc/profile.d/cnf.sh ] && . /etc/profile.d/cnf.sh # Arch (alternative, for Manjaro mostly)
# Node Version Manager
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion