From ab8bb275434d11fc70b4af7709addec457b15e3c Mon Sep 17 00:00:00 2001 From: Bryan Date: Sun, 14 Sep 2025 21:55:18 -0600 Subject: [PATCH] lnk: sync configuration files --- .zsh_plugins.txt | 2 ++ .zsh_plugins.zsh | 46 ++++++++++++++++--------------- .zshrc | 58 +++++++++++++++++++--------------------- .zshrc.d/aliases.zsh | 3 +++ .zshrc.d/environment.zsh | 18 +++++++++++++ 5 files changed, 74 insertions(+), 53 deletions(-) diff --git a/.zsh_plugins.txt b/.zsh_plugins.txt index 2a096c0..3e3b5b4 100644 --- a/.zsh_plugins.txt +++ b/.zsh_plugins.txt @@ -19,3 +19,5 @@ mattmc3/zman # NOTE: syntax highlighting needs to be last zdharma-continuum/fast-syntax-highlighting +# jeffreytse/zsh-vi-mode +jeffreytse/zsh-vi-mode diff --git a/.zsh_plugins.zsh b/.zsh_plugins.zsh index a4eef5d..99aa652 100644 --- a/.zsh_plugins.zsh +++ b/.zsh_plugins.zsh @@ -1,22 +1,24 @@ -fpath+=( $HOME/.cache/antidote/mattmc3/zephyr/plugins/color ) -source $HOME/.cache/antidote/mattmc3/zephyr/plugins/color/color.plugin.zsh -fpath+=( $HOME/.cache/antidote/mattmc3/zephyr/plugins/completion ) -source $HOME/.cache/antidote/mattmc3/zephyr/plugins/completion/completion.plugin.zsh -fpath+=( $HOME/.cache/antidote/mattmc3/zephyr/plugins/editor ) -source $HOME/.cache/antidote/mattmc3/zephyr/plugins/editor/editor.plugin.zsh -fpath+=( $HOME/.cache/antidote/mattmc3/zephyr/plugins/zfunctions ) -source $HOME/.cache/antidote/mattmc3/zephyr/plugins/zfunctions/zfunctions.plugin.zsh -fpath+=( $HOME/.cache/antidote/zsh-users/zsh-autosuggestions ) -source $HOME/.cache/antidote/zsh-users/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh -fpath+=( $HOME/.cache/antidote/zsh-users/zsh-history-substring-search ) -source $HOME/.cache/antidote/zsh-users/zsh-history-substring-search/zsh-history-substring-search.plugin.zsh -fpath+=( $HOME/.cache/antidote/3v1n0/zsh-bash-completions-fallback ) -source $HOME/.cache/antidote/3v1n0/zsh-bash-completions-fallback/zsh-bash-completions-fallback.plugin.zsh -fpath+=( $HOME/.cache/antidote/Sam-programs/zsh-calc ) -source $HOME/.cache/antidote/Sam-programs/zsh-calc/zsh-calc.zsh -fpath+=( $HOME/.cache/antidote/MichaelAquilina/zsh-you-should-use ) -source $HOME/.cache/antidote/MichaelAquilina/zsh-you-should-use/zsh-you-should-use.plugin.zsh -fpath+=( $HOME/.cache/antidote/mattmc3/zman ) -source $HOME/.cache/antidote/mattmc3/zman/zman.plugin.zsh -fpath+=( $HOME/.cache/antidote/zdharma-continuum/fast-syntax-highlighting ) -source $HOME/.cache/antidote/zdharma-continuum/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh +fpath+=( "$HOME/.cache/antidote/mattmc3/zephyr/plugins/color" ) +source "$HOME/.cache/antidote/mattmc3/zephyr/plugins/color/color.plugin.zsh" +fpath+=( "$HOME/.cache/antidote/mattmc3/zephyr/plugins/completion" ) +source "$HOME/.cache/antidote/mattmc3/zephyr/plugins/completion/completion.plugin.zsh" +fpath+=( "$HOME/.cache/antidote/mattmc3/zephyr/plugins/editor" ) +source "$HOME/.cache/antidote/mattmc3/zephyr/plugins/editor/editor.plugin.zsh" +fpath+=( "$HOME/.cache/antidote/mattmc3/zephyr/plugins/zfunctions" ) +source "$HOME/.cache/antidote/mattmc3/zephyr/plugins/zfunctions/zfunctions.plugin.zsh" +fpath+=( "$HOME/.cache/antidote/zsh-users/zsh-autosuggestions" ) +source "$HOME/.cache/antidote/zsh-users/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh" +fpath+=( "$HOME/.cache/antidote/zsh-users/zsh-history-substring-search" ) +source "$HOME/.cache/antidote/zsh-users/zsh-history-substring-search/zsh-history-substring-search.plugin.zsh" +fpath+=( "$HOME/.cache/antidote/3v1n0/zsh-bash-completions-fallback" ) +source "$HOME/.cache/antidote/3v1n0/zsh-bash-completions-fallback/zsh-bash-completions-fallback.plugin.zsh" +fpath+=( "$HOME/.cache/antidote/Sam-programs/zsh-calc" ) +source "$HOME/.cache/antidote/Sam-programs/zsh-calc/zsh-calc.zsh" +fpath+=( "$HOME/.cache/antidote/MichaelAquilina/zsh-you-should-use" ) +source "$HOME/.cache/antidote/MichaelAquilina/zsh-you-should-use/zsh-you-should-use.plugin.zsh" +fpath+=( "$HOME/.cache/antidote/mattmc3/zman" ) +source "$HOME/.cache/antidote/mattmc3/zman/zman.plugin.zsh" +fpath+=( "$HOME/.cache/antidote/zdharma-continuum/fast-syntax-highlighting" ) +source "$HOME/.cache/antidote/zdharma-continuum/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh" +fpath+=( "$HOME/.cache/antidote/jeffreytse/zsh-vi-mode" ) +source "$HOME/.cache/antidote/jeffreytse/zsh-vi-mode/zsh-vi-mode.plugin.zsh" diff --git a/.zshrc b/.zshrc index 5fb5c06..90d7bd6 100644 --- a/.zshrc +++ b/.zshrc @@ -11,15 +11,6 @@ antidote load plugins+=(fzf) -export PAGER='ov' -export VISUAL='nvim' -export EDITOR='nvim' - -export MANPAGER="sh -c 'col -bx | bat -l man -p'" -export MANROFFOPT="-c" - -export BAT_PAGER="ov -FX" - ## zoxide stuff - zoxide is a better cd utility eval "$(zoxide init zsh)" @@ -30,40 +21,45 @@ eval "$(starship init zsh)" [[ -e "$HOME/.fzf-extras/fzf-extras.sh" ]] && source "$HOME/.fzf-extras/fzf-extras.sh" -# set vi mode -bindkey -v -# set ctrl-p and ctrl-n for vi insert mode -bindkey -v '^P' history-substring-search-up #up-history -bindkey -v '^N' history-substring-search-down #down-history +# This function is automatically called by zsh-vi-mode plugin +# Set keybindings here so that they aren't overridden by zsh-vi-mode +function zvm_after_init() { + # set vi mode + bindkey -v + # set ctrl-p and ctrl-n for vi insert mode + bindkey -v '^P' history-substring-search-up #up-history + bindkey -v '^N' history-substring-search-down #down-history -# mattmc3/zephyr path:plugins/editor -bindkey '^Z' symmetric-ctrl-z -bindkey '^S' prepend-sudo + # mattmc3/zephyr path:plugins/editor + bindkey '^Z' symmetric-ctrl-z + bindkey '^S' prepend-sudo -# Alt+Enter -# To make shift+enter work in zsh we map Shift+Enter to Alt+Enter in kitty. -# There are autocommands in Neovim that set a user variable in kitty when we are in Neovim and unsets it when we exit. -# This allows us to unmap Shift+Enter in kitty when inside Neovim. -# By doing this we can use Shift+Enter for `forward-word`, which is autosuggest partial accept -# in the autosuggest plugin in zsh, without interfering with the mapping in nvim. -bindkey '^[^M' forward-word -# bindkey '^R' fzf-history-widget + # Alt+Enter + # To make shift+enter work in zsh we map Shift+Enter to Alt+Enter in kitty. + # There are autocommands in Neovim that set a user variable in kitty when we are in Neovim and unsets it when we exit. + # This allows us to unmap Shift+Enter in kitty when inside Neovim. + # By doing this we can use Shift+Enter for `forward-word`, which is autosuggest partial accept + # in the autosuggest plugin in zsh, without interfering with the mapping in nvim. + bindkey '^[^M' forward-word + # bindkey '^R' fzf-history-widget + + # [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh + # Source skim keybindings. Skim repo is cloned into stow directory + # so we can use stow to install the man page. The stow binary still has + # to be installed seperately. + source "$STOW_DIR/skim/shell/key-bindings.zsh" +} # Source anything in .zshrc.d. for _rc in ${ZDOTDIR:-$HOME}/.zshrc.d/*.zsh; do # Ignore tilde files. + if [[ $_rc:t != '~'* ]]; then source "$_rc" fi done unset _rc -# [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh -# Source skim keybindings. Skim repo is cloned into stow directory -# so we can use stow to install the man page. The stow binary still has -# to be installed seperately. -source "$STOW_DIR/skim/shell/key-bindings.zsh" - export NVM_DIR="$HOME/.config/nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion diff --git a/.zshrc.d/aliases.zsh b/.zshrc.d/aliases.zsh index 7e8f225..d64469e 100644 --- a/.zshrc.d/aliases.zsh +++ b/.zshrc.d/aliases.zsh @@ -30,3 +30,6 @@ alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo ## Use main clipbard by default with xclip alias xclip="xclip -selection clipboard" + +# Qalc +alias q=qalc diff --git a/.zshrc.d/environment.zsh b/.zshrc.d/environment.zsh index 153941f..d190b1a 100644 --- a/.zshrc.d/environment.zsh +++ b/.zshrc.d/environment.zsh @@ -1,5 +1,14 @@ # vim: set filetype=sh nospell: +export PAGER='ov' +export VISUAL='nvim' +export EDITOR='nvim' + +export MANPAGER="sh -c 'col -bx | bat -l man -p'" +export MANROFFOPT="-c" + +export BAT_PAGER="ov -FX" + # Set language. export LANG=${LANG:-en_US.UTF-8} @@ -39,3 +48,12 @@ HISTORY_SUBSTRING_SEARCH_PREFIXED=1 # Match against the start of each history en # for `Sam-programs/zsh-calc` plugin CALC_CMD="qalc -t -c -f <(echo \$BUFFER)" + +# zsh-vi-mode stuff +ZVM_VI_HIGHLIGHT_FOREGROUND=black +ZVM_VI_HIGHLIGHT_BACKGROUND=green +ZVM_NORMAL_MODE_CURSOR=$ZVM_CURSOR_BLINKING_BLOCK +ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLINKING_BEAM +ZVM_VISUAL_MODE_CURSOR=$ZVM_CURSOR_BLOCK +ZVM_VISUAL_LINE_MODE_CURSOR=$ZVM_CURSOR_BLOCK +ZVM_OPPEND_MODE_CURSOR=$ZVM_CURSOR_BLINKING_UNDERLINE