If you try yank c:\foo\bar\file.txt:94 when you are on line 94 c:\foo\bar\file.txt , you can use the following statement to set the + register to
<file_path>:<line_number>
:let @+=expand("%") . ':' . line(".")
expand("%") is the current file name
line(".") - current line number
Display example
nnoremap <leader>y :let @+=expand("%") . ':' . line(".")<CR>
source share