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

The Super Search and Vim Scripts for Python

Expand Messages
  • gberar
    I installed some Python specific Vim scripts and found that, when editing python files, the Super Search does not behave as it does normally. If I have the
    Message 1 of 3 , Jan 31, 2012
    • 0 Attachment
      I installed some Python specific Vim scripts and found that, when
      editing python files, the "Super Search" does not behave as it does
      normally.

      If I have the cursor over "foo" in the string "foo.bar" and type the
      character *, vim will search for the string "foo" as long the file is
      not a python file type.

      If I edit a python file and perform the same action, vim will search
      for "foo.bar".

      What is causing this behavior? I really want it to perform the normal
      way unless there is a good reason it does this.

      The scripts that I have are

      ./vim73/autoload/python3complete.vim
      ./vim73/autoload/pythoncomplete.vim
      ./vim73/ftplugin/python.vim
      ./vim73/plugin/pydoc.vim
      ./vim73/syntax/python.vim
      ./vim73/indent/python.vim

      --
      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
    • Benjamin R. Haskell
      ... What you re calling Super Search is actually keyword search. It searches for the keyword under the cursor¹. One of those files you list is setting it
      Message 2 of 3 , Jan 31, 2012
      • 0 Attachment
        On Tue, 31 Jan 2012, gberar wrote:

        > I installed some Python specific Vim scripts and found that, when
        > editing python files, the "Super Search" does not behave as it does
        > normally.
        >
        > If I have the cursor over "foo" in the string "foo.bar" and type the
        > character *, vim will search for the string "foo" as long the file is
        > not a python file type.
        >
        > If I edit a python file and perform the same action, vim will search
        > for "foo.bar".
        >
        > What is causing this behavior? I really want it to perform the normal
        > way unless there is a good reason it does this.

        What you're calling "Super Search" is actually keyword search. It
        searches for the keyword under the cursor¹. One of those files you list
        is setting it so that '.' is considered part of a "word".

        Seeing as how I'm not seeing this behavior, and I don't have this file:

        > ./vim73/plugin/pydoc.vim

        You should check to see if it sets the 'isk' (short for 'iskeyword') option.

        Also, you shouldn't install plugins in the system directory (if that's
        what you're abbreviating to './'). There's a good chance they'll be
        overwritten when you update Vim.

        --
        Best,
        Ben

        ¹: It doesn't always just use the "word" under the cursor, but only when
        there's no keyword character underneath the cursor. For full details, see:

        :help star

        Also see:

        :help 'iskeyword'

        --
        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
      • John Beckett
        ... As already mentioned, one of the scripts active for files of type python is changing your iskeyword setting to include a dot. When editing a Python
        Message 3 of 3 , Jan 31, 2012
        • 0 Attachment
          gberar wrote:
          > I installed some Python specific Vim scripts and found that,
          > when editing python files, the "Super Search" does not behave
          > as it does normally.
          >
          > If I have the cursor over "foo" in the string "foo.bar" and
          > type the character *, vim will search for the string "foo" as
          > long the file is not a python file type.

          As already mentioned, one of the scripts active for files of
          type "python" is changing your 'iskeyword' setting to include a
          dot.

          When editing a Python file, enter the following to determine
          which script is responsible:

          :verbose set iskeyword?

          With the default Python stuff, "." is not part of iskeyword, and
          pressing * does not include any dot.

          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
        Your message has been successfully submitted and would be delivered to recipients shortly.