mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-05 04:08:03 +00:00
feat(config): replace ctrl-a agents bind with omp-session command
This commit is contained in:
1 parent
b7425ac9ae
commit
8b4a52a66d
3 files changed
+10
-19
No files matched your search
@@ -1,12 +0,0 @@
|
|||||||
function _agents_bind --description 'ctrl-a: pick an AI agent (tv agents --inline) and start it, then redraw the prompt'
|
|
||||||
# The cable's launch action writes `ran` to $AGENTS_STATE before exec'ing
|
|
||||||
# the agent. Cancelled: tv left the cursor on the line below the prompt, so
|
|
||||||
# step back up; ran: the prompt goes wherever the agent left the cursor.
|
|
||||||
set -lx AGENTS_STATE (mktemp)
|
|
||||||
tv agents --inline
|
|
||||||
if test "$(cat $AGENTS_STATE)" != ran
|
|
||||||
printf '\033[A' >/dev/tty
|
|
||||||
end
|
|
||||||
rm -f $AGENTS_STATE
|
|
||||||
commandline -f repaint
|
|
||||||
end
|
|
||||||
@@ -11,17 +11,18 @@ function fish_user_key_bindings
|
|||||||
# ctrl-g → lazygit overlay, ctrl-y → yazi vsplit,
|
# ctrl-g → lazygit overlay, ctrl-y → yazi vsplit,
|
||||||
# ctrl-h/j/k/l → vim-aware split nav (pass_keys.py).
|
# ctrl-h/j/k/l → vim-aware split nav (pass_keys.py).
|
||||||
# ctrl-e: tv git-files (bat preview, enter opens nvim). ctrl-o, ctrl-p
|
# ctrl-e: tv git-files (bat preview, enter opens nvim). ctrl-o, ctrl-p
|
||||||
# and down also open tv cables — same keys in zsh and bash; ctrl-a
|
# and down also open tv cables — same keys in zsh and bash. tv runs
|
||||||
# (tv agents: pick an AI agent and start it) is fish-only. tv runs
|
# --inline below the prompt; _tv_inline/_gho_bind/_pj_bind put the
|
||||||
# --inline below the prompt; _tv_inline/_gho_bind/_pj_bind/_agents_bind
|
# prompt back in place (or below any output) afterwards. ctrl-a:
|
||||||
# put the prompt back in place (or below any output) afterwards.
|
# omp-session resumes or starts omp for the repo (same in zsh); when it
|
||||||
|
# opens the omp-sessions cable and it is cancelled, it steps back up.
|
||||||
bind -M $mode ctrl-e '_tv_inline git-files; commandline -f repaint'
|
bind -M $mode ctrl-e '_tv_inline git-files; commandline -f repaint'
|
||||||
bind -M $mode ctrl-b purple repaint
|
bind -M $mode ctrl-b purple repaint
|
||||||
bind -M $mode ctrl-y clip-last
|
bind -M $mode ctrl-y clip-last
|
||||||
|
|
||||||
bind -M $mode ctrl-o _gho_bind
|
bind -M $mode ctrl-o _gho_bind
|
||||||
bind -M $mode ctrl-p _pj_bind
|
bind -M $mode ctrl-p _pj_bind
|
||||||
bind -M $mode ctrl-a _agents_bind
|
bind -M $mode ctrl-a 'omp-session; commandline -f repaint'
|
||||||
bind -M $mode ctrl-w 'atuin ai inline; commandline -f repaint'
|
bind -M $mode ctrl-w 'atuin ai inline; commandline -f repaint'
|
||||||
|
|
||||||
# Arrow keys: atuin owns up (bound from config.fish, survives the
|
# Arrow keys: atuin owns up (bound from config.fish, survives the
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ _zle-run() {
|
|||||||
$cmd </dev/tty
|
$cmd </dev/tty
|
||||||
zle reset-prompt
|
zle reset-prompt
|
||||||
}
|
}
|
||||||
for _cmd in purple clip-last omp yy lazygit; do
|
for _cmd in purple clip-last omp-session yy lazygit; do
|
||||||
zle -N "run-$_cmd" _zle-run
|
zle -N "run-$_cmd" _zle-run
|
||||||
done
|
done
|
||||||
unset _cmd
|
unset _cmd
|
||||||
@@ -82,7 +82,9 @@ bindkey '^B' run-purple
|
|||||||
bindkey '^Y' run-clip-last
|
bindkey '^Y' run-clip-last
|
||||||
bindkey '^O' gho-inline
|
bindkey '^O' gho-inline
|
||||||
bindkey '^P' pj-inline
|
bindkey '^P' pj-inline
|
||||||
bindkey '^A' run-omp
|
# ctrl-a: omp-session resumes or starts omp for the repo; after a cancelled
|
||||||
|
# omp-sessions picker it moves the cursor back up itself.
|
||||||
|
bindkey '^A' run-omp-session
|
||||||
# ctrl-f: yazi; yy cd's to yazi's exit dir on quit.
|
# ctrl-f: yazi; yy cd's to yazi's exit dir on quit.
|
||||||
bindkey '^F' run-yy
|
bindkey '^F' run-yy
|
||||||
bindkey '^G' run-lazygit
|
bindkey '^G' run-lazygit
|
||||||
|
|||||||
Reference in new issue
Block a user