Vimmers,
Can i send the results of, say a (unix) find command, to vim and start editing right away with the first file from the resultlist? Thanks, Hans |
Scholte, J.C.M. wrote:
> Vimmers, > > Can i send the results of, say a (unix) find command, to vim and start editing right away with the first file from the resultlist? > > Thanks, > Hans > > > > > > invocation of an external program, use the quickfix window. In your case I believe the most useful will be :grep and (version 7 only) :vimgrep HTH, Tony. |
In reply to this post by ehannes
> Can i send the results of, say a (unix) find command, to vim
> and start editing right away with the first file from the > resultlist? Sounds like the common use for xargs: find / -name "filespec.*" | xargs vim If you've already put the results in a file with something like find / -name "filespec.*" > ~/filelist.txt you can still use xargs like xargs vim < ~/filelist.txt Hope this gets you where you want to go, -tim |
In reply to this post by ehannes
Yes, that's exactly what i was looking for!
Hans -----Oorspronkelijk bericht----- Van: Tim Chase [mailto:[hidden email]] Verzonden: maandag 23 mei 2005 15:31 Aan: Scholte, J.C.M. CC: [hidden email] Onderwerp: Re: multiple file edit > Can i send the results of, say a (unix) find command, to vim > and start editing right away with the first file from the > resultlist? Sounds like the common use for xargs: find / -name "filespec.*" | xargs vim If you've already put the results in a file with something like find / -name "filespec.*" > ~/filelist.txt you can still use xargs like xargs vim < ~/filelist.txt Hope this gets you where you want to go, -tim |
In reply to this post by ehannes
Don't forget the basic, gvim `find / -name "filespec.*" ` xargs is especially useful in complicated pipe sequences. If it's a truely large list, you can use the quickfix window as already suggested,i.e. this is what I use to emulate "less file*": ls $* >C:/tmp/le.tmp ; gvim -R -c 'set errorformat+=%f nowrapscan readonly nomodifiable' -c 'nmap <Space> <C-F>' -c 'nmap q :q!<CR>' -c 'norm L' -c ':copen 15' -c ':norm t' -c ":e $1" -c 'cgetfile C:/tmp/le.tmp' & there's more to the script but that's the Vim line. --- Tim Chase <[hidden email]> wrote: > > Can i send the results of, say a (unix) find command, to vim > > and start editing right away with the first file from the > > resultlist? > > > Sounds like the common use for xargs: > > find / -name "filespec.*" | xargs vim > > If you've already put the results in a file with something like > > find / -name "filespec.*" > ~/filelist.txt > > you can still use xargs like > > xargs vim < ~/filelist.txt > > Hope this gets you where you want to go, > > -tim > > > > > |
In reply to this post by ehannes
Don't forget the basic, gvim `find / -name "filespec.*" ` xargs is especially useful in complicated pipe sequences, or if your OS bombs with too many files on the arg list. If it's a truely large list, you can use the quickfix window as already suggested. I use this to emulate "less filespec*": ls $* >C:/tmp/le.tmp ; gvim -R -c 'set errorformat+=%f nowrapscan readonly nomodifiable' -c 'nmap <Space> <C-F>' -c 'nmap q :q!<CR>' -c 'norm L' -c ':copen 15' -c ':norm t' -c ":e $1" -c 'cgetfile C:/tmp/le.tmp' & there's more to the script but that's the Vim line. --- Tim Chase <[hidden email]> wrote: > > Can i send the results of, say a (unix) find command, to vim > > and start editing right away with the first file from the > > resultlist? > > > Sounds like the common use for xargs: > > find / -name "filespec.*" | xargs vim > > If you've already put the results in a file with something like > > find / -name "filespec.*" > ~/filelist.txt > > you can still use xargs like > > xargs vim < ~/filelist.txt > > Hope this gets you where you want to go, > > -tim > > > > > |
Free forum by Nabble | Edit this page |