Issue
is it possible to send the word under the cursor to a perl script by typing a shortcut?
how do i do that?
Solution
Above solutions are not safe if word under cursor contains special characters. You should use
nnoremap <F2> :execute "!/path/to/script.pl ".shellescape(expand("<cword>"), 1)<CR>
instead.
For the whole line, replace expand("<cword>")
with getline('.')
. For the filename under cursor use expand("<cfile>")
.
Answered By – ZyX
Answer Checked By – Katrina (BugsFixing Volunteer)