-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuffer.lua
More file actions
80 lines (78 loc) · 1.99 KB
/
Copy pathbuffer.lua
File metadata and controls
80 lines (78 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
local builtin = require "user.keymap.builtin"
local silent_opts = { silent = true }
---@type table<string, UserKeymapGroup[]>
return {
lsp = {
{
plugin = "lsp",
family = "buffer",
maps = {
{
mode = "n",
lhs = "gD",
rhs = function()
vim.lsp.buf.declaration()
end,
desc = "LSP: Declaration",
opts = silent_opts,
conflict = { builtin = builtin.get("n", "gD") },
},
{
mode = "n",
lhs = "gd",
rhs = function()
vim.lsp.buf.definition()
end,
desc = "LSP: Definition",
opts = silent_opts,
conflict = { builtin = builtin.get("n", "gd") },
},
{
mode = "n",
lhs = "K",
rhs = function()
vim.lsp.buf.hover { border = "rounded" }
end,
desc = "LSP: Hover",
opts = silent_opts,
conflict = {
builtin = builtin.get("n", "K"),
note = "Shadows the global nvim-ufo K in LSP-attached buffers",
},
},
{
mode = "n",
lhs = "gI",
rhs = function()
vim.lsp.buf.implementation()
end,
desc = "LSP: Implementation",
opts = silent_opts,
conflict = { builtin = builtin.get("n", "gI") },
},
{
mode = "n",
lhs = "gr",
rhs = function()
vim.lsp.buf.references()
end,
desc = "LSP: References",
opts = silent_opts,
conflict = { builtin = builtin.get("n", "gr") },
},
{
mode = "n",
lhs = "gl",
rhs = function()
vim.diagnostic.open_float()
end,
desc = "LSP: Diagnostics",
opts = silent_opts,
conflict = {
note = "Reviewed normal-mode g-family slot before reusing it for diagnostics",
},
},
},
},
},
}