-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashrc
More file actions
123 lines (106 loc) · 2.62 KB
/
bashrc
File metadata and controls
123 lines (106 loc) · 2.62 KB
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
120
121
122
export LANG=ja_JP.UTF-8
#######
# env #
#######
HISTSIZE=5000
if command -v nvim &> /dev/null; then
export EDITOR="nvim"
fi
########
# brew #
########
for homebrew in /opt/homebrew/bin/brew /usr/local/bin/brew; do
if [ -f $homebrew ]; then
eval "$($homebrew shellenv)"
break
fi
done
if [ -n "$HOMEBREW_PREFIX" ]; then
bash_completion="$HOMEBREW_PREFIX/etc/profile.d/bash_completion.sh"
if [[ -r $bash_completion ]]; then
. $bash_completion
fi
aws_completer="$HOMEBREW_PREFIX/bin/aws_completer"
if [ -f $aws_completer ]; then
complete -C $aws_completer aws
fi
fi
##############
# completion #
##############
if command -v nerdctl &> /dev/null
then
source <(nerdctl completion bash)
fi
#########
# local #
#########
export PATH="$HOME/.local/bin:$PATH"
bash_local="${HOME}/.bash_local"
if [ -f $bash_local ]; then
. $bash_local
fi
########
# bind #
########
if [[ $- == *i* ]]; then
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
fi
#######
# git #
#######
# macOS (Homebrew)
if [ -n "$HOMEBREW_PREFIX" ] && [ -f "$HOMEBREW_PREFIX/etc/bash_completion.d/git-completion.bash" ]; then
source "$HOMEBREW_PREFIX/etc/bash_completion.d/git-completion.bash"
fi
if [ -n "$HOMEBREW_PREFIX" ] && [ -f "$HOMEBREW_PREFIX/etc/bash_completion.d/git-prompt.sh" ]; then
source "$HOMEBREW_PREFIX/etc/bash_completion.d/git-prompt.sh"
fi
# Linux (Ubuntu/Debian)
if [ -f /usr/share/doc/git/contrib/completion/git-completion.bash ]; then
source /usr/share/doc/git/contrib/completion/git-completion.bash
fi
if [ -f /usr/share/git-core/contrib/completion/git-prompt.sh ]; then
source /usr/share/git-core/contrib/completion/git-prompt.sh
fi
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWUPSTREAM=1
GIT_PS1_SHOWUNTRACKEDFILES=1
GIT_PS1_SHOWSTASHSTATE=1
##########
# prompt #
##########
__short_pwd() {
pwd | sed "s|^$HOME|~|; s|^~/workspace/|~/w…/|"
}
PS1='\[\e[1;31m\]$(__short_pwd)\[\e[00m\]\[\e[1;36m\]$(__git_ps1)\[\e[00m\] \[\e[1;32m\]→\[\e[00m\] '
added_prompt_command='history -a; history -c; history -r'
PROMPT_COMMAND="$added_prompt_command;$PROMPT_COMMAND"
#########
# alias #
#########
ALIASES=(git docker)
for a in ${ALIASES[@]}; do
alias_file="${HOME}/workspace/dotfiles/aliases/${a}/aliases.sh"
if [ -f $alias_file ]; then
. $alias_file
fi
done
# terraform
alias tf='terraform'
# kubernetes
alias k='kubectl'
# nvim
alias vi='nvim'
# system
if [[ "$(uname)" == "Darwin" ]]; then
alias sed='gsed'
fi
alias grep='grep --color=auto'
alias ll='ls -l'
alias ls='ls -G'
alias xargs='xargs '
# Added by LM Studio CLI (lms)
export PATH="$PATH:/Users/kohbis/.lmstudio/bin"
# End of LM Studio CLI section