Vim problems on Centos-4

2006-07-09 Thread dave--uk

I used to use RH9 and was VERY happy with three features of vim (6.1.320)
1) almost everything was syntax highlighted, including, for example, httpd.conf.
2) when i edited a file, vim remembered the last position I was at
3) the help worked

Having moved to Centos-4 (RHEL) (vim 6.3.046) none of these work any more.

I do get some syntax highlighting - for example of .cpp files - but
.conf files etc don't get highlighted anymore, and no file positions
are remembered.

When I try to use help I get something like

 "quickref.txt.gz" [readonly][noeol] 83L, 20610C
 E434: Can't find tag pattern

then quickref.txt.gz is loaded binary.

I've tried to find the cause myself by comparing the vimrc files etc,
and by searching google, but not found any answers.  I even found and
installed v7 (from the rpm at
http://www.karan.org/blog/index.php/2006/05/10/p139) but this gives
exactly the same issues.

I have the following vim packages installed:
vim-common.i386  2:7.0.000-2.el4.kb installed
vim-enhanced.i3862:7.0.000-2.el4.kb installed
vim-minimal.i386 2:7.0.000-2.el4.kb installed

Any ideas?

TIA

Dave


Re: Vim problems on Centos-4

2006-07-09 Thread Yakov Lerner

On 7/10/06, dave--uk <[EMAIL PROTECTED]> wrote:

I used to use RH9 and was VERY happy with three features of vim (6.1.320)
1) almost everything was syntax highlighted, including, for example, httpd.conf.
2) when i edited a file, vim remembered the last position I was at
3) the help worked

Having moved to Centos-4 (RHEL) (vim 6.3.046) none of these work any more.

I do get some syntax highlighting - for example of .cpp files - but
.conf files etc don't get highlighted anymore, and no file positions
are remembered.

When I try to use help I get something like

  "quickref.txt.gz" [readonly][noeol] 83L, 20610C
  E434: Can't find tag pattern

then quickref.txt.gz is loaded binary.

I've tried to find the cause myself by comparing the vimrc files etc,
and by searching google, but not found any answers.  I even found and
installed v7 (from the rpm at
http://www.karan.org/blog/index.php/2006/05/10/p139) but this gives
exactly the same issues.

I have the following vim packages installed:
vim-common.i386  2:7.0.000-2.el4.kb installed
vim-enhanced.i3862:7.0.000-2.el4.kb installed
vim-minimal.i386 2:7.0.000-2.el4.kb installed


You binary installation of vim seems to be
bad/bogus/broken/befuddled. (may be even bedeviled).

I recommend to install vim from sources. This is best. This
is also easy. You need gcc installed.  Then, (download
tgz from http://www.vim.org/download.php#unix,
./configure && make && make install), or follow
instructions on http://www.vim.org/download.php#unix

If you, for some reason, can't build & install from sources, then
you can try binary rpms found on rpmfind.net.
My guess is that many of rpms of over distros, listed
on rpmfind.net, are installable on your distro, because
vim generally has little external dependencies. But this is
only an option if you can't build & install from sources,
see above.

Yakov


Re: Vim problems on Centos-4

2006-07-10 Thread dave--uk

I'm not really convinced that is the problem.  Nothing really points to it.

1) Syntax highlighting does work for some files - if it was the build
it wouldn't work at all.
2) Not remembering the file positions sounds like a configuration switch.
3) The help files being opened binary, rather than uncompressed on the
fly, along with the associated message, strongly suggests this is a
config problem.
4) I've used multiple binary builds, from different sources, all
giving exactly the same issues.
5) It seems so unlikely that the official Centos-4 build of vi -
Centos is basically RHEL - is radically broken.  Vi is pretty basic
stuff.  I don't believe RH would ship and not fix a broken vi.

If necessary I can build from source, but it's not my first choice!

On 7/10/06, Yakov Lerner <[EMAIL PROTECTED]> wrote:

