mirror of
https://github.com/sadan4/nvim.git
synced 2024-11-16 22:34:39 -05:00
add keymaps and plugins
This commit is contained in:
parent
671a7efdb9
commit
f5c8df2248
3 changed files with 27 additions and 17 deletions
|
@ -44,3 +44,8 @@ vim.keymap.set("n", "<C-[>", "zc", {})
|
|||
vim.keymap.set("n", "<C-]>", "zo", {})
|
||||
-- clangd switch source/header
|
||||
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, {})
|
||||
|
|
|
@ -2,18 +2,19 @@ local plugins = {
|
|||
{
|
||||
"williamboman/mason.nvim",
|
||||
},
|
||||
{
|
||||
"ray-x/lsp_signature.nvim"
|
||||
},
|
||||
{
|
||||
"ray-x/lsp_signature.nvim",
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
{
|
||||
"p00f/clangd_extensions.nvim",
|
||||
},
|
||||
{ "folke/neodev.nvim", opts = {} },
|
||||
{
|
||||
"p00f/clangd_extensions.nvim",
|
||||
},
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
-- 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()
|
||||
|
||||
capabilities.textDocument.foldingRange = {
|
||||
|
@ -18,10 +21,10 @@ require("lspconfig").yamlls.setup({
|
|||
})
|
||||
require("lspconfig").clangd.setup({
|
||||
capabilities = capabilities,
|
||||
cmd = {
|
||||
"clangd",
|
||||
"--header-insertion=iwyu"
|
||||
}
|
||||
cmd = {
|
||||
"clangd",
|
||||
"--header-insertion=iwyu",
|
||||
},
|
||||
})
|
||||
require("lspconfig").pyright.setup({
|
||||
capabilities = capabilities,
|
||||
|
@ -55,17 +58,18 @@ require("lspconfig").lua_ls.setup({
|
|||
-- Make the server aware of Neovim runtime files
|
||||
workspace = {
|
||||
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
|
||||
-- library = vim.api.nvim_get_runtime_file("", true)
|
||||
library = vim.api.nvim_get_runtime_file("", true)
|
||||
},
|
||||
})
|
||||
end,
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local luasnip = require("luasnip")
|
||||
|
|
Loading…
Reference in a new issue