11376Re: Remote commands?
- Apr 3, 2010On Feb 16, 2:05 am, Sean DeNigris <truste...@...> wrote:
> > Sorry for taking so long to reply to your posts. I think what you areBen Fritz gave you the following solution on vim_use:
> > looking for is the "remote functions", see ":h remote.txt|/FUNCTIONS".
> I've been using remote, and thought there might be a better way, but
> after posting on vim_use, it seems the two options for remote commands
> 1. sending keys
> 2. wrapping exe in a function and calling it with remote-expr
--remote-send ':ruby delete_line(1)<CR>'
which I think is as economical ("as elegant" as a math teacher would
say) as you could get. I might add that you would maybe want to test
for Ruby support -- something like (untested):
--remote-send ':if has("ruby") | exe "ruby_delete_line(1)" | else |
echoerr "Sorry, no ruby" | endif<CR>'
(all on one line, and with single quotes around the whole to force the
Unix-like shell to pass the | as part of the parameter). I wrap the
ruby statement in an exe so that Vim versions without ruby support
would not try to parse it.
However you could delete the first line more easily without calling
(which is still an ex-command) or
In the latter case I think the quotes can be omitted since there are
no embedded spaces and no risk of interpretation by the shell.
"Hey! Who took the cork off my lunch??!"
-- W. C. Fields
You received this message from the "vim_mac" 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
To unsubscribe, reply using "remove me" as the subject.
- << Previous post in topic