LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-12-2012, 09:11 AM   #1
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Rep: Reputation: 48
Turn off yellow highlighting in vi


On one of my servers, every time I go to vi my smb.conf, there's a pattern of numbers that is always highlighted yellow. Assuming somehow I did a search or something by accident, but every time i go into this file, those numbers are always highlighted yellow now. How can i turn that off?
 
Old 07-12-2012, 09:21 AM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,561

Rep: Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127
I'm sure there's a more "correct" way, but usually I just do a search for jibberish to turn that off. Forward slash to search, then type in something like "hdgwvohdbshfi". It'll say there were no matches, then the highlighting will be gone.
 
1 members found this post helpful.
Old 07-12-2012, 09:29 AM   #3
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Original Poster
Rep: Reputation: 48
"correct" or not, that worked! that was driving me nuts haha. I wonder what the "correct" way is, maybe I won't mark this as solved quite yet to see if anyone else chimes in with that. Thanks eggroll.
 
Old 07-12-2012, 10:25 AM   #4
slimm609
Member
 
Registered: May 2007
Location: Chas, SC
Distribution: slackware, gentoo, fedora, LFS, sidewinder G2, solaris, FreeBSD, RHEL, SUSE, Backtrack
Posts: 430

Rep: Reputation: 67
the correct way to turn it off is ":nohl" and it stands for no highlight
 
1 members found this post helpful.
Old 07-12-2012, 10:47 AM   #5
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Original Poster
Rep: Reputation: 48
Thanks. Any idea why that would get stuck on inside the file though for that search? Also, whats the shortcut to turn that on? Just trying to understand, and figure out what I accidentally typed to get it to stick like that.
 
Old 07-12-2012, 10:51 AM   #6
slimm609
Member
 
Registered: May 2007
Location: Chas, SC
Distribution: slackware, gentoo, fedora, LFS, sidewinder G2, solaris, FreeBSD, RHEL, SUSE, Backtrack
Posts: 430

Rep: Reputation: 67
when you search for something like "/test" in a file it will highlight when it finds it. you are using VIM and it keeps history and persists things between usages.
another example of the setting saved is if you open a long file and scroll to the middle of the file then close and reopen it should put you back in the same position. based on the .vimrc in your home directory decides what persists through the sessions.
 
2 members found this post helpful.
Old 07-12-2012, 11:02 AM   #7
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi all

I use references from here to play with the settings
and from here where you can enable/disable Last known cursor position.
 
1 members found this post helpful.
Old 07-12-2012, 11:20 AM   #8
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Original Poster
Rep: Reputation: 48
Cool, thanks for all the help everyone. Think i'm all set now.
 
Old 07-12-2012, 11:54 AM   #9
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
well,
here's a lot more of VIM configurations.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I hear I can turn my Sony Ply stn 3 into a mini supercomputer with Linux Yellow Dog? mixhypnatist Linux - Software 7 01-21-2011 02:21 PM
How do I turn off the Yellow Dog Linux 6.2 screen saver? Psychokillaz Linux - General 5 06-11-2010 09:24 PM
My CnMBook Manual page 5 shows how to turn off on desk top, but how do I turn on? salmagundi Linux - Newbie 2 04-04-2009 03:46 PM
How to start, stop, turn on, and turn off deamons BuckRogers01 Debian 3 08-16-2005 10:39 AM
How to turn off Xserver in the gui and turn it off in the command line geminiviper Linux - Newbie 8 08-20-2004 09:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration