Skip to content

Commit

Permalink
zshrc with oh-my-zsh
Browse files Browse the repository at this point in the history
  • Loading branch information
varp committed Nov 6, 2024
1 parent a8f9e8c commit 6686f6e
Showing 1 changed file with 36 additions and 40 deletions.
76 changes: 36 additions & 40 deletions dotfiles/zshrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
time_ms
##
## zinit
##
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
[ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $ZINIT_HOME)"
[ ! -d $ZINIT_HOME/.git ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
source "${ZINIT_HOME}/zinit.zsh"

##
## POSIX complaint shell utitly functions and envs
##
Expand All @@ -15,6 +7,16 @@ source "$HOME/.shell/env"
source "$HOME/.shell/aliases"
source "$HOME/.shell/xvm"

##
## OhMyZsh
##
export ZSH="$HOME/.oh-my-zsh"
export KEEP_ZSHRC="yes"
[[ -d "$ZSH" && -f "$ZSH/oh-my-zsh.sh" ]] || sh -c "$(
export KEEP_ZSHRC=$KEEP_ZSHRC
curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
)"

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
Expand Down Expand Up @@ -71,31 +73,26 @@ DISABLE_UNTRACKED_FILES_DIRTY="true"
ZSH_DISABLE_COMPFIX=true

# Plugins
zinit ice as"completion"
zinit snippet https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker

zinit snippet OMZP::git
zinit snippet OMZP::pyenv
zinit snippet OMZP::dotenv
zinit snippet OMZP::sudo
zinit snippet OMZP::golang
zinit snippet OMZP::common-aliases
zinit snippet OMZP::pyenv

zstyle ':omz:plugins:nvm' autoload yes
zstyle ':omz:plugins:nvm' silent-autoload yes # optionally remove the output generated by NVM when autoloading
zinit snippet OMZP::nvm

zinit snippet OMZP::colored-man-pages
zinit snippet OMZP::systemd
zinit snippet OMZP::themes
zinit snippet OMZP::perms
zinit snippet OMZP::docker-compose
zinit snippet OMZP::kubectl

zinit light zsh-users/zsh-syntax-highlighting
zinit light zsh-users/zsh-autosuggestions
zinit light zsh-users/zsh-completions
plugins=(
git
pyenv
dotenv
sudo
golang
common-aliases
pyenv
nvm
colored-man-pages
systemd
themes
perms
docker
docker-compose
kubectl
# globalias
)

source "$ZSH/oh-my-zsh.sh"

##
## correct only spelling of commands
Expand All @@ -117,20 +114,19 @@ eval "$(starship init zsh)"
##

if [ -n "$HOMEBREW_PREFIX" ]; then
fpath=("$HOMEBREW_PREFIX/share/zsh-completions" $fpath)
fpath=("$HOMEBREW_PREFIX/share/zsh/site-functions" $fpath)
fpath=("$HOMEBREW_PREFIX/completions" $fpath)
fpath=("$HOMEBREW_PREFIX/share/zsh-completions" $fpath)
fpath=("$HOMEBREW_PREFIX/share/zsh/site-functions" $fpath)
fpath=("$HOMEBREW_PREFIX/completions" $fpath)
fi

ZSH_COMPLETION_DIR="$HOME/.zsh_completion.d"
[ ! -d $ZSH_COMPLETION_DIR ] && mkdir -p "$ZSH_COMPLETION_DIR"
fpath=("$ZSH_COMPLETION_DIR" $fpath)

## TODO: there is an issue https://github.com/zdharma-continuum/zinit/issues/654
# [ -f "$HOME/.zsh_completion" ] && source "$HOME/.zsh_completion"
# autoload -Uz compinit && compinit -u
source "$HOME/.zsh_completion"

# zinit cdreplay -q
autoload -Uz compinit && compinit -u
autoload -Uz bashcompinit && bashcompinit

##
## PATH without duplicates
Expand Down

0 comments on commit 6686f6e

Please sign in to comment.