Last active
August 11, 2022 15:04
-
-
Save ndtn97/a3bf175ca6deab1a3bd86ac11b3b6c11 to your computer and use it in GitHub Desktop.
.zshrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Added by Zinit's installer | |
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then | |
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f" | |
command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit" | |
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \ | |
print -P "%F{33} %F{34}Installation successful.%f%b" || \ | |
print -P "%F{160} The clone has failed.%f%b" | |
fi | |
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh" | |
autoload -Uz _zinit | |
(( ${+_comps} )) && _comps[zinit]=_zinit | |
# Load starship theme | |
eval "$(starship init zsh)" | |
# Homebrew comp | |
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}" | |
# zsh-completions | |
zinit ice lucid wait'0'; zinit light zsh-users/zsh-completions | |
autoload -Uz compinit && compinit | |
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' | |
zstyle ':completion:*:default' menu select=1 | |
# zsh-syntax-highlighting | |
zinit ice lucid wait'0'; zinit light zsh-users/zsh-syntax-highlighting | |
# zsh-autosuggestions | |
zinit ice lucid wait'0'; zinit light zsh-users/zsh-autosuggestions | |
# zsh | |
HISTSIZE=100000 | |
SAVEHIST=1000000 | |
setopt AUTO_CD | |
setopt AUTO_PARAM_KEYS | |
alias ls='ls -G' | |
# pyenv | |
eval "$(pyenv init -)" | |
# nodebrew | |
export PATH=$HOME/.nodebrew/current/bin:$PATH | |
# go | |
export GOPATH=`go env GOPATH` | |
export PATH=$PATH:$GOPATH/bin | |
# ghq-fzf | |
function ghq-fzf() { | |
local src=$(ghq list | fzf --preview "ls -laTp $(ghq root)/{} | tail -n+4 | awk '{print \$9\"/\"\$6\"/\"\$7 \" \" \$10}'") | |
if [ -n "$src" ]; then | |
BUFFER="cd $(ghq root)/$src" | |
zle accept-line | |
fi | |
zle -R -c | |
} | |
zle -N ghq-fzf | |
bindkey '^g' ghq-fzf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment