Hi

As the title suggests, I want to set something up so that while trouble is_open(), I have a keyboard shortcut that cycles through the various modes listed at https://github.com/folke/trouble.nvim/tree/main#commands.

I see how I can assign shortcuts to jump directly to the different modes, but I want to remember only one shortcut.

Writing a bit of lua to do this is easy enough, but I can’t find any way to see what mode it’s currently in, in order to write some function that toggles to the next one.

Is there any way to accomplish this?

Bonus question: Is there any way to get trouble to display on screen what mode it’s currently in? Such as at the top or bottom of the trouble panel.

  • autokludge@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    10 months ago

    Are you trying to recreate the default action keys? Nope, that just bounces between workspace and document

    Does :lua require("trouble").action("toggle_mode") do anything for you? is just doing the same thing as above.

    • spacemanspiffy@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      10 months ago

      I tried after writing the function I posted below. This works to flip between workspace and document mode but I can’t get to all of the modes like this. Thank you though.