Wednesday, July 25, 2012

Vim - open a list of files from previous command


Problem : You want to execute a find command and open all the files into vim

find . -name * | xargs vim

Something not working right ?

Try
$> find . -name *
$> vim $(!!)

What just happened ?

The first command executes a "find"

The second command is opening vim and providing an argument list from a previous command. You
could also have executed

$> vim $(find . -name *)

Keywords
output command previous xargs vim to pipe