add keybindings

This commit is contained in:
gameloader 2022-10-07 13:00:21 +08:00
parent d13b36024b
commit 1291acb250

View File

@ -18,6 +18,11 @@ wk.register({
-- 代码相关
map("n", ",", ":RunCode<CR>", opt)
-- git related
-- git 相关
wk.register({
["<Leader>g"] = { ":LazyGit<CR>", "Open lazygit" },
})
-- file related
-- 文件相关操作
wk.register({
@ -61,8 +66,8 @@ wk.register({
-- base operation for visual mode
-- 可视模式下基本操作
map('v', '<', '<gv', opt)
map('v', '>', '>gv', opt)
map("v", "<", "<gv", opt)
map("v", ">", ">gv", opt)
-- nvimTree
map("n", "n", ":NvimTreeToggle<CR>", opt)
@ -102,27 +107,25 @@ wk.register({
l = { ":Mason<CR>", "Mason info" },
u = { ":MasonUninstall<CR>", "Uninstall lsp" },
U = { ":MasonUninstallAll<CR>", "Unistall all" },
}
},
})
-- Telescope
map("n", "f", ":Telescope find_files<CR>", opt)
-- cmpeletion keys
-- 补全快捷键
pluginKeys.cmp = function(cmp)
return {
-- next option
-- 下一个
['<Tab>'] = cmp.mapping.select_next_item(),
['<Up>'] = cmp.mapping.select_prev_item(),
["<Tab>"] = cmp.mapping.select_next_item(),
["<Up>"] = cmp.mapping.select_prev_item(),
['<CR>'] = cmp.mapping.confirm({
["<CR>"] = cmp.mapping.confirm({
select = true,
behavior = cmp.ConfirmBehavior.Replace
})
behavior = cmp.ConfirmBehavior.Replace,
}),
}
end
@ -133,17 +136,19 @@ wk.register({
r = { ":lua require('dap').continue()<CR>", "Start debug" },
b = { ":lua require('dap').toggle_breakpoint()<CR>", "Set breakpoint" },
c = { ":lua require('dap').clear_breakpoints()<CR>", "Clear breakpoint" },
e = {":lua require'dap'.close()<CR>"
e = {
":lua require'dap'.close()<CR>"
.. ":lua require'dap'.terminate()<CR>"
.. ":lua require'dap.repl'.close()<CR>"
.. ":lua require'dapui'.close()<CR>"
.. ":lua require('dap').clear_breakpoints()<CR>"
.. "<C-w>o<CR>", "Stop debug"},
}
.. "<C-w>o<CR>",
"Stop debug",
},
},
})
map("i", "<C-d>", ":lua require'dap'.continue()<CR>", opt)
map("n", "<C-n>", ":lua require'dap'.step_into()<CR>", opt)
map("n", "<C-o>", ":lua require'dap'.step_over()<CR>", opt)
return pluginKeys