Vim does support a nice option to accept a file with list of files that are then opened in a Quickfix list. Rough example, I find all files in ~ that are smaller than 1KB and pass this to Vim:
find ~ -type f -size -1k > /tmp/1 && vim -q /tmp/1
I would love to use that as zsh suffix alias:
alias V='> /tmp/1 && vim -q /tmp/1'
So that I can:
find ~ -type f -size -1k V
I use several convenience suffixes:
alias -g H='| head -n'
alias -g X='| xargs -d"\n"'
So that I can:
git log H 5
And finally I'm approaching the Question itself.
It makes me sad that I cannot use mktemp
to create that temporary file. Tried all the stupid rookie shell script tricks:
find . | tee QL=$(mktemp) && vim -q $QL
I assume the solution is so simple I'd be put to shame.
At the moment I use:
find ... | xargs -d"\n" vim --
But this only fills in a list of buffers, and doesn't populate Quickfix of Location list, even though I think a command may be passed to Vim with -c
to do so. There's a warning "Vim: Warning: Input is not from a terminal", and then after you quit Vim, terminal fails prints ^D
^M
instead of Ctrl-C
Ctrl-D
afterwards, though this may be fixed by adding ttyctl -f
to .zshrc
, but in Vim itself Tab and Backspace keys misbehave in Ex mode which is very annoying.
vfind
, could do the job just as well, and could be just as easy to use.find
, I may want to use anls
orls | grep
.