From cd61c699d650ddf6524183d99b53da26868187c0 Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Wed, 7 Dec 2022 13:59:27 -0500 Subject: Update zshrc --- modules/20-zsh/install.sh | 3 +++ modules/20-zsh/zshrc | 43 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/modules/20-zsh/install.sh b/modules/20-zsh/install.sh index 7d76729..f0e9960 100644 --- a/modules/20-zsh/install.sh +++ b/modules/20-zsh/install.sh @@ -8,6 +8,9 @@ function preinstall() { if ! [[ -x "$(command -v zsh)" ]]; then PACKAGES+=("zsh") fi + if ! [[ -x "$(command -v pkgfile)" ]]; then + PACKAGES+=("pkgfile") + fi } function install() { diff --git a/modules/20-zsh/zshrc b/modules/20-zsh/zshrc index c820230..9bfe051 100644 --- a/modules/20-zsh/zshrc +++ b/modules/20-zsh/zshrc @@ -47,7 +47,7 @@ zstyle ':omz:update' frequency 7 # You can also set it to another string to have that shown instead of the default red dots. # e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" # Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) - COMPLETION_WAITING_DOTS="true" +export COMPLETION_WAITING_DOTS="true" # Uncomment the following line if you want to disable marking untracked files # under VCS as dirty. This makes repository status check for large repositories @@ -70,13 +70,30 @@ zstyle ':omz:update' frequency 7 # Custom plugins may be added to $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-completions zsh-syntax-highlighting) +plugins=( + cp #dep:rsync + command-not-found #dep:pkgfile + dotenv + ssh-agent + sudo + zsh-autosuggestions + zsh-completions + zsh-syntax-highlighting +) +# pkgfile:cron: 0 */6 * * * pkgfile --update autoload -U compinit && compinit -source $ZSH/oh-my-zsh.sh +zstyle :omz:plugins:ssh-agent identities id_ed25519 id_rsa +zstyle :omz:plugins:ssh-agent agent-forwarding yes +zstyle :omz:plugins:ssh-agent quiet yes +zstyle :omz:plugins:ssh-agent lazy yes source $ZSH/oh-my-zsh.sh +if [[ ! -z "${_ZSH_RUN_GUARD}" ]]; then + return 0 +fi + # User configuration # export MANPATH="/usr/local/man:$MANPATH" @@ -103,10 +120,9 @@ source $ZSH/oh-my-zsh.sh # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" -ZSH_THEME_GIT_PROMPT_PREFIX=" git:(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")" - -PROMPT='%{$fg[green]%}%n%{$reset_color%}@%{$FG[033]%}%M%{$reset_color%}:%{$fg[green]%}%~%{$reset_color%}$(git_prompt_info)%(!.#.$) ' +export ZSH_THEME_GIT_PROMPT_PREFIX=" git:(" +export ZSH_THEME_GIT_PROMPT_SUFFIX=")" +export PROMPT='%{$fg[green]%}%n%{$reset_color%}@%{$FG[033]%}%M%{$reset_color%}:%{$fg[green]%}%~%{$reset_color%}$(git_prompt_info)%(!.#.$) ' export EDITOR=nano @@ -146,6 +162,15 @@ if [[ -d "$HOME/.deta" ]]; then export PATH="$HOME/.deta/bin:$PATH" fi +export RG_PATH="${RG_PATH:-$(which rg)}" +function rg() { + if [[ -t 1 ]]; then + $RG_PATH -p "$@" | less -RFX + else + $RG_PATH "$@" + fi +} + func bottom() { cat /dev/urandom | env LC_CTYPE=C tr -dc "asdfghjkl;" | fold -w 20 | head -n 1 } @@ -175,3 +200,7 @@ function pyvenv() { source "./venv/bin/activate" fi } + +alias gdiff="git diff --no-index" + +export _ZSHRC_RUN_GUARD=1 -- cgit v1.2.3