-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
84 lines (71 loc) · 1.9 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
#!/bin/bash
# shellcheck disable=SC1090
# shellcheck disable=SC1091
# shellcheck disable=SC2139
# shellcheck disable=SC2262
# shellcheck disable=SC2263
export HISTSIZE="10000"
export HISTFILE="${XDG_STATE_HOME}/history"
export HISTFILESIZE="50000"
export HISTCONTROL="erasedups"
export HISTIGNORE="ls:ll:la:pwd:exit:clear:history:h:c:r:q"
shopt -s no_empty_cmd_completion
shopt -s nullglob
shopt -s extglob
shopt -s dotglob
shopt -s histappend
shopt -s histreedit
shopt -s histverify
shopt -s checkwinsize
# Use eza instead of ls
if type eza >/dev/null 2>&1; then
alias ls='LC_COLLATE=C eza --color=auto --group-directories-first'
elif ls --group-directories-first >/dev/null 2>&1; then
alias ls='LC_COLLATE=C ls --color=auto --group-directories-first'
else
alias ls='LC_COLLATE=C ls --color=auto'
fi
# Use bat instead of cat
if type bat >/dev/null 2>&1; then
alias bat="bat --color=always --theme Dracula"
alias cat="bat -p"
fi
alias tree='tree -C'
alias diff='diff --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias la='ls -a'
alias ll='ls -alHF'
alias ..='cd ..'
alias cp='cp -i'
alias rm='rm -i'
alias mv='mv -i'
alias h='history'
alias c='clear'
alias r='exec ${SHELL} -l'
alias q='exit'
alias fd='fd --hidden --follow --exclude .git'
alias rg='rg --hidden --follow --glob "!.git"'
# Use neovim or neovim-remote instead of vim
if type nvim >/dev/null 2>&1; then
if type nvr >/dev/null 2>&1; then
alias vim='nvr -s'
else
alias vim='nvim'
fi
fi
# Load fzf shellenv
if type fzf >/dev/null 2>&1; then
eval "$(fzf --bash)"
fi
# Load zoxide shellenv
if type zoxide >/dev/null 2>&1; then
eval "$(zoxide init bash)"
fi
# Load starship shellenv
if type starship >/dev/null 2>&1; then
export STARSHIP_CONFIG="${XDG_CONFIG_HOME}/starship/starship.toml"
export STARSHIP_CACHE="${XDG_CACHE_HOME}/starship/"
eval "$(starship init bash)"
fi