gabrielgio.lua @ f13d4744354684c3258f56dab94f4387b89fa777

Migrate to vim.lsp and removed unused package

Nix+Home-manager makes mason obsolete.
  1diff --git a/init.lua b/init.lua
  2index c7f1455353be3e1c1e91822bf9bfbc223d0d0d02..f39e7fae120566ec2fbbdb40911171fac1a7340b 100644
  3--- a/init.lua
  4+++ b/init.lua
  5@@ -28,7 +28,6 @@     "rcarriga/nvim-dap-ui",                         -- dap ui
  6     "nvim-lua/plenary.nvim",                        -- base lib
  7     "nvim-telescope/telescope.nvim",                -- telescope
  8     "nvim-telescope/telescope-file-browser.nvim",   -- telescope file browser
  9-    "TimUntersberger/neogit",                       -- magit
 10     "vimwiki/vimwiki",                              -- wiki
 11     "f-person/git-blame.nvim",                      -- more git info
 12     "nvim-mini/mini.nvim",                          -- provides many things
 13@@ -40,11 +39,7 @@     "hedyhli/outline.nvim",                         -- symbols tree (lsp aware)
 14     "akinsho/toggleterm.nvim",                      -- terminal
 15     "RRethy/vim-illuminate",                        -- hightlight use of the same word (lsp aware)
 16     "sainnhe/edge",                                 -- light theme
 17-    "ellisonleao/gruvbox.nvim",                     -- light theme
 18-    "williamboman/mason.nvim",                      -- manages many things
 19-    "williamboman/mason-lspconfig.nvim",            -- glue mason and lspconfig
 20     "neovim/nvim-lspconfig",                        -- lsp support
 21-    "vimwiki/vimwiki",                              -- wiki
 22     "ray-x/go.nvim",                                -- go things
 23 }
 24 -- stylua: ignore end
 25diff --git a/lua/gabrielgio/lazy.lua b/lua/gabrielgio/lazy.lua
 26index 03e68d19a7f2527cd7a9af1840ead09747fc2a1f..77762b1177618d893b44315af4a8778372e902b9 100644
 27--- a/lua/gabrielgio/lazy.lua
 28+++ b/lua/gabrielgio/lazy.lua
 29@@ -1,23 +1,7 @@
 30 -- this file is an amalgamation of configurations that don't have its own
 31 -- config file and will be lazily loaded
 32 require("gitblame").setup()
 33-require("neogit").setup()
 34-require("mason").setup()
 35 require("treesitter-context").setup()
 36-require("mason-lspconfig").setup({
 37-	ensure_installed = {
 38-		"cssls",
 39-		"emmet_ls",
 40-		-- "gopls",
 41-		"html",
 42-		"lua_ls",
 43-		"pylsp",
 44-		"rust_analyzer",
 45-		"tsserver",
 46-		"zls",
 47-		-- "clangd" not working on alpine
 48-	},
 49-})
 50 
 51 vim.diagnostic.config({
 52 	signs = {
 53diff --git a/lua/gabrielgio/lsp.lua b/lua/gabrielgio/lsp.lua
 54index 3c169c428ce011566499f963551e27e6a67b7984..f6596844b3eaf09aaf5bfbae0ed5b4a9b661c37e 100644
 55--- a/lua/gabrielgio/lsp.lua
 56+++ b/lua/gabrielgio/lsp.lua
 57@@ -1,5 +1,3 @@
 58-local lsp_config = require("lspconfig")
 59-
 60 local function set_key(mode, keys, v, opts)
 61 	return vim.keymap.set(mode, keys, v, opts)
 62 end
 63@@ -18,7 +16,8 @@ 	return bufnr
 64 end
 65 
 66 local function setup(f)
 67-	return f({ on_attach = on_attach })
 68+	vim.lsp.enable(f)
 69+	return vim.lsp.config(f, { on_attach = on_attach })
 70 end
 71 
 72 local function load_all(l)
 73@@ -29,24 +28,25 @@ 	return nil
 74 end
 75 
 76 load_all({
 77-	lsp_config.rust_analyzer.setup,
 78-	lsp_config.clangd.setup,
 79-	lsp_config.cssls.setup,
 80-	lsp_config.html.setup,
 81-	lsp_config.emmet_ls.setup,
 82-	lsp_config.pylsp.setup,
 83-	lsp_config.zls.setup,
 84-	lsp_config.ts_ls.setup,
 85-	lsp_config.terraformls.setup,
 86-	lsp_config.tsp_server.setup,
 87+	"rust_analyzer",
 88+	"clangd",
 89+	"cssls",
 90+	"html",
 91+	"emmet_ls",
 92+	"pylsp",
 93+	"zls",
 94+	"ts_ls",
 95+	"terraformls",
 96+	"tsp_server",
 97 })
 98 
 99-lsp_config.gopls.setup({
100+vim.lsp.enable("gopls")
101+vim.lsp.config("gopls", {
102 	cmd_env = { GOFLAGS = "-tags=unit,integration,e2e" },
103 	on_attach = on_attach,
104 })
105-
106-lsp_config.lua_ls.setup({
107+vim.lsp.enable("lua_ls")
108+vim.lsp.config("lua_ls", {
109 	on_attach = on_attach,
110 	settings = {
111 		Lua = {
112diff --git a/lua/gabrielgio/mini.lua b/lua/gabrielgio/mini.lua
113index bc5f347a1344cf3c5e71368d6174f34012a7808a..4d151e86deba14abceb4172c95ab2eeec13342d0 100644
114--- a/lua/gabrielgio/mini.lua
115+++ b/lua/gabrielgio/mini.lua
116@@ -1,20 +1,22 @@
117+local ai = require("mini.ai")
118 local cmp = require("mini.completion")
119 local diff = require("mini.diff")
120 local icons = require("mini.icons")
121+local indentscope = require("mini.indentscope")
122 local notify = require("mini.notify")
123+local snippets = require("mini.snippets")
124 local status = require("mini.statusline")
125 local tabline = require("mini.tabline")
126-local ai = require("mini.ai")
127 local trailspace = require("mini.trailspace")
128-local indentscope = require("mini.indentscope")
129 
130+ai.setup()
131 cmp.setup()
132 diff.setup({ view = { style = "sign" } })
133 icons.setup()
134 notify.setup()
135+snippets.setup()
136 status.setup()
137 tabline.setup()
138-ai.setup()
139 trailspace.setup()
140 indentscope.setup({
141 	draw = {