Closed ghost closed 3 years ago
@mrhieu059 You closed the question - did you find a solution? For a single script you could use the x-hint-command
which is a command to be run after a hint ist fired that was started by ;x
.
So you could use :set x-hint-command=:sh! youtube-dl.sh <C-R>;<CR>
- the <C-R>;
pasted the yanked link target. And than start the hinting by ;x
or via :nnoremap ;v ;x
.
For two script you have to change the x-hint-command direct before triggering the ;x hints.
:nnoremap ;v ::set x-hint-command=:sh! youtube-dl.sh <C-R>;<CR>;x
(the ::
before set
disables recording of the set command in command history)
:nnoremap ;m ::set x-hint-command=:sh! mpv.sh <C-R>;<CR>;x
That's not a direct solution but should work.
I have two scripts youtube-dl.sh, and mpv.sh. One will pipe clipboard into youtube-dl and the second one will pipe the clipboard into mpv.
How would I bind these two scripts to ;v , ;m (which activate hint mode and yank to clipboard then activate
:shellcmd! youtube-dl.sh
immediately after a hint is chose) and ;m (which do the same as above but instead activate mpv.sh script).Normally I would use the method below
I have tried to map
:nn ;v ;y :sh! youtube-dl.sh<CR>
. The hint does work however it doesn't seem to activate the shellcmd after hint is yanked to clipboard.