-
Notifications
You must be signed in to change notification settings - Fork 2
/
dot_bash_profile.tmpl
119 lines (95 loc) · 3.56 KB
/
dot_bash_profile.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/bash
# TODO consider
#if [ -f /etc/profile ]; then
# . /etc/profile
#fi
# History options
export HISTFILE=$HOME/.bash_history
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
export HISTSIZE='32768';
export HISTFILESIZE="${HISTSIZE}";
export SAVEHIST=99999
export HISTFILESIZE=99999
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# Save multi-line commands as one command
shopt -s cmdhist
# Don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
export HISTCONTROL=erasedups:ignoreboth
# Useful timestamp format
export HISTTIMEFORMAT='%F %T '
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# Key bindings
set -o vi
bind '"^R":"history-incremental-search-backward"'
# Tab completion changes
##uncomment the following to activate bash-completion:
#[ -f /etc/profile.d/bash-completion ] && source /etc/profile.d/bash-completion
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# Prompts
ctx=""
if test "$SHLVL" -gt 1; then
ctx="${ctx}:${SHLVL}"
fi
if test -n "${ctx}"; then
ctx="(${ctx})"
fi
# TODO Set title: PS1="\[\e]0;\u@\h: \w\a\]$PS1" ish
export PS1='\u@\h:'"\${PWD} ${ctx}"$'\n''\$ '
unset ctx
{{ template "dev-utils-env.tmpl" $ }}
# Helper stuff
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
{{ template "shell-aliases.tmpl" $ }}
#{{ if eq .chezmoi.os "darwin" }} Darwin
#{{ else if eq .chezmoi.os "linux" }} Linux
#{{ else if eq .chezmoi.os "windows" }} Windows
#{{ end }} End OS Specific code
{{ template "shell-term-env.tmpl" $ }}
{{ template "shell-man-env.tmpl" $ }}
# Other program envs
{{ template "common-misc-env.tmpl" $ }}
{{ template "atuin.tmpl" deepCopy $ | merge (dict "shell" "bash") }}
# OS Specific
#{{ if eq .chezmoi.os "darwin" }} Darwin
# {{- if stat "/usr/local/etc/bash_completion.d/git-completion.bash" }} Git bash completion usr local - home brew
GIT_COMPLETION_PATH="/usr/local/etc/bash_completion.d/git-completion.bash"
# {{- end }}
#{{ else if eq .chezmoi.os "linux" }} Linux
#{{ else if eq .chezmoi.os "windows" }} Windows
#{{ else if eq .chezmoi.os "solaris" }} Solaris -- Been a while
#{{ end }} End OS Specific code
{{ template "path-discovery.tmpl" $ }}
{{ template "dev-utils-env.tmpl" $ }}
# TODO chezmoi'd a bit more
if test -f /usr/share/bash-completion/bash_completion; then
. /usr/share/bash-completion/bash_completion
elif test -f /etc/bash_completion; then
. /etc/bash_completion
elif test -f /run/current-system/profile/etc/profile.d/bash_completion.sh; then
. /run/current-system/profile/etc/profile.d/bash_completion.sh
fi
return # This prevents scripts which append their own installers from "working"
{{/* vim: set filetype=bash: */}}