Skip to content

Commit

Permalink
Assign ctags symbols browser to Alt-Q instead of ctrl-k
Browse files Browse the repository at this point in the history
The key is already bound to push-line, however the zle widget
has also two other keys, ctrl-q and Alt-q, so no problem, as
IMO users who want that widget already use Alt-q, not Alt-Q.
  • Loading branch information
psprint committed Sep 30, 2022
1 parent 65331c2 commit 2fe8ef0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 9 additions & 4 deletions zi-browse-symbol
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,10 @@ if [[ $__tfind_spe_call_count -eq 1 ]]; then
zle -A $pup_widget saved-$pup_widget
zle -N $pdown_widget _tfind_simulate_widget
zle -N $pup_widget _tfind_simulate_widget
zle -A zle-line-pre-redraw saved-pre-redraw
zle -D zle-line-pre-redraw
if (( $+widgets[zle-line-pre-redraw] )); then
zle -A zle-line-pre-redraw saved-pre-redraw
zle -D zle-line-pre-redraw
fi
local selected_editor cd_at_edit tagtext tagline taglinebyte tagfile
local -a comm
comm=()
Expand Down Expand Up @@ -457,8 +459,11 @@ if [[ $__tfind_spe_call_count -eq 1 ]]; then
zle -A saved-$pup_widget $pup_widget
zle -D saved-$pdown_widget saved-$pup_widget

zle -A saved-pre-redraw zle-line-pre-redraw
zle -D saved-pre-redraw
if (( $+widgets[saved-pre-redraw] )); then
zle -A saved-pre-redraw zle-line-pre-redraw
zle -D saved-pre-redraw
fi

# Full reinitialisation at next call
__tfind_spe_call_count=0

Expand Down
3 changes: 2 additions & 1 deletion zinit.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -3265,6 +3265,7 @@ zle -N zi-browse-symbol
zle -N zi-browse-symbol-backwards zi-browse-symbol
zle -N zi-browse-symbol-pbackwards zi-browse-symbol
zle -N zi-browse-symbol-pforwards zi-browse-symbol
bindkey "^K" zi-browse-symbol
zstyle -s ':zinit:browse-symbol' key ZINIT_TMP || ZINIT_TMP='\eQ'
[[ -n $ZINIT_TMP ]] && bindkey $ZINIT_TMP zi-browse-symbol

# vim:ft=zsh:sw=4:sts=4:et:foldmarker=[[[,]]]:foldmethod=marker

0 comments on commit 2fe8ef0

Please sign in to comment.