[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: highlighting in Vi

Karthik Vishwanath wrote:
> I apologise if this is not exactly an installation question. If these are
> not appreciated on this list, then can someone please guide to a list
> where I can take these questions?
> I recently upgraded to 6.2, and vim now highlights my searches (with /,
>:s, :g etc.). I dislike this behaviour and want to turn it off. Or,
> change the color of highlighting, cursor color, etc. I use syntax=on in
> my configuration of vim. Any suggestions to where I tweak around?

The way in vi (or vim) to see all of the current settings has always been
the following:


When I do a :set, I see the following settings of vim:

--- Options ---
  autoindent          complete=.,b,u,i    scroll=24           ttyfast
  backspace=2         history=50          secure              ttymouse=xterm
  backup              incsearch           showcmd             viminfo='20,"50
  backupdir=~/tmp,.   ruler               smartindent    

The only one of these that deal with searching is "incsearch".  To turn
any command off, all you have to do is prepend a "no" before the attribute
and it'll be turned off.  For this one, it'd be:


If you need to know more about any of the setting attitributes, all you've
got to do in "vim" is to enter:

   :help settingname

When doing it for "incsearch", the following is the output:

                 *'incsearch'* *'is'* *'noincsearch'* *'nois'*

'incsearch' 'is'        boolean (default off)
                        {not in Vi}
                        {not available when compiled without the
                        |+extra_search| feature}
        While typing a search pattern, show immediately where the so far
        typed pattern matches.  The matched string is highlighted.  If the
        pattern is invalid or not found, nothing is shown.  The screen will
        be updated often, this is only useful on fast terminals.  Note that
        the match will be shown, but the cursor is not actually positioned
        there.  You still need to finish the search command with <CR> to move
        the cursor.  The highlighting can be set with the 'i' flag in
        'highlight'.  See also: 'hlsearch'.
        NOTE: This option is reset when 'compatible' is set.         

Besides the paragraph of information, we see there are aliases to the 
setting "incsearch" being "is" and "noincsearch" is "nois".  So, if you
wanted to turn this attribute/setting off, you could also enter:

   :set nois

... and it'd work just as effectively.

Also, if there are options in vi/vim that you regularly are turning off and
turning on as your normal preferences, while in vi/vim do a:

    :help exrc  -or-   :help vimrc

... to look up how to store these parameters in a file in your home directory
so that it'll work the same all of the time each time for you.

Tyler Nally
|                                                                              |
| Tyler Nally                Sr Programmer Analyst          phone 317.817.7077 |
| tnally iquest net          InformIT.com                     fax 317.817.7232 |
| tyler nally informit com   Macmillan USA Inc.             voice 317.261.4700 |
|                            Indianapolis, IN 46290                   ext.7777 |
|                                                                              |
|    "It said ... `Requires Windows 95 or better' ... so I installed Linux"    |
|                                                                              |

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]