Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 667 Bytes

open-list-of-files-from-command.md

File metadata and controls

19 lines (13 loc) · 667 Bytes

Open List of Files From Command

It is trivial to open multiple files in vim using something like vim file1.txt file2.txt. That will open each file for editing. Sometimes though, the file list needs to be generated dynamically. For that, we can pass a file list to vim using:

vim `<command`>`

The above will open each of the files listed in the output of <command> in a separate buffer. From there, edit, close, and move around buffers as you normally would. For example, let's open all the files in directory dir1:

vim `find dir1 -type f`

Or, open all the modified files as reported by git:

vim `git ls-files --modified`