This repository has been archived by the owner on Jan 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
64 lines (51 loc) · 1.97 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
# fpath=(/usr/share/licenses/zsh-completions $fpath)
# Aliases
[ -f $HOME/.config/zsh/script/alias.sh ] && source $HOME/.config/zsh/script/alias.sh
# Aliases for tmux projects
[ -f $HOME/.config/tmux/aliases.sh ] && source $HOME/.config/tmux/aliases.sh
# Autoload colors (for prompt)
autoload -U colors && colors
# Prompt theme
[ -f $HOME/.config/zsh/themes/prompt.zsh ] && source $HOME/.config/zsh/themes/prompt.zsh
# Auto/tab complete
autoload -U compinit
zstyle ':completion:*' menu select
zmodload zsh/complist
compinit
_comp_options+=(globdots)
# vi mode
bindkey -v
# export KEYTIMEOUT=1
# vi keys in tab complete menu
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
# Block cursor when in vi mode
# [ -f $HOME/.config/zsh/script/vi-mode.sh ] && source $HOME/.config/zsh/script/vi-mode.sh
# Use ranger to change directory
rgcd () {
tmp="$(mktemp)"
ranger --choosedir="$tmp" "$@"
if [ -f "$tmp" ]; then
dir="$(cat "$tmp")"
rm -f "$tmp"
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
fi
}
# Source files
[ -f "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -f "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
[ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ] \
&& source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
[ -f /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh ] \
&& source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
# Raspberry Pi specific sources, [[]] not POSIX compliant.
if [[ "$(uname -a)" == *"raspi"* ]]; then
[ -f $HOME/.config/zsh/script/alias-raspi.sh ] \
&& source $HOME/.config/zsh/script/alias-raspi.sh
fi
# Use specified node version
nvm use $NODE_VERSION 1>/dev/null
# System information
echo "" && pfetch