Friday, July 23, 2010

Re: switching buffers problems on OpenSuse 11.2

On 23/07/10 06:13, Henry Hertz Hobbit wrote:
> When I am using vim on OpenSuse 11.2 and switch from one buffer to
> another I have already been in using the :rew or :n it has the very
> disturbing behavior of positioning the cursor at the bottom of the
> screen. At first I thought it was just a behavior that exists in an
> xterm but then I found it also exists in gvim as well. I finally
> mapped the following function keys to get rid of this strange behavior
> (this my entire ~/.vimrc file):
>
> set hlsearch
> set nobackup
> set nocompatible
> set noerrorbells
> set nowrapscan
> set showmatch
> set showmode
> map<F5> :n<CR>zz
> map<F6> :rew<CR>zz
> map<F7> :wn<CR>zz
> map<F8> :w!<CR>zz
> map<F12> :x!<CR>
> " set so=999
> behave xterm
>
> All they have are the following files in /etc:
>
> /etc/vimrc
> /etc/skel/.vimrc
>
> I cannot find what is doing it in the /etc/vimrc file. What do I need
> to do to turn this behavior of bottoming of the cursor off (other than
> using the preceding Fn keys)?. If nothing else this argues for Bram
> coming up with a standard that all Linux and Unix vendors should use
> for the /etc files to give a minimal standard for everybody to proceed
> from. Some turn on hlsearch (I prefer it) and some don't. I can
> clearly see that is something that is optional that should probably be
> off by default. That isn't the problem - I want all of these
> differences to disappear and not have something like this happen
> again.
>
> Or is it a bug that has been fixed? It doesn't happen on Ubuntu
> 10.04. Please send me a personal answer if at all possible since I
> only receive the Abridged summary.
>

"Bram's standard" applies if there is _no_ system vimrc. Any /etc/vimrc
(if that's the compioled-in place where your distro's Vim looks instead
of $VIM/vimrc) overrides Bram's defaults, often misguidedly.

I've had a look at the openSUSE /etc/vimrc, and I notice two things near
the end: one, which I'd say is misguided is that "the SuSE security team
requires 'nomodeline' to be unconditionally set" — not only when running
as root which has lately become the Vim default. The other is an
autocommand, copied from the $VIMRUNTIME/vimrc_example.vim (a "typical"
vimrc distributed with Vim, and which could be called "Bram's optional
standard for those who don't expressly want behaviour 'compatible' with
legacy vi"), and it moves the cursor to the "last known position"
whenever you open a file. If that last known position was at the very
bottom you'll be at the bottom of the window — there's nothing after
that in the file. If there is no last known position, it will by default
be at the top of the file, and that also means the top of the window. If
you've been looking at the contents of an existing file it could be at
any point in the file and in that case it will be near the middle of the
window. Don't you think that this "bring me back where I left off"
behaviour is useful? I do.


Best regards,
Tony.
--
New members urgently required for SUICIDE CLUB, Watford area.
-- Monty Python's Big Red Book

--
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: