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

Detecting when in omnicomplete

Expand Messages
  • Karl Guertin
    I m playing around with keybindings and omnicompletion and I d like a special set of keybindings when pumvisible() and it s an omnicomplete match. I can mostly
    Message 1 of 4 , Sep 26, 2006
      I'm playing around with keybindings and omnicompletion and I'd like a
      special set of keybindings when pumvisible() and it's an omnicomplete
      match. I can mostly do this by setting a buffer variable in all my
      mappings that would cause me to enter/exit omnicomplete, but I keep
      missing edge cases. Is there a better way to detect which completion
      mode vim is in?
    • David.Fishburn@sybase.com
      If you have a look at ftplugin/sql.vim it does this. I override the ctrl-left|right keys. When pumvisible() is false I want to do the default Vim behaviour.
      Message 2 of 4 , Sep 26, 2006
        If you have a look at ftplugin/sql.vim it does this.

        I override the ctrl-left|right keys. When pumvisible() is false I want to do the default Vim behaviour. When it is true I want to perform special SQL actions.

        I was only able to do this via a mapping which called a function. But that does keept it neat and tidy.

        HTH,
        Dave




        ----- Original Message -----
        From: "Karl Guertin" [grayrest@...]
        Sent: 09/26/2006 11:50 AM
        To: "VIM Help" <vim@...>
        Subject: Detecting when in omnicomplete

        I'm playing around with keybindings and omnicompletion and I'd like a
        special set of keybindings when pumvisible() and it's an omnicomplete
        match. I can mostly do this by setting a buffer variable in all my
        mappings that would cause me to enter/exit omnicomplete, but I keep
        missing edge cases. Is there a better way to detect which completion
        mode vim is in?
      • Karl Guertin
        ... sql.vim does have different functionality based on whether the popup menu is visible or not, but I don t see where it distinguishes between omnicomplete
        Message 3 of 4 , Sep 26, 2006
          On 9/26/06, David.Fishburn@... <David.Fishburn@...> wrote:
          > If you have a look at ftplugin/sql.vim it does this.

          sql.vim does have different functionality based on whether the popup
          menu is visible or not, but I don't see where it distinguishes between
          omnicomplete and keyword completion. E.g. if you hit <C-n><C-Right> on
          windows, you still attempt to drill down instead of doing <C-Right>.
        • David Fishburn
          ... That is right, since does not actually do anything when the completion window is open, I assume you wanted to perform the drill down and show the
          Message 4 of 4 , Oct 2, 2006
            > -----Original Message-----
            > From: Karl Guertin [mailto:grayrest@...]
            > Sent: Tuesday, September 26, 2006 4:10 PM
            > To: David.Fishburn@...
            > Cc: VIM Help
            > Subject: Re: Detecting when in omnicomplete
            >
            > On 9/26/06, David.Fishburn@...
            > <David.Fishburn@...> wrote:
            > > If you have a look at ftplugin/sql.vim it does this.
            >
            > sql.vim does have different functionality based on whether
            > the popup menu is visible or not, but I don't see where it
            > distinguishes between omnicomplete and keyword completion.
            > E.g. if you hit <C-n><C-Right> on windows, you still attempt
            > to drill down instead of doing <C-Right>.

            That is right, since <C-Right> does not actually do anything when the
            completion window is open, I assume you wanted to perform the drill down and
            show the column list for the table highlighted in the current table list.

            I am not sure if it is possible to determine why the popup window is
            displaying (<C-X><C-O> vs <C-X><C-N>).

            Dave
          Your message has been successfully submitted and would be delivered to recipients shortly.