diff options
| author | Gabriel A. Giovanini <g.giovanini@gridx.de> | 2025-10-30 16:31:38 +0100 |
|---|---|---|
| committer | Gabriel A. Giovanini <g.giovanini@gridx.de> | 2025-10-30 16:31:38 +0100 |
| commit | f13d4744354684c3258f56dab94f4387b89fa777 (patch) | |
| tree | 76e9b58ed82de7cab123016bce0e854f7e00ffad | |
| parent | f4168dd73f11a896ed00180fec5b5159a4019ade (diff) | |
| download | gabrielgio.lua-f13d4744354684c3258f56dab94f4387b89fa777.tar.gz gabrielgio.lua-f13d4744354684c3258f56dab94f4387b89fa777.tar.bz2 gabrielgio.lua-f13d4744354684c3258f56dab94f4387b89fa777.zip | |
Migrate to vim.lsp and removed unused package
Nix+Home-manager makes mason obsolete.
| -rw-r--r-- | init.lua | 5 | ||||
| -rw-r--r-- | lua/gabrielgio/lazy.lua | 16 | ||||
| -rw-r--r-- | lua/gabrielgio/lsp.lua | 32 | ||||
| -rw-r--r-- | lua/gabrielgio/mini.lua | 8 |
4 files changed, 21 insertions, 40 deletions
@@ -28,7 +28,6 @@ local pkgs = { "nvim-lua/plenary.nvim", -- base lib "nvim-telescope/telescope.nvim", -- telescope "nvim-telescope/telescope-file-browser.nvim", -- telescope file browser - "TimUntersberger/neogit", -- magit "vimwiki/vimwiki", -- wiki "f-person/git-blame.nvim", -- more git info "nvim-mini/mini.nvim", -- provides many things @@ -40,11 +39,7 @@ local pkgs = { "akinsho/toggleterm.nvim", -- terminal "RRethy/vim-illuminate", -- hightlight use of the same word (lsp aware) "sainnhe/edge", -- light theme - "ellisonleao/gruvbox.nvim", -- light theme - "williamboman/mason.nvim", -- manages many things - "williamboman/mason-lspconfig.nvim", -- glue mason and lspconfig "neovim/nvim-lspconfig", -- lsp support - "vimwiki/vimwiki", -- wiki "ray-x/go.nvim", -- go things } -- stylua: ignore end diff --git a/lua/gabrielgio/lazy.lua b/lua/gabrielgio/lazy.lua index 03e68d1..77762b1 100644 --- a/lua/gabrielgio/lazy.lua +++ b/lua/gabrielgio/lazy.lua @@ -1,23 +1,7 @@ -- this file is an amalgamation of configurations that don't have its own -- config file and will be lazily loaded require("gitblame").setup() -require("neogit").setup() -require("mason").setup() require("treesitter-context").setup() -require("mason-lspconfig").setup({ - ensure_installed = { - "cssls", - "emmet_ls", - -- "gopls", - "html", - "lua_ls", - "pylsp", - "rust_analyzer", - "tsserver", - "zls", - -- "clangd" not working on alpine - }, -}) vim.diagnostic.config({ signs = { diff --git a/lua/gabrielgio/lsp.lua b/lua/gabrielgio/lsp.lua index 3c169c4..f659684 100644 --- a/lua/gabrielgio/lsp.lua +++ b/lua/gabrielgio/lsp.lua @@ -1,5 +1,3 @@ -local lsp_config = require("lspconfig") - local function set_key(mode, keys, v, opts) return vim.keymap.set(mode, keys, v, opts) end @@ -18,7 +16,8 @@ local function on_attach(client, bufnr) end local function setup(f) - return f({ on_attach = on_attach }) + vim.lsp.enable(f) + return vim.lsp.config(f, { on_attach = on_attach }) end local function load_all(l) @@ -29,24 +28,25 @@ local function load_all(l) end load_all({ - lsp_config.rust_analyzer.setup, - lsp_config.clangd.setup, - lsp_config.cssls.setup, - lsp_config.html.setup, - lsp_config.emmet_ls.setup, - lsp_config.pylsp.setup, - lsp_config.zls.setup, - lsp_config.ts_ls.setup, - lsp_config.terraformls.setup, - lsp_config.tsp_server.setup, + "rust_analyzer", + "clangd", + "cssls", + "html", + "emmet_ls", + "pylsp", + "zls", + "ts_ls", + "terraformls", + "tsp_server", }) -lsp_config.gopls.setup({ +vim.lsp.enable("gopls") +vim.lsp.config("gopls", { cmd_env = { GOFLAGS = "-tags=unit,integration,e2e" }, on_attach = on_attach, }) - -lsp_config.lua_ls.setup({ +vim.lsp.enable("lua_ls") +vim.lsp.config("lua_ls", { on_attach = on_attach, settings = { Lua = { diff --git a/lua/gabrielgio/mini.lua b/lua/gabrielgio/mini.lua index bc5f347..4d151e8 100644 --- a/lua/gabrielgio/mini.lua +++ b/lua/gabrielgio/mini.lua @@ -1,20 +1,22 @@ +local ai = require("mini.ai") local cmp = require("mini.completion") local diff = require("mini.diff") local icons = require("mini.icons") +local indentscope = require("mini.indentscope") local notify = require("mini.notify") +local snippets = require("mini.snippets") local status = require("mini.statusline") local tabline = require("mini.tabline") -local ai = require("mini.ai") local trailspace = require("mini.trailspace") -local indentscope = require("mini.indentscope") +ai.setup() cmp.setup() diff.setup({ view = { style = "sign" } }) icons.setup() notify.setup() +snippets.setup() status.setup() tabline.setup() -ai.setup() trailspace.setup() indentscope.setup({ draw = { |
