Open files on stdout in Vim
To open all files on stdout in Vim, use the xargs -o
option.
ack PATTERN -l | xargs -o vim
The -o
option to xargs
makes sure to reopen stdin as /dev/tty
in Vim, avoiding the annoying "Vim: Warning: Input is not from a terminal" message.
NOTE: Of course, you should make sure that the command above keeps working for files that contain whitespaces, so it's better to do this:
ack PATTERN -l --print0 | xargs -0 -o vim
Written by Vincent Driessen
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#