I'm looking for a function(probably doesn't exist) which can return the filepath under the cursor. I know that there is a command/shortcut gf
that helps me jump to that file if the file exists.
But I do wonder, is there a function so that I can simply get that filename/filepath without opening it? If not, that function might be very useful in some cases. Are there any elegant ways to implemente the function(use regex?)?
As far as I know, the only way seems using pattern matching. However, the regex and the matching logic seems a little complex(suppose there are multiple filenames in the line which the cursor locates at)...