AutoYADM commit: 2025-05-21 03:03:07

This commit is contained in:
Daniel Fichtinger 2025-05-21 03:03:07 -04:00
parent ec6e7d142a
commit 7c524d8e20
2 changed files with 116 additions and 111 deletions

View file

@ -37,9 +37,14 @@ hook global WinSetOption filetype=man %{
remove-highlighter window/show-whitespaces remove-highlighter window/show-whitespaces
ui-wrap-disable ui-wrap-disable
} }
define-command mantest %{
execute-keys %sh{ execute-keys %sh{
result=$((kak_window_height / 2 - 1)) result=$((kak_window_height / 2 - 1))
notify-send 'this' notify-send 'this'
printf '%d%s' "$result" 'j' printf '%d%s' "$result" 'j'
} }
} }
hook window User manpageloaded %{
mantest
}
}

View file

@ -27,7 +27,8 @@ hook global WinSetOption filetype=man %{
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window man-hooks } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window man-hooks }
} }
define-command -hidden -params ..3 man-impl %{ evaluate-commands %sh{ define-command -hidden -params ..3 man-impl %{
evaluate-commands %sh{
buffer_name="$1" buffer_name="$1"
if [ -z "${buffer_name}" ]; then if [ -z "${buffer_name}" ]; then
exit exit
@ -59,7 +60,9 @@ define-command -hidden -params ..3 man-impl %{ evaluate-commands %sh{
nop %%sh{ rm "%s"; rm "%s" } nop %%sh{ rm "%s"; rm "%s" }
' "$(cat "$manerr")" "${colout}" "${manerr}" ' "$(cat "$manerr")" "${colout}" "${manerr}"
fi fi
} } }
trigger-user-hook manpageloaded
}
# MAN COMMAND # MAN COMMAND
# TODO: REMOVE number lines and show whitespace highlighters! # TODO: REMOVE number lines and show whitespace highlighters!
@ -91,8 +94,6 @@ define-command -params ..1 \
printf %s\\n "evaluate-commands -try-client %opt{docsclient} man-impl man $pagenum $subject" printf %s\\n "evaluate-commands -try-client %opt{docsclient} man-impl man $pagenum $subject"
} } } }
# The following section of code enables a user # The following section of code enables a user
# to go to next or previous man page links and to follow man page links, # to go to next or previous man page links and to follow man page links,
# for example, apropos(1), that would normally appear in SEE ALSO sections. # for example, apropos(1), that would normally appear in SEE ALSO sections.
@ -139,4 +140,3 @@ map global man 'g' -docstring 'Jump to a man page using selected man page link'
map global man 'j' -docstring 'Go to next man page link' :man-link-next<ret> map global man 'j' -docstring 'Go to next man page link' :man-link-next<ret>
map global man 'k' -docstring 'Go to previous man page link' :man-link-prev<ret> map global man 'k' -docstring 'Go to previous man page link' :man-link-prev<ret>
map global man 'm' -docstring 'Look up a man page' :man<space> map global man 'm' -docstring 'Look up a man page' :man<space>