add keymaps and plugins

This commit is contained in:
sadanslargehole 2024-03-15 15:05:44 -04:00
parent 671a7efdb9
commit f5c8df2248
No known key found for this signature in database
GPG key ID: B2E2F4A5161A7800
3 changed files with 27 additions and 17 deletions

View file

@ -44,3 +44,8 @@ vim.keymap.set("n", "<C-[>", "zc", {})
vim.keymap.set("n", "<C-]>", "zo", {}) vim.keymap.set("n", "<C-]>", "zo", {})
-- clangd switch source/header -- clangd switch source/header
vim.keymap.set({ "i", "n" }, "<A-o>", vim.cmd.ClangdSwitchSourceHeader, { silent = true }) vim.keymap.set({ "i", "n" }, "<A-o>", vim.cmd.ClangdSwitchSourceHeader, { silent = true })
-- goto mappings
vim.keymap.set({"i", "n"}, "gd", vim.lsp.buf.definition, {})
vim.keymap.set({"i", "n"}, "gD", vim.lsp.buf.declaration, {})
vim.keymap.set({"i", "n"}, "gi", vim.lsp.buf.implementation, {})
vim.keymap.set({"i", "n"}, "<C-.>", vim.lsp.buf.code_action, {})

View file

@ -3,7 +3,7 @@ local plugins = {
"williamboman/mason.nvim", "williamboman/mason.nvim",
}, },
{ {
"ray-x/lsp_signature.nvim" "ray-x/lsp_signature.nvim",
}, },
{ {
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
@ -11,6 +11,7 @@ local plugins = {
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
}, },
{ "folke/neodev.nvim", opts = {} },
{ {
"p00f/clangd_extensions.nvim", "p00f/clangd_extensions.nvim",
}, },

View file

@ -1,4 +1,7 @@
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
require("neodev").setup({
-- add any options here, or leave empty to use the default settings
})
local capabilities = require("cmp_nvim_lsp").default_capabilities() local capabilities = require("cmp_nvim_lsp").default_capabilities()
capabilities.textDocument.foldingRange = { capabilities.textDocument.foldingRange = {
@ -20,8 +23,8 @@ require("lspconfig").clangd.setup({
capabilities = capabilities, capabilities = capabilities,
cmd = { cmd = {
"clangd", "clangd",
"--header-insertion=iwyu" "--header-insertion=iwyu",
} },
}) })
require("lspconfig").pyright.setup({ require("lspconfig").pyright.setup({
capabilities = capabilities, capabilities = capabilities,
@ -55,17 +58,18 @@ require("lspconfig").lua_ls.setup({
-- Make the server aware of Neovim runtime files -- Make the server aware of Neovim runtime files
workspace = { workspace = {
checkThirdParty = false, checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
-- Depending on the usage, you might want to add additional paths here.
-- "${3rd}/luv/library"
-- "${3rd}/busted/library",
},
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower -- or pull in all of 'runtimepath'. NOTE: this is a lot slower
-- library = vim.api.nvim_get_runtime_file("", true) library = vim.api.nvim_get_runtime_file("", true)
}, },
}) })
end, end,
settings = {
Lua = {
completion = {
callSnippet = "Replace",
},
},
},
}) })
local luasnip = require("luasnip") local luasnip = require("luasnip")