How can I copy the current file name and line number to the system clipboard, formatted like this:
relative/path/to/file:123
And how can I map this to a leader key command?
The necessary command is :let @+ = expand('%') . ':' . line(".")
This can be mapped to a leader key command like this:
:nmap <Leader>l <Esc>:let @+ = expand('%') . ':' . line(".")<CR>
The equivalent in Lua for NeoVim is:
set("n", "<Leader>l", ":let @+ = expand('%') . ':' . line('.')<cr>")