-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
executable file
·78 lines (62 loc) · 2.31 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
# zsh config
## vi mode
bindkey -v
export KEYTIMEOUT=1
## history
export HISTSIZE=20000 # history size
export HISTFILE="$HOME/.zsh_history" # history file
export SAVEHIST=$HISTSIZE # lines of history to save to HISTFILE
## reverse history search
bindkey '^R' history-incremental-search-backward
## default editor
export EDITOR=/usr/local/bin/vim
export VISUAL=/usr/local/bin/vim
## modern completion system
zstyle ':completion:*' menu select=long
autoload -Uz compinit
compinit
## Prompt config
# Print an empty line before the PROMPT is rendered
# precmd() { print "" }
## %/ Present working directory
LOCATION=$'# %/' # current location
NEWLINE=$'\n' # newline
AUTOHASH=$'%#' # character that shows as % (normal user) or # (sudo user)
PROMPT=%B${NEWLINE}${LOCATION}%b${NEWLINE}${AUTOHASH}" "
# NPM
# export PATH="$PATH:$HOME/.npm/bin"
# Yarn
# export PATH="$(yarn global bin):$PATH"
# NVM (NodeJS version manager)
export NVM_DIR="/home/tyler/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
# Path completion like ~/d/s => ~/Documents/stuff...
# These two initialize the completion system,
# providing the case-sensitive expansion
autoload -U compinit
compinit
# This sets the case insensitivity
zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}'
# Init fzf (fuzzy finder)
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# Set default for fzf
export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.git/*"'
# --files: List files that would be searched but do not search
# --no-ignore: Do not respect .gitignore, etc...
# --hidden: Search hidden files and folders
# --follow: Follow symlinks
# --glob: Additional conditions for search (in this case ignore everything in the .git/ folder)
# 'ghost history' when typing commands.
# https://github.com/zsh-users/zsh-autosuggestions
# git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=cyan" # ghost color
# Colors in byobu/tmux + vim
# export TERM="xterm-256color"
# get some secret stuff
source ~/.zshrc_private
# Configure pagers for better file inspection.
export PAGER=less
export LESS="-iMSx4 -FX"
# npm install --global diff-so-fancy
export GIT_PAGER="diff-so-fancy | less --tabs=2 -RFX"