Compare commits

...

2 Commits

3 changed files with 67 additions and 0 deletions

View File

@@ -36,10 +36,12 @@ ruby_install = true
"cargo:cargo-show" = "latest"
"cargo:cargo-update" = "latest"
"cargo:dirstat-rs" = "latest"
"cargo:dutree" = "latest"
"cargo:eza" = "latest"
"cargo:kubectl-watch" = "latest"
"cargo:mergiraf" = "latest"
"cargo:paper-terminal" = "latest"
"cargo:parallel-disk-usage" = { version = "latest", bin = "pdu" }
"cargo:pastel" = "latest"
"github:spinel-coop/rv" = "latest"
"github:stacklok/toolhive" = "latest"
@@ -87,6 +89,7 @@ ruby_install = true
actionlint = "latest"
argo-rollouts = "latest"
argocd = "latest"
atuin = "latest"
aws-cli = "latest"
bat = "latest"
bat-extras = "latest"
@@ -97,6 +100,7 @@ crane = "latest"
ctop = "latest"
difftastic = "latest"
direnv = "latest"
dua = "latest"
dust = "latest"
evans = "latest"
fd = "latest"

62
zsh/atuin.zsh Normal file
View File

@@ -0,0 +1,62 @@
#
# atuin
#
if command-exists atuin; then
# Atuin + FZF integration, stolen/adapted from:
# - https://github.com/atuinsh/atuin/issues/68
atuin-setup() {
if ! which atuin &>/dev/null; then return 1; fi
bindkey '^E' _atuin_search_widget
export ATUIN_NOBIND="true"
eval "$(atuin init zsh)"
zle -N fzf-atuin-history-widget
bindkey '^R' fzf-atuin-history-widget
}
fzf-atuin-history-widget() {
local selected num
setopt localoptions noglobsubst noposixbuiltins pipefail no_aliases 2>/dev/null
# local atuin_opts="--cmd-only --limit ${ATUIN_LIMIT:-5000}"
local atuin_opts="--cmd-only"
local fzf_opts=(
# from $FZF_DEFAULT_OPTS
--bind=ctrl-k:kill-line
--bind=ctrl-v:half-page-down
--bind=alt-v:half-page-up
--tabstop=4
--highlight-line
# from $FZF_CTRL_R_OPTS
--tmux=75%
--border=rounded
"--preview=echo {}"
--preview-window=down:3:hidden:wrap
"--bind=ctrl-/:toggle-preview"
"--bind=ctrl-y:execute-silent(echo -n {2..} | pbcopy)+abort"
--tac
"-n2..,.."
--tiebreak=index
"--query=${LBUFFER}"
"+m"
"--bind=ctrl-r:reload(atuin search $atuin_opts)"
)
selected=$(atuin search ${atuin_opts} | fzf "${fzf_opts[@]}")
local ret=$?
if [ -n "$selected" ]; then
# the += lets it insert at current pos instead of replacing
LBUFFER+="${selected}"
fi
zle reset-prompt
return $ret
}
atuin-setup
setup-completions atuin "$(mise-which atuin)" atuin gen-completions --shell zsh
fi

1
zshrc
View File

@@ -309,6 +309,7 @@ if [[ "$OSTYPE" == "linux"* ]]; then source "$DOTZSH/linux.zsh"; fi
# Utils
source "$DOTZSH/1password.zsh"
source "$DOTZSH/ansi.zsh"
source "$DOTZSH/atuin.zsh"
source "$DOTZSH/copilot.zsh"
source "$DOTZSH/emacs.zsh"
source "$DOTZSH/cursor.zsh"