nvimtools / hydra.nvim

Create custom submodes and menus
MIT License
145 stars 8 forks source link

Help: could show examples for nvim-dap #36

Closed blithefeng closed 1 month ago

blithefeng commented 6 months ago

I'm using nvim-dap and nvim-dap-ui for debugging. And I want to use hydra for step over, step into, .etc. But when I hit n, nothing happened. The action was done when I pressed another key not in hydra heads.

hydra def:

Hydra({
    name = "Debug",
    mode = { "n" },
    body = "<leader>z",
    config = {
        invoke_on_body = true,
    },
    heads = {
        {
            "b",
            dap.toggle_breakpoint,
            { desc = "Toggle Breakpoint" },
        },
        {
            "c",
            function()
                require("dap").continue()
            end,
            { desc = "Continue", nowait = true },
        },
        {
            "a",
            function()
                require("dap").continue({ before = get_args })
            end,
            { desc = "Run with args", nowait = true },
        },
        {
            "i",
            function()
                require("dap").step_into()
            end,
            { desc = "Step Into", nowait = true },
        },
        {
            "n",
            function()
                require("dap").step_over()
            end,
            { desc = "Step Over", nowait = true },
        },
        {
            "o",
            function()
                require("dap").step_out()
            end,
            { desc = "Step Out", nowait = true },
        },
        {
            "q",
            function()
                require("dap").terminate()
            end,
            { desc = "Terminate", nowait = true },
        },
    },
})
miversen33 commented 6 months ago

Here is my nvim-dap hydra configuration

miversen33 commented 3 months ago

Did my provided configuration help? Are we good to close this issue out?

miversen33 commented 1 month ago

Closing this out. Lemme know if you need more help