Closed VRehnberg closed 7 months ago
For the sake of clarity: the default_args
- as documented - are vim command args that will always be prepended to the argument list when you invoke the command in question. So if you have
{
default_args = {
DiffviewOpen = { "foo", "bar" },
}
}
and you invoke
:DiffviewOpen baz
the command will expand to
:DiffviewOpen foo bar baz
If you wish to pass arguments directly to Git, you should see the :h diffview-config-git_cmd
config option.
If you wish to create a "command alias", you can just create a user command (:h user-commands
). Example:
:command MyDiffview DiffviewOpen --imply-local origin/HEAD...HEAD
" Then you can use it like:
:MyDiffview
Thanks, while it seems I could have had a command that temporarily uses a different set-up for diffview.nvim
, the solution I went with was to temporarily set git environment variables instead.
https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables
There is the
default_args
config option which seems to do what I'd like, but I want to be able to send some args to git in only a few situations.From the name it seems there should be a way to be able to use non-default args.
Concretely what I would like to do is to have a alias or something which is
DiffviewOpen
with a separate set of default args or possibly a possibility to send git args as an option to diffviewcommands.