Friday, December 9, 2011

Re: How can I keep vim from keeping context

On 2011-12-09, Bruce wrote:
> I've been annoyed by it for years, but maybe it has become more
> aggressive.
>
> I *HATE* colors because I cannot read blue on black or yellow on
> white.
> Those colors are all too common.
>
> I *HATE* finding myself in the middle of a file because several months
> ago I
> edited the same file and that is where I left off.
>
> VIM is waaaay too smart for its own good.
>
> Yesterday, I googled the answer to shutting down VIM's memory:
>
> set viminfo='0,:0,<0,@0,f0,/0'
>
> cool except that vim responded with, "I saw that in your vimrc file,
> and
> I do know what you want to do, but I am not going to honor it because
> you left off something or other (and I won't tell you what)."
>
> OK, not quite true, but this is true:
>
> > Error detected while processing /old-home/bkorb/.vimrc:
> > line 39:
> > E527: Missing comma: viminfo='0,:0,<0,@0,f0,/0'
> > Press ENTER or type command to continue
>
> and adding a comma yields another error and fixing that goes back to
> this.
> Entirely equivalent to "I won't tell you what."
>
> Morals to the story:
>
> 1. Clear error messages are crucial
> 2. How do I tell VIM that I want it to be a stupid (non-fancy) text
> editor?

Those fancy features are not enabled by Vim itself when Vim starts
but are enabled by some configuration file. You can see a list of
those files with

:scriptnames

The one causing your problems is probably the first one, which is
probably

/etc/vimrc

or

/usr/share/vim/vimrc

depending on who supplied your copy of Vim. The providers of some
Linux distributions try to make Vim as "friendly" as they can by
configuring a lot of stuff for you. If their choice of settings
matches your expectations, great. If not, some of their settings
can be a pain to cancel. That's one reason I always build my own
Vim.

To turn off colors, put this in your ~/.vimrc:

syntax off

Stopping jumping to the last place the file was edited is a little
more complicated because it is performed by an autocommand. Here is
what I used to stop it on a Fedora 11 system:

if exists("#fedora#BufRead#*")
au! fedora BufRead *
endif

Your

set viminfo='0,:0,<0,@0,f0,/0'

contains a syntax error. Vim is not a mind reader--it doesn't know
what you meant to write, so it tells you what it knows. In this
case, that first single quote is a flag, not an opening quote, so
the error is the extra single quote at the end. The following is
syntactically correct but I didn't check the values.

set viminfo='0,:0,<0,@0,f0,/0

That's probably not what you want anyway if all you want to do is
not have colors and not jump to the last location.

HTH,
Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: