diff --git a/scripts/default.nix b/scripts/default.nix index 99b6635..79fe4c6 100644 --- a/scripts/default.nix +++ b/scripts/default.nix @@ -124,6 +124,7 @@ zbar wl-clipboard ]; + pint-fmt = [ ]; powerplay-led-idle = [ bash libinput diff --git a/scripts/pint-fmt b/scripts/pint-fmt new file mode 100755 index 0000000..85ea6cd --- /dev/null +++ b/scripts/pint-fmt @@ -0,0 +1,7 @@ +#!/bin/sh + +file="$(mktemp --tmpdir=/dev/shm).php" +cat - >"$file" +./vendor/bin/pint --quiet "$file" +cat "$file" +rm "$file" diff --git a/user/kakoune/default.nix b/user/kakoune/default.nix index 337e007..9963f26 100644 --- a/user/kakoune/default.nix +++ b/user/kakoune/default.nix @@ -133,6 +133,7 @@ in emmet-cli nodePackages.prettier + pint-fmt aspell aspellDicts.en diff --git a/user/kakoune/filetypes.kak b/user/kakoune/filetypes.kak index fd0b87c..293293c 100644 --- a/user/kakoune/filetypes.kak +++ b/user/kakoune/filetypes.kak @@ -30,6 +30,10 @@ hook global WinSetOption filetype=angular %[ add-highlighter buffer/angular ref html ] +hook global BufCreate .*\.php %{ + set buffer formatcmd 'pint-fmt' +} + hook global BufCreate .*\.js %{ set buffer formatcmd 'prettier --parser babel' }