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