hedyhli / outline.nvim

Code outline sidebar powered by LSP. Significantly enhanced & refactored fork of symbols-outline.nvim.
https://sr.ht/~hedy/outline.nvim
MIT License
543 stars 15 forks source link

Mouse support #56

Closed sodle-splunk closed 5 months ago

sodle-splunk commented 5 months ago

Is there a way to configure this so that clicking or double-clicking a symbol in the outline will jump to it? I'm using LunarVim with mouse = "a", and currently the mouse is only able to select the text of the outline.

hedyhli commented 5 months ago

As of now you can add <LeftRelease> to your keymap for goto_location:

keymaps = {
  -- ...
  goto_location = {"<CR>", "<LeftRelease>"},
  -- ...
}

This lets you jump to the symbol location on single mouse clicks.

Alternatively, use peek_location rather than goto_location to prevent the cursor moving to the source window when jumping.

Does that solve your issue?

https://github.com/hedyhli/outline.nvim/assets/50042066/07d5416c-b19d-4923-98e7-b0d2a2e0ad12

sodle-splunk commented 5 months ago

Yep, that works! Thanks for the tip!