On 7/10/06, dave--uk <[EMAIL PROTECTED]> wrote:
> I used to use RH9 and was VERY happy with three features of vim (6.1.320)
> 1) almost everything was syntax highlighted, including, for example, 
httpd.conf.
> 2) when i edited a file, vim remembered the last position I was at
> 3) the help worked
>
> Having moved to Centos-4 (RHEL) (vim 6.3.046) none of these work any more.
>
> I do get some syntax highlighting - for example of .cpp files - but
> .conf files etc don't get highlighted anymore, and no file positions
> are remembered.
>
> When I try to use help I get something like
>
>   "quickref.txt.gz" [readonly][noeol] 83L, 20610C
>   E434: Can't find tag pattern
>
> then quickref.txt.gz is loaded binary.
>
> I've tried to find the cause myself by comparing the vimrc files etc,
> and by searching google, but not found any answers.  I even found and
> installed v7 (from the rpm at
> http://www.karan.org/blog/index.php/2006/05/10/p139) but this gives
> exactly the same issues.
>
> I have the following vim packages installed:
> vim-common.i386  2:7.0.000-2.el4.kb installed
> vim-enhanced.i3862:7.0.000-2.el4.kb installed
> vim-minimal.i386 2:7.0.000-2.el4.kb installed

You binary installation of vim seems to be
bad/bogus/broken/befuddled. (may be even bedeviled).

I recommend to install vim from sources. This is best. This
is also easy. You need gcc installed.  Then, (download
tgz from http://www.vim.org/download.php#unix,
./configure && make && make install), or follow
instructions on http://www.vim.org/download.php#unix

If you, for some reason, can't build & install from sources, then
you can try binary rpms found on rpmfind.net.
My guess is that many of rpms of over distros, listed
on rpmfind.net, are installable on your distro, because
vim generally has little external dependencies. But this is
only an option if you can't build & install from sources,
see above.

Yakov



Re: Vim problems on Centos-4

2006-07-10 Thread Yakov Lerner

On 7/10/06, dave--uk <[EMAIL PROTECTED]> wrote:

2) when i edited a file, vim remembered the last position I was at


For this to work, you need certain definitions in your ~/.vimrc.

1) You need some definition for 'viminfo' option, for example:

   set viminfo='20,<50,s10,:20,h
   ( does not need to be exactly like this. See :help 'viminfo')

2) You need specific BufReadPost autocommand in your ~/.vimrc,
which looks like this:

:au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe
"normal g'\"" | endif

or like this:

 autocmd BufReadPost *
   \ if line("'\"") > 0 && line("'\"") <= line("$") |
   \   exe "normal g`\"" |
   \ endif

or like this:

if has("autocmd")
"...
 augroup vimrcEx
 au!
"...
 autocmd BufReadPost *
   \ if line("'\"") > 0 && line("'\"") <= line("$") |
   \   exe "normal g`\"" |
   \ endif

 augroup END
" ...
endif

Yakov


Re: Vim problems on Centos-4

2006-07-11 Thread Benji Fisher
 Do not have too much faith in RH.  Several years ago, they included
an alpha version of vim (6.0z, I think) in their release, and linked it
to /bin/vi (or maybe /usr/bin/vi ).  The last time I checked, the system
vimrc file they included was seriously crufty.

 Have a look at the system vimrc files on the two systems.  (See the
end of the :version message for where these are, or the start of
:scriptnames .)  That should explain wuestion (2) from your original
post, and maybe others.  It will also give you a chance to decide for
yourself whether I am right about the cruft.

 As a first step toward figuring out the highlighting problems, try

:verbose set ft? syntax?

in a file where it works and one where it does not.

HTH --Benji Fisher

