From 50b9dfa17f24b869e9b1df2a982d5cbf8353423e Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 18 Jul 2016 09:12:00 +0300 Subject: [PATCH] .gitconfig: edit all files of the given type Edit ignored or modified or staged files. --- .gitconfig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitconfig b/.gitconfig index e99fce7..a5dd970 100644 --- a/.gitconfig +++ b/.gitconfig @@ -102,6 +102,15 @@ # Find text in any commit ever grep-all = !"f() { git rev-list --all | xargs git grep \"$@\"; }; f" + # Edit all files of the given type + edit-cached = !"f() { git ls-files --cached | sort -u ; }; \"${VISUAL:-${EDITOR:-vi}}\" `f`" + edit-deleted = !"f() { git ls-files --deleted | sort -u ; }; \"${VISUAL:-${EDITOR:-vi}}\" `f`" + edit-others = !"f() { git ls-files --others | sort -u ; }; \"${VISUAL:-${EDITOR:-vi}}\" `f`" + edit-ignored = !"f() { git ls-files --ignored | sort -u ; }; \"${VISUAL:-${EDITOR:-vi}}\" `f`" + edit-killed = !"f() { git ls-files --killed | sort -u ; }; \"${VISUAL:-${EDITOR:-vi}}\" `f`" + edit-modified = !"f() { git ls-files --modified | sort -u ; }; \"${VISUAL:-${EDITOR:-vi}}\" `f`" + edit-stage = !"f() { git ls-files --stage | cut -f2 | sort -u ; }; "${VISUAL:-${EDITOR:-vi}}" `f`" + # Editing and adding conflicted files: when we get many merge conflicts # and want to quickly solve them using an editor, then add the files. edit-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; "${VISUAL:-${EDITOR:-vi}}" `f`" -- 2.39.5