-
Notifications
You must be signed in to change notification settings - Fork 0
/
mappings.lua
68 lines (57 loc) · 1.8 KB
/
mappings.lua
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
---@type MappingsTable
local M = {}
M.general = {
n = {
[";"] = { ":", "enter command mode", opts = { nowait = true } },
["gm"] = { "<cmd>call cursor(0, virtcol('$')/2)<CR>", "go to middle of line", opts={ noremap = true, silent = true } },
},
}
M.lspconfig = {
n = {
["<leader>h"] = { "<cmd> ClangdSwitchSourceHeader<CR>", "switch between src/header", opts={ noremap = true, silent = true } },
["<leader>dd"] = { "<cmd>lua vim.diagnostic.disable()<CR>", "diable diagnostic", opts = { noremap = true, silent = true } },
["<leader>de"] = { "<cmd>lua vim.diagnostic.enable()<CR>", "enable diagnostic", opts = { noremap = true, silent = true } },
},
}
M.tabufline = {
n = {
-- closes tab + all of its buffers
["<leader>cx"] = {
function()
require("nvchad.tabufline").closeAllBufs()
end,
"Close all buffers",
},
-- closes all bufs except current one
["<leader>cb"] = {
function()
require("nvchad.tabufline").closeOtherBufs ()
end,
"Close all buffers except current one",
},
},
}
M.spectre = {
plugin = true,
n = {
["<leader>S"] = { '<cmd>lua require("spectre").toggle()<CR>', "Toggle spectre" },
["<leader>sw"] = { '<cmd>lua require("spectre").open_visual({select_word=true})<CR>', "Search current word" },
["<leader>sp"] = { '<cmd>lua require("spectre").open_file_search({select_word=true})<CR>', desc = "Search on current file" },
},
v = {
["<leader>sw"] = { '<esc><cmd>lua require("spectre").open_visual()<CR>', "Search current word" },
},
}
M.aerial = {
plugin = true,
n = {
["<leader>a"] = { '<cmd>AerialToggle!<CR>', "Toggle Aerial outline" },
},
}
M.symbols_outline = {
plugin = true,
n = {
["<leader>o"] = { '<cmd>:SymbolsOutline<CR>', "Toggle Symbols-Outline" },
},
}
return M