On Mar 9, 11:53 pm, rameo <rai...@gmail.com> wrote:

> Why does this one not work?

>     call feedkeys("\<c-x>\<c-".a:type.">")

I wouldn't expect that to work because I'd expect the \<c-?> construct
to be parsed when the double quoted string is built, before the .
operator is invoked.  You'd need some indirection:

fun! Mycompl(type)
    startinsert
    execute 'let keys = "\<c-x>\<c-' . a:type . '>"'
    call feedkeys(keys)
endfun

Seems to work for me, at least with 'k'.  I don't know why it works
without moving the cursor right, though.  If the cursor is on the end
of a word, and I type i ^x ^k the last letter of the word is shunted
to the right and doesn't take part in the matching.  Maybe startinsert
has some magic.  Simpler might be to use a:

fun! Mycompl(type)
    execute 'let keys = "a\<c-x>\<c-' . a:type . '>"'
    call feedkeys(keys)
endfun

Regards, John

-- 
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

Reply via email to