trouble.nvim icon indicating copy to clipboard operation
trouble.nvim copied to clipboard

feature: persistence / save to file

Open Noneangel opened this issue 9 months ago • 18 comments

Did you check the docs?

  • [x] I have read all the trouble.nvim docs

Is your feature request related to a problem? Please describe.

When I close Neovim, the view is lost. I often edit a view using delete (dd), or trouble_add https://github.com/folke/trouble.nvim/blob/85bedb7eb7fa331a2ccbecb9202d8abba64d37b3/lua/trouble/sources/snacks.lua#L110 The view act as my to-do list. But noevim crash some time, so the editions made to the view are lost.

Describe the solution you'd like

An API like require("trouble").save(filename, opts) to save a view to a file.

Describe alternatives you've considered

Use quickfix list with romainl/vim-qf plugin. But it is hard to keep it in sync with trouble.

Additional context

No response

Noneangel avatar Mar 10 '25 18:03 Noneangel

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Apr 10 '25 02:04 github-actions[bot]

not stale

Noneangel avatar Apr 10 '25 05:04 Noneangel

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar May 11 '25 02:05 github-actions[bot]

I actually want the "opposite" feature, which would be the ability to load from an arbitrary file. The other day I ran eslint . > lint-results.txt at the commandline, outside of neovim, and wanted to load the lint-results.txt into the trouble window later on. I couldn't find an obvious way to do that.

rmunn avatar May 13 '25 06:05 rmunn

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jun 13 '25 02:06 github-actions[bot]

Not stale. It's a feature request! Feature requests should never be marked as stale, IMHO.

Edit: Correction. Feature requests should never be automatically marked as stale due to lack of comments. The nature of feature requests is that they are made, then they sit there until the author has time to look at them. A lack of comment activity does not correlate to a lack of interest in the feature; rather, it means that people don't want to spam the issue comments. Having a bot auto-mark feature requests as stale just results in more useless, bordering-on-spam comments being made because the system forces users to do that.

In other words, this comment of mine adds NO value to the discussion of the feature, and borders on being spam. Yet I'm forced to add it so that the feature request won't be closed. This is silly, causes everyone subscribed to the feature to get unnecessary email/notifications, and should not be needed.

rmunn avatar Jun 13 '25 04:06 rmunn

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jul 30 '25 02:07 github-actions[bot]

Not stale.

Noneangel avatar Jul 30 '25 05:07 Noneangel

@folke - I understand why overworked maintainers use stalebots to keep their issues trimmed down to a manageable number. But it would be nice if the stalebot was set to have a higher inactivity count than 30 days, especially at times when the maintainer goes traveling and is absent for several months. You're going to come back from your travels with a bunch of issues that have been spammed for no good reason except to keep the stalebot away. (And, if I may offer a suggestion: issues tagged with "enhancement" should probably be excluded from stalebot consideration altogether: feature requests should never be closed as stale.)

rmunn avatar Jul 30 '25 05:07 rmunn

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Aug 31 '25 02:08 github-actions[bot]

Not stale.

Noneangel avatar Aug 31 '25 09:08 Noneangel

@rmunn Loading entries into the quickfix list is already supported in (neo)vim natively! You can load a file in the quickfix supported format using :cfile [file-name] as long as it is in the quickfix list format.

eslint's error format won't be parseable by :cfile by default, so you'll have to modify the errorformat option to get it to work. You can just use the compiler option which sets it up automatically - :compiler eslint.

Then you can run :cfile lint-results.txt, and open trouble with the quickfix list (:Trouble quickfix).

(Check out the help pages for the :make command: https://neovim.io/doc/user/quickfix.html#_4.-using-:make, and the compiler and errorformat options: https://neovim.io/doc/user/quickfix.html#_7.-the-error-format). This gist was also helpful for me: https://gist.github.com/romainl/ce55ce6fdc1659c5fbc0f4224fd6ad29)

basokant avatar Sep 02 '25 19:09 basokant

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Oct 03 '25 02:10 github-actions[bot]

Not stale.

Noneangel avatar Oct 03 '25 05:10 Noneangel

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Nov 03 '25 02:11 github-actions[bot]

Not stale.

Noneangel avatar Nov 03 '25 07:11 Noneangel