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