On Mon, Jul 10, 2006 at 09:28:59AM +0100, dave--uk wrote:
> I'm not really convinced that is the problem.  Nothing really points to it.
> 
> 1) Syntax highlighting does work for some files - if it was the build
> it wouldn't work at all.
> 2) Not remembering the file positions sounds like a configuration switch.
> 3) The help files being opened binary, rather than uncompressed on the
> fly, along with the associated message, strongly suggests this is a
> config problem.
> 4) I've used multiple binary builds, from different sources, all
> giving exactly the same issues.
> 5) It seems so unlikely that the official Centos-4 build of vi -
> Centos is basically RHEL - is radically broken.  Vi is pretty basic
> stuff.  I don't believe RH would ship and not fix a broken vi.
> 
> If necessary I can build from source, but it's not my first choice!
> 
> On 7/10/06, Yakov Lerner <[EMAIL PROTECTED]> wrote:
> >On 7/10/06, dave--uk <[EMAIL PROTECTED]> wrote:
> >> I used to use RH9 and was VERY happy with three features of vim (6.1.320)
> >> 1) almost everything was syntax highlighted, including, for example, 
> >httpd.conf.
> >> 2) when i edited a file, vim remembered the last position I was at
> >> 3) the help worked
> >>
> >> Having moved to Centos-4 (RHEL) (vim 6.3.046) none of these work any 
> >more.
> >>
> >> I do get some syntax highlighting - for example of .cpp files - but
> >> .conf files etc don't get highlighted anymore, and no file positions
> >> are remembered.
> >>
> >> When I try to use help I get something like
> >>
> >>   "quickref.txt.gz" [readonly][noeol] 83L, 20610C
> >>   E434: Can't find tag pattern
> >>
> >> then quickref.txt.gz is loaded binary.
> >>
> >> I've tried to find the cause myself by comparing the vimrc files etc,
> >> and by searching google, but not found any answers.  I even found and
> >> installed v7 (from the rpm at
> >> http://www.karan.org/blog/index.php/2006/05/10/p139) but this gives
> >> exactly the same issues.
> >>
> >> I have the following vim packages installed:
> >> vim-common.i386  2:7.0.000-2.el4.kb installed
> >> vim-enhanced.i3862:7.0.000-2.el4.kb installed
> >> vim-minimal.i386 2:7.0.000-2.el4.kb installed
> >
> >You binary installation of vim seems to be
> >bad/bogus/broken/befuddled. (may be even bedeviled).
> >
> >I recommend to install vim from sources. This is best. This
> >is also easy. You need gcc installed.  Then, (download
> >tgz from http://www.vim.org/download.php#unix,
> >./configure && make && make install), or follow
> >instructions on http://www.vim.org/download.php#unix
> >
> >If you, for some reason, can't build & install from sources, then
> >you can try binary rpms found on rpmfind.net.
> >My guess is that many of rpms of over distros, listed
> >on rpmfind.net, are installable on your distro, because
> >vim generally has little external dependencies. But this is
> >only an option if you can't build & install from sources,
> >see above.
> >
> >Yakov
> >


Re: Vim problems on Centos-4

2006-07-11 Thread dave--uk

In the end I found the problem - and this did help, but not as I expected.

It was actually in /etc/profile.d/vim.*.  If the uid>100 vi is aliased
to vim (so I get all the nice features) otherwise it's not and I dont.
That's why I sometimes got the nice stuff and sometimes didn't.  RH9
did a simple alias.

Now I know, I can just change it.  But ... why only alias for uid>100?
Maybe they asumed that anyone using uid<0 knows what they are doing
(so types vim not vi) :)

Thanks all the same.



On 7/11/06, Benji Fisher <[EMAIL PROTECTED]> wrote:

 Do not have too much faith in RH.  Several years ago, they included
an alpha version of vim (6.0z, I think) in their release, and linked it
to /bin/vi (or maybe /usr/bin/vi ).  The last time I checked, the system
vimrc file they included was seriously crufty.

 Have a look at the system vimrc files on the two systems.  (See the
end of the :version message for where these are, or the start of
:scriptnames .)  That should explain wuestion (2) from your original
post, and maybe others.  It will also give you a chance to decide for
yourself whether I am right about the cruft.

 As a first step toward figuring out the highlighting problems, try

:verbose set ft? syntax?

in a file where it works and one where it does not.

HTH --Benji Fisher

On Mon, Jul 10, 2006 at 09:28:59AM +0100, dave--uk wrote:
> I'm not really convinced that is the problem.  Nothing really points to it.
>
> 1) Syntax highlighting does work for some files - if it was the build
> it wouldn't work at all.
> 2) Not remembering the file positions sounds like a configuration switch.
> 3) The help files being opened binary, rather than uncompressed on the
> fly, along with the associated message, strongly suggests this is a
> config problem.
> 4) I've used multiple binary builds, from different sources, all
> giving exactly the same issues.
> 5) It seems so unlikely that the official Centos-4 build of vi -
> Centos is basically RHEL - is radically broken.  Vi is pretty basic
> stuff.  I don't believe RH would ship and not fix a broken vi.
>
> If necessary I can build from source, but it's not my first choice!
>
> On 7/10/06, Yakov Lerner <[EMAIL PROTECTED]> wrote:
> >On 7/10/06, dave--uk <[EMAIL PROTECTED]> wrote:
> >> I used to use RH9 and was VERY happy with three features of vim (6.1.320)
> >> 1) almost everything was syntax highlighted, including, for example,
> >httpd.conf.
> >> 2) when i edited a file, vim remembered the last position I was at
> >> 3) the help worked
> >>
> >> Having moved to Centos-4 (RHEL) (vim 6.3.046) none of these work any
> >more.
> >>
> >> I do get some syntax highlighting - for example of .cpp files - but
> >> .conf files etc don't get highlighted anymore, and no file positions
> >> are remembered.
> >>
> >> When I try to use help I get something like
> >>
> >>   "quickref.txt.gz" [readonly][noeol] 83L, 20610C
> >>   E434: Can't find tag pattern
> >>
> >> then quickref.txt.gz is loaded binary.
> >>
> >> I've tried to find the cause myself by comparing the vimrc files etc,
> >> and by searching google, but not found any answers.  I even found and
> >> installed v7 (from the rpm at
> >> http://www.karan.org/blog/index.php/2006/05/10/p139) but this gives
> >> exactly the same issues.
> >>
> >> I have the following vim packages installed:
> >> vim-common.i386  2:7.0.000-2.el4.kb installed
> >> vim-enhanced.i3862:7.0.000-2.el4.kb installed
> >> vim-minimal.i386 2:7.0.000-2.el4.kb installed
> >
> >You binary installation of vim seems to be
> >bad/bogus/broken/befuddled. (may be even bedeviled).
> >
> >I recommend to install vim from sources. This is best. This
> >is also easy. You need gcc installed.  Then, (download
> >tgz from http://www.vim.org/download.php#unix,
> >./configure && make && make install), or follow
> >instructions on http://www.vim.org/download.php#unix
> >
> >If you, for some reason, can't build & install from sources, then
> >you can try binary rpms found on rpmfind.net.
> >My guess is that many of rpms of over distros, listed
> >on rpmfind.net, are installable on your distro, because
> >vim generally has little external dependencies. But this is
> >only an option if you can't build & install from sources,
> >see above.
> >
> >Yakov
> >



Re: Vim problems on Centos-4

2006-07-15 Thread A.J.Mechelynck

dave--uk wrote:

In the end I found the problem - and this did help, but not as I expected.

It was actually in /etc/profile.d/vim.*.  If the uid>100 vi is aliased
to vim (so I get all the nice features) otherwise it's not and I dont.
That's why I sometimes got the nice stuff and sometimes didn't.  RH9
did a simple alias.

Now I know, I can just change it.  But ... why only alias for uid>100?
Maybe they asumed that anyone using uid<0 knows what they are doing
(so types vim not vi) :)

Thanks all the same.



When booting in single-user mode (usually for system repairs or some 
such), /usr (where the executable "vim" from the vim-enhanced rpm 
resides) might not even be mounted. (Only / is guaranteed to be mounted, 
and it is expected that /bin and /sbin [but not necessarily /usr/bin or 
/usr/sbin, even less /usr/X11R6/bin which contains the "gvim" executable 
from the vim-X11 rpm] will be on the same filesystem as / ). So root 
must use (at least when booting in single-user mode) the "vi" executable 
which is a bare-bones vim from the vim-minimal rpm. Other users may use 
the "vim" (vim-enhanced) or "gvim" (vim-x11) binaries.



Best regards,
Tony.


Re: Vim problems on Centos-4

2006-07-15 Thread A.J.Mechelynck

Yakov Lerner wrote:

On 7/10/06, dave--uk <[EMAIL PROTECTED]> wrote:

2) when i edited a file, vim remembered the last position I was at


For this to work, you need certain definitions in your ~/.vimrc.

1) You need some definition for 'viminfo' option, for example:

   set viminfo='20,<50,s10,:20,h
   ( does not need to be exactly like this. See :help 'viminfo')

2) You need specific BufReadPost autocommand in your ~/.vimrc,
which looks like this:

:au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe
"normal g'\"" | endif

or like this:

 autocmd BufReadPost *
   \ if line("'\"") > 0 && line("'\"") <= line("$") |
   \   exe "normal g`\"" |
   \ endif

or like this:

if has("autocmd")
"...
 augroup vimrcEx
 au!
"...
 autocmd BufReadPost *
   \ if line("'\"") > 0 && line("'\"") <= line("$") |
   \   exe "normal g`\"" |
   \ endif

 augroup END
" ...
endif

Yakov




... and you also need an executable which can handle autocommands and 
expression evaluation. On Redhat-like systems, there may be up to three 
Vim executables per version on a single system:


"/bin/vi", from the vim-minimal rpm, a bare-bones "tiny version" Vim 
with no autocommands, no arithmetic evaluation, no syntax highlighting, 
nothing at all that can be omitted at compile-time. This executable is 
guaranteed to be on a mounted filesystem even when booting for 
"emergency repairs" in syngle-user mode. Being mounted even at runlevel 
1 or S is its sole redeeming feature IMHO.


"/usr/bin/vim", from the vim-enhanced rpm, a "big" version without GUI. 
This one will be available in multiuser runlevels even if X11 isn't up 
(as in runlevels 2 or 3)


"/usr/X11R6/bin/gvim", from the vim-X11 rpm, a "big" or "huge" version 
with GUI enabled. This one is particularly useful at runlevel 5 
(multiuser with X11).



Best regards,
Tony.