-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashrc
More file actions
94 lines (76 loc) · 2.52 KB
/
Copy pathbashrc
File metadata and controls
94 lines (76 loc) · 2.52 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
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return ;;
esac
# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
for rc in ~/.bashrc.d/*; do
if [ -f "$rc" ]; then
# TIMEFORMAT="$rc: %E"
# time . "$rc"
# unset TIMEFORMAT
. "$rc"
fi
done
fi
unset rc
HISTCONTROL=ignoreboth:erasedups
HISTIGNORE='cd *:htop:vi *:vim:z *:z -:la *:git pull:git push:ranger:gs:git s:git su:la:l:rm *:svn revert*:sudo dnf update:pyenv *:deactivate:fg:git push:git c:git commit:findme:flatpak update'
HISTSIZE=20000
HISTFILESIZE=20000
PROMPT_DIRTRIM=2
shopt -s histappend # Append to the history file upon exit
shopt -s checkwinsize # Check the window size after each command
shopt -s autocd # Enable auto cd by typing a dir
bind -m emacs '"\C-p": history-search-backward'
bind -m emacs '"\C-n": history-search-forward'
# After each command, append to the history file and reread it
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
# Ignore case on auto-completion
# Note: bind used instead of sticking these in .inputrc
bind "set completion-ignore-case on"
# Show auto-completion list automatically, without double tab
bind "set show-all-if-ambiguous On"
# colored GCC warnings and errors
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# vars
export EDITOR=/usr/bin/nvim
export WGETRC=$HOME/.config/.wgetrc
export MOZ_ENABLE_WAYLAND=1
# 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'
alias vbash='nvim ~/.bashrc'
alias rc-reload='source ~/.bashrc'
alias keybinds='bind -P | less'
# Trap non zero errors
EC() {
echo -e '\e[1;33m'code $?'\e[m'
}
trap EC ERR
# Mimic zsh run-help keybind
run-help() { help "$READLINE_LINE" 2>/dev/null || man "$READLINE_LINE" 2>/dev/null; }
bind -m vi-insert -x '"\eh": run-help'
bind -m emacs -x '"\eh": run-help'
eval "$(fzf --bash)"
eval "$(zoxide init bash)"
eval "$(direnv hook bash)"
eval "$(starship init bash)"