5 ms·
"rg --vimgrep restore_tool | vim -c cb -" looks like I want to use it. However, it doesn't work for me. vim says it had errors while processing, and says I ha
by lynx97 1y ago
"rg --vimgrep restore_tool | vim -c cb -" looks like I want to use it. However, it doesn't work for me. vim says it had errors while processing, and says I haven't saved the buffer. I get the rg result displayed, but how do I navigate to a place?
- covoeus 1y agoUse `cb!` instead of `cb`: rg --vimgrep restore_tool | vim -c cb! - You might also wanna open the quickfix list by default: rg --vimgrep restore_tool | vim -c cb! -c copen - You can learn more about how to navigate it using `:h quickfix`.
- palata 1y agoI had never heard of the quickfix list! Thanks a lot!
- _sharp 1y agoThis is amazing! Thank you!! The quickfix window is so small, so I added the "-c only" option to make it the only window that first pops up. Then made it a function so it's easier to call: ``` vgrep() { rg --vimgrep "$1" | vim -c cb! -c copen -c only - } ``` $> vgrep "restore_tool"
- sam_lowry_ 1y agoI tried searching how to open the quickfix window in a vertical split, but found nothing. Any ideas?
- sam_lowry_ 1y agogot it find "$1" -name "$2" | vim -c cb! -c "vert 40copen" - 40 means open at 40 column.