-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
65 lines (56 loc) · 1.67 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
# github.com/yak6/dotfiles
autoload -U compinit && compinit
autoload -Uz colors && colors
PS1='%F{red}[%F{yellow}%n%f@%F{blue}%m%F %F{yellow}%1~%F{red}]%f$ '
setopt autocd
stty stop undef
setopt interactive_comments
# Exports
[[ -d "$HOME/.local/bin" ]] && export PATH="$HOME/.local/bin:$PATH"
[[ -d "/opt/homebrew/bin" ]] && export PATH="/opt/homebrew/bin:$PATH"
[[ -d "/usr/local/bin" ]] && export PATH="/usr/local/bin:$PATH"
export EDITOR="vim"
export VISUAL="vim"
# History settings
HISTSIZE=100000 # Saved in the memory
SAVEHIST=100000 # Saved on disk
HISTFILE=~/.zsh_history # History file path
setopt hist_ignore_all_dups # Ignore duplicats
setopt share_history # Share history between zsh sessions
setopt append_history # Add new entries to the end of the history file
setopt inc_append_history # Save history each new prompt
setopt extended_history # Add time
# Underline - \e[3 q
# Beam - \e[5 q
# Block - \e[1 q
echo -ne '\e[5 q' # Use cursor shape after shell starts
preexec() { echo -ne '\e[5 q';} # Use cursor shape for each new prompt
# Colorize commands
alias \
ls='ls --color' \
grep='grep --color' \
diff='diff --color' \
ip='ip --color'
# File listing aliases
alias \
l='ls -CF' \
ll='ls -lh' \
la='ls -A'
# File operations
alias \
cp='cp -iv' \
mv='mv -iv' \
rm='rm -vI' \
mkdir='mkdir -pv'
# Shortcuts
alias \
g='git' \
v='vim' \
sv='sudo vim' \
sn='sudo nano' \
t='date +"%T"' \
d='date +"%d.%m.%Y"' \
i="ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'" \
q='exit' \
c='clear -X' \
reload='source ~/.zshrc'