-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
69 lines (59 loc) · 2.55 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
# History file settings
HISTFILE=~/.cache/zsh/histfile
HISTSIZE=5000
SAVEHIST=5000
# Options
setopt appendhistory # append history list to history file
setopt sharehistory # import new commands from history in other session
setopt histignorespace # remove entries in history that starts with space
setopt histignorealldups # remove duplicate entries from history
setopt completealiases # Tab completion for aliases
setopt autocd # cd into typed directory
unsetopt beep # Disable beep sound
stty stop undef # Disable ctrl-s to freeze terminal
# Vi mode
bindkey -v
autoload -Uz compinit # Initialize completion system
zstyle ':completion::complete:*' menu select gain-privileges 1 # Enable for sudo commands
zmodload zsh/complist
compinit -d ~/.cache/zsh/zcompdump # Change completion file location
_comp_options+=(globdots) # Include hidden files in completion
# Use vim keys in completion menu
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -v '^?' backward-delete-char
# This is a shell function to automatically change the current working
# directory to the last visited one after ranger quits. Either put it into your
# .zshrc/.bashrc/etc or source this file from your shell configuration.
# To undo the effect of this function, you can type "cd -" to return to the
# original directory.
ranger_cd() {
temp_file="$(mktemp -t "ranger_cd.XXXXXXXXXX")"
ranger --choosedir="$temp_file" -- "${@:-$PWD}"
if chosen_dir="$(cat -- "$temp_file")" && [ -n "$chosen_dir" ] && [ "$chosen_dir" != "$PWD" ]; then
cd -- "$chosen_dir"
fi
rm -f -- "$temp_file"
}
# Set pywal colors (messes up st alpha)
# ZLS_COLORS=''
# (cat ~/.cache/wal/sequences &)
# Aliases
alias l="lsd"
alias ls="lsd"
alias la="lsd -a"
alias ll="lsd -l"
alias lla="lsd -la"
alias ip="ip -color=auto"
alias vim="nvim"
alias sudo="sudo "
alias nmtui="sudo nmtui"
alias ranger="ranger_cd"
alias grep="grep --color=auto"
alias diff="diff --color=auto"
alias weather="curl https://wttr.in/"
PROMPT='%B%F{cyan}[%f%F{green}%n%f@%F{magenta}%M%f %F{blue}%1~%f%F{cyan}]%f%#%b ' # Left prompt
RPROMPT='[%F{yellow}%?%f]' # Right prompt
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # load syntax highlighting