AutoYADM commit: 2025-05-08 22:55:43

This commit is contained in:
Daniel Fichtinger 2025-05-08 22:55:43 -04:00
parent 72fa883888
commit 148237e9e0
3 changed files with 50 additions and 30 deletions

18
.config/kak/scripts/kakfmt Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env perl
use strict;
use warnings;
my $Indent = 0;
my $Blank_Lines = 0;
my $Open = qr/[{\[(]$/;
my $Close = qr/^[}\])]/;
while (<>) {
s/^\h*//;
$Blank_Lines++, next if m/^$/;
my $Comment = m/^#/;
$Indent-- if m/$Close/ and not $Comment;
$Blank_Lines = 0, print "\n" if $Blank_Lines;
print "\t" x $Indent, $_;
$Indent++ if m/$Open/ and not $Comment;
}