-
I have a shell command that outputs vimgrep formatted lines. Looks like this: ✦ ❯ { git diff master... & git diff } | diff2vimgrep | sort -u
app/controllers/cms/image_uploads_controller.rb:12:1: response.headers['Cache-Control'] = 'public, max-age=31536000'
app/controllers/cms/image_uploads_controller.rb:13:1:
test/controllers/cms/image_uploads_controller_test.rb:55:1: assert_redirected_to(rails_representation_url(image_upload.uploaded_image))
test/controllers/cms/image_uploads_controller_test.rb:56:1:
test/controllers/cms/image_uploads_controller_test.rb:57:1: assert_equal 'max-age=31536000, public', response.headers['cache-control'] I'd like to make it a "source" for fzf-lua, but I can't figure out how. It looks like But I can't figure out how to substitute the command. I tried vim.keymap.set("n", "<leader>d", function()
local cmd = "{ git diff master... & git diff } | diff2vimgrep | sort -u"
fzf_lua.grep {
search = '',
cmd = cmd
}
end, { desc = "Git diff master" }) but I am getting this error: Using Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Grep modifies the command in order to add the search regex at the end of the command, add |
Beta Was this translation helpful? Give feedback.
-
For the reference (so you could test it yourself), here's diff2vimgrep script. |
Beta Was this translation helpful? Give feedback.
Alright solved it, command wasn't POSIX compliant, add a
;
before the 2nd curly brace: