diff --git a/lua/community.lua b/lua/community.lua index eab004a..17e2fab 100644 --- a/lua/community.lua +++ b/lua/community.lua @@ -7,12 +7,14 @@ return { "AstroNvim/astrocommunity", { import = "astrocommunity.colorscheme.catppuccin" }, + { import = "astrocommunity.diagnostics.lsp_lines-nvim" }, { import = "astrocommunity.diagnostics.trouble-nvim" }, + { import = "astrocommunity.editing-support.rainbow-delimiters-nvim" }, { import = "astrocommunity.editing-support.ultimate-autopair-nvim" }, { import = "astrocommunity.indent.indent-blankline-nvim" }, - { import = "astrocommunity.indent.mini-indentscope" }, + { import = "astrocommunity.indent.indent-rainbowline" }, { import = "astrocommunity.lsp.lsp-lens-nvim" }, { import = "astrocommunity.lsp.lsplinks-nvim" }, @@ -24,7 +26,6 @@ return { { import = "astrocommunity.pack.cs-omnisharp" }, { import = "astrocommunity.pack.html-css" }, - { import = "astrocommunity.pack.lua" }, { import = "astrocommunity.pack.nix" }, { import = "astrocommunity.pack.python" }, { import = "astrocommunity.pack.rust" }, diff --git a/lua/plugins/astrolsp.lua b/lua/plugins/astrolsp.lua index 31a6f00..f9703da 100644 --- a/lua/plugins/astrolsp.lua +++ b/lua/plugins/astrolsp.lua @@ -12,6 +12,7 @@ return { codelens = true, inlay_hints = true, semantic_tokens = true, + signature_help = true; }, formatting = { disabled = { diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua new file mode 100644 index 0000000..2734a67 --- /dev/null +++ b/lua/plugins/cmp.lua @@ -0,0 +1,28 @@ +return { + { + "hrsh7th/nvim-cmp", + opts = function(_, opts) + local cmp = require("cmp") + local lspkind = require('lspkind') + + opts.sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + }) + + opts.experimental = { ghost_text = true } + opts.formatting.fields = {"abbr", "kind", "menu"} + opts.formatting.format = lspkind.cmp_format({ + mode = "symbol_text", + menu = ({ + buffer = "[BUFFER]", + nvim_lsp = "[LSP]", + luasnip = "[SNIP]", + path = "[PATH]", + }) + }) + end, + } +} diff --git a/lua/plugins/lua.lua b/lua/plugins/lua.lua new file mode 100644 index 0000000..a6d29f8 --- /dev/null +++ b/lua/plugins/lua.lua @@ -0,0 +1,69 @@ +local function selene_configured(path) + return #vim.fs.find("selene.toml", { path = path, upward = true, type = "file" }) > 0 +end + +return { + { + "AstroNvim/astrolsp", + optional = true, + opts = { + config = { + lua_ls = { settings = { Lua = { hint = { enable = true, arrayIndex = "Disable" } } } }, + }, + }, + }, + { + "nvim-treesitter/nvim-treesitter", + optional = true, + opts = function(_, opts) + if opts.ensure_installed ~= "all" then + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "lua", "luap" }) + end + end, + }, + { + "jay-babu/mason-null-ls.nvim", + optional = true, + opts = function(_, opts) + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "stylua", "selene" }) + if not opts.handlers then opts.handlers = {} end + opts.handlers.selene = function(source_name, methods) + local null_ls = require "null-ls" + for _, method in ipairs(methods) do + null_ls.register(null_ls.builtins[method][source_name].with { + runtime_condition = function(params) return selene_configured(params.bufname) end, + }) + end + end + end, + }, + { + "WhoIsSethDaniel/mason-tool-installer.nvim", + optional = true, + opts = function(_, opts) + opts.ensure_installed = + require("astrocore").list_insert_unique(opts.ensure_installed, { "lua-language-server", "stylua", "selene" }) + end, + }, + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { + lua = { "stylua" }, + }, + }, + }, + { + "mfussenegger/nvim-lint", + optional = true, + opts = { + linters_by_ft = { + lua = { "selene" }, + }, + linters = { + selene = { condition = function(ctx) return selene_configured(ctx.filename) end }, + }, + }, + }, +}