Is there any way to make the special symbol
% work with path names on the command line? For instance, I'd like to do:
So that I can do a
@: to quickly compare files of the same name. However, this just opens up a new buffer called
Of course I could do:
:exe 'diffsplit Path\to\other\directory\'.expand('%')
But this is cumbersome as I can't tab complete directories when typing the command.
Is there any other better way to do this?
Here's a related question, but it doesn't address my situation exactly.
Edit: Just to clarify, I would like to be able to re-use the command exactly for different files. So a solution that simply autofills the current file in the command line will not work. The same command needs to work for different file names.