Skip to content

Instantly share code, notes, and snippets.

@Lysak
Created October 26, 2017 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lysak/e53f59d8f7d52ace8042c908bbc8862e to your computer and use it in GitHub Desktop.
Save Lysak/e53f59d8f7d52ace8042c908bbc8862e to your computer and use it in GitHub Desktop.
.bashrc
# enable bash completion in interactive shells
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
alias st='git status'
alias add='git add .'
alias cm='git commit -m '
alias push='git push -u origin master'
alias pull='git pull'
#
#alias ll='ls -l'
alias ls='ls -F --color=auto --show-control-chars'
#
alias up='sudo apt-get update && sudo apt-get upgrade -y'
#
alias cd..='cd ..'
alias cp='cp -i'
alias d='ls'
alias df='df -h -x supermount'
alias du='du -h'
alias egrep='egrep --color'
alias fgrep='fgrep --color'
alias grep='grep --color'
alias l='ls'
alias la='ls -a'
alias ll='ls -l'
#alias ls='ls -F --color=auto'
alias lsd='ls -d */'
alias md='mkdir'
alias mv='mv -i'
alias p='cd -'
alias rd='rmdir'
alias rm='rm -i'
alias install="sudo apt-get install"
@Lysak
Copy link
Author

Lysak commented Nov 3, 2017

change cursor and prompt color

cursor_color='#0087FF'
prompt_color='33'

local stuff

[[ -f ~/.bash_local ]] && . ~/.bash_local

set to red

root_cursor_color='#FF0000'
root_prompt_color='196'

#my favorite PS1
case "$TERM" in
xterm*|rxvt*)
PS1='[\e[38;5;'$prompt_color'm]\t j\j \u@\h:\w\n'
[[ $UID == 0 ]] && { prompt_color=$root_prompt_color;cursor_color=$root_cursor_color; }
PS1="$PS1"'[\e[m\e]12;'$cursor_color'\a\e[38;5;'$prompt_color'm]$ [\e[m]'
;;
*)
PS1='\t j\j \u@\h:\w\n$ '
;;
esac

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment