From cbf1edac22ee2a44d45203c7f47038a6410b5d2d Mon Sep 17 00:00:00 2001 From: crater2150 Date: Wed, 28 Aug 2024 18:01:10 +0200 Subject: [PATCH 1/2] prompt todo: handle duplicates --- zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zshrc b/zshrc index f05b987..ce22276 100644 --- a/zshrc +++ b/zshrc @@ -102,8 +102,8 @@ exists thefuck && eval $(thefuck --alias) if [[ -e $HOME/.calendars ]]; then _prompt_todos() { - local todos=$(rg -l '^STATUS:NEEDS-ACTION' $HOME/.calendars | wc -l) - [[ $todos -gt 0 ]] && echo "Todos: $todos" + local todos=( ${(u)$( rg -l '^STATUS:NEEDS-ACTION' $HOME/.calendars ):t} ) + [[ $#todos -gt 0 ]] && echo "Todos: $#todos" } __chromaz_extra_left+=_prompt_todos fi From 281ea9f354bbfb6198f5508f666ad6165ca4a726 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Mon, 4 Aug 2025 21:48:01 +0200 Subject: [PATCH 2/2] Add atuin --- .zimrc | 2 ++ bindings.zsh | 8 +++++++- confs | 1 + plugins/atuin/atuin.plugin.zsh | 5 +++++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 plugins/atuin/atuin.plugin.zsh diff --git a/.zimrc b/.zimrc index fdcf8ef..752bb8e 100644 --- a/.zimrc +++ b/.zimrc @@ -7,6 +7,7 @@ zmodule crater2150-zsh/chroma-z zmodule $ZDOTDIR/plugins/tmpsrc zmodule $ZDOTDIR/plugins/pyenv zmodule $ZDOTDIR/plugins/cs-java-home +zmodule $ZDOTDIR/plugins/atuin zmodule $ZDOTDIR/plugins/highlight-config zmodule zsh-users/zsh-syntax-highlighting @@ -14,3 +15,4 @@ zmodule zsh-users/zsh-syntax-highlighting zmodule ohmyzsh/ohmyzsh --root plugins/ng --fpath ./ zmodule carlosedp/mill-zsh-completions +zmodule zsh-users/zsh-autosuggestions diff --git a/bindings.zsh b/bindings.zsh index 2726458..2689f19 100644 --- a/bindings.zsh +++ b/bindings.zsh @@ -98,11 +98,17 @@ bindkey "\ev" zle-venv # Map widgets to key bindkey "\ec" fzf-change-directory -bindkey "^r" fzf-insert-history bindkey "^xf" fzf-insert-files bindkey "^xd" fzf-insert-directory bindkey "^xn" fzf-insert-named-directory +if [[ $+commands[atuin] == 1 ]]; then + bindkey -M viins '^r' atuin-search-viins + bindkey -M vicmd '/' atuin-search +else + bindkey "^r" fzf-insert-history +fi + FZF_CHANGE_DIR_FIND_COMMAND="fd -t d" FZF_INSERT_DIR_COMMAND="fd -t d" FZF_INSERT_FILES_COMMAND="fd -t f" diff --git a/confs b/confs index a6c81a0..315910a 100755 --- a/confs +++ b/confs @@ -19,3 +19,4 @@ xd $XDG_CONFIG_HOME/xd.conf zsh $ZDOTDIR kitty $XDG_CONFIG_HOME/kitty/kitty.conf kitty-sessions $XDG_CONFIG_HOME/kitty/sessions +atuin $XDG_CONFIG_HOME/atuin/config.toml diff --git a/plugins/atuin/atuin.plugin.zsh b/plugins/atuin/atuin.plugin.zsh new file mode 100644 index 0000000..c2b4a07 --- /dev/null +++ b/plugins/atuin/atuin.plugin.zsh @@ -0,0 +1,5 @@ +local FOUND_ATUIN=$+commands[atuin] + +if [[ $FOUND_ATUIN -eq 1 ]]; then + source <(atuin init zsh --disable-up-arrow) +fi