-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
203 lines (162 loc) · 6.3 KB
/
.bashrc
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
######################################################################
#
#
# ██████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗
# ██╔══██╗██╔══██╗██╔════╝██║ ██║██╔══██╗██╔════╝
# ██████╔╝███████║███████╗███████║██████╔╝██║
# ██╔══██╗██╔══██║╚════██║██╔══██║██╔══██╗██║
# ██████╔╝██║ ██║███████║██║ ██║██║ ██║╚██████╗
# ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝
#
#
######################################################################
# Enable bash programmable completion features in interactive shells
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
#Keybinds
bind '"\C-0": beginning-of-line'
#Activate vi mode by default
# set -o vi
####################################################
####################################################
#History stuff--- Timeformat, ignore dupes, buffer size
HISTTIMEFORMAT="%F %T "
HISTCONTROL=ignoredups
HISTSIZE=2000
HISTFILESIZE=2000
# Check the window size after each command and, if necessary, update the values of LINES and COLUMNS
shopt -s checkwinsize
#bash appends to his, inbstead of overwriting it. this keeps history across terminals
shopt -s histappend
PROMPT_COMMAND='history -a'
# Allow ctrl-S for history navigation (with ctrl-R)
stty -ixon
# Ignore case on auto-completion
# Note: bind used instead of sticking these in .inputrc
if [[ $iatest > 0 ]]; then bind "set completion-ignore-case on"; fi
# Show auto-completion list automatically, without double tab
if [[ $iatest > 0 ]]; then bind "set show-all-if-ambiguous On"; fi
# Set the default editor
export EDITOR=nvim
export VISUAL=nvim
# To have colors for ls and all grep commands such as grep, egrep and zgrep
export CLICOLOR=1
export LS_COLORS='no=00:fi=00:di=00;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:*.xml=00;31:'
#export GREP_OPTIONS='--color=auto' #deprecated
alias grep="/usr/bin/grep $GREP_OPTIONS"
unset GREP_OPTIONS
# Color for manpages in less makes manpages a little easier to read
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
#Colors
blk='\[\033[01;30m\]' # Black
red='\[\033[01;31m\]' # Red
grn='\[\033[01;32m\]' # Green
ylw='\[\033[01;33m\]' # Yellow
blu='\[\033[01;34m\]' # Blue
pur='\[\033[01;35m\]' # Purple
cyn='\[\033[01;36m\]' # Cyan
wht='\[\033[01;37m\]' # White
clr='\[\033[00m\]' # Reset
####################################################
####################################################
#Alias's
#git alias's
alias gs='git status'
alias ga='git add'
alias gaa='git add --all'
alias gc='git commit'
alias gl='git log --oneline'
alias gb='git checkout -b'
alias gd='git diff'
#dir alias's
alias ..='cd ..;pwd'
alias ...='cd ../..;pwd'
alias ....='cd ../../..;pwd'
alias c='clear'
alias h='history'
alias tree='tree --dirsfirst -F'
alias mkdir='mkdir -p -v'
# Alias's for multiple directory listing commands
alias la='exa -a --icons' # list all with icons
alias ls='exa --icons' # list with icons
alias ll='exa -a -l --icons --header' # list all, long, with icons and header
alias lg='exa -l -a --git --icons --header' # list all, long, with git & icons
alias lt='exa -a --icons --tree'
#cal alias's
alias jan='cal -m 01'
alias feb='cal -m 02'
alias mar='cal -m 03'
alias apr='cal -m 04'
alias may='cal -m 05'
alias jun='cal -m 06'
alias jul='cal -m 07'
alias aug='cal -m 08'
alias sep='cal -m 09'
alias oct='cal -m 10'
alias nov='cal -m 11'
alias dec='cal -m 12'
alias snvim='sudo -e'
alias mail='neomutt'
alias on='cd Nextcloud/Obisian\ vault/'
#sail logic
sail() {
if [ -f ./vendor/bin/sail ]; then
./vendor/bin/sail "$@"
else
echo "Error: This is not a Laravel Sail directory (no ./vendor/bin/sail file found)." >&2
return 1
fi
}
####################################################
####################################################
# Env
export BROWSER=xdg-open
####################################################
####################################################
#Functions
function hg() {
history | grep "$1"
}
function find_largest_files() {
du -h -x -s -- * | sort -r -h | head -20
}
function git_branch() {
if [ -d .git ]; then
printf "%s" "($(git branch 2>/dev/null | awk '/\*/{print $2}'))"
fi
}
# Set the prompt.
function bash_prompt() {
PS1='${debian_chroot:+($debian_chroot)}'${blu}'$(git_branch)'${pur}' \W'${grn}' '${clr}
}
bash_prompt
function git_init() {
if [ -z "$1" ]; then
printf "%s\n" "Please provide a directory name."
else
mkdir "$1"
builtin cd "$1"
pwd
git init
touch readme.md .gitignore LICENSE
echo "# $(basename $PWD)" >>readme.md
fi
}
# Set up fzf key bindings and fuzzy completion
# eval "$(fzf --bash)"
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export PATH="/home/zeal/.config/herd-lite/bin:$PATH"
export PHP_INI_SCAN_DIR="/home/zeal/.config/herd-lite/bin:$PHP_INI_SCAN_DIR"
export PATH="$HOME/.local/share/nvim/mason/packages/blade-formatter/node_modules/.bin:$PATH"