-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
166 lines (139 loc) · 4.84 KB
/
.bashrc
File metadata and controls
166 lines (139 loc) · 4.84 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
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
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# 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
HISTSIZE=5000
HISTFILESIZE=10000
# 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)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
color_prompt=yes
else
color_prompt=
fi
fi
# --------------- prompt -------------------
__PS1_BUILD() {
local EXIT="$?"
PS1=""
local RCol='\[\e[0m\]'
local Red='\[\e[0;31m\]'
local Gre='\[\e[0;32m\]'
local Yel='\[\e[0;33m\]'
local Blu='\[\e[0;34m\]'
local __PS1_LOCATION="${Yel}\A${Blu}:${Gre}\w${RCol}"
local __PS1_GIT_STATUS=$([[ $(git status -s 2>/dev/null | wc -l) != 0 ]] && echo -en " \e[1;33;44m" || echo -en " \e[39;44m")
local __PS1_GIT_BRANCH=$(git branch 2>/dev/null | grep \* | { read tmpv; [[ -n $tmpv ]] && echo " ${tmpv##* } \e[0m" || echo "\e[0m"; })
local __PS1_AFTER="†"
PS1+="$__PS1_LOCATION$__PS1_GIT_STATUS$__PS1_GIT_BRANCH"
[[ $EXIT != 0 ]] && PS1+=" ${Red}$EXIT${RCol} " || :
PS1+="\n${Yel}$__PS1_AFTER${RCol} "
}
PROMPT_COMMAND=__PS1_BUILD
unset color_prompt force_color_prompt
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
alias ll='ls -alhF'
alias la='ls -A'
alias l='ls -CF'
alias vi=nvim
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias c=clear
alias b=batcat
alias ?=ddgr
alias top=htop
alias k=kubectl
complete -F __start_kubectl k
alias dcu='docker compose up -d'
alias dcd='docker compose down'
alias g='git status'
alias yd='npm run dev'
alias ya='npm run start:api'
alias ys='npm run start'
alias yb='npm run build'
alias npmscripts='jq .scripts package.json'
alias ascii='man ascii | grep -m 1 -A 88 --color=never Oct | grep -P -v "Tables|For|^\s*$"'
alias lessf='less -F'
alias prw='gh pr view -w'
alias sumatra='/mnt/c/Users/dpsig/Área\ de\ Trabalho/SumatraPDF-3.4.6-64.exe'
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
#owncomp=(s01)
#for i in ${owncomp[@]}; do complete -C $i $i; done
export GITUSER="$USER"
export MAIN_REPOS_PATH="$HOME/repos/github.com/$GITUSER"
export DOTFILES="$MAIN_REPOS_PATH/dot"
# export SCRIPTS="$DOTFILES/scripts"
# export EDITOR="/usr/bin/vim"
export VISUAL=vim
export PYTHONDONTWRITEBYTECODE=1
# export GOBIN=/usr/local/go/bin
export LC_CTYPE="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LANG=en_US.UTF-8
if [ -f ~/.config/.secrets/envsecrets ]; then
. ~/.config/.secrets/envsecrets
fi
# export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:~/.local/bin
# export PATH=$PATH:~/go/bin
# export PATH=$PATH:~/zig
# export PATH="/home/dpsigor/.ebcli-virtual-env/executables:$PATH"
# export PATH="/home/dpsigor/.node-v16.11.1-linux-x64/bin:$PATH"
# export PATH="/opt/nvim-linux64/bin:$PATH"
bind '"\t":menu-complete'
# export BUN_INSTALL="$HOME/.bun"
# export PATH=$BUN_INSTALL/bin:$PATH
# export DENO_INSTALL="/home/dpsigor/.deno"
# export PATH="$DENO_INSTALL/bin:$PATH"
export CDPATH=".:$MAIN_REPOS_PATH"
export DISCERN_REPOS_PATH="$HOME/repos/github.com/discernhq"
export CDPATH=".:$DISCERN_REPOS_PATH"
# Para disable ctrl+s e ctrl+q padrao do terminal
stty -ixon
# Cores em man pages
export LESS_TERMCAP_mb=$'\e[1;32m'
export LESS_TERMCAP_md=$'\e[1;32m'
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[01;33m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[1;4;31m'
export PAGER="less"
# export MANPAGER="sh -c 'col -bx | batcat -l man -p'"
set -o vi
bind 'set bell-style none'
# [ -f ~/.fzf.bash ] && source ~/.fzf.bash
# eval "$(fzf --bash)"
# . "$HOME/.asdf/asdf.sh"
# . "$HOME/.asdf/completions/asdf.bash"
[ -f ~/.config/.secrets/secrets.bash ] && source ~/.config/.secrets/secrets.bash