I want to pipe the selected text to a shell command and receive the one-line output from this shell command on the vim info/command line?
What I\'m really trying to
I would do it like this:
Place this function in your vimrc:
function Test() range
echo system('echo '.shellescape(join(getline(a:firstline, a:lastline), "\n")).'| pbcopy')
endfunction
This will allow you to call this function by doing:
:'<,'>call Test()
Then you can also map that like this (just under the function declaration in your vimrc):
com -range=% -nargs=0 Test :,call Test()
So you can call the function doing this:
:'<,'>Test
Note: :<','>
are range selectors, in order to produce them just select the pertinent lines in visual mode and then go to command mode (pressing the colon key)