diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-10-20 22:21:17 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-10-21 13:39:46 +0530 |
| commit | 87a96e7c86ef7a718246dfe6fc37b219c66dc557 (patch) | |
| tree | 3715263544ee5b2b10019988d17c100aa5888d3d /autoload/formatter.kak | |
| parent | 717ed5d90813ac7610b8d9cf1e110b6f31e87efc (diff) | |
| download | kakoune-config-87a96e7c86ef7a718246dfe6fc37b219c66dc557.tar.gz kakoune-config-87a96e7c86ef7a718246dfe6fc37b219c66dc557.zip | |
Refactored bits out into files
Diffstat (limited to '')
| -rw-r--r-- | autoload/formatter.kak | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/autoload/formatter.kak b/autoload/formatter.kak index 741e9e8..6012604 100644 --- a/autoload/formatter.kak +++ b/autoload/formatter.kak @@ -1,7 +1,9 @@ -# TODO: Use a single hook? hook global BufSetOption filetype=json %{ set-option buffer formatcmd "jq" } + hook global BufSetOption filetype=fennel %{ set-option buffer formatcmd "fnlfmt -" } + hook global BufSetOption filetype=nix %{ set-option buffer formatcmd "nixfmt -" } + hook global BufSetOption filetype=(?:javascript|typescript) %{ evaluate-commands %sh{ if [ -f "$PWD/biome.json" ]; then @@ -9,11 +11,10 @@ hook global BufSetOption filetype=(?:javascript|typescript) %{ fi } } + hook global BufSetOption filetype=(?:ruby) %{ evaluate-commands %sh{ - if [ -f "$PWD/.rubocop.yml" ]; then - echo "set-option buffer formatcmd %{rubocop -x --stderr -s '$kak_buffile'}" - fi + echo "set-option buffer formatcmd %{rubocop -x --stderr -s '$kak_buffile'}" } } |
