diff --git a/bashrc b/bashrc index a673ee2..784433b 100644 --- a/bashrc +++ b/bashrc @@ -115,17 +115,31 @@ export PATH="$HOME/.scripts/:$PATH" [ -f /etc/bash_completion ] && . /etc/bash_completion # Bad day mood-saver -if which thefuck &> /dev/null; then - 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' - alias FUCK='fuck' -fi +fuck() { + if which thefuck &> /dev/null + then + 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 [ -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) -# 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