diff --git a/bashrc/.bashrc b/bashrc/.bashrc index af9c847..a749a1c 100644 --- a/bashrc/.bashrc +++ b/bashrc/.bashrc @@ -31,6 +31,7 @@ fi if ! $(which navigate &>/dev/null); then alias push='pushd' alias pop='popd' + alias stack='dirs -v' fi alias ls='ls -hal --color=auto' @@ -49,9 +50,9 @@ fi alias bdiff='diff -uw --color=always' -alias bashsource='source ~/.bashrc' +alias sbash='source ~/.bashrc' -# for convenient opening of pdfs.. +# because `libreWolf` is ambiguous for tab completion if $(which librewolf &>/dev/null); then alias firefox='librewolf' fi @@ -60,16 +61,18 @@ fi ## run script to setup default tmux session and then attach the session ## attaching the session needs to be done from the calling shell, otherwise ## the setup script will only terminate after detaching or killing the session -alias dmux='bash default-tmux-session.sh && tmux attach' +if $(which tmux &>/dev/null); then + alias dmux='bash default-tmux-session.sh && tmux attach' -alias tks='tmux kill-session' -alias tma='tmux attach' -alias tmd='tmux detach -P' + alias tks='tmux kill-session' + alias tma='tmux attach' + alias tmd='tmux detach -P' -alias trs='tmux rename-session' -alias trw='tmux rename-window' -alias tns='tmux new-session -d' -alias tnw='tmux new-window -c "#{pane_current_path}"' + alias trs='tmux rename-session' + alias trw='tmux rename-window' + alias tns='tmux new-session -d' + alias tnw='tmux new-window -c "#{pane_current_path}"' +fi # promt config, is overwritten by starship PS1='[\u@\h \W]\$ ' @@ -77,23 +80,22 @@ PS1='[\u@\h \W]\$ ' # overwrite $TERM to avoid problems when connecting to devices via ssh export TERM="xterm-256color" +# setup `starship` +if $(which starship &>/dev/null); then + eval "$(starship init bash)" +fi + # extend PATH variable # export PATH=$PATH:~/path/to/add if [[ "$PATH" != *"dotfiles/scripts/"* ]]; then export PATH=$PATH:$HOME/dotfiles/scripts/ fi -# setup `starship` -if $(which starship &>/dev/null); then - eval "$(starship init bash)" -fi - -## source alias file -source ~/.bash_alias - ## source various scripts personal_scripts=${HOME}/dotfiles/scripts/ source_list=() +source_list+=("$HOME/.bash_alias") +source_list+=("$HOME/.bash_profile") source_list+=("${personal_scripts}/navigate_bash_setup.sh") source_list+=("${personal_scripts}/fzf-bash-history.sh") source_list+=("${personal_scripts}/colors.sh") @@ -111,5 +113,3 @@ done if [[ -t 0 && $- = *i* ]]; then stty -ixon fi - -source $HOME/.bash_profile