diff options
| author | Brad Clawsie <brad@b7j0c.org> | 2025-11-19 13:10:47 -0600 |
|---|---|---|
| committer | Brad Clawsie <brad@b7j0c.org> | 2025-11-19 13:10:47 -0600 |
| commit | dc2bc7f98dd1be0d718b7e747b8ffd58df67c3d0 (patch) | |
| tree | 0b727f07094713ab7acf7d31431f7c4f52ab8c4d /nvim/init.lua | |
| parent | 92330032be86b9f3b718d1780c04c4fe06d44019 (diff) | |
mason
Diffstat (limited to 'nvim/init.lua')
| -rw-r--r-- | nvim/init.lua | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/nvim/init.lua b/nvim/init.lua index 37c59ba..df1c46e 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -12,6 +12,22 @@ vim.g.perl_host_prog = "/usr/bin/perl" vim.g.mapleader = " " vim.g.maplocalleader = " " +vim.api.nvim_create_autocmd("LspAttach", { + desc = "LSP actions", + callback = function(event) + local opts = { buffer = event.buf } + + vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) + vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) + vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) + vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts) + vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) + + -- Diagnostics (optional but helpful) + vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, opts) + end, +}) + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then vim.fn.system({ @@ -72,4 +88,26 @@ require("lazy").setup({ config = true }, + { + "williamboman/mason.nvim", + dependencies = { + "williamboman/mason-lspconfig.nvim", + "neovim/nvim-lspconfig", + }, + config = function() + require("mason").setup({ + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗" + } + } + }) + + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls" }, + }) + end + } }) |
