config/git: create powerful fzf aliases
This commit is contained in:
parent
1b412ce6ca
commit
ff9d52cdeb
|
@ -27,6 +27,7 @@
|
||||||
[diff]
|
[diff]
|
||||||
tool = nvim
|
tool = nvim
|
||||||
submodule = log
|
submodule = log
|
||||||
|
context = 2
|
||||||
[merge]
|
[merge]
|
||||||
tool = nvim
|
tool = nvim
|
||||||
[mergetool "nvim"]
|
[mergetool "nvim"]
|
||||||
|
@ -74,13 +75,17 @@
|
||||||
required = true
|
required = true
|
||||||
|
|
||||||
[alias]
|
[alias]
|
||||||
|
fzf = !fzf --preview='git diff HEAD --color=always -- {}' --tiebreak=end,index --multi
|
||||||
|
fzs = !cut -z -c2- | git fzf --read0 -d' ' --nth=2.. --preview='test {1} != \\? && git diff --color HEAD -- {2..} | $(git config interactive.diffFilter) || diff --color=always -u /dev/null {2..}' | cut -c3-
|
||||||
|
|
||||||
# GET INFO
|
# GET INFO
|
||||||
s = !git stl && git stb
|
s = !git stl && git stb
|
||||||
st = stb .
|
st = stb .
|
||||||
stb = status --short --branch
|
stb = status --short --branch
|
||||||
sv = --paginate status -v
|
sv = --paginate status -v
|
||||||
svv = --paginate status -vv
|
svv = --paginate status -vv
|
||||||
sf = !git diff-index HEAD --name-only | fzf --preview='git diff HEAD --color=always -- {}' --multi | git commit -v --pathspec-from-file=-
|
sf = !git status --porcelain --no-renames -z | sed -z 's/^\\(\\w\\) / \\1/' | git fzs | git commit -v --pathspec-from-file=-
|
||||||
|
|
||||||
|
|
||||||
r = remote -v
|
r = remote -v
|
||||||
b = branch -vv
|
b = branch -vv
|
||||||
|
@ -122,6 +127,8 @@
|
||||||
a = add -u
|
a = add -u
|
||||||
aa = add -u .
|
aa = add -u .
|
||||||
ap = add -p
|
ap = add -p
|
||||||
|
af = !git status --porcelain --no-renames -z | grep -v '^\\w ' -z | git fzs | git -c advice.addEmptyPathspec=false add --verbose --pathspec-from-file=-
|
||||||
|
|
||||||
c = commit -v
|
c = commit -v
|
||||||
cad = !git diff-tree --no-commit-id --name-only -r HEAD | git commit -v --amend --pathspec-from-file=- # Amend commit with all already changed files
|
cad = !git diff-tree --no-commit-id --name-only -r HEAD | git commit -v --amend --pathspec-from-file=- # Amend commit with all already changed files
|
||||||
cme = commit -v --edit --message # Commit with message but edit it
|
cme = commit -v --edit --message # Commit with message but edit it
|
||||||
|
|
Loading…
Reference in New Issue