From 44ef1a47017f969c3657e4dceb1b1b0369f97387 Mon Sep 17 00:00:00 2001 From: Elias Almqvist Date: Tue, 14 Jan 2025 14:10:55 +0100 Subject: [PATCH] stuff --- nvchad/.config/nvim/lua/chadrc.lua | 2 +- nvchad/.config/nvim/lua/configs/lspconfig.lua | 2 +- nvchad/.config/nvim/lua/plugins/init.lua | 45 +++++++++++-------- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/nvchad/.config/nvim/lua/chadrc.lua b/nvchad/.config/nvim/lua/chadrc.lua index 515289a..b51e1b9 100644 --- a/nvchad/.config/nvim/lua/chadrc.lua +++ b/nvchad/.config/nvim/lua/chadrc.lua @@ -38,7 +38,7 @@ end M = { base46 = { theme = "ayu_dark", - theme_toggle = { "ayu_dark", "ayu_dark" }, + theme_toggle = { "ayu_dark", "ayu_light" }, }, ui = { hl_override = highlights.override, diff --git a/nvchad/.config/nvim/lua/configs/lspconfig.lua b/nvchad/.config/nvim/lua/configs/lspconfig.lua index 86f99bc..b1aa65a 100644 --- a/nvchad/.config/nvim/lua/configs/lspconfig.lua +++ b/nvchad/.config/nvim/lua/configs/lspconfig.lua @@ -14,7 +14,7 @@ local servers = { "tailwindcss", "pyright", "julials", - "metals", + -- "metals", -- handled by nvim-metals } -- lsps with default config diff --git a/nvchad/.config/nvim/lua/plugins/init.lua b/nvchad/.config/nvim/lua/plugins/init.lua index 0b2360e..2c5cdfa 100644 --- a/nvchad/.config/nvim/lua/plugins/init.lua +++ b/nvchad/.config/nvim/lua/plugins/init.lua @@ -157,29 +157,36 @@ local plugins = { -- end, }, - -- { - -- "numToStr/Comment.nvim", - -- dependencies = "JoosepAlviste/nvim-ts-context-commentstring", - -- config = function() - -- require("Comment").setup({ - -- pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), - -- }) - -- end, - -- }, - - -- To make a plugin not be loaded + { + "scalameta/nvim-metals", + dependencies = { + "nvim-lua/plenary.nvim", + }, + ft = { "scala", "sbt", "java" }, + opts = function() + local metals_config = require("metals").bare_config() + metals_config.on_attach = function(client, bufnr) + -- your on_attach function + end + + return metals_config + end, + config = function(self, metals_config) + local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }) + vim.api.nvim_create_autocmd("FileType", { + pattern = self.ft, + callback = function() + require("metals").initialize_or_attach(metals_config) + end, + group = nvim_metals_group, + }) + end + }, + -- { "NvChad/nvim-colorizer.lua", enabled = true }, - - -- All NvChad plugins are lazy-loaded by default - -- For a plugin to be loaded, you will need to set either `ft`, `cmd`, `keys`, `event`, or set `lazy = false` - -- If you want a plugin to load on startup, add `lazy = false` to a plugin spec, for example - -- { - -- "mg979/vim-visual-multi", - -- lazy = false, - -- } } return plugins