←back to thread

539 points todsacerdoti | 1 comments | | HN request time: 0s | source
Show context
robenkleene ◴[] No.44358285[source]
I love this, I've been iterating on workflows like this for something like a decade now. Over time I've tried to peel back as many of my custom layers as possible, because all of those layers have a maintenance cost.

Stock Vim (without `tmux`) can actually do most of what's shared in this post with `rg --vimgrep restore_tool | vim -c cb -` (`vim -c cb -` is my favorite feature in Vim; I find it strange that it's so rarely used or talked about).

(Since re-running the `rg` search can be undesirable, and I often like to analyze results in a terminal before opening them in Vim. I use a custom `tmux` command to copy the output of the last command [using this trick that involves adding a Unicode character to your prompt https://ianthehenry.com/posts/tmux-copy-last-command/], then I send that into Vim with e.g., `tmux saveb - | vim -c cb -`.)

replies(7): >>44358653 #>>44358736 #>>44360925 #>>44362611 #>>44363893 #>>44364510 #>>44403351 #
1. lenkite ◴[] No.44403351[source]
Isn't `rg --vimgrep restore_tool | vim -q -` better though ?

    -q [errorfile] QuickFix mode.  The file with the name [errorfile] is read
  and the first error is displayed.  See |quickfix|.
  If [errorfile] is not given, the 'errorfile' option is used
  for the file name.  See 'errorfile' for the default value.

If you wish to automatically also open the quickfix list

    rg --vimgrep restore_tool | vim -q - -c 'copen'