From 2081dbf18b6a433567461264b6b928d69f5ad163 Mon Sep 17 00:00:00 2001
From: Jan Hensel <ceo@dubious.engineering>
Date: Sat, 20 Jul 2024 13:38:02 +0200
Subject: [PATCH] nvim: Use mason and let lazy init lsp settings

These are not unrelated to each other, mason and lsp need to load in
a specific order, so my setup was counter to that.

this also adds dap/dapui (I guess)
---
 .config/nvim/init.vim        |  1 -
 .config/nvim/lua/plugins.lua | 28 +++++++++++++++++++++-------
 2 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
index 11507dd..82f159c 100644
--- a/.config/nvim/init.vim
+++ b/.config/nvim/init.vim
@@ -41,7 +41,6 @@ EOF
 
 lua require('ztf.colorscheme').apply()
 
-lua require("ztf.lsp")
 lua require("ztf.dap")
 lua require('ztf.treesitter')
 
diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua
index 94e8961..9876c70 100644
--- a/.config/nvim/lua/plugins.lua
+++ b/.config/nvim/lua/plugins.lua
@@ -31,21 +31,35 @@ local plugins = {
   'tpope/vim-characterize',
   'tommcdo/vim-lion',
 
-  'neovim/nvim-lspconfig',
-  'mfussenegger/nvim-dap',
   {
-    "rcarriga/nvim-dap-ui",
-    lazy = true,
-    config = function() require("ztf.configure.dapui") end,
-    dependencies = { "mfussenegger/nvim-dap" },
+    "williamboman/mason.nvim",
+    opts = {},
   },
   {
-    "williamboman/mason.nvim",
+    "williamboman/mason-lspconfig.nvim",
     opts = {
       ensure_installed = {
         "tinymist",
+        "rust_analyzer",
+        "rust_analyzer",
+        "lua_ls",
       },
     },
+    dependencies = { "williamboman/mason.nvim" },
+  },
+  {
+    'neovim/nvim-lspconfig',
+    dependencies = { "williamboman/mason-lspconfig.nvim" },
+    config = function()
+      require("ztf.lsp")
+    end,
+  },
+  'mfussenegger/nvim-dap',
+  {
+    "rcarriga/nvim-dap-ui",
+    lazy = true,
+    config = function() require("ztf.configure.dapui") end,
+    dependencies = { "mfussenegger/nvim-dap" },
   },
   -- rust
   {
-- 
GitLab