add debug keymaps
This commit is contained in:
188
config/keymaps.nix
Normal file
188
config/keymaps.nix
Normal file
@@ -0,0 +1,188 @@
|
||||
{ ... }: {
|
||||
|
||||
globals = {
|
||||
mapleader = " ";
|
||||
maplocalleader = " ";
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ff";
|
||||
action = "<cmd>Telescope find_files hidden=true<CR>";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>fc";
|
||||
action = "<cmd>Telescope treesitter<CR>";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>t";
|
||||
action = "<cmd>NvimTreeToggle<CR>";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-.>";
|
||||
action = "<cmd>BufferNext<CR>";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-,>";
|
||||
action = "<cmd>BufferPrevious<CR>";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-h>";
|
||||
action = "<cmd>wincmd h<CR>";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-j>";
|
||||
action = "<cmd>wincmd j<CR>";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-k>";
|
||||
action = "<cmd>wincmd k<CR>";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-l>";
|
||||
action = "<cmd>wincmd l<CR>";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "Q";
|
||||
action = "<nop>";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "v";
|
||||
key = "J";
|
||||
action = ":m '>+1<CR>gv=gv";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "v";
|
||||
key = "K";
|
||||
action = ":m '<-2<CR>gv=gv";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>y";
|
||||
action = "\"+y";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "v";
|
||||
key = "<leader>y";
|
||||
action = "\"+y";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>s";
|
||||
action = ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<F5>";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require('dap').continue()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Debug: Start/Continue";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<F1>";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require('dap').step_into()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Debug: Step Into";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<F2>";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require('dap').step_over()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Debug: Step Over";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<F3>";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require('dap').step_out()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Debug: Step Out";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>b";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require('dap').toggle_breakpoint()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Debug: Toggle Breakpoint";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>B";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Debug: Set Breakpoint";
|
||||
};
|
||||
}
|
||||
# Toggle to see last session result. Without this, you can't see session output
|
||||
# in case of unhandled exception.
|
||||
{
|
||||
mode = "n";
|
||||
key = "<F7>";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require('dapui').toggle()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Debug: See last session result.";
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user