is it possible to send the word under the cursor to a perl script by typing a shortcut?
how do i do that?
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>
For the whole line, replace
getline('.'). For the filename under cursor use
Answered By – ZyX
Answer Checked By – Katrina (BugsFixing Volunteer)