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

gvim 7 highlight search string

Expand Messages
  • Brian E. Lozier
    In the old gvim, doing a search (/something) highlights all something in red. In gvim 7, it doesn t highlight all occurrences. Is there a way to turn this
    Message 1 of 6 , Jun 1, 2007
    View Source
    • 0 Attachment
      In the old gvim, doing a search (/something) highlights all
      "something" in red. In gvim 7, it doesn't highlight all occurrences.
      Is there a way to turn this back on?

      Thanks!
    • Tim Chase
      ... It sounds like in the process, a vimrc (system-wide?) was changed. You don t mention your distro/OS, so it s hard to help there. However, in your
      Message 2 of 6 , Jun 1, 2007
      View Source
      • 0 Attachment
        > In the old gvim, doing a search (/something) highlights all
        > "something" in red. In gvim 7, it doesn't highlight all occurrences.
        > Is there a way to turn this back on?

        It sounds like in the process, a vimrc (system-wide?) was
        changed. You don't mention your distro/OS, so it's hard to help
        there.

        However, in your $HOME/.vimrc (or _vimrc on Win32), you can
        simply add the line

        set hls

        to turn on highlighting your searches by default.

        If you just want to turn it on for a current session, you can use
        it as an Ex command:

        :set hls

        or toggle it with

        :set hls!

        Using this method, it's not preserved across runs of Vim though
        (which is what the vimrc is for).

        -tim
      • fREW
        ... If Brian is running Ubuntu that could have happened. When I mentioned on the list how updating changes default (to Ubuntu) behavior this was another
        Message 3 of 6 , Jun 1, 2007
        View Source
        • 0 Attachment
          On 6/1/07, Tim Chase <vim@...> wrote:
          > > In the old gvim, doing a search (/something) highlights all
          > > "something" in red. In gvim 7, it doesn't highlight all occurrences.
          > > Is there a way to turn this back on?
          >
          > It sounds like in the process, a vimrc (system-wide?) was
          > changed. You don't mention your distro/OS, so it's hard to help
          > there.
          >
          > However, in your $HOME/.vimrc (or _vimrc on Win32), you can
          > simply add the line
          >
          > set hls
          >
          > to turn on highlighting your searches by default.
          >
          > If you just want to turn it on for a current session, you can use
          > it as an Ex command:
          >
          > :set hls
          >
          > or toggle it with
          >
          > :set hls!
          >
          > Using this method, it's not preserved across runs of Vim though
          > (which is what the vimrc is for).
          >
          > -tim
          >
          >
          >
          >

          If Brian is running Ubuntu that could have happened. When I mentioned
          on the list how updating changes default (to Ubuntu) behavior this was
          another symptom (I think.)

          --
          -fREW
        • Charles E Campbell Jr
          ... I suspect that you may be having problems because you made changes to files in files in your former $VIMRUNTIME (use :echo $VIMRUNTIME when running vim to
          Message 4 of 6 , Jun 1, 2007
          View Source
          • 0 Attachment
            Brian E. Lozier wrote:

            > In the old gvim, doing a search (/something) highlights all
            > "something" in red. In gvim 7, it doesn't highlight all occurrences.
            > Is there a way to turn this back on?

            I suspect that you may be having problems because you made changes to
            files in
            files in your former $VIMRUNTIME (use :echo $VIMRUNTIME when running vim to
            see where that is). Those files should not be changed, added to, etc,
            unless
            you don't mind having to re-do all such changes when next you upgrade vim.

            Instead:

            * put settings, most customizations, etc in
            $HOME/.vimrc (linux)
            $HOME\_vimrc (windows)

            You can find out where your $HOME is by typing
            :echo $HOME
            when you're running vim.

            * Put plugins into
            $HOME/.vim/plugin/ (linux)
            $HOME\vimfiles\plugin\ (windows)

            * Put autoload plugins into
            $HOME/.vim/autoload/ (linux)
            $HOME\vimfiles\autoload\ (windows)

            * Put colorschemes into
            $HOME/.vim/colors/ (linux)
            $HOME\vimfiles\colors\ (windows)

            The setting in question here is: hls
            You'll probably should include the following in your .vimrc (_vimrc), too:

            set nocp
            if version >= 600
            filetype plugin indent on
            endif

            Regards,
            Chip Campbell
          • Brian E. Lozier
            Thanks all for the replies. I have a relatively fresh install of Debian Testing. I don t believe I have manually modified any system-level configuration
            Message 5 of 6 , Jun 2, 2007
            View Source
            • 0 Attachment
              Thanks all for the replies. I have a relatively fresh install of
              Debian Testing. I don't believe I have manually modified any
              system-level configuration files. All my settings are in ~/.gvimrc
              and ~/.vimrc

              Actually this is happening on two systems. My debian testing system
              at home and my work machine which is running RHEL 4. I believe I
              compiled vim/gvim from source at work, although here at home I'm using
              the debian packaged one.

              > On 6/1/07, Charles E Campbell Jr <drchip@...> wrote:
              > > Brian E. Lozier wrote:
              > >
              > > > In the old gvim, doing a search (/something) highlights all
              > > > "something" in red. In gvim 7, it doesn't highlight all occurrences.
              > > > Is there a way to turn this back on?
              > >
              > > I suspect that you may be having problems because you made changes to
              > > files in
              > > files in your former $VIMRUNTIME (use :echo $VIMRUNTIME when running vim to
              > > see where that is). Those files should not be changed, added to, etc,
              > > unless
              > > you don't mind having to re-do all such changes when next you upgrade vim.
              > >
              > > Instead:
              > >
              > > * put settings, most customizations, etc in
              > > $HOME/.vimrc (linux)
              > > $HOME\_vimrc (windows)
              > >
              > > You can find out where your $HOME is by typing
              > > :echo $HOME
              > > when you're running vim.
              > >
              > > * Put plugins into
              > > $HOME/.vim/plugin/ (linux)
              > > $HOME\vimfiles\plugin\ (windows)
              > >
              > > * Put autoload plugins into
              > > $HOME/.vim/autoload/ (linux)
              > > $HOME\vimfiles\autoload\ (windows)
              > >
              > > * Put colorschemes into
              > > $HOME/.vim/colors/ (linux)
              > > $HOME\vimfiles\colors\ (windows)
              > >
              > > The setting in question here is: hls
              > > You'll probably should include the following in your .vimrc (_vimrc), too:
              > >
              > > set nocp
              > > if version >= 600
              > > filetype plugin indent on
              > > endif
              > >
              > > Regards,
              > > Chip Campbell
              > >
              > >
              > >
              >
            • Charles E Campbell Jr
              ... * do you have a $HOME/.vimrc file? (wasn t clear from your response; I wasn t referring to any manual modifications done to the new system level
              Message 6 of 6 , Jun 4, 2007
              View Source
              • 0 Attachment
                Brian E. Lozier wrote:

                > Thanks all for the replies. I have a relatively fresh install of
                > Debian Testing. I don't believe I have manually modified any
                > system-level configuration files. All my settings are in ~/.gvimrc
                > and ~/.vimrc
                >
                > Actually this is happening on two systems. My debian testing system
                > at home and my work machine which is running RHEL 4. I believe I
                > compiled vim/gvim from source at work, although here at home I'm using
                > the debian packaged one.
                >
                Charles Campbell wrote:

                >>
                >> The setting in question here is: hls
                >> You'll probably should include the following in your .vimrc (_vimrc),
                >> too:
                >>
                >> set nocp
                >> if version >= 600
                >> filetype plugin indent on
                >> endif
                >

                * do you have a $HOME/.vimrc file? (wasn't clear from your response; I
                wasn't referring to any manual modifications done to the new system
                level configuration files, but was wondering if your previous vim work
                depended on such manual modifications to the previous system level
                configuration files)
                * do you have (at least) the four lines mentioned above in your .vimrc
                file? (you'll probably want syntax on , too)
                * do you have set hls in your .vimrc file?
                * if you do have such a file, is it owned/readable by you? (some folks
                were having problems with $HOME/.viminfo files owned by root)
                * what does vim --version show? (I'm wondering here if its one of
                the minimal vim compiles)

                Regards,
                Chip Campbell
              Your message has been successfully submitted and would be delivered to recipients shortly.