From d3bf04bf6c07c8787c32f28a266b5311ba7e57a2 Mon Sep 17 00:00:00 2001 From: cnst Date: Sun, 14 Jul 2024 20:35:43 +0200 Subject: [PATCH] testing nixvim 4 --- home/extra/neovim/plugins/default.nix | 1 + home/extra/neovim/plugins/lsp.nix | 93 ++++++++++++--------------- home/extra/neovim/plugins/nonels.nix | 46 +++++++++++++ 3 files changed, 88 insertions(+), 52 deletions(-) create mode 100644 home/extra/neovim/plugins/nonels.nix diff --git a/home/extra/neovim/plugins/default.nix b/home/extra/neovim/plugins/default.nix index d369a841..da8d3d26 100644 --- a/home/extra/neovim/plugins/default.nix +++ b/home/extra/neovim/plugins/default.nix @@ -15,6 +15,7 @@ ./telescope.nix ./treesitter.nix ./vimtex.nix + ./nonels.nix ]; programs.nixvim = { diff --git a/home/extra/neovim/plugins/lsp.nix b/home/extra/neovim/plugins/lsp.nix index 350b26e2..c3def42d 100644 --- a/home/extra/neovim/plugins/lsp.nix +++ b/home/extra/neovim/plugins/lsp.nix @@ -22,73 +22,62 @@ }; }; - servers = { - clangd = {enable = true;}; + # Language server + lsp = { + enable = true; + servers = { + # Average webdev LSPs + tsserver.enable = true; # TS/JS + cssls.enable = true; # CSS + tailwindcss.enable = true; # TailwindCSS + html.enable = true; # HTML + astro.enable = true; # AstroJS + phpactor.enable = true; # PHP + svelte.enable = false; # Svelte + vuels.enable = false; # Vue + + # Python + pyright.enable = true; + + # Markdown + marksman.enable = true; + + # Nix + nil-ls.enable = true; + + # Docker + dockerls.enable = true; + + # Bash + bashls.enable = true; + + # C/C++ + clangd.enable = true; + + # C# + csharp-ls.enable = true; + + # Lua lua-ls = { enable = true; - extraOptions = { - settings = { - Lua = { - completion = { - callSnippet = "Replace"; - }; - telemetry = { - enabled = false; - }; - hint = {enable = true;}; - }; - }; - }; + settings.telemetry.enable = false; }; - nil-ls = {enable = true;}; - tsserver = { - enable = true; - filetypes = ["javascript" "javascriptreact" "typescript" "typescriptreact"]; - cmd = ["./tsserver-wrapper.sh"]; - extraOptions = { - settings = { - javascript = { - inlayHints = { - includeInlayEnumMemberValueHints = true; - includeInlayFunctionLikeReturnTypeHints = true; - includeInlayFunctionParameterTypeHints = true; - includeInlayParameterNameHints = "all"; - includeInlayParameterNameHintsWhenArgumentMatchesName = true; - includeInlayPropertyDeclarationTypeHints = true; - includeInlayVariableTypeHints = true; - }; - }; - typescript = { - inlayHints = { - includeInlayEnumMemberValueHints = true; - includeInlayFunctionLikeReturnTypeHints = true; - includeInlayFunctionParameterTypeHints = true; - includeInlayParameterNameHints = "all"; - includeInlayParameterNameHintsWhenArgumentMatchesName = true; - includeInlayPropertyDeclarationTypeHints = true; - includeInlayVariableTypeHints = true; - }; - }; - }; - }; - }; - eslint = {enable = true;}; - pyright = {enable = true;}; - ruff-lsp = {enable = true;}; + # Rust rust-analyzer = { enable = true; - installCargo = true; installRustc = true; + installCargo = true; settings = { checkOnSave = true; check = { command = "clippy"; }; + }; }; }; }; -}; + }; }; }; } diff --git a/home/extra/neovim/plugins/nonels.nix b/home/extra/neovim/plugins/nonels.nix new file mode 100644 index 00000000..b4c41392 --- /dev/null +++ b/home/extra/neovim/plugins/nonels.nix @@ -0,0 +1,46 @@ +{ + +programs.nixvim.plugins.none-ls = { + enable = true; + settings = { + cmd = ["bash -c nvim"]; + debug = true; + }; + sources = { + code_actions = { + statix.enable = true; + gitsigns.enable = true; + }; + diagnostics = { + statix.enable = true; + deadnix.enable = true; + pylint.enable = true; + checkstyle.enable = true; + }; + formatting = { + alejandra.enable = true; + stylua.enable = true; + shfmt.enable = true; + nixpkgs_fmt.enable = true; + google_java_format.enable = false; + prettier = { + enable = true; + disableTsServerFormatter = true; + }; + black = { + enable = true; + withArgs = '' + { + extra_args = { "--fast" }, + } + ''; + + }; + }; + completion = { + luasnip.enable = true; + spell.enable = true; + }; + }; + }; + }