LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Accidentally pressed 2 keys - What did I do? How do I undo it? (https://www.linuxquestions.org/questions/linux-newbie-8/accidentally-pressed-2-keys-what-did-i-do-how-do-i-undo-it-574529/)

split917 08-03-2007 11:58 AM

Accidentally pressed 2 keys - What did I do? How do I undo it?
 
Running version is Red Hat Enterpise Linux ES release 3 (Taroon Update 8)

I went into VI mode to edit a file. I was scrolling through the file first before going into input mode. I accidentally pressed the SHIFT and 3/# keys (not the keys on the numeric keypad). So it highlighted (in yellow) all instances of a word found in the file. I pressed the combination again hoping that it would undo the action, but it ended up highlighting all instances of the next word. I exited out using ":q!". I went back into the file using VI to see if it was gone, but it wasn't. I exited again. I did a cat command on the file and it didn't show any higlighted text.

So my questions are: What did I do exactly? How can undo this action so that nothing is highlighted?

Thanks in advance for any comments.

Danny

acid_kewpie 08-03-2007 12:28 PM

it's just a highlight taking the current word on the cursor as input, nothing to worry about. it's only still there in vi as vi saves that to it's own config file. the original file is utterly fine.

split917 08-03-2007 02:13 PM

thanks chris! so how can i remove the highlight? is there another combination of keys i can hit to remove it? thanks again.

danny

pwc101 08-03-2007 02:15 PM

Search for something which isn't in the file:
Code:

/asfddsa
then hit enter, and you're text should appear normal again. I haven't found a more elegant way of doing that though!

split917 08-03-2007 03:49 PM

that did the trick. thanks a lot for the quick replies.

danny

cojo 08-05-2007 09:45 AM

do this in command mode within vi :nohl should do the trick.


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