Wednesday, November 26, 2014

vim keymap to execute bash script with parameter

Hi, all
I want to implement such a feature in vim script: in command mode of vi, press v to select the key word, and then press F5, then vi call my bash file, called search.sh, passing the selected key word as parameter to the bash.
Then my search.sh will do all the left work.
But, I don't know how to call my search.sh from vi command mode, I guess it would be something like:
nnoremap F5 :vs path_to_mybash.sh $param1 $param2
Could someone give me some clues?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment