Browse Source

Switch to zinit instead of Oh-My-Zsh

Frans Bergman 3 years ago
parent
commit
1af54429d0
2 changed files with 42 additions and 35 deletions
  1. 0 1
      .profile
  2. 42 34
      .zshrc

+ 0 - 1
.profile

@@ -6,7 +6,6 @@
 source /etc/profile
 
 export GOPATH="$HOME/go"
-export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src"
 export PATH="/usr/lib/distcc/bin:$PATH:$HOME/.cargo/bin:$GOPATH/bin:$HOME/.scripts:$HOME/bin"
 export BROWSER="firefox"
 export READER="zathura"

+ 42 - 34
.zshrc

@@ -1,47 +1,55 @@
 source ~/.profile
+source ~/.aliases
 
-# Path to your oh-my-zsh installation.
-export ZSH=/home/frans/.oh-my-zsh
+export HISTFILE="$HOME/.zsh_history"
+export HISTSIZE="1000000"
+export SAVEHIST="1000000"
 
-# Set name of the theme to load. Optionally, if you set this to "random"
-# it'll load a random theme each time that oh-my-zsh is loaded.
-# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
-ZSH_THEME="michelebologna"
+### Added by Zinit's installer
+if [[ ! -f $HOME/.zinit/bin/zinit.zsh ]]; then
+    print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma/zinit%F{220})…%f"
+    command mkdir -p "$HOME/.zinit" && command chmod g-rwX "$HOME/.zinit"
+    command git clone https://github.com/zdharma/zinit "$HOME/.zinit/bin" && \
+        print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \
+        print -P "%F{160}▓▒░ The clone has failed.%f%b"
+fi
 
-# Uncomment the following line to display red dots whilst waiting for completion.
-COMPLETION_WAITING_DOTS="true"
+source "$HOME/.zinit/bin/zinit.zsh"
+autoload -Uz _zinit
+(( ${+_comps} )) && _comps[zinit]=_zinit
 
-# Uncomment the following line if you want to disable marking untracked files
-# under VCS as dirty. This makes repository status check for large repositories
-# much, much faster.
-DISABLE_UNTRACKED_FILES_DIRTY="true"
+# Load a few important annexes, without Turbo
+# (this is currently required for annexes)
+zinit light-mode for \
+    zinit-zsh/z-a-rust \
+    zinit-zsh/z-a-as-monitor \
+    zinit-zsh/z-a-patch-dl \
+    zinit-zsh/z-a-bin-gem-node
 
-ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
+### End of Zinit's installer chunk
 
-# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
-# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
-# Example format: plugins=(rails git textmate ruby lighthouse)
-# Add wisely, as too many plugins slow down shell startup.
-plugins=(
-  git
-  zsh-autosuggestions
-  zsh-syntax-highlighting
-)
+# Autosuggestions & fast-syntax-highlighting
+zinit ice wait lucid atinit"zpcompinit; zpcdreplay"
+zinit light zdharma/fast-syntax-highlighting
+# zsh-autosuggestions
+zinit ice wait lucid atload"!_zsh_autosuggest_start"
+zinit load zsh-users/zsh-autosuggestions
 
-source $ZSH/oh-my-zsh.sh
+zinit light 'ytet5uy4/fzf-widgets'
 
-# User configuration
+# Load OMZ Git library
+zinit snippet OMZL::git.zsh
+zinit cdclear -q # <- forget completions provided up to this moment
 
-source ~/.aliases
+setopt promptsubst
 
-bindkey -v
+# Load Git plugin from OMZ
+zinit snippet OMZP::git
 
-# Fuzzy Finder
-[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
+zinit ice pick"async.zsh" src"pure.zsh"
+zinit light sindresorhus/pure
 
-fzf-history-widget-accept() {
-  fzf-history-widget
-  zle accept-line
-}
-zle     -N     fzf-history-widget-accept
-bindkey '^X^R' fzf-history-widget-accept
+bindkey '^r'  fzf-insert-history
+bindkey '^t'  fzf-insert-files
+
+bindkey -v