[SOLVED] Tell vim to FORGET WHAT I LAST SEARCHED FOR!
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
On one of my CentOS 7 servers I accidentally executed a search (? in command mode) in vim while editing /etc/fstab. The couple of characters I accidentally searched for were highlighted as expected. Unexpectedly and annoyingly those two characters are highlighted in every file I open in vim on that machine - provided the characters are present in the file of course.
I have found a lot of references to the search capabilities of vim but nothing about finishing the search and getting on with business. So the question is...
That would certainly do the trick. I was looking for something "built in" which I had overlooked. For my next trick I decided to figure out where vim saved its "history." Seems it is in ~/.viminfo. Wow! What a bunch of crap it stores. Almost as bad as browser history. I cleared the item titled "# Last Search Pattern:" and that seemed to do the trick. There is also a section with search history going back how far I do not know as I do not use search in vim except by accident or in the test. Unbelievable.
Thank you dejank! That does the trick exactly. It seems from my further searching that :noh is short for :nohlsearch which make sense.
I am taking a Red Hat admin course at the local community college - just something to do, I am RETIRED The course is delving into vim deeper than I typically use it but only scratching the surface from what I am finding with my research. It is a tremendously full featured and complicated program. yum tells me the installed size of the package is 2.2 MB. By comparison, Wordstar on my Osborne CP/M computer fit on a 180 KB diskette with room for CP/M and some data files. Wordstar was a fully functional word processor AND a great program editor. I wonder if we are really moving forward?
Ken
p.s. I wonder if I can find a CP/M emulator? And my old Wordstar software?
... It is a tremendously full featured and complicated program. yum tells me the installed size of the package is 2.2 MB. By comparison, Wordstar on my Osborne CP/M computer fit on a 180 KB diskette with room for CP/M and some data files. Wordstar was a fully functional word processor AND a great program editor. I wonder if we are really moving forward?
...
I wouldn't worry too much about that
Code:
sudo apt-get remove atom
The following packages will be REMOVED:
atom
0 upgraded, 0 newly installed, 1 to remove and 27 not upgraded.
After this operation, 243 MB disk space will be freed.
If you find vim useful, combining it with YouCompleteMe will reach a whole new level, allowing for a lot of autocompletion.
Fortunately I do not have atom installed on my CentOS 7 machines nor on a couple of Ubuntu Mate 16.14 virtual machines. I do not know what it is and probably don't want to know
By comparison, Wordstar on my Osborne CP/M computer fit on a 180 KB diskette with room for CP/M and some data files. Wordstar was a fully functional word processor AND a great program editor. I wonder if we are really moving forward?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.