I have a bash script which takes a single argument and returns around 8-10 lines of text.
I'd like to be able to call this script from within vim. Ideally by highlighting a string of characters as the argument. I'd then like the output of the script to be displayed in a new pane.
I'm new to vim so I'm not sure if this can be done simply by creating a command in my vimrc file or if I need to create a plugin.
Any advice would be much appreciated.
after a bit of googling I've come up with
function! Foo(a1)
new
r !myscript a:a1
endfunction
This doesn't quite work yet. It seems to pass the name a:a1 rather than the value.