Skip to content

Instantly share code, notes, and snippets.

@Lysak Lysak/.bashrc
Created Oct 26, 2017

Embed
What would you like to do?
.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

This comment has been minimized.

Copy link
Owner Author

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
You can’t perform that action at this time.