Nvim: small tweaks and organizing config
This commit is contained in:
parent
fc50b07d4e
commit
9c2f5dee4c
|
@ -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,
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
-- vim api documentation for lua lsp
|
||||
return {
|
||||
"ii14/emmylua-nvim",
|
||||
ft = { "lua" },
|
||||
}
|
|
@ -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" } },
|
||||
})
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue