diff --git a/config/keymaps.nix b/config/keymaps.nix index af02426..6caf954 100644 --- a/config/keymaps.nix +++ b/config/keymaps.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ keymaps = [ { # Focus file tree @@ -10,6 +11,16 @@ key = "e"; action = "CHADopen"; } + { + # format current document + mode = "n"; + key = "bf"; + action = "lua require('conform').format()"; + options = { + silent = true; + desc = "Format Buffer"; + }; + } ]; } diff --git a/config/plugins/lang/rust.nix b/config/plugins/lang/rust.nix index ca72de4..b1943c9 100644 --- a/config/plugins/lang/rust.nix +++ b/config/plugins/lang/rust.nix @@ -11,13 +11,7 @@ conform-nvim.settings = { formatters_by_ft = { - rust = [ "cargo" ]; - }; - - formatters = { - cargo = { - command = "cargo-fmt"; - }; + rust = [ "rustfmt" ]; }; };