-
Notifications
You must be signed in to change notification settings - Fork 1
/
dot_bashrc.tmpl
63 lines (54 loc) · 2.1 KB
/
dot_bashrc.tmpl
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
# vi: ft=bash
# shellcheck shell=bash
# Skip if not running interactively
[[ "$-" == *i* ]] || return
alias ls='ls --classify --color=auto'
alias cz='chezmoi'
alias grep='grep --color=always'
alias gtypist='gtypist --personal-best --max-error=1'
alias vi='nvim'
alias t='tmux attach || tmux new'
if ! command -v fd > /dev/null && command -v fdfind > /dev/null ; then
alias fd='fdfind'
fi
# Enable CTRL-S for forward history search
# (overwrites suspension of terminal output)
stty -ixon
export HISTSIZE=10000
# Append history file when shell exits
shopt -s histappend
# Display ANSI color escape characters in less
export LESS="--RAW-CONTROL-CHARS"
# Customize Git repository prompt
export GIT_PS1_SHOWDIRTYSTATE=1 # +/*
export GIT_PS1_SHOWSTASHSTATE=1 # $
export GIT_PS1_SHOWUNTRACKEDFILES=1 # %
export GIT_PS1_SHOWUPSTREAM=auto
# Color the classic (user@host:workdir$) prompt
# 032 - green
# 034 - blue
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 " [%s]") \$ '
# Set terminal window title to user@host: workdir
export PS1="\[\e]0;\u@\h: \w\a\]$PS1"
# Enable completion
[ -f /etc/profile.d/bash_completion.sh ] && source /etc/profile.d/bash_completion.sh
[ -f /home/linuxbrew/.linuxbrew/etc/profile.d/bash_completion.sh ] \
&& source /home/linuxbrew/.linuxbrew/etc/profile.d/bash_completion.sh
[ -f /opt/homebrew/etc/profile.d/bash_completion.sh ] \
&& source /opt/homebrew/etc/profile.d/bash_completion.sh
source <(chezmoi completion bash)
# Enable Cargo completion
command -v rustup &> /dev/null && source <(rustup completions bash cargo)
command -v rustup &> /dev/null && source <(rustup completions bash rustup)
# Enable pass-otp completion (https://github.com/tadfisher/pass-otp/issues/137)
[ -f /usr/share/bash-completion/completions/pass-otp ] \
&& source /usr/share/bash-completion/completions/pass-otp
# Tell GPG pinentry where to prompt for password
GPG_TTY=$(tty)
export GPG_TTY
{{- if eq .chezmoi.os "darwin" }}
gpgconf --launch gpg-agent
{{- end }}
source ~/.bash_functions
# Load machine-specific configuration
[ -f ~/.bashrc.local ] && source ~/.bashrc.local