From 25855e6dc0179be3fe54a7ca65418cb3b5f8b9b0 Mon Sep 17 00:00:00 2001 From: GHOSCHT <31184695+GHOSCHT@users.noreply.github.com> Date: Fri, 16 Feb 2024 12:19:41 +0100 Subject: [PATCH] Add neovim rust formatting --- home/features/coding/nvim/default.nix | 18 ++++++++++-------- home/features/coding/nvim/plugin/none-ls.lua | 2 ++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/home/features/coding/nvim/default.nix b/home/features/coding/nvim/default.nix index 791e02d..7c9176e 100644 --- a/home/features/coding/nvim/default.nix +++ b/home/features/coding/nvim/default.nix @@ -1,13 +1,14 @@ -{ - config, - lib, - pkgs, - # vars, +{ config +, lib +, pkgs +, # vars, ... -}: let +}: +let vars = import ../../../../vars.nix; colors = config.colorScheme.colors; -in { +in +{ home.sessionVariables.EDITOR = "nvim"; programs.neovim = { @@ -28,6 +29,7 @@ in { black # pyton alejandra # nix clang-tools_16 # c/c++ + rustfmt # Linters ruff # python @@ -231,7 +233,7 @@ in { ]; terminal = true; type = "Application"; - categories = ["Utility" "TextEditor"]; + categories = [ "Utility" "TextEditor" ]; }; }; } diff --git a/home/features/coding/nvim/plugin/none-ls.lua b/home/features/coding/nvim/plugin/none-ls.lua index 6ae5eb0..8c96821 100644 --- a/home/features/coding/nvim/plugin/none-ls.lua +++ b/home/features/coding/nvim/plugin/none-ls.lua @@ -15,6 +15,8 @@ local opts = { null_ls.builtins.formatting.clang_format, -- Nix null_ls.builtins.formatting.alejandra, + -- Rust + null_ls.builtins.formatting.rustfmt, }, on_attach = function(client, bufnr) if client.supports_method("textDocument/formatting") then