diff --git a/.config/fish/functions/man.fish b/.config/fish/functions/man.fish index 12987c21..c0b39f23 100644 --- a/.config/fish/functions/man.fish +++ b/.config/fish/functions/man.fish @@ -25,12 +25,12 @@ function man --wraps man --description 'Format and display manual pages' else set fish_data_dir $__fish_datadir end - + set -l kakcmd 'set buffer filetype man; set buffer readonly true' set -l fish_manpath (dirname $fish_data_dir)/fish/man if test -d "$fish_manpath" -a -n "$MANPATH" set MANPATH "$fish_manpath":$MANPATH - command man $argv | kak -e 'set buffer filetype man' + command man $argv | kak -e "$kakcmd" return end - command man $argv | kak -e 'set buffer filetype man' + command man $argv | kak -e "$kakcmd" end diff --git a/.config/kak/autoload/filetype.kak b/.config/kak/autoload/filetype.kak index ab7eeee6..2a5862a9 100644 --- a/.config/kak/autoload/filetype.kak +++ b/.config/kak/autoload/filetype.kak @@ -37,4 +37,9 @@ hook global WinSetOption filetype=man %{ remove-highlighter window/show-whitespaces ui-wrap-disable } + execute-keys %sh{ + result=$((kak_window_height / 2 - 1)) + notify-send 'this' + printf '%d%s' "$result" 'j' + } }