Move nvim config into nvim/ subdirectory

Prepare repo structure for storing multiple dotfile configs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Mikhail Kilin
2026-02-23 23:44:15 +03:00
parent 7213bec4dc
commit 50805a9042
15 changed files with 0 additions and 0 deletions

57
nvim/lua/plugins/lsp.lua Normal file
View File

@@ -0,0 +1,57 @@
return {
{
"williamboman/mason.nvim",
opts = {},
},
{
"williamboman/mason-lspconfig.nvim",
dependencies = { "williamboman/mason.nvim", "neovim/nvim-lspconfig" },
opts = {
ensure_installed = {
"ts_ls",
"clangd",
},
},
},
{
"neovim/nvim-lspconfig",
dependencies = {
"williamboman/mason-lspconfig.nvim",
"hrsh7th/cmp-nvim-lsp",
},
config = function()
local capabilities = require("cmp_nvim_lsp").default_capabilities()
-- LSP keymaps on attach
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(ev)
local map = function(keys, func, desc)
vim.keymap.set("n", keys, func, { buffer = ev.buf, desc = desc })
end
map("gd", vim.lsp.buf.definition, "Go to definition")
map("gD", vim.lsp.buf.declaration, "Go to declaration")
map("gr", vim.lsp.buf.references, "Go to references")
map("gi", vim.lsp.buf.implementation, "Go to implementation")
map("K", vim.lsp.buf.hover, "Hover documentation")
map("<leader>ca", vim.lsp.buf.code_action, "Code action")
map("<leader>rn", vim.lsp.buf.rename, "Rename symbol")
map("<leader>fs", "<cmd>Telescope lsp_document_symbols<cr>", "Document symbols")
end,
})
-- Configure servers using vim.lsp.config (Neovim 0.11+)
vim.lsp.config("ts_ls", { capabilities = capabilities })
vim.lsp.config("clangd", { capabilities = capabilities })
vim.lsp.config("zls", { capabilities = capabilities })
-- Enable servers
vim.lsp.enable({ "ts_ls", "clangd", "zls" })
end,
},
{
-- Rust gets its own dedicated plugin
"mrcjkb/rustaceanvim",
version = "^5",
lazy = false,
},
}