Compare commits

...

2 Commits

Author SHA1 Message Date
f396e93591 Update zsh and zsh plugins 2026-03-13 06:24:36 +01:00
8842a1ed90 Switch to better zsh vi mode 2026-03-13 06:23:04 +01:00
6 changed files with 26 additions and 26 deletions

3
.gitmodules vendored
View File

@@ -16,3 +16,6 @@
[submodule "zsh/custom/plugins/zsh-completions"] [submodule "zsh/custom/plugins/zsh-completions"]
path = zsh/custom/plugins/zsh-completions path = zsh/custom/plugins/zsh-completions
url = https://github.com/zsh-users/zsh-completions.git url = https://github.com/zsh-users/zsh-completions.git
[submodule "zsh/custom/plugins/zsh-vi-mode"]
path = zsh/custom/plugins/zsh-vi-mode
url = https://github.com/jeffreytse/zsh-vi-mode

View File

@@ -1,2 +1,3 @@
ohmyzsh ohmyzsh
custom custom
fzf-git.sh

View File

@@ -15,17 +15,19 @@ zstyle ':omz:update' mode reminder # just remind me to update when it's time
# ENABLE_CORRECTION="true" # ENABLE_CORRECTION="true"
COMPLETION_WAITING_DOTS="true" COMPLETION_WAITING_DOTS="true"
ZSH_DISABLE_COMPFIX="true" ZSH_DISABLE_COMPFIX="true"
ZOXIDE_CMD_OVERRIDE="cd"
plugins=( plugins=(
git git
zsh-autosuggestions zsh-autosuggestions
# Disabled because the highlighting conflicts with autosuggestions # Disabled because the highlighting conflicts with autosuggestions
# history-substring-search # history-substring-search
vi-mode zsh-vi-mode
colored-man-pages colored-man-pages
command-not-found command-not-found
zsh-autopair zsh-autopair
fast-syntax-highlighting fast-syntax-highlighting
zoxide
) )
bindkey -M vicmd "k" up-line-or-beginning-search bindkey -M vicmd "k" up-line-or-beginning-search
@@ -37,8 +39,21 @@ HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_TIMEOUT=3
ZSH_AUTOSUGGEST_STRATEGY=(history completion) ZSH_AUTOSUGGEST_STRATEGY=(history completion)
VI_MODE_RESET_PROMPT_ON_MODE_CHANGE=true # Enable system clipboard
VI_MODE_SET_CURSOR=true ZVM_SYSTEM_CLIPBOARD_ENABLED=true
# Make p and P use the system clipboard, instead of CUTBUFFER,
# without this you need gp and gP
function zvm_after_lazy_keybindings() {
bindkey -M vicmd 'p' zvm_paste_clipboard_after
bindkey -M vicmd 'P' zvm_paste_clipboard_before
bindkey -M visual 'p' zvm_visual_paste_clipboard
bindkey -M visual 'P' zvm_visual_paste_clipboard
}
# Fix autopair and zsh-vi-mode compatibility
AUTOPAIR_INHIBIT_INIT=1
zvm_after_init_commands+=('autopair-init')
# Might cause issues? # Might cause issues?
KEYTIMEOUT=1 KEYTIMEOUT=1
@@ -111,9 +126,8 @@ if (( $+commands[fd] )); then
export FZF_DEFAULT_COMMAND="fd --type f --strip-cwd-prefix" export FZF_DEFAULT_COMMAND="fd --type f --strip-cwd-prefix"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
fi fi
if (( $+commands[fzf] )); then
source <(fzf --zsh)
if (( $+commands[fzf] )); then
if (( $+commands[paru] )); then if (( $+commands[paru] )); then
function pi { function pi {
paru -Slq | fzf -q "$1" --border-label=" Install package " --multi --preview 'paru -Si {1} --color=always' | xargs -ro paru -S paru -Slq | fzf -q "$1" --border-label=" Install package " --multi --preview 'paru -Si {1} --color=always' | xargs -ro paru -S
@@ -121,25 +135,6 @@ if (( $+commands[fzf] )); then
fi fi
fi fi
export _ZO_FZF_OPTS="--tmux"
if (( $+commands[zoxide] )); then
eval "$(zoxide init zsh --cmd cd)"
fi
# Generate missing text objects
autoload -Uz select-bracketed select-quoted
zle -N select-quoted
zle -N select-bracketed
for km in viopp visual; do
bindkey -M $km -- '-' vi-up-line-or-history
for c in {a,i}${(s..)^:-\'\"\`\|,./:;=+@}; do
bindkey -M $km $c select-quoted
done
for c in {a,i}${(s..)^:-'()[]{}<>bB'}; do
bindkey -M $km $c select-bracketed
done
done
ZSH_TMUX_AUTOSTART=true ZSH_TMUX_AUTOSTART=true
if (( $+commands[tmux] )); then if (( $+commands[tmux] )); then
if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" && -z "$INSIDE_EMACS" && -z "$EMACS" && -z "$VIM" && -z "$INTELLIJ_ENVIRONMENT_READER" && -z "$ZED_TERM" ]]; then if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" && -z "$INSIDE_EMACS" && -z "$EMACS" && -z "$VIM" && -z "$INTELLIJ_ENVIRONMENT_READER" && -z "$ZED_TERM" ]]; then