commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Opens all files in the index (modified plus not added yet) in tabs in vim.
There are 6 alternatives - vote for the best!
The option --porcelain makes the output of git easier to parse.
This one-liner may not work if there is a space in the modified file name.
This oneliner gets all the 'modified' files in your git repository, and opens all of them in vim.
Very handy when you're starting to work in the morning and you simply want to review your modified files before committing them.
Maybe there are better ways to do that (and maybe integrated in vim and/or git, who knows), but I found quicker to do this oneliner.
Works even with spaces in filenames.
As an alias in .gitconfig:
editchanged = "!git status --porcelain | sed -ne 's/^ M //p' | tr '\\n' '\\0' | tr -d '\"' | xargs -0 vim"
If you can do better, submit your command here.
You must be signed in to comment.