vim-unstack icon indicating copy to clipboard operation
vim-unstack copied to clipboard

Idea: UnstackFromCommand

Open jdsutherland opened this issue 4 years ago • 1 comments

As a tmux user, my workflow for using unstack is usually:

  1. run a failing build or test (using vim-test)
  2. copy (either tmux copy mode or piping 1. to xclip)
  3. :UnstackFromClipboard

It seems like this could be turned into a single command (UnstackFromCommand) that would streamline this.

Do you think this could be useful? I imagine that in many contexts, the trace might be too messy to send the entire output, so I'm not sure.

jdsutherland avatar Dec 12 '20 17:12 jdsutherland

Thanks for the suggestion! I'm a little worried about false positives or multiple stack traces being an issue, but will leave this ticket open and think it over for a while.

Using vim's :terminal would allow you to highlight the stack trace and trigger unstack via the mapping (default `s'), potentially saving you a step. I totally understand if you prefer using tmux panes, though.

In theory, if you can customize vim-test to automatically pipe stdout to xclip, you could probably write a custom command that runs your test then calls UnstackFromClipboard (or in cases where a vim function runs the test and returns stdout, you can do :UnstackFromText(RunTests())), but I'm still thinking if there's a clean way to generalize this to warrant its inclusion to the plugin.

mattboehm avatar Feb 02 '21 23:02 mattboehm