[OT] Help with "vim" on Linux
Moderators: chulett, rschirm, roy
[OT] Help with "vim" on Linux
Working on my first Linux system where vi is actually vim or "Vi IMproved" under the covers and some of the so-called improvements are making me crazy. Two in particular and curious what my options are, if any:
1) It remembers where I was in every dang file from session to session and puts me back there when I vi it again. I would prefer to just start at the top, is there a setting for this?
2) Search highlighting. Fine, nice and all but how in the heck do you clear them? All I've been able to figure out to do is to then search for something I know it won't find. And it remembers them as well between sessions, exiting and coming back doesn't get rid the dang things.
Thanks.
1) It remembers where I was in every dang file from session to session and puts me back there when I vi it again. I would prefer to just start at the top, is there a setting for this?
2) Search highlighting. Fine, nice and all but how in the heck do you clear them? All I've been able to figure out to do is to then search for something I know it won't find. And it remembers them as well between sessions, exiting and coming back doesn't get rid the dang things.
Thanks.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Re: [OT] Help with "vim" on Linux
http://durgaprasad.wordpress.com/2007/0 ... m-solaris/chulett wrote:1) It remembers where I was in every dang file from session to session and puts me back there when I vi it again. I would prefer to just start at the top, is there a setting for this?
http://ubuntuforums.org/showthread.php?t=209136
So search for BufReadPost in your vimrc?
http://vim.wikia.com/wiki/Highlight_all ... rn_matcheschulett wrote:2) Search highlighting. Fine, nice and all but how in the heck do you clear them? All I've been able to figure out to do is to then search for something I know it won't find. And it remembers them as well between sessions, exiting and coming back doesn't get rid the dang things.
Perhaps rename your .vimrc, and build yours up from scratch?
http://stripey.com/vim/vimrc.html
http://www.vi-improved.org/vimrc.php
(There are others of course...Google for sample .vimrc files and steal and modify until you get one that works for you).
HTH...
Scott
Some people are the Michael Jordan's of Datastage. I'm more like Muggsy Bogues
Look for /etc/vimrc, /etc/vim/vimrc, or /usr/local/share/vim/vimrc.
Or do, then go get a cup of coffee
Or create ~/.vimrc, which should override any global settings.
should tell you which initialization files are used.
HTH
Or do
Code: Select all
find / -name vimrc
Or create ~/.vimrc, which should override any global settings.
Code: Select all
:scriptnames
HTH
Some people are the Michael Jordan's of Datastage. I'm more like Muggsy Bogues
Code: Select all
:nohlsearch
Code: Select all
:let @/ = ""
Supposedly unsetting the "hlsearch" option stops it from happening but I haven't figured out how to set it (have removed the hlsearch entry from .vimrc but still highlights for me... and .viminfo is telling me it is still set).
As for the line it opens on... haven't figured it out...
To always open a file on the first line, in the .vimrc file, change the "set viminfo=" line to have 0 after the single quote...
Or you could move back to using just vi as per previous comment... but where is the fun in that???
Edit: And to solve the highlighting, add a 'h' on to the viminfo line (remembering it is a comma separated list)
Or you could move back to using just vi as per previous comment... but where is the fun in that???
Edit: And to solve the highlighting, add a 'h' on to the viminfo line (remembering it is a comma separated list)
Yes, it is RH w/ bash and it's not like I'm typing "vim", I type vi and get vim instead so that unalias sounds like a godsend. I just figured my poor old brain-dead vi was gone for good. [sniff]asorrell wrote:If it is Redhat Linux, and you are getting vim when you type vi you can just "unalias vi" to get the original vi command. I'm colorblind, so vim drove me nuts. I just put the unalias vi command in my .bash_profile so it is turned off for me when I login.
And between putty and vim on RH, all of the colors have been a bit much - kind of like going from Kansas to Oz, if you know what I mean. I had to find a custom color scheme that 'worked' for me as the default one drove me nuts and the blue it used made anything blue illegible to me. Ended up with lighter 'desert' colors that are (mostly) palatable.
I'll let you know tomorrow! And sorry Kryt0n but I'm quite at home in vi and have no need for none of them there fancy improvements. One sec, be right back... Damn munchkins, get off my lawn!
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
If you are connecting to the R/Ht system from a Windows box, I like to use UltraEdit by IDM, It was cheap, can access files on the Unix/Linux remote box and becomes a 1 stop editing shop for me. Combined with my favorite File tool (FileCommander) I'm in pig heavin (one without a fllu though).
Just my effective 0 cents (2 cents rounded down because we don't use copper anymore)
Just my effective 0 cents (2 cents rounded down because we don't use copper anymore)
Andrew
Think outside the Datastage you work in.
There is no True Way, but there are true ways.
Think outside the Datastage you work in.
There is no True Way, but there are true ways.