-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
113 lines (87 loc) · 2.45 KB
/
.zshrc
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
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# THEMES
export ZSH="$HOME/.oh-my-zsh"
BAT_THEME="gruvbox-dark"
ZSH_THEME="custom-nanotech"
# PLUGINS
plugins=(
git
git-prompt
zsh-autosuggestions
zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh
zstyle ':omz:update' mode auto
# HISTORY
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=~/.zsh_history
# AUTOcompletions:
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh-completions:$FPATH
autoload -Uz compinit
compinit
fi
# CUSTOM aliases
alias v=openNvim
alias guc="git reset --soft HEAD~"
alias fp="fzf --preview 'bat --style=numbers --color=always --line-range :500 {}'"
# FOLDER aliases
alias ll='lsd -lh --group-dirs=first'
alias la='lsd -a --group-dirs=first'
alias l='lsd --group-dirs=first'
alias lla='lsd -lha --group-dirs=first'
alias ls='lsd --group-dirs=first'
alias cat='bat'
alias catn='/usr/bin/cat'
# SYSTEM aliases
alias updt='brew update && brew upgrade && brew outdated && brew cleanup'
alias dskt='cd ~/Desktop/'
# FNM configuration
eval "`fnm env`"
# SOURCE external files
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# CUSTOM Functions
if [ -f ~/.myenvs ]; then
source ~/.myenvs
fi
function openNvim {
if [ $# -eq 0 ]; then
nvim ./
else
nvim $1
fi
}
function man() {
env \
LESS_TERMCAP_mb=$'\e[01;31m' \
LESS_TERMCAP_md=$'\e[01;31m' \
LESS_TERMCAP_me=$'\e[0m' \
LESS_TERMCAP_se=$'\e[0m' \
LESS_TERMCAP_so=$'\e[01;44;33m' \
LESS_TERMCAP_ue=$'\e[0m' \
LESS_TERMCAP_us=$'\e[01;32m' \
man "$@"
}
function fzf-lovely(){
if [ "$0" = "h" ]; then
fzf -m --reverse --preview-window down:20 --preview '[[ $(file --mime {}) =~ binary ]] &&
echo {} is a binary file ||
(bat --style=numbers --color=always {} ||
highlight -O ansi -l {} ||
coderay {} ||
rougify {} ||
cat {}) 2> /dev/null | head -500'
else
fzf -m --preview '[[ $(file --mime {}) =~ binary ]] &&
echo {} is a binary file ||
(bat --style=numbers --color=always {} ||
highlight -O ansi -l {} ||
coderay {} ||
rougify {} ||
cat {}) 2> /dev/null | head -500'
fi
}
export PATH=$PATH/.fnm:$PATH