From: Oleg Broytman Date: Mon, 18 Jul 2016 06:12:00 +0000 (+0300) Subject: .gitconfig: edit all files of the given type X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=commitdiff_plain;h=50b9dfa17f24b869e9b1df2a982d5cbf8353423e .gitconfig: edit all files of the given type Edit ignored or modified or staged files. --- 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`"