From 49643683d44a9767bea85cd39a1245d7002cd7dd Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Tue, 4 Apr 2023 09:28:27 +0100 Subject: [PATCH] Remove nvim-mason, using nix to manager LSP installs instead --- config/nvim/lua/config/mason.lua | 13 -------- config/nvim/lua/config/mason_lspconfig.lua | 3 -- config/nvim/lua/config/mason_null_ls.lua | 4 --- config/nvim/lua/config/mason_nvim_dap.lua | 4 --- config/nvim/lua/lsp/cmp.lua | 6 ++++ config/nvim/lua/lsp/config.lua | 24 ++++++-------- config/nvim/lua/lsp/null_ls_sources.lua | 1 + config/nvim/lua/plugins/mason.lua | 33 ------------------- nixos/desktop/picom.nix | 11 +------ nixos/home-manager/packages/tui/default.nix | 2 ++ nixos/home-manager/packages/tui/neovim.nix | 36 ++++++++++++++------- 11 files changed, 44 insertions(+), 93 deletions(-) delete mode 100644 config/nvim/lua/config/mason.lua delete mode 100644 config/nvim/lua/config/mason_lspconfig.lua delete mode 100644 config/nvim/lua/config/mason_null_ls.lua delete mode 100644 config/nvim/lua/config/mason_nvim_dap.lua delete mode 100644 config/nvim/lua/plugins/mason.lua diff --git a/config/nvim/lua/config/mason.lua b/config/nvim/lua/config/mason.lua deleted file mode 100644 index 7707a8d7..00000000 --- a/config/nvim/lua/config/mason.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - pip = { - upgrade_pip = true, - }, - ui = { - border = "single", - icons = { - package_installed = "✓", - package_pending = "➜", - package_uninstalled = "✗", - }, - }, -} diff --git a/config/nvim/lua/config/mason_lspconfig.lua b/config/nvim/lua/config/mason_lspconfig.lua deleted file mode 100644 index e942fd62..00000000 --- a/config/nvim/lua/config/mason_lspconfig.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - automatic_installation = false, -} diff --git a/config/nvim/lua/config/mason_null_ls.lua b/config/nvim/lua/config/mason_null_ls.lua deleted file mode 100644 index 269f1b49..00000000 --- a/config/nvim/lua/config/mason_null_ls.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - automatic_installation = false, - automatic_setup = true, -} diff --git a/config/nvim/lua/config/mason_nvim_dap.lua b/config/nvim/lua/config/mason_nvim_dap.lua deleted file mode 100644 index 269f1b49..00000000 --- a/config/nvim/lua/config/mason_nvim_dap.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - automatic_installation = false, - automatic_setup = true, -} diff --git a/config/nvim/lua/lsp/cmp.lua b/config/nvim/lua/lsp/cmp.lua index aa6a3fda..97f34750 100644 --- a/config/nvim/lua/lsp/cmp.lua +++ b/config/nvim/lua/lsp/cmp.lua @@ -50,6 +50,12 @@ cmp.setup.filetype("python", { }, }) +cmp.setup.filetype("nix", { + sources = { + { name = "nvim_lsp" }, + }, +}) + cmp.setup.filetype("gitcommit", { sources = { { name = "nvim_lsp" }, diff --git a/config/nvim/lua/lsp/config.lua b/config/nvim/lua/lsp/config.lua index 0d4f8777..c4a43192 100644 --- a/config/nvim/lua/lsp/config.lua +++ b/config/nvim/lua/lsp/config.lua @@ -14,32 +14,26 @@ for type, icon in pairs(signs) do vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) end -require("mason").setup() -require("mason-lspconfig").setup(require "config.mason_lspconfig") -require("mason-null-ls").setup(require "config.mason_null_ls") -require("mason-nvim-dap").setup() require("neodev").setup() M.on_attach = require "lsp.attach" M.lsp_flags = require "lsp.flags" M.capabilities = require("cmp_nvim_lsp").default_capabilities() -require("mason-lspconfig").setup_handlers { - function(server_name) - require("lspconfig")[server_name].setup { - on_attach = M.on_attach, - flags = M.lsp_flags, - capabilities = M.capabilities, - } - end, -} +local servers = { "jedi_language_server", "lua_ls", "rnix", "nil_ls", "fortls" } +for _, name in ipairs(servers) do + require("lspconfig")[name].setup { + on_attach = M.on_attach, + flags = M.lsp_flags, + capabilities = M.capabilities, + } +end + require("null-ls").setup { sources = require "lsp.null_ls_sources", on_attach = M.on_attach, flags = M.lsp_flags, capabilities = M.capabilities, } -require("mason-null-ls").setup_handlers() -require("mason-nvim-dap").setup_handlers() return M diff --git a/config/nvim/lua/lsp/null_ls_sources.lua b/config/nvim/lua/lsp/null_ls_sources.lua index d24376c6..2387d356 100644 --- a/config/nvim/lua/lsp/null_ls_sources.lua +++ b/config/nvim/lua/lsp/null_ls_sources.lua @@ -3,6 +3,7 @@ return { null_ls.builtins.code_actions.gitsigns, null_ls.builtins.diagnostics.zsh, null_ls.builtins.diagnostics.mypy, + null_ls.builtins.diagnostics.ruff, null_ls.builtins.formatting.black, null_ls.builtins.formatting.isort, null_ls.builtins.formatting.trim_whitespace, diff --git a/config/nvim/lua/plugins/mason.lua b/config/nvim/lua/plugins/mason.lua deleted file mode 100644 index 568f9530..00000000 --- a/config/nvim/lua/plugins/mason.lua +++ /dev/null @@ -1,33 +0,0 @@ -return { - { - "williamboman/mason.nvim", - cmd = { - "Mason", - }, - config = function() require("mason").setup(require "config.mason") end, - }, - { - "williamboman/mason-lspconfig.nvim", - dependencies = { - "williamboman/mason.nvim", - "neovim/nvim-lspconfig", - }, - lazy = true, - }, - { - "jay-babu/mason-null-ls.nvim", - dependencies = { - "jose-elias-alvarez/null-ls.nvim", - "neovim/nvim-lspconfig", - }, - lazy = true, - }, - { - "jay-babu/mason-nvim-dap.nvim", - dependencies = { - "mfussenegger/nvim-dap", - "neovim/nvim-lspconfig", - }, - lazy = true, - }, -} diff --git a/nixos/desktop/picom.nix b/nixos/desktop/picom.nix index bc9092a8..8aa1506e 100644 --- a/nixos/desktop/picom.nix +++ b/nixos/desktop/picom.nix @@ -8,15 +8,6 @@ shadow = true; fade = true; activeOpacity = 1.0; - inactiveOpacity = 0.8; - settings = { - blur = - { - method = "dual_kawase"; - size = 10; - deviation = 5.0; - strength = 7; - }; - }; + inactiveOpacity = 1.0; }; } diff --git a/nixos/home-manager/packages/tui/default.nix b/nixos/home-manager/packages/tui/default.nix index 11c586d4..8834a548 100644 --- a/nixos/home-manager/packages/tui/default.nix +++ b/nixos/home-manager/packages/tui/default.nix @@ -8,5 +8,7 @@ programs.neovim.defaultEditor = true; home.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) + file + silver-searcher ]; } diff --git a/nixos/home-manager/packages/tui/neovim.nix b/nixos/home-manager/packages/tui/neovim.nix index 8a340c8b..d453cb39 100644 --- a/nixos/home-manager/packages/tui/neovim.nix +++ b/nixos/home-manager/packages/tui/neovim.nix @@ -3,21 +3,35 @@ { programs.neovim = { enable = true; + defaultEditor = true; viAlias = true; vimAlias = true; vimdiffAlias = true; withNodeJs = true; + withRuby = true; withPython3 = true; + extraPackages = with pkgs; [ + # Used by installed plugins + gnumake + gcc + fzf + ripgrep + # LSP config + # Python + mypy + black + isort + ruff + # Nix + rnix-lsp + nil + # Lua + sumneko-lua-language-server + # Fortran + fortran-language-server + ]; + extraPython3Packages = ps: with ps; [ + jedi + ]; }; - home.packages = with pkgs; [ - gnumake - gcc - python310Packages.mypy - python310Packages.black - python310Packages.isort - fzf - ripgrep - cargo - rustc - ]; }