Nvim: small tweaks and organizing config

This commit is contained in:
Marko Korhonen 2023-11-20 21:14:45 +02:00
parent fc50b07d4e
commit 9c2f5dee4c
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890
4 changed files with 18 additions and 12 deletions

View file

@ -4,7 +4,7 @@ local m = {}
-- Maps LSP specific keybinds.
-- This makes them only available when LSP is running
function m.map_keys()
local function map_keys()
local telescope_builtin = require("telescope.builtin")
require("which-key").register({
g = {
@ -42,7 +42,7 @@ function m.map_keys()
end
-- Maps keys and does other needed actions
-- when client attatches
-- when client attaches
function m.on_attach(client, bufnr)
-- Attach navic if document symbols are available
if client.server_capabilities.documentSymbolProvider then
@ -50,7 +50,7 @@ function m.on_attach(client, bufnr)
end
-- Setup keybinds
m.map_keys()
map_keys()
end
-- Combine built-in LSP and cmp cabaibilities
@ -62,8 +62,7 @@ function m.get_capabilities()
require("cmp_nvim_lsp").default_capabilities()
)
-- Neovim hasn't added foldingRange to default capabilities, users must add it manually
-- for ufo
-- Neovim hasn't added foldingRange to default capabilities, users must add it manually for ufo
--capabilities.textDocument.foldingRange = {
-- dynamicRegistration = false,
-- lineFoldingOnly = true,

View file

@ -1,5 +0,0 @@
-- vim api documentation for lua lsp
return {
"ii14/emmylua-nvim",
ft = { "lua" },
}

View file

@ -5,8 +5,7 @@ return {
local gitsigns = require("gitsigns")
gitsigns.setup()
local wk = require("which-key")
wk.register({
require("which-key").register({
["["] = { h = { gitsigns.prev_hunk, "Previous hunk" } },
["]"] = { h = { gitsigns.next_hunk, "Next hunk" } },
})

View file

@ -18,4 +18,17 @@ return {
lsp_doc_border = true,
},
},
config = function(_, opts)
local noice = require("noice")
noice.setup(opts)
require("which-key").register({
d = {
function()
vim.cmd("NoiceDismiss")
end,
"Dismiss notifications",
},
}, { prefix = "<leader>" })
end,
}