From ed2d42984222bd7579359abd38cdd4899004faa7 Mon Sep 17 00:00:00 2001 From: 135e2 <135e2@135e2.tk> Date: Sat, 15 Jan 2022 19:52:04 +0800 Subject: .zshrc: new, 20220115 --- .zshrc | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .zshrc diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..96c12e3 --- /dev/null +++ b/.zshrc @@ -0,0 +1,76 @@ +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. +# Initialization code that may require console input (password prompts, [y/n] +# confirmations, etc.) must go above this block; everything else may go below. +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + + +### 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-continuum/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 + +source "$HOME/.zinit/bin/zinit.zsh" +autoload -Uz _zinit +(( ${+_comps} )) && _comps[zinit]=_zinit + +# Load a few important annexes, without Turbo +# (this is currently required for annexes) +zinit light-mode for \ + zdharma-continuum/z-a-rust \ + zdharma-continuum/z-a-as-monitor \ + zdharma-continuum/z-a-patch-dl \ + zdharma-continuum/z-a-bin-gem-node + +### End of Zinit's installer chunk + +# Highlighting +zinit ice lucid wait='0' atinit='zpcompinit' +zinit light zsh-users/zsh-syntax-highlighting + +# Completions +zinit ice lucid wait='0' +zinit light zsh-users/zsh-completions + +# Powerlevel10k +zinit ice depth=1 +zinit light romkatv/powerlevel10k + +# Zprof +zmodload zsh/zprof + +# Load from oh-my-zsh +zinit wait="1" lucid for \ + OMZL::clipboard.zsh \ + OMZL::git.zsh \ + OMZL::history.zsh \ + OMZP::systemd/systemd.plugin.zsh \ + OMZP::sudo/sudo.plugin.zsh \ + OMZP::git/git.plugin.zsh +# Auto suggestions +zinit ice lucid wait='0' atload='_zsh_autosuggest_start' +zinit light zsh-users/zsh-autosuggestions + +# Use exa instead +DISABLE_LS_COLORS=true +alias ls=exa + +# Use batcat as cat +alias cat=batcat + +# Goproxy +export GOPROXY=https://goproxy.io,direct + +# Go bin +export PATH="$PATH:${HOME}/go/bin" + +# GnuPG magic for commit signing +export GPG_TTY=${_P9K_TTY} + +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh -- cgit v1.2.3