AutoYADM commit: 2025-06-24 20:45:18
This commit is contained in:
parent
2bbd2e7fc1
commit
0a9c5d2e60
1 changed files with 4 additions and 3 deletions
|
@ -1,10 +1,11 @@
|
|||
declare-option -hidden str fmt_command %{
|
||||
# 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'
|
||||
fmt -u -w "$kak_opt_fmt_width" -g "$kak_opt_fmt_goal" | perl -CS -pe 's/([.!?])\s{2,}/\1 /g'
|
||||
}
|
||||
|
||||
declare-option -hidden str fmt_mode fail
|
||||
declare-option int fmt_width 80
|
||||
declare-option int fmt_width 75
|
||||
declare-option int fmt_goal 70
|
||||
|
||||
define-command -docstring "run fmt for each selection" fmt %{
|
||||
evaluate-commands -save-regs | %{
|
||||
|
@ -28,7 +29,7 @@ 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>"
|
||||
execute-keys -draft "x<a-k>^[^\n]{%opt{fmt_goal},}[^\n]<ret>"
|
||||
evaluate-commands -save-regs "c|s" %{
|
||||
evaluate-commands -draft %{
|
||||
execute-keys ';'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue