Last Updated: February 25, 2016
·
687
· brombomb

Edit all modified files in VIM

I wanted a way to easily edit all the files in my modfied list from running

git status

so I came up with this nifty little shortcut

vim $(git status -s -uno --ignore-submodules -z | sed 's/ M//g')

A little explanation about the switches used.

-s -- short version
-uno -- show 'untracked' set to no
-ignore-submodules -- don't look in submodules
-z -- use a NUL instead of a LF

sed 's/ M///g' -- remove the remaining 'Modified' flag

I already have my vim set to vim -p so it opens in tabs as I like.