Re: Upgrading or enabling features in vim

2007-01-16 Thread A.J.Mechelynck

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" comman

Re: Upgrading or enabling features in vim

2007-01-15 Thread Gary Johnson
On 2007-01-15, Erin Spiceland <[EMAIL PROTECTED]> 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. ...

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

[...]

> 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 for the extra info.  I think I understand what's going on a 
little better now.  I just logged on to a system running Red Hat 
Enterprise Linux ES release 3 (Taroon Update 8).  It happens to have 
vim installed on it in /usr/bin, but it also has /bin/vi.  I ran 
"/bin/vi -u NONE" (to keep it from choking on my ~/.vimrc), saw that 
it was Vim-6.3.81, and executed ":version".  There I saw this:

Compiled by <[EMAIL PROTECTED]>
Tiny version without GUI.
...
   system vimrc file: "/etc/vimrc"
 user vimrc file: "$HOME/.vimrc"
  user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"

I think this is Red Hat's minimal vi that they include so that the 
user has something to edit with even if /usr is not mounted.  So 
that's where your /etc/vimrc came from.  I would just leave that one 
alone.

I then ran "/usr/bin/vim -u NONE", also Vim-6.3.81, and again 
executed ":version" with this result:

Compiled by <[EMAIL PROTECTED]>
Huge version without GUI.
...
   system vimrc file: "/etc/vimrc"
 user vimrc file: "$HOME/.vimrc"
  user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"

So it appears that Red Hat uses the same initialization file for 
both /bin/vi and /usr/bin/vim.  I took a look at /etc/vimrc and 
found that it contained the commands to set 'nocompatible' ('nocp'),
to restore the last cursor position when editing a file, and to set 
the color commands for an xterm, among others.

The features you are used to having are not part of the default 
installation of vim from vim.org.  They are usually compiled into 
the binary by the default configure and make process, but they must 
also be configured and enabled in your initialization file(s).  Red 
Hat's vim rpm includes an initialization file but the default 
installation of vim from vim.org does not.  You have to provide 
those yourself.

So, to get a vim with these features enabled, you could either:

-  remove your current vim install and install the Red Hat vim 
   rpm instead, which knows to look in /etc/vimrc; or

-  retain your current vim install and copy /etc/vimrc to 
   /usr/local/share/vim/vimrc.

HTH,
Gary

-- 
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED]

Re: Upgrading or enabling features in vim

2007-01-15 Thread Erin Spiceland
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



Re: Upgrading or enabling features in vim

2007-01-15 Thread Gary Johnson
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

-- 
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Wireless Division
 | Spokane, Washington, USA


Re: Upgrading or enabling features in vim

2007-01-15 Thread Gary Johnson
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.

HTH,
Gary

-- 
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Wireless Division
 | Spokane, Washington, USA


Re: Upgrading or enabling features in vim

2007-01-15 Thread Evan Klitzke
On Mon, 2007-01-15 at 15:43 -0500, Erin Spiceland 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:

Just as a reminder, if you use :version you can find out what options
vim was compiled with. This should help you enable features that you
have on your existing servers, but might not have been compiled in on
your new server.

-- 
Evan Klitzke



Re: Upgrading or enabling features in vim

2007-01-15 Thread Tim Chase

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.


These two sound like your $TERM setting isn't getting properly 
configured, or your vimrc is trying to override your terminal's 
setting.


It would help to know what

echo $TERM

returns in your shell, and what

:echo $TERM

returns from within Vim.  Theoretically, they should match ;)


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.


These sound a bit like your "cp" option is off (often shows up as 
#5 but might also trigger #3 and #4).  There might also be some 
issues with your viminfo settings.  I'd compare them against your 
old box's settings if you still have it around, so you can tell 
what has changed.


With a little more info regarding the above settings, it should 
be pretty easy to diagnose.


-tim




Upgrading or enabling features in vim

2007-01-15 Thread Erin Spiceland
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?

Erin