From 9dca602bd1084f345ab7683ea2f13af0ed6286d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Sun, 22 Jan 2023 19:41:28 -0300 Subject: [PATCH] fix nix formatting --- user/kak/filetypes.kak | 4 ++++ user/kak/usermode.kak | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/user/kak/filetypes.kak b/user/kak/filetypes.kak index 0a2e478..765c14f 100644 --- a/user/kak/filetypes.kak +++ b/user/kak/filetypes.kak @@ -11,6 +11,10 @@ hook global WinSetOption filetype=c %{ set buffer formatcmd 'clang-format' } +hook global WinSetOption filetype=nix %{ + set buffer formatcmd 'nixpkgs-fmt' +} + hook global BufCreate .*\.rs %{ set buffer formatcmd 'rustfmt' } diff --git a/user/kak/usermode.kak b/user/kak/usermode.kak index 1e42712..cf3ae16 100644 --- a/user/kak/usermode.kak +++ b/user/kak/usermode.kak @@ -10,7 +10,7 @@ map global user 'z' ':zoxide ' -docstring 'zoxide' map global user 'n' ': new' -docstring 'new window' map global user 'e' 'x|emmet@' -docstring 'process line with emmet' -map global user 'm' ': try lsp-formatting-sync catch format-buffer' -docstring 'format document' +map global user 'm' ': try format-buffer catch lsp-formatting-sync' -docstring 'format document' map global user 'M' ': try lsp-range-formatting-sync catch format-selections' -docstring 'format selection' map global user 'c' ': comment-line' -docstring 'comment line'