On 08/18/13 00:31, Alan wrote:
I'm using Vim 6.3.46 (with no update possibilities) on a machine where I do not
have my own login. I'm starting vim via alias vi='vim'.
There's no .vim.rc afaik (is there a way to verify this, or discovr what config
file vim is using?). The default config is OK except I always want line numbers
so I'd like to configure vim with -u myvim.rc
The default config file isn't .vim.rc but .vimrc (in the $HOME
directory) with no dot other than at the start -- this can be changed at
compile time but it usually isn't. To check it, look at the middle
section of the output of the :version command, or of "vim --version
|less" without the quotes at the shell prompt.
But if I do use a config file vim behaves differently:
- without myvim.rc I can be in insert mode and move around a file with the cursor keys
(staying in insert mode). There's also a status "Insert" visible at bottom of
screen.
- with myvim.rc (which contains only 'set nu') using cursor keys drops me out of insert mode. For
the left-arrow key there's a message "E388 Couldn't find a definition" but the other
cursor keys don't give messages. Also there is never a status "Insert" shown.
Maybe there is a vimrc in your home directory after all. Once Vim has
started,
:echo $MYVIMRC
will tell you (in most cases) which init script (if any) it has used.
See :help $MYVIMRC for details.
There might also be a "system vimrc". Its location ($VIM/vimrc by
default, but that _is_ often changed at compile time) is also shown in
the middle section of the :version output. If there is one, it is also
usually the first script sourced by Vim, before your vimrc, so that it
appears at the very top of the output of the :scriptnames command (see
:help :scriptnames).
How do I keep the "default" behavior and also turn line numbering on?
Or how do I configure that behavior in myvim.rc?
I recommend adding the line
runtime vimrc_example.vim
near the start of your vimrc. This, however, will change many settings
(giving them values which IMHO are more useful then the "vim default").
It will also set the (recommended) 'nocompatible' setting, which will
already be set if Vim has found a ~/.vimrc at the default location, but
not if you use the -u command-line switch to tell Vim where your vimrc
is located.
You may have a look at that script by doing
:view $VIRUNTIME/vimrc_example.vim
-----------------------
This whole stuff (including the E388) sounds to me as if there were a
mapping defined somewhere for the arrow keys. Try the following:
:verbose map! <Left>
:verbose map! <Right>
:verbose map! <Up>
:verbose map! <Down>
where <Left> <Right> etc. are as I wrote them (text between < and >),
not just hitting ← ↓ ↑ or →.
Thanks
Alan
Best regards,
Tony.
--
When in doubt, tell the truth.
-- Mark Twain
--
--
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
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.