Erin Spiceland wrote:
On Mon, 2007-01-15 at 15:39 -0800, Gary Johnson wrote:
On 2007-01-15, Erin Spiceland <[EMAIL PROTECTED]> wrote:
On Mon, 2007-01-15 at 14:55 -0800, Gary Johnson wrote:
On 2007-01-15, Erin Spiceland <[EMAIL PROTECTED]> wrote:
I just got a new server and vim wasn't installed. I installed 7.0 from
scratch, but there are some problems with missing features or features
not working:
1. syntax highlighting doesn't work. It is turned on in vimrc but I
haven't checked anything else.
2. using the arrows on the keyboard in insert mode puts A, B, C, or D
and newline into the file instead of moving up, down, left, or right.
3. doesn't remember my command history
4. doesn't remember where I was in the file when I closed it.
5. only remembers 1 change, so I can't use the "u" command to undo more
than 1 change.
What can I do to fix these problems or enable these features?
#5 indicates that, as Tim said, you have 'cp' set. But vim sets
'nocp' automatically when it detects and sources an initialization
file named .vimrc or _vimrc. Therefore, it appears that your vimrc
file is not being sourced, which would explain #1.
Executing :version will show you where your vim is looking for its
initialization files and :scriptnames will show you the
initialization files vim actually sourced. Reading
:help initialization
will also help you understand what should be happening when you
start vim and may help you track down the root problem.
system vimrc file: "$VIM/vimrc"
$VIM is set to "/usr/local/share/vim" but /usr/local/share/vim/vimrc
doesn't exist, and a vimrc does exist in /etc. How can I change it to
use /etc?
There is something wrong with your installation. If vim had never
before been installed on that server, then the only way for
/etc/vimrc to have appeared was for your installation process to
have created it. But if you configured vim to look for vimrc in
/usr/local/share/vim, then that's where your installation process
should have put it. The "right" place to put it depends on your
system and where you want to put stuff and, if you are not the
system administrator, where you are allowed to put stuff.
You'll have to give us more details of your system and how you
configured vim for us to sort this out properly.
You wrote originally that there were some features missing or not
working in this installation. That implies that you have used them
before where they did work. How did you get them to work then? Did
you have your own ~/.vimrc or just a system vimrc? If you had just
a system vimrc and that is the file now in /etc, I would just move
that file to /usr/local/share/vim. On the Unix systems where I have
installed vim, I don't even have a system vimrc--I just use
~/.vimrc.
There are also ways to set environment variables to get vim to look
in other places for initialization files, but since you built this
vim from scratch, it would be better for you to reconfigure and
rebuild it to get it right, or at least self-consistent.
The preferred replying style in the vim list is to put the quoted
text on top and your reply underneath, so I have reformatted your
reply to that style.
Also, don't forget to reply to the list rather than to just the
author of the message to which you are replying, so that everyone in
the list can follow the discussion and help in solving the problem,
or see that it has been solved.
Regards,
Gary
Thanks for the tips. This server was supposedly a fresh install of RHE.
I say that vim was not installed only because I tried to use it and got
the bash "command not found" message. I downloaded the source from
vim.org and did "./configure; make; make install." The machines I have
used vim on before were always preinstalled with vim. I use FC6 at home
and RHE on my other 4 servers. I've never worked with a vimrc
or .viminfo before, except very minimally. The five things I listed in
my original email were things that always just worked. I was very
surprised to find vim was not installed this time. "rpm -qa | grep vim
shows" that vim 6.3 minimal is also installed, but that isn't the one my
system is using, because vim --version shows 7.0. Are there any
configure options that I can use or is there an enhanced version that I
might be used to? Should I reinstall? from source or rpm?
Thanks,
Erin
To have Vim use a system vimrc located in /etc when compiled to use
/usr/share/vim as the default location, just create a soft link from one to
the other, as follows (in the shell):
cd /usr/share/vim
ln -sv /etc/vimrc
Or you may want to disregard that /etc/vimrc totally.
I suggest you create a .vimrc in your $HOME directory. As its initial
contents, the line
runtime vimrc_example.vim
will do. (Then you may view $VIMRUNTIME/vimrc_example.vim at your leisure, to
see what it does.) If and when you decide to tweak your Vim settings, you will
add additional lines below this ":runtime" command, except that if you want to
change the menu/messages languages, the ":language" command for it should be
placed before the line calling the vimrc_example. For instance, to force
English menus & messages regardless of the locale, you can add the following
at the very top of your vimrc:
if has("unix")
language messages C
else
language messages en
endif
Whether to reinstall from source or from rpm is a question of choice.
Installing from rpm is less work, but you should keep in mind that it adds
into the process an additional step of which you aren't the master, namely the
compilation process done by the Red Hat (or SuSE or...) admins. Therefore a
Vim installed from rpm will always somewhat "lag behind" the latest official
bugfixes.
To configure, compile and install Vim from source (on Unix/Linux), see my
HowTo page http://users.skynet.be/antoine.mechelynck/vim/compunix.htm
To install from rpm, you should make sure that your rpm files are all for the
same version of Vim. Then you can install two or more (or all) of the
following RPM packages:
vim-common
required whenever you install one or more of the following
vim-minimal
install a Vim with minimal ("tiny") features. The executable is called "vi"
and has nothing that can be disabled at compile-time. In particular, it has
neither expression evaluation nor syntax highlighting. Its only advantage is
that it is guaranteed always to be "mounted", even when you boot in
single-user mode to repair system problems.
vim-enhanced
install a Vim with most features enabled except the GUI. The executable is
called "vim".
vim-x11
install a full-featured Vim with GUI. The executable is called "gvim". Unless
you boot into X11 (or otherwise start X11), this one is of course "no better"
than the previous one.
Best regards,
Tony.