On Monday, May 4, 2015 at 9:43:26 AM UTC-4, Ivan wrote:
> I'm sending keys from a shell to a running Vim instance using the 
> "--remote-send" option. I want to trigger Tab-completion on Vim's command 
> line (e.g. `vim --remote-send ":ed<Tab>"` -> ":edit") but it ends up 
> inserting a Tab character rather than completing the command (":ed^I" rather 
> than ":edit"). Is there a way to do this?
> 
> The reason I'm doing this in the first place is I'm using Vimrunner 
> (https://github.com/AndrewRadev/vimrunner) to write integration tests for a 
> Vim plugin I'm building. I ran into this problem using Vimrunner's api to 
> interact with Vim, and under the hood it's using Vim's client/server remote 
> functionality. I tried it directly in the shell and got the same results.

Awesome! feedkeys() was the answer. What finally worked from the shell was:
--remote-send ':call feedkeys(":ed\<Tab>", "t")\<CR>'

and in ruby, using Vimrunner:
vim = Vimrunner.start
vim.feedkeys ':call feedkeys(":ed\<Tab>", "t")\<CR>'

Thanks a million!

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to