screen: add GNU Screen config
[~bandali/configs] / .bashrc
CommitLineData
d99f86cd
AB
1# If not running interactively, don't do anything else
2[[ $- != *i* ]] && return
3
acb525a9
AB
4# from https://unix.stackexchange.com/a/55935
5a_prompt() {
6 cwd=$(sed -e "s:$HOME:~:" -e "s:\(\.\?[^/]\)[^/]*/:\1/:g" <<<$PWD)
7 printf $cwd
8}
9PS1="\u@\h \$(a_prompt)> "
10
d99f86cd
AB
11# i-beam cursor
12# echo -e "\033[5 q" # blinking
13echo -e "\033[6 q" # non-blinking
14
58a81de3
AB
15# various bash tweaks
16shopt -s histappend
17shopt -s cmdhist
18HISTSIZE=
19HISTFILESIZE=
20HISTCONTROL=ignoreboth
d99f86cd 21HISTIGNORE='ls:l:s:g:[bf]g:history'
58a81de3
AB
22HISTTIMEFORMAT='%F %T '
23stty stop ""
6b8582fa 24
dc9a8087 25# aliases
6b8582fa 26alias ls='ls --color=auto'
d99f86cd
AB
27alias l='ls -lh' # long format and human-readable sizes
28alias ll='l -A' # long format, all files
29alias g='git'
30include /usr/share/bash-completion/completions/git && __git_complete g _git
dc9a8087
AB
31alias mpv="mpv --ytdl-format mp4"
32alias mv="mv -iv"
33alias cp="cp -iv"
34alias scl=systemctl
35alias jcl=journalctl
c036d6d7 36alias mbsync='mbsync -c "$XDG_CONFIG_HOME"/isync/mbsyncrc'
dc9a8087
AB
37alias m="mbsync csclub; mbsync uwaterloo; mbsync amin"
38alias best="youtube-dl -f best"
39
40aur() {
41 cd ~/usr/builds
d55c009f 42 [ -d ${1} ] || git clone https://aur.archlinux.org/${1}.git
dc9a8087
AB
43 cd ${1}
44}
45
d99f86cd
AB
46# fzf
47include /usr/share/fzf/key-bindings.bash
48include /usr/share/fzf/completion.bash
58a81de3 49
6e39e3a2
AB
50if ! pgrep -u "$USER" ssh-agent > /dev/null; then
51 ssh-agent > ~/.ssh-agent-thing
52fi
53if [[ ! "$SSH_AUTH_SOCK" ]]; then
54 eval "$(<~/.ssh-agent-thing)"
55fi