Find the answer to your Linux question:
Results 1 to 3 of 3
Hey guys, I am new here and looking to get more familiar with Linux. I recently decided to study c programming, and I am using the vi editor under Redhat. ...
  1. #1
    Just Joined! BlkJack's Avatar
    Join Date
    Apr 2010
    Posts
    2

    [SOLVED] my vi settings are messed up! HELP

    Hey guys, I am new here and looking to get more familiar with Linux. I recently decided to study c programming, and I am using the vi editor under Redhat. But the other day I did a fat finger at my #include header file in the vi editor and now all words "include" are all highlighted blue; if i type in another include as soon as I finish the word it automatically highlights blue. How can I undo this?

    Thanks for any help!

  2. #2
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    You may have pressed the '*' key. '*' means to search for all occurrences of the word currently under the cursor.

    There is a setting in vi called hlsearch that causes all occurrences of a word that is being searched for to highlight, so that they're easy to find. To turn it off is simple, just run the command:
    Code:
    :set nohl
    Note that the next time you run a search, the words will highlight again, and you will have to run :set nohl to turn it off again. To prevent words from ever highlighting, you can run the command:
    Code:
    :set highlight clear Search
    DISTRO=Arch
    Registered Linux User #388732

  3. #3
    Just Joined! BlkJack's Avatar
    Join Date
    Apr 2010
    Posts
    2
    Thanks for the help, you put me right on track! Now I can focus on c programming again.

    I guess commands vary a bit from distro or version? since I had to use:

    Code:
    : noh

    Thanks again!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...