2023-01-13 22:28:13 +00:00
|
|
|
##########################################################
|
|
|
|
# USE ALIASES WITH SUDO HOORAY #
|
|
|
|
##########################################################
|
|
|
|
alias sudo='sudo '
|
|
|
|
|
2023-04-09 02:33:14 +00:00
|
|
|
#what cd should do by default
|
|
|
|
alias cd='cd_func'
|
2023-05-10 06:33:29 +00:00
|
|
|
alias bat='batcat '
|
2023-04-09 02:33:14 +00:00
|
|
|
cd_func ()
|
|
|
|
{
|
|
|
|
builtin cd "$@" && ls --color=auto --group-directories-first --format=single-column
|
|
|
|
}
|
2020-09-21 01:46:36 +00:00
|
|
|
# If not running interactively, don't do anything
|
2021-07-15 18:35:23 +00:00
|
|
|
case $- in
|
|
|
|
*i*) ;;
|
|
|
|
*) return;;
|
|
|
|
esac
|
|
|
|
|
2023-06-05 07:14:46 +00:00
|
|
|
export DOCKER_COMPOSE_COMMAND="docker compose"
|
|
|
|
|
2023-01-13 07:49:04 +00:00
|
|
|
# Don't put duplicate lines in the history and do not add lines that start with a space
|
|
|
|
export HISTCONTROL=erasedups:ignoredups:ignorespace
|
2021-07-15 18:35:23 +00:00
|
|
|
|
|
|
|
# append to the history file, don't overwrite it
|
|
|
|
shopt -s histappend
|
|
|
|
|
|
|
|
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
|
|
|
HISTSIZE=1000
|
|
|
|
HISTFILESIZE=2000
|
|
|
|
|
|
|
|
# check the window size after each command and, if necessary,
|
|
|
|
# update the values of LINES and COLUMNS.
|
|
|
|
shopt -s checkwinsize
|
|
|
|
|
|
|
|
|
|
|
|
# make less more friendly for non-text input files, see lesspipe(1)
|
|
|
|
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
|
|
|
|
|
|
|
# set variable identifying the chroot you work in (used in the prompt below)
|
|
|
|
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
|
|
|
debian_chroot=$(cat /etc/debian_chroot)
|
2020-09-21 01:46:36 +00:00
|
|
|
fi
|
|
|
|
|
2021-07-15 18:35:23 +00:00
|
|
|
# set a fancy prompt (non-color, unless we know we "want" color)
|
|
|
|
case "$TERM" in
|
|
|
|
xterm-color|*-256color) color_prompt=yes;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# uncomment for a colored prompt, if the terminal has the capability; turned
|
|
|
|
# off by default to not distract the user: the focus in a terminal window
|
|
|
|
# should be on the output of commands, not on the prompt
|
|
|
|
#force_color_prompt=yes
|
|
|
|
|
|
|
|
if [ -n "$force_color_prompt" ]; then
|
|
|
|
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
|
|
|
# We have color support; assume it's compliant with Ecma-48
|
|
|
|
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
|
|
|
|
# a case would tend to support setf rather than setaf.)
|
|
|
|
color_prompt=yes
|
2020-09-21 01:46:36 +00:00
|
|
|
else
|
2021-07-15 18:35:23 +00:00
|
|
|
color_prompt=
|
2020-09-21 01:46:36 +00:00
|
|
|
fi
|
2021-07-15 18:35:23 +00:00
|
|
|
fi
|
2020-09-21 01:46:36 +00:00
|
|
|
|
2021-07-15 18:35:23 +00:00
|
|
|
if [ "$color_prompt" = yes ]; then
|
|
|
|
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
|
|
|
else
|
|
|
|
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
|
|
|
fi
|
|
|
|
unset color_prompt force_color_prompt
|
|
|
|
|
|
|
|
# If this is an xterm set the title to user@host:dir
|
|
|
|
case "$TERM" in
|
|
|
|
xterm*|rxvt*)
|
|
|
|
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# enable color support of ls and also add handy aliases
|
|
|
|
if [ -x /usr/bin/dircolors ]; then
|
|
|
|
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
|
|
|
alias ls='ls --color=auto'
|
|
|
|
#alias dir='dir --color=auto'
|
|
|
|
#alias vdir='vdir --color=auto'
|
|
|
|
|
|
|
|
alias grep='grep --color=auto'
|
|
|
|
alias fgrep='fgrep --color=auto'
|
|
|
|
alias egrep='egrep --color=auto'
|
|
|
|
fi
|
|
|
|
|
2023-01-13 07:49:04 +00:00
|
|
|
# To have colors for ls and all grep commands such as grep, egrep and zgrep
|
|
|
|
export CLICOLOR=1
|
|
|
|
export LS_COLORS='no=00:fi=00:di=00;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:*.xml=00;31:'
|
|
|
|
#export GREP_OPTIONS='--color=auto' #deprecated
|
|
|
|
alias grep="/usr/bin/grep $GREP_OPTIONS"
|
|
|
|
unset GREP_OPTIONS
|
|
|
|
|
|
|
|
# Color for manpages in less makes manpages a little easier to read
|
|
|
|
export LESS_TERMCAP_mb=$'\E[01;31m'
|
|
|
|
export LESS_TERMCAP_md=$'\E[01;31m'
|
|
|
|
export LESS_TERMCAP_me=$'\E[0m'
|
|
|
|
export LESS_TERMCAP_se=$'\E[0m'
|
|
|
|
export LESS_TERMCAP_so=$'\E[01;44;33m'
|
|
|
|
export LESS_TERMCAP_ue=$'\E[0m'
|
|
|
|
export LESS_TERMCAP_us=$'\E[01;32m'
|
|
|
|
|
2021-07-15 18:35:23 +00:00
|
|
|
# Add an "alert" alias for long running commands. Use like so:
|
|
|
|
# sleep 10; alert
|
|
|
|
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
|
|
|
|
|
|
|
# Alias definitions.
|
|
|
|
# You may want to put all your additions into a separate file like
|
|
|
|
# ~/.bash_aliases, instead of adding them here directly.
|
|
|
|
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
|
|
|
|
|
|
|
|
if [ -f ~/.bash_aliases ]; then
|
|
|
|
. ~/.bash_aliases
|
|
|
|
fi
|
|
|
|
|
2023-01-15 21:14:39 +00:00
|
|
|
############################
|
|
|
|
# This allows you to have #
|
|
|
|
# a local aliases file #
|
|
|
|
# not affected by this #
|
|
|
|
# git repo #
|
|
|
|
############################
|
|
|
|
if [ -f ~/.bashlocal ]; then
|
|
|
|
. ~/.bashlocal
|
|
|
|
fi
|
|
|
|
|
2021-07-15 18:35:23 +00:00
|
|
|
# enable programmable completion features (you don't need to enable
|
|
|
|
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
|
|
|
# sources /etc/bash.bashrc).
|
|
|
|
if ! shopt -oq posix; then
|
|
|
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
|
|
|
. /usr/share/bash-completion/bash_completion
|
|
|
|
elif [ -f /etc/bash_completion ]; then
|
|
|
|
. /etc/bash_completion
|
|
|
|
fi
|
|
|
|
fi
|
2022-08-16 05:44:12 +00:00
|
|
|
|
2023-01-13 07:49:04 +00:00
|
|
|
# Extracts any archive(s) (if unp isn't installed)
|
|
|
|
extract () {
|
|
|
|
for archive in $*; do
|
|
|
|
if [ -f $archive ] ; then
|
|
|
|
case $archive in
|
|
|
|
*.tar.bz2) tar xvjf $archive ;;
|
|
|
|
*.tar.gz) tar xvzf $archive ;;
|
|
|
|
*.bz2) bunzip2 $archive ;;
|
|
|
|
*.rar) rar x $archive ;;
|
|
|
|
*.gz) gunzip $archive ;;
|
|
|
|
*.tar) tar xvf $archive ;;
|
|
|
|
*.tbz2) tar xvjf $archive ;;
|
|
|
|
*.tgz) tar xvzf $archive ;;
|
|
|
|
*.zip) unzip $archive ;;
|
|
|
|
*.Z) uncompress $archive ;;
|
|
|
|
*.7z) 7z x $archive ;;
|
|
|
|
*) echo "don't know how to extract '$archive'..." ;;
|
|
|
|
esac
|
|
|
|
else
|
|
|
|
echo "'$archive' is not a valid file!"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2023-08-05 05:23:41 +00:00
|
|
|
export PATH="$HOME/.cargo/bin:$HOME/.local/bin:$PATH"
|
2023-03-10 17:42:28 +00:00
|
|
|
export CDPATH=:..:~:~/dock:/dock
|