AutoYADM commit: 2025-05-16 17:14:15
This commit is contained in:
parent
51ccc1e607
commit
b9cc8e936f
9 changed files with 78 additions and 171 deletions
51
.config/kak/autoload/ui-mode.kak
Normal file
51
.config/kak/autoload/ui-mode.kak
Normal file
|
@ -0,0 +1,51 @@
|
|||
declare-user-mode ui
|
||||
map -docstring "UI" global user u ": enter-user-mode ui<ret>"
|
||||
|
||||
define-command ui-wrap-enable -docstring "enable wrap" %{
|
||||
add-highlighter window/wrap wrap -word -indent
|
||||
echo -markup "{Information}wrap enabled"
|
||||
}
|
||||
|
||||
define-command ui-wrap-disable -docstring "disable wrap" %{
|
||||
remove-highlighter window/wrap
|
||||
echo -markup "{Information}wrap disabled"
|
||||
}
|
||||
|
||||
define-command -override ui-wrap-toggle -docstring "toggle wrap" %{
|
||||
try %{ ui-wrap-enable } catch %{ ui-wrap-disable }
|
||||
}
|
||||
map -docstring "toggle soft wrap" global ui w ": ui-wrap-toggle<ret>"
|
||||
|
||||
declare-option str base_scrolloff %opt{scrolloff}
|
||||
|
||||
define-command ui-scrolloff-toggle -docstring "toggle scrolloff" %{
|
||||
evaluate-commands %sh{
|
||||
CUR="$kak_opt_scrolloff"
|
||||
IFS=,
|
||||
read TARG HOR <<<$kak_opt_base_scrolloff
|
||||
IFS=,
|
||||
read VSCROLL _ <<<$kak_opt_scrolloff
|
||||
if [ "$VSCROLL" = 99 ]; then
|
||||
final="$TARG,$HOR"
|
||||
else
|
||||
final="99,$HOR"
|
||||
fi
|
||||
echo "set-option window scrolloff $final"
|
||||
}
|
||||
}
|
||||
|
||||
map -docstring 'toggle screen centering' global ui z ": ui-scrolloff-toggle<ret>"
|
||||
|
||||
declare-option bool autowrap false
|
||||
|
||||
define-command autowrap-toggle -docstring "toggle autowrap" %{
|
||||
evaluate-commands %sh{
|
||||
if [ "$kak_opt_autowrap" = "true" ]; then
|
||||
echo "autowrap-disable"
|
||||
echo "set-option window autowrap false"
|
||||
else
|
||||
echo "autowrap-enable"
|
||||
echo "set-option window autowrap true"
|
||||
fi
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue