diff --git a/plugins/git/README.md b/plugins/git/README.md index dde60fe13..8642dd055 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -62,6 +62,7 @@ plugins=(... git) | gdct | git describe --tags $(git rev-list --tags --max-count=1) | | gds | git diff --staged | | gdt | git diff-tree --no-commit-id --name-only -r | +| gdnolock | git diff $@ ":(exclude)package-lock.json" ":(exclude)*.lock" | | gdv | git diff -w $@ \| view - | | gdw | git diff --word-diff | | gf | git fetch | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 855a746b4..1112421bf 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -86,6 +86,11 @@ alias gds='git diff --staged' alias gdt='git diff-tree --no-commit-id --name-only -r' alias gdw='git diff --word-diff' +function gdnolock() { + git diff "$@" ":(exclude)package-lock.json" ":(exclude)*.lock" +} +compdef _git gdnolock=git-diff + function gdv() { git diff -w "$@" | view - } compdef _git gdv=git-diff