AutoYADM commit: 2025-07-01 15:24:24
This commit is contained in:
parent
4c7960a6a8
commit
163abe5562
4 changed files with 42 additions and 15 deletions
|
@ -197,7 +197,7 @@ pipe-visible=[wl-copy] Control+Mod1+Shift+v
|
|||
# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none
|
||||
pipe-scrollback=[wl-copy] Control+Mod1+Shift+p
|
||||
# pipe-selected=[xargs -r firefox] none
|
||||
pipe-command-output=[wl-copy] Control+Shift+y
|
||||
pipe-command-output=[wl-copy] Control+Mod1+Shift+y
|
||||
show-urls-launch=Control+Shift+o
|
||||
show-urls-copy=Control+Mod1+Shift+o
|
||||
# show-urls-persistent=Control+Mod1+Shift+p
|
||||
|
|
|
@ -55,8 +55,12 @@ add-highlighter shared/kakrc/shell6 region -recurse '\(' '(^|\h)\K-?shell-script
|
|||
add-highlighter shared/kakrc/shell7 region -recurse '\[' '(^|\h)\K-?shell-script(-completion|-candidates)?\h+%\[' '\]' ref sh
|
||||
add-highlighter shared/kakrc/shell8 region -recurse '<' '(^|\h)\K-?shell-script(-completion|-candidates)?\h+%<' '>' ref sh
|
||||
|
||||
## BEGIN PATCH
|
||||
# add-highlighter shared/kakrc/code
|
||||
## END PATCH
|
||||
|
||||
evaluate-commands %sh{
|
||||
# Grammar
|
||||
# Grammar
|
||||
keywords="add-highlighter alias arrange-buffers buffer buffer-next buffer-previous catch
|
||||
change-directory colorscheme debug declare-option declare-user-mode define-command complete-command
|
||||
delete-buffer delete-buffer! echo edit edit! enter-user-mode evaluate-commands execute-keys
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
declare-option -hidden str mark_saved
|
||||
define-command mark-save %{
|
||||
execute-keys '"jZ'
|
||||
}
|
||||
define-command mark-restore %{
|
||||
execute-keys '"jz'
|
||||
try %{
|
||||
execute-keys '"jZ'
|
||||
echo "Mark saved"
|
||||
} catch %{
|
||||
info "Couldn't save mark!"
|
||||
}
|
||||
}
|
||||
|
||||
map global normal <c-s-y> ': echo hi<ret>'
|
||||
# map global normal <c-Y> ': mark-save<ret>'
|
||||
define-command mark-restore %{
|
||||
try %{
|
||||
execute-keys '"jz'
|
||||
echo "Mark restored"
|
||||
} catch %{
|
||||
info "Couldn't restore mark!"
|
||||
}
|
||||
}
|
||||
|
||||
map global normal <c-Y> ': mark-save<ret>'
|
||||
map global normal <c-y> ': mark-restore<ret>'
|
||||
|
|
|
@ -14,6 +14,19 @@ provide-module search-highlight %—
|
|||
def -hidden -override search-highlight-on nop
|
||||
def -hidden -override search-highlight-off fail
|
||||
|
||||
declare-option -hidden bool search_highlight_quit false
|
||||
|
||||
define-command -hidden search-highlight-clear %{
|
||||
try %{
|
||||
# for safety; only run if highlighting is on
|
||||
%opt{search_highlight_status}
|
||||
# remove highlighter
|
||||
remove-highlighter window/search-highlight
|
||||
# update status
|
||||
set-option window search_highlight_status 'search-highlight-off'
|
||||
}
|
||||
}
|
||||
|
||||
# enable the plugin
|
||||
define-command -hidden search-highlight-enable-impl %{
|
||||
# register hook to show highlighting during search
|
||||
|
@ -22,20 +35,21 @@ provide-module search-highlight %—
|
|||
try %{
|
||||
%opt{search_highlight_status}
|
||||
} catch %{
|
||||
map window prompt <esc> '<a-;>: set-option window search_highlight_quit true<ret>'
|
||||
# if not, add the highlighter
|
||||
add-highlighter window/search-highlight dynregex '%reg{/}' %exp{0:%opt{search_highlight_face}}
|
||||
# update status tracker
|
||||
set-option window search_highlight_status 'search-highlight-on'
|
||||
|
||||
# register hook to clear highlighter after leaving search
|
||||
hook -once -group search-highlight window NormalIdle .* %{
|
||||
try %{
|
||||
# for safety; only run if highlighting is on
|
||||
%opt{search_highlight_status}
|
||||
# remove highlighter
|
||||
remove-highlighter window/search-highlight
|
||||
# update status
|
||||
set-option window search_highlight_status 'search-highlight-off'
|
||||
%opt{search_highlight_quit}
|
||||
search-highlight-clear
|
||||
} catch %{
|
||||
map window normal <esc> ': search-highlight-clear<ret>'
|
||||
}
|
||||
unmap window prompt <esc>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue