diff --git a/dot_bashrc b/dot_bashrc index a887809..2be76db 100644 --- a/dot_bashrc +++ b/dot_bashrc @@ -17,8 +17,6 @@ HISTFILE=/dev/null bind '"\e[A":history-search-backward' bind '"\e[B":history-search-forward' - - # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt -s checkwinsize @@ -103,16 +101,25 @@ alias rm='rm --interactive --verbose' alias mv='mv --interactive --verbose' alias cp='cp --verbose --interactive' -alias wget='wget -c' +if hash wget 2>/dev/null; then + alias wget='wget -c' +fi + alias dmesg='dmesg -T' alias grep='grep --color' -alias serve="python3 -m $(python3 -c 'import sys; print("http.server" if sys.version_info[:2] > (2,7) else "SimpleHTTPServer")')" +if hash python3 2>/dev/null; then + alias serve="python3 -m $(python3 -c 'import sys; print("http.server" if sys.version_info[:2] > (2,7) else "SimpleHTTPServer")')" +fi -alias ta='tmux attach' -alias tkill="for s in \$(tmux list-sessions | awk -F ':' '{print \$1}' | fzf); do tmux kill-session -t \$s; done;" +if hash tmux 2>/dev/null; then + alias ta='tmux attach' + alias tkill="for s in \$(tmux list-sessions | awk -F ':' '{print \$1}' | fzf); do tmux kill-session -t \$s; done;" +fi -alias tiga='tig --all' +if hash tig 2>/dev/null; then + alias tiga='tig --all' +fi if hash fd 2>/dev/null; then alias fdfind='fd' @@ -122,6 +129,10 @@ if command -v most > /dev/null 2>&1; then export PAGER="most" fi +if hash nix-env 2>/dev/null; then + alias nix-update='nix-channel --update && nix-env -u' +fi + # --------------------------------------------------------------------------- # COMPLETIONS # ---------------------------------------------------------------------------