dotfiles/dot_config/nvim/lua/custom/mappings.lua

108 lines
1.9 KiB
Lua
Raw Normal View History

2024-02-17 14:33:09 +01:00
local M = {}
M.dap = {
plugin = true,
n = {
["<leader>db"] = {
"<cmd> DapToggleBreakpoint <CR>",
"Add breakpoint at line"
},
2024-02-18 01:14:11 +01:00
["<leader>dc"] = {
"<cmd> DapContinue <CR>",
"Debug - continue"
},
["<leader>dsi"] = {
"<cmd> DapStepInto <CR>",
"Debug - step into"
},
["<leader>dn"] = {
"<cmd> DapStepOver <CR>",
"Debug - step over (next)"
},
["<leader>dso"] = {
"<cmd> DapStepOut <CR>",
"Debug - step out"
},
["<leader>dt"] = {
"<cmd> DapTerminate <CR>",
"Debug - terminate"
},
2024-02-17 14:33:09 +01:00
["<leader>dus"] = {
function ()
2024-02-18 01:14:11 +01:00
require("dapui").toggle();
-- local widgets = require('dap.ui.widgets');
-- local sidebar = widgets.sidebar(widgets.scopes);
-- sidebar.open();
2024-02-17 14:33:09 +01:00
end,
2024-02-18 01:14:11 +01:00
"Toggle debugging interface"
2024-02-17 14:33:09 +01:00
}
}
}
M.dap_go = {
plugin = true,
n = {
["<leader>dgt"] = {
function()
require("dap-go").debug_test()
end,
"Debug go test"
},
["<leader>dgl"] = {
function()
2024-02-18 01:14:11 +01:00
require("dap-go").debug_last_test()
2024-02-17 14:33:09 +01:00
end,
"Debug last go test"
},
}
}
2024-02-18 01:14:11 +01:00
M.dap_ui = {
plugin = true,
n = {
["È"] = { -- alt+k
function()
require("dapui").eval()
end,
2024-02-18 12:07:46 +01:00
"Debug - eval expression (Alt+K)"
2024-02-18 01:14:11 +01:00
}
}
}
2024-02-17 14:33:09 +01:00
M.terminal = {
t = {
["<Esc>"] = {"<C-\\><C-n>"}
}
}
M.general = {
i = {
["<C-a>"] = { "<ESC>^i", "Beginning of line" },
}
}
2024-02-18 12:07:46 +01:00
M.nvterm = {
n = {
["<leader>ti"] = {
function()
require("nvterm.terminal").toggle "float"
end,
"Toggle floating term"
},
["<leader>tv"] = {
function()
require("nvterm.terminal").toggle "vertical"
end,
"Toggle vertical term"
},
["<leader>th"] = {
function()
require("nvterm.terminal").toggle "horizontal"
end,
"Toggle horizontal term"
},
}
}
2024-02-17 14:33:09 +01:00
return M