-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmappings.lua
158 lines (144 loc) · 4.42 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
local M = {}
-- In order to disable a default keymap, use
M.disabled = {
i = {
["<C-h>"] = "",
},
}
M.general = {
n = {
[","] = {
function()
require("nvchad_ui.tabufline").tabuflineNext()
end,
"goto next buffer",
},
["<C-w>M"] = { "<C-w>| <C-w>_", "maximize current pane" },
["<C-w>m"] = { "<C-w>=", "minimize current pane" },
},
}
M.telescope = {
n = {
["<leader>,"] = { "<cmd> Telescope buffers <CR>", "find buffers" },
["<leader>ff"] = { "<cmd> Telescope find_files follow=true no_ignore=true hidden=true <CR>", "find all" },
["<leader>fg"] = { "<cmd> Telescope git_files <CR>", "find git files" },
["<leader>fa"] = { "<cmd> Telescope live_grep <CR>", "live grep" },
["<leader>fw"] = { "<cmd> Telescope grep_string <CR>", "grep string" },
},
}
M.lspsage = {
n = {
["gh"] = { "<cmd>Lspsaga finder<CR>", "lsp declaration" },
["<Leader>t"] = { "<cmd>Lspsaga term_toggle<CR>", "outgoing calls" },
["<Leader>gr"] = { "<cmd>Lspsaga rename<CR>", "rename" },
["<Leader>gd"] = { "<cmd>Lspsaga peek_definition<CR>", "peek definition" },
["<Leader>gD"] = { "<cmd>lua vim.lsp.buf.definition()<CR>", "buf definition" },
["<Leader>sl"] = { "<cmd>Lspsaga show_line_diagnostics<CR>", "show line deagnostics" },
["<Leader>sc"] = { "<cmd>Lspsaga show_cursor_diagnostics<CR>", "show cursor diagnostics" },
["<Leader>sb"] = { "<cmd>Lspsaga show_buf_diagnostics<CR>", "show buffer diagnostics" },
["[e"] = { "<cmd>Lspsaga diagnostics_jump_prev<CR>", "diagnostics jump prev" },
["]e"] = { "<cmd>Lspsaga diagnostics_jump_next<CR>", "diagnostics jump next" },
["<Leader>o"] = { "<cmd>Lspsaga outline<CR>", "outline" },
["K"] = { "<cmd>Lspsaga hover_doc ++keep<CR>", "hover" },
["<Leader>ci"] = { "<cmd>Lspsaga incoming_calls<CR>", "incoming calls" },
["<Leader>co"] = { "<cmd>Lspsaga outgoing_calls<CR>", "outgoing calls" },
["<Leader>ca"] = { "<cmd>Lspsaga code_action<CR>", "code action" },
},
v = {
["<Leader>ca"] = { "<cmd>Lspsaga code_action<CR>", "code action" },
},
}
M.NeoZoom = {
n = {
["<leader>fp"] = { "<cmd> NeoZoomToggle <CR>", "floating current pane" },
},
}
M.crates = {
n = {
["<leader>rcu"] = {
function()
require("crates").upgrade_all_crates()
end,
"update crates",
},
},
}
M.dap = {
plugin = true,
n = {
["<leader>db"] = {
"<cmd> DapToggleBreakpoint <CR>",
"Add breakpoint at line",
},
["<leader>dus"] = {
function()
local widgets = require "dap.ui.widgets"
local sidebar = widgets.sidebar(widgets.scopes)
sidebar.open()
end,
"Open debugging sidebar",
},
["<leader>dr"] = {
"<cmd> DapContinue <CR>",
"Run or continue the debugger",
},
},
}
M.dap_python = {
plugin = true,
n = {
["<leader>dpr"] = {
function()
require("dap-python").test_method()
end,
},
},
}
M.dap_go = {
plugin = true,
n = {
["<leader>dgt"] = {
function()
require("dap-go").debug_test()
end,
"Debug to test",
},
["<leader>dgl"] = {
function()
require("dap-go").debug_last()
end,
"Debug last go test",
},
},
}
M.gopher = {
plugin = true,
n = {
["<leader>gsj"] = {
"<cmd> GoTagAdd json <CR>",
"Add json struct tags",
},
["<leader>gsy"] = {
"<cmd> GoTagAdd yaml <CR>",
"Add yaml struct tags",
},
},
}
M.nvimtree = {
plugin = true,
n = {
-- ["<leader>e"] = {"<cmd> Oil --float <CR>", "Open oil in a floating window" }
["<leader>e"] = {
function()
local oil = require("oil")
local api = require("nvim-tree.api")
local node = api.tree.get_node_under_cursor()
local dirname = node.absolute_path:match("(.*[/\\])")
oil.open_float(dirname)
end,
"Open oil in a floating windows"
}
--
}
}
return M