Commit | Line | Data |
---|---|---|
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 |
5 | a_prompt() { | |
6 | cwd=$(sed -e "s:$HOME:~:" -e "s:\(\.\?[^/]\)[^/]*/:\1/:g" <<<$PWD) | |
7 | printf $cwd | |
8 | } | |
9 | PS1="\u@\h \$(a_prompt)> " | |
10 | ||
d99f86cd AB |
11 | # i-beam cursor |
12 | # echo -e "\033[5 q" # blinking | |
9daac239 | 13 | # echo -e "\033[6 q" # non-blinking |
d99f86cd | 14 | |
58a81de3 AB |
15 | # various bash tweaks |
16 | shopt -s histappend | |
17 | shopt -s cmdhist | |
18 | HISTSIZE= | |
19 | HISTFILESIZE= | |
20 | HISTCONTROL=ignoreboth | |
d99f86cd | 21 | HISTIGNORE='ls:l:s:g:[bf]g:history' |
58a81de3 AB |
22 | HISTTIMEFORMAT='%F %T ' |
23 | stty stop "" | |
6b8582fa | 24 | |
dc9a8087 | 25 | # aliases |
6b8582fa | 26 | alias ls='ls --color=auto' |
d99f86cd AB |
27 | alias l='ls -lh' # long format and human-readable sizes |
28 | alias ll='l -A' # long format, all files | |
dc9a8087 AB |
29 | alias mpv="mpv --ytdl-format mp4" |
30 | alias mv="mv -iv" | |
31 | alias cp="cp -iv" | |
c036d6d7 | 32 | alias mbsync='mbsync -c "$XDG_CONFIG_HOME"/isync/mbsyncrc' |
249a5298 | 33 | alias getmail='getmail --getmaildir "$XDG_CONFIG_HOME"/getmail --rcfile getmailrc' |
d4cc5497 | 34 | alias mb="mbsync csclub; mbsync uwaterloo; mbsync shemshak" |
249a5298 AB |
35 | alias gm="getmail" |
36 | alias m="mb; gm" | |
dc9a8087 | 37 | alias best="youtube-dl -f best" |
d355f997 AB |
38 | alias e="$EDITOR" |
39 | alias se="SUDO_EDITOR=\"emacsclient\" sudo -e" | |
dc9a8087 AB |
40 | |
41 | aur() { | |
42 | cd ~/usr/builds | |
d55c009f | 43 | [ -d ${1} ] || git clone https://aur.archlinux.org/${1}.git |
dc9a8087 AB |
44 | cd ${1} |
45 | } | |
46 | ||
d99f86cd | 47 | # fzf |
9daac239 AB |
48 | #include /usr/share/fzf/key-bindings.bash |
49 | #include /usr/share/fzf/completion.bash | |
58a81de3 | 50 | |
6e39e3a2 AB |
51 | if ! pgrep -u "$USER" ssh-agent > /dev/null; then |
52 | ssh-agent > ~/.ssh-agent-thing | |
53 | fi | |
54 | if [[ ! "$SSH_AUTH_SOCK" ]]; then | |
55 | eval "$(<~/.ssh-agent-thing)" | |
56 | fi |