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

Re: Filtering popupmenu-completion without changing word before cursor

Expand Messages
  • Ben Fritz
    ... Try setting completeopt=longest,menuone -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you
    Message 1 of 6 , Mar 5, 2013
    • 0 Attachment
      On Tuesday, March 5, 2013 9:07:15 AM UTC-6, Martin Lundberg wrote:
      > Hi,
      >
      > I want to create something like what FuzzyFinder has where I create a one-line buffer at top and show the vim popupmenu-completion and as I type the popupmenu is filtered. The problem I've got is that vim selects the first match and changes the word before the cursor.
      >
      > I've set 'completeopt' to only 'menuone' but I can't find a way to stop vim from changing the word before the cursor as I type and run <C-x><C-u>.
      >
      > -Martin

      Try setting completeopt=longest,menuone

      --
      --
      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 vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Martin Lundberg
      ... That s not what I want, I don t want anything to get added to the filter. I ve been looking at the FuzzyFinder code and I can t figure out how it s done
      Message 2 of 6 , Mar 5, 2013
      • 0 Attachment
        On Tuesday, March 5, 2013 5:08:04 PM UTC+1, Ben Fritz wrote:
        > Try setting completeopt=longest,menuone

        That's not what I want, I don't want anything to get added to the filter. I've been looking at the FuzzyFinder code and I can't figure out how it's done there.

        They add an autocmd for CursorMovedI where I thought it would be: https://github.com/vim-scripts/FuzzyFinder/blob/master/autoload/fuf.vim#L384 but I'm not getting it.

        --
        --
        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 vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Ben Fritz
        ... Setting longest won t add anything to any sort of filter . I have no idea what you mean there. You said your problem was that Vim was changing what you
        Message 3 of 6 , Mar 5, 2013
        • 0 Attachment
          On Tuesday, March 5, 2013 11:16:08 AM UTC-6, Martin Lundberg wrote:
          > On Tuesday, March 5, 2013 5:08:04 PM UTC+1, Ben Fritz wrote:
          > > Try setting completeopt=longest,menuone
          >
          > That's not what I want, I don't want anything to get added to the filter. I've been looking at the FuzzyFinder code and I can't figure out how it's done there.
          >

          Setting 'longest' won't add anything to any sort of "filter". I have no idea what you mean there.

          You said your problem was that Vim was changing what you typed when you triggered completion mode. "longest" will mostly fix that. You can continue typing to filter the menu just as you said you wanted.

          You also mentioned "a one-line buffer at the top" showing up for completion. Maybe you also want "preview"? I.e. it sounds to me like you want

          :set completeopt=longest,menuone,preview

          What exactly isn't happening that you expect with that setting? Or, what is happening that you don't want? Please be precise.

          --
          --
          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 vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Martin Lundberg
          I found the line (https://github.com/vim-scripts/FuzzyFinder/blob/master/autoload/fuf.vim#L826): call feedkeys( , n ) -- -- You received this
          Message 4 of 6 , Mar 5, 2013
          • 0 Attachment
            I found the line (https://github.com/vim-scripts/FuzzyFinder/blob/master/autoload/fuf.vim#L826):

            call feedkeys("\<C-p>\<Down>", 'n')




            --
            --
            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 vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Martin Lundberg
            ... The first sentence describing longest in the help is Only insert the longest common text of the matches. It inserts the longest common text of the
            Message 5 of 6 , Mar 5, 2013
            • 0 Attachment
              On Tuesday, March 5, 2013 6:30:35 PM UTC+1, Ben Fritz wrote:
              > Setting 'longest' won't add anything to any sort of "filter". I have no idea what you mean there.

              The first sentence describing 'longest' in the help is "Only insert the longest common text of the matches." It inserts the longest common text of the matches, I don't want that.

              > You also mentioned "a one-line buffer at the top" showing up for completion. Maybe you also want "preview"? I.e. it sounds to me like you want
              >
              > :set completeopt=longest,menuone,preview
              >
              > What exactly isn't happening that you expect with that setting? Or, what is happening that you don't want? Please be precise.

              You can see what I mean with a one line buffer here: http://www.youtube.com/watch?feature=player_detailpage&v=_MYuiqhfrIU#t=28s

              --
              --
              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 vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            Your message has been successfully submitted and would be delivered to recipients shortly.