Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I would like to yank -
I would also like to paste it to my system clipboard so i will use '+' register for this.
can you suggest me possible way to do this?
c:\foo\bar\file.txt:94如果您在第 94 行时尝试拉动,c:\foo\bar\file.txt可以使用以下语句将+寄存器设置为 <file_path>:<line_number>
c:\foo\bar\file.txt:94
c:\foo\bar\file.txt
+
<file_path>:<line_number>
:let @+=expand("%") . ':' . line(".")
expand("%")- 是当前文件名 line(".")- 是当前行号
expand("%")
line(".")
一个示例映射是
nnoremap <leader>y :let @+=expand("%") . ':' . line(".")<CR>