←back to thread

538 points todsacerdoti | 3 comments | | HN request time: 0.732s | 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. magarnicle ◴[] No.44360925[source]
Is this the same/similar to 'vim -q <(ripgrep --vimgrep restore_tool)'?
replies(1): >>44360969 #
2. robenkleene ◴[] No.44360969[source]
Similar enough, minor semantic differences (e.g., I don't think `-q` creates a buffer containing the matches)
replies(1): >>44364474 #
3. anticodon ◴[] No.44364474[source]
I use fish and neovim, thanks to the thread, created the following alias:

   nvim -q (rg --vimgrep needle --color=never | psub) -c copen