folke / trouble.nvim

🚦 A pretty diagnostics, references, telescope results, quickfix and location list to help you solve all the trouble your code is causing.
Apache License 2.0
5.51k stars 177 forks source link

feat: Add keybindings for next/prev with skipping groups #297

Closed tamirzb closed 6 months ago

Andrei-Yermakovich commented 9 months ago

I made the same behaviour in my config without changes in trouble.nvim

local next_skip_groups = function()
    require("trouble").next({ skip_groups = true });
end

local previous_skip_groups = function()
    require("trouble").previous({ skip_groups = true });
end

vim.api.nvim_create_autocmd({ "FileType" }, {
    pattern = { "Trouble" },
    callback = function(args)
        vim.api.nvim_buf_set_keymap(
            args.buf,
            'n',
            'j',
            "",
            {
                callback = next_skip_groups
            })
        vim.api.nvim_buf_set_keymap(
            args.buf,
            'n',
            'k',
            "",
            {
                callback = previous_skip_groups
            })
    end,
})
folke commented 6 months ago

Development on the main branch is EOL.

Trouble has been rewritten and will be merged in main soon.

This issue/feature either no longer exists or has been implemented on dev.

For more info, see https://github.com/folke/trouble.nvim/tree/dev