aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lua/plugin
diff options
context:
space:
mode:
authorXander Swan <email>2025-12-03 10:00:41 -0500
committerXander Swan <email>2025-12-03 10:00:41 -0500
commitbcf4e0f9547a4fc1a4e4e03e3cb1c4314f750daa (patch)
treebbce6030cd8def08f4d47d10ef49e38caefda964 /.config/nvim/lua/plugin
parentc11a0db97fad18db098447522bc0c2db3bfae071 (diff)
nvim
Diffstat (limited to '.config/nvim/lua/plugin')
-rw-r--r--.config/nvim/lua/plugin/lsp.lua21
-rw-r--r--.config/nvim/lua/plugin/packer.lua1
2 files changed, 14 insertions, 8 deletions
diff --git a/.config/nvim/lua/plugin/lsp.lua b/.config/nvim/lua/plugin/lsp.lua
index 8e9d66f..0c02c4f 100644
--- a/.config/nvim/lua/plugin/lsp.lua
+++ b/.config/nvim/lua/plugin/lsp.lua
@@ -23,22 +23,27 @@ local cmp = require('cmp')
cmp.setup {
mapping = cmp.mapping.preset.insert({
-- `Enter` key to confirm completion
- ['<CR>'] = cmp.mapping.confirm({select = false}),
+ ['<CR>'] = cmp.mapping.confirm({ select = false }),
-- `Tab` key to navigate
- ['<S-Tab>'] = cmp.mapping.select_prev_item({behavior = 'select'}),
- ['<Tab>'] = cmp.mapping.select_next_item({behavior = 'select'}),
+ ['<S-Tab>'] = cmp.mapping.select_prev_item({ behavior = 'select' }),
+ ['<Tab>'] = cmp.mapping.select_next_item({ behavior = 'select' }),
})
}
+require("lsp-format").setup {}
+require("lspconfig").clangd.setup {
+ on_attach = require("lsp-format").on_attach
+}
+
lsp.on_attach(function(client, buffer)
- local opts = { buffer=buffer, remap=false }
+ local opts = { buffer = buffer, remap = false }
- vim.keymap.set("n", "<leader>ld", function() vim.lsp.buf.definition() end, opts)
- vim.keymap.set("n", "<leader>h", function() vim.lsp.buf.hover() end, opts)
- vim.keymap.set("n", "<leader>la", function() vim.lsp.buf.code_action() end, opts)
+ vim.keymap.set("n", "<leader>ld", function() vim.lsp.buf.definition() end, opts)
+ vim.keymap.set("n", "<leader>h", function() vim.lsp.buf.hover() end, opts)
+ vim.keymap.set("n", "<leader>la", function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set("n", "<leader>lrf", function() vim.lsp.buf.references() end, opts)
vim.keymap.set("n", "<leader>lrn", function() vim.lsp.buf.rename() end, opts)
- vim.keymap.set("n", "<leader>ls", function() vim.lsp.buf.signature_help() end, opts)
+ vim.keymap.set("n", "<leader>ls", function() vim.lsp.buf.signature_help() end, opts)
end)
lsp.setup()
diff --git a/.config/nvim/lua/plugin/packer.lua b/.config/nvim/lua/plugin/packer.lua
index 653b786..f03cca2 100644
--- a/.config/nvim/lua/plugin/packer.lua
+++ b/.config/nvim/lua/plugin/packer.lua
@@ -34,6 +34,7 @@ return require("packer").startup(function(use)
use {
"VonHeikemen/lsp-zero.nvim",
requires = {
+ {"lukas-reineke/lsp-format.nvim"},
-- LSP Support
{"neovim/nvim-lspconfig"},
{"williamboman/mason.nvim"},