AutoYADM commit: 2025-06-24 20:30:05
This commit is contained in:
parent
6d4c81fc68
commit
2bbd2e7fc1
1 changed files with 26 additions and 23 deletions
|
@ -1,7 +1,6 @@
|
|||
declare-option -hidden str fmt_command %{
|
||||
fmt -u | perl -CS -pe 's/([.!?])\s{2,}/\1 /g'
|
||||
# original:
|
||||
# fmt --uniform-spacing "--goal=$kak_opt_fmt_width" "--width=$kak_opt_fmt_width" | sed "s/\. /. /g"
|
||||
# fmt --uniform-spacing "--goal=$kak_opt_fmt_width" "--width=$kak_opt_fmt_width" | perl -CS -pe 's/([.!?])\s{2,}/\1 /g'
|
||||
fmt -u -w "$kak_opt_fmt_width" | perl -CS -pe 's/([.!?])\s{2,}/\1 /g'
|
||||
}
|
||||
|
||||
declare-option -hidden str fmt_mode fail
|
||||
|
@ -27,6 +26,9 @@ define-command -docstring "enable autofmt at window scope" fmt-enable-window %{
|
|||
}
|
||||
|
||||
define-command -hidden fmt-impl-window %{
|
||||
try %{
|
||||
# do nothing if the line isn't too long
|
||||
execute-keys -draft "x<a-k>^[^\n]{%opt{fmt_width},}[^\n]<ret>"
|
||||
evaluate-commands -save-regs "c|s" %{
|
||||
evaluate-commands -draft %{
|
||||
execute-keys ';'
|
||||
|
@ -55,6 +57,7 @@ define-command -hidden fmt-impl-window %{
|
|||
evaluate-commands %exp{ select %reg{s} }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
define-command -docstring "toggle autofmt at window scope" fmt-toggle-window %{
|
||||
try %{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue