Sunday, August 30, 2009

Re: using j,k, to move through completion popup menu


2009/8/30 Kevin <lazyweb@gmail.com>

How would i set up vim to let me move through the completion menu
popup using j and k, and selecting with enter?
You can do something like this:

inoremap j <C-r>=Jmap()<CR>
inoremap k <C-r>=Kmap()<CR>

function! Jmap()
    if pumvisible()
        return "\<C-n>"
    else
        return "j"
    endif
endfunction

function! Kmap()
    if pumvisible()
        return "\<C-p>"
    else
        return "k"
    endif
endfunction

This e-mail have an attach file with the code the source using :source <path-to-file>/j_kmove.vim

--
----------------------------------------------
Roberto Miura Honji
LAS - Laboratório de Administração e Segurança de Sistemas
Engenharia de Computação - 2006
Instituto de Computação - UNICAMP

email: miurahonji@gmail.com (principal)
email: ra064201@students.ic.unicamp.br
msn:   miurahonji@msn.com
-------------------------------------------

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

No comments:

Post a Comment