Loading ...
Sorry, an error occurred while loading the content.

Re: Vim does not get out of after completion?

Expand Messages
  • Fran├žois Ingelrest
    ... Well, always using is not a good idea, as it has different meaning when not in completion mode. I m stuck here, using could be a solution, but
    Message 1 of 5 , Jan 31, 2008
    • 0 Attachment
      > I may be wrong, but <c-x><c-n> uses a different completion set than
      > <c-n>, doesn't it?
      >
      > I think that <c-e> is the best solution, so I tried to update the
      > function I used to map <tab> to use completion mode:
      >
      > function! CleverTab(mode)
      > if pumvisible()
      > let l:prefix = ""
      > else
      > let l:prefix = "\<c-e>"
      > endif
      >
      > if a:mode == 0 || strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$'
      > return "\<tab>"
      > elseif a:mode == 1
      > return l:prefix . "\<c-p>"
      > else
      > return l:prefix . "\<c-n>"
      > endif
      > endfunction
      >
      > I use pumvisible() to determine whether a new completion task should
      > be started. By doing that, I assume that <c-e> is harmless when there
      > is no completion task to end, because I did not find how to determine
      > if there is a running one.
      >
      > What do you think?

      Well, always using <c-e> is not a good idea, as it has different
      meaning when not in completion mode. I'm stuck here, using <c-x> could
      be a solution, but there is not <c-x><c-...> which would be equivalent
      to <c-n>....

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.