From 36765368aa9f41899008b56333f634e511424dcc Mon Sep 17 00:00:00 2001 From: zackartz Date: Tue, 28 May 2024 16:51:59 -0400 Subject: [PATCH] 716 current 2024-05-28 16:51:56 24.11.20240524.bfb7a88 6.9.1-zen1 * --- .../neovim/config/lua/plugins/lsp/null-ls.lua | 26 ----------------- .../config/lua/plugins/tools/conform.lua | 28 +++++++++++++++++++ modules/home/apps/tools/neovim/default.nix | 1 + 3 files changed, 29 insertions(+), 26 deletions(-) delete mode 100644 modules/home/apps/tools/neovim/config/lua/plugins/lsp/null-ls.lua create mode 100644 modules/home/apps/tools/neovim/config/lua/plugins/tools/conform.lua diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/lsp/null-ls.lua b/modules/home/apps/tools/neovim/config/lua/plugins/lsp/null-ls.lua deleted file mode 100644 index 448bf45..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/lsp/null-ls.lua +++ /dev/null @@ -1,26 +0,0 @@ -return { - "jose-elias-alvarez/null-ls.nvim", - event = { "BufReadPost", "BufNewFile" }, - config = function() - local null_ls = require("null-ls") - - null_ls.setup({ - debug = false, - sources = { - null_ls.builtins.formatting.prettierd, - null_ls.builtins.formatting.alejandra, - null_ls.builtins.formatting.stylua, - null_ls.builtins.formatting.rustfmt.with({ - extra_args = { "--edition=2021" }, - }), - null_ls.builtins.formatting.shfmt.with({ - filetypes = { "sh", "zsh" }, - extra_args = { "--indent-type Spaces" }, - }), - null_ls.builtins.formatting.clang_format.with({ - extra_args = { "-style={IndentWidth: 4, AllowShortFunctionsOnASingleLine: Empty}" }, - }), - }, - }) - end, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/tools/conform.lua b/modules/home/apps/tools/neovim/config/lua/plugins/tools/conform.lua new file mode 100644 index 0000000..318b0e0 --- /dev/null +++ b/modules/home/apps/tools/neovim/config/lua/plugins/tools/conform.lua @@ -0,0 +1,28 @@ +return { + "stevearc/conform.nvim", + event = { "BufReadPre", "BufNewFile" }, + opts = { + formatters_by_ft = { + javascript = { "prettierd" }, + typescript = { "prettierd" }, + javascriptreact = { "prettierd", "rustywind" }, + typescriptreact = { "prettierd", "rustywind" }, + svelte = { "prettierd", "rustywind" }, + astro = { "prettierd", "rustywind" }, + css = { "prettierd" }, + html = { "prettierd" }, + json = { "prettierd" }, + yaml = { "prettierd" }, + markdown = { "prettierd" }, + graphql = { "prettierd" }, + lua = { "stylua" }, + python = { "isort", "black" }, + nix = { "alejandra" }, + }, + format_on_save = { + lsp_fallback = true, + async = false, + timeout_ms = 500, + }, + }, +} diff --git a/modules/home/apps/tools/neovim/default.nix b/modules/home/apps/tools/neovim/default.nix index 4858925..cc65493 100644 --- a/modules/home/apps/tools/neovim/default.nix +++ b/modules/home/apps/tools/neovim/default.nix @@ -45,6 +45,7 @@ in { shfmt isort stylua + rustywind # LSP lua-language-server