summaryrefslogtreecommitdiff
path: root/files/shell/bashrc
blob: df595d02e29b20644e72f8d0540c1f9e95007cb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
source ~/.profile

gpgconf --launch gpg-agent

if [ -v $NIX_SHELL ]; then
  complete -cf doas
else
  complete -F _root_command doas
fi

export HISTCONTROL=erasedups
export HISTFILE=$HOME/.bash_history
export HISTFILESIZE=100000
export HISTSIZE=1000

bind 'set completion-query-items 0'
bind 'set show-all-if-ambiguous on'
bind 'set show-all-if-unmodified on'
bind 'set menu-complete-display-prefix on'
bind '"\t": menu-complete'
bind '"\e[Z": menu-complete-backward'
# Clear screen and set return code to 0.
# Caveat: The text 'clear' will flash in the command line as
#  if it was pasted and sent extremely fast.
bind '"\C-l":"\C-a\C-kclear\n"'

alias ls='ls --ignore=lost+found --color=auto'
alias cp='rsync -av'
alias gdb='gdb -q'
alias top='htop'
alias pgrep='pgrep -f'
alias python='python -q'
alias bc='bc -l'
alias make='make -j6'
alias diff='diff -u'
alias mail='mutt'
alias iroha='ssh andrew@iroha'
alias moyo='ssh andrew@moyo'
alias station='ssh moyo -t "ssh 192.168.122.89"'
alias rod='ssh -p 1738 rod'
alias bmrg='ssh boomerang'
alias cmv-add='$HOME/c/camu/scripts/cmv_add.sh'
alias cmv-pause='cmv-add PAUSE'
cmv-next() { cmv-add "NEXT $@"; }
cmv-prev() { cmv-add "PREV $@"; }
cmv-seek() { cmv-add "SEEK $@"; }
alias cmv-shuffle='cmv-add SHUFFLE'
alias cmv-sort='cmv-add SORT'
alias cmv-reverse='cmv-add REVERSE'
alias cmv-clear='cmv-add CLEAR'

RESET="\001\017\002"
NORMAL="\001\033[0m\002"
GREEN="\001\033[0;32m\002"
RED="\001\033[0;31m\002"
IROHA="\001\033[38;5;214m\002"
export HOSTCOLOR=$IROHA
exit_code_guy()
{
  retcode=$?
  if [ $retcode -eq 0 ]; then
    printf "(・_・) >$RED"
  else
    printf "(″ロ゛) >$RED *$retcode"
  fi
}
export PS1="$RESET$GREEN\u@$HOSTCOLOR\H$GREEN:\w\$(exit_code_guy)$NORMAL "

# Nix-specific.
LOCALE_ARCHIVE=$HOME/.nix-profile/lib/locale/locale-archive