Closed yujinyuz closed 3 years ago
@yujinyuz you can take reference from here
snap.maps {
{"<Leader>ss", file {
try = {
snap.get'producer.git.file'.args({'your args'}),
'ripgrep.file'
}
}
@babygau thanks. I just tried it but I get this error
packer.nvim: Error running config for snap: [string "..."]:0: attempt to index a function value
Edit:
Here's my config
local snap = require('snap')
local file = snap.config.file:with{reverse = false, consumer = 'fzf'}
local vimgrep = snap.config.vimgrep:with{
reverse = false,
consumer = 'fzf',
limit = 50000,
}
snap.maps {
{
'<leader>ss', file {
try = {
snap.get'producer.git.file'.args({'--cached', '--others'}),
'ripgrep.file',
}
},
},
}
I don't think git.file
supports adding arbitrary arguments yet, though it should. I can take a look
Thanks.
Does this mean I have to also include ls-files
to the args? Something like tihs?
snap.maps {
{
'<leader>ss', file {
try = {
snap.get'producer.git.file'.args({'ls-files', '--cached', '--others'}),
'ripgrep.file',
}
},
},
ls-files should be defaulted in and you are just adding the extras. Thanks for logging the issue btw!
@camspiers Welcome! Also thanks for the immediate fix for this
I currently have this in my config
How can I pass arguments to
git.file
?