A common action I perform in Vim is to do $ grep or $ git grep (in a vim :terminal), and then open the files discovered.
This works great most of the time. However, I noticed that considering the following output from grep/git grep:
my-file: some code
my-file:// my comments
my-file:/ test
my-file:/// test
The first line will work properly with Vim gf and the like, so we know that vim is ignoring the colon as expected.Similarly, the third line also works.
However, the second and fourth line don't work, with vim reporting E447: Can't find file "my-file://" in path.
It seems that with two or more slashes after the colon, gf no longer works as expected. This suggests that Vim is parsing the text as a URL? I don't think I have ever or will ever find a use for URLs and gf.
My isfname does not contain the : character.
What is causing Vim to behave unexpectedly for gf, and how do I make it behave the way I expect it to?
:set includeexpr?and by::set ft?? – Vivian De Smedt Dec 26 '23 at 07:27:set includeexpr?gives an emptyincludeexpr=. As mentioned, I call this from the vim terminal, which likewise gives for:set ft?an empty valuefiletype=. – user22476690 Dec 26 '23 at 07:31:help :grepin combination with:help quickfixseems more efficient than your current strategy. – romainl Dec 26 '23 at 08:37