public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* /usr/bin/vi: errors parsing .vim files from vim-common package
@ 2023-12-16 20:11 John Hein
  2023-12-18 19:42 ` Lee
  0 siblings, 1 reply; 4+ messages in thread
From: John Hein @ 2023-12-16 20:11 UTC (permalink / raw)
  To: cygwin

I just updated vim packages (including vim-minimal and vim-common) to 9.0.2155-1

Now when I run 'vi', I get this:

Error detected while processing /usr/share/vim/vim90/filetype.vim:
line   11:
E319: Sorry, the command is not available in this version: let did_load_filetypes = 1
line   14:
E319: Sorry, the command is not available in this version: let s:cpo_save = &cpo
line   48:
E319: Sorry, the command is not available in this version: func s:StarSetf(ft)
line   52:
E319: Sorry, the command is not available in this version: endfunc
line 2941:
E319: Sorry, the command is not available in this version: func TestFiletypeFuncs(testlist)
 .
 .
and so on.


Running '/usr/bin/vim' does not produce those errors (not surprisingly).  This happens even if I use 'env HOME=/ /usr/bin/vi' (just to try to remove home dir dot files from the question).

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: /usr/bin/vi: errors parsing .vim files from vim-common package
  2023-12-16 20:11 /usr/bin/vi: errors parsing .vim files from vim-common package John Hein
@ 2023-12-18 19:42 ` Lee
  2023-12-18 20:25   ` matthew patton
  2023-12-19  2:09   ` Marco Atzeri
  0 siblings, 2 replies; 4+ messages in thread
From: Lee @ 2023-12-18 19:42 UTC (permalink / raw)
  To: John Hein; +Cc: cygwin

tl,dr:  Did vi/vim change from /etc/alternatives to an alias?

$ ls -l $(which vi) $(which vim)
-rwxr-xr-x 1 root Administrators 1507859 Dec 12 09:07 /usr/bin/vi.exe
-rwxr-xr-x 1 root Administrators 3565587 Dec 12 09:07 /usr/bin/vim.exe

$ alias vi
alias vi='vim'


On Sat, Dec 16, 2023 at 3:11 PM John Hein wrote:
>
> I just updated vim packages (including vim-minimal and vim-common) to 9.0.2155-1

I've got the same version installed
$ grep '^vi' cygcheck-srv_2023-12-17.txt
vim                                     9.0.2155-1                    OK
vim-common                              9.0.2155-1                    OK
vim-minimal                             9.0.2155-1                    OK

> Now when I run 'vi', I get this:
>
> Error detected while processing /usr/share/vim/vim90/filetype.vim:
> line   11:
  <.. snip ..>
> and so on.

I can duplicate the problem by

cd /tmp
touch f1 f2
vi f1
:sh
vi f2

 ... and I get the same thing:
Error detected while processing /usr/share/vim/vim90/filetype.vim:
line   11:
E319: Sorry, the command is not available in this version: let
did_load_filetypes = 1
line   14:
  ... etc.


Tracking down bash startup processing is not my thing, so I could be wrong but

/etc/profile has this bit:
    for file in /etc/profile.d/*.$1; do
      [ -e "${file}" ] && . "${file}"
    done

and /etc/profile.d/vim.sh has this bit:
if [ -n "$BASH_VERSION" -o -n "$KSH_VERSION" -o -n "$ZSH_VERSION" ]; then
  # for bash and zsh, only if no alias is already set
  alias vi >/dev/null 2>&1 || alias vi=vim
fi

So I end up with
$ alias | grep ' vi'
alias vi='vim'

and vi works in the shell but gives all those errors in a sub shell - eg
vi /tmp/f1
  -------- no error messages
bash
vi /tmp/f1
  -------- lots of error messages

Regards,
Lee

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: /usr/bin/vi: errors parsing .vim files from vim-common package
  2023-12-18 19:42 ` Lee
@ 2023-12-18 20:25   ` matthew patton
  2023-12-19  2:09   ` Marco Atzeri
  1 sibling, 0 replies; 4+ messages in thread
From: matthew patton @ 2023-12-18 20:25 UTC (permalink / raw)
  To: John Hein, Lee; +Cc: cygwin

[-- Attachment #1: Type: text/plain, Size: 293 bytes --]

<quote>and /etc/profile.d/vim.sh has this bit:
if [ -n "$BASH_VERSION" -o -n "$KSH_VERSION" -o -n "$ZSH_VERSION" ]; then
  # for bash and zsh, only if no alias is already set
  alias vi >/dev/null 2>&1 || alias vi=vim
fi
</quote>
someone needs to be smacked good and hard for that.
  

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: /usr/bin/vi: errors parsing .vim files from vim-common package
  2023-12-18 19:42 ` Lee
  2023-12-18 20:25   ` matthew patton
@ 2023-12-19  2:09   ` Marco Atzeri
  1 sibling, 0 replies; 4+ messages in thread
From: Marco Atzeri @ 2023-12-19  2:09 UTC (permalink / raw)
  To: cygwin

On 18/12/2023 20:42, Lee via Cygwin wrote:
> tl,dr:  Did vi/vim change from /etc/alternatives to an alias?
> 
> $ ls -l $(which vi) $(which vim)
> -rwxr-xr-x 1 root Administrators 1507859 Dec 12 09:07 /usr/bin/vi.exe
> -rwxr-xr-x 1 root Administrators 3565587 Dec 12 09:07 /usr/bin/vim.exe
> 

they are two different binaries

$ ls -l vi vim
-rwxr-xr-x 1 marco None 1.5M Dec 12 13:58 vi
-rwxr-xr-x 1 marco None 3.5M Dec 12 13:58 vim

 > $ alias vi
 > alias vi='vim'
 >


$ grep -rH alias .
./profile.d/vim.csh:alias vi vim
./profile.d/vim.fish:alias vi vim
./profile.d/vim.sh:  # for bash and zsh, only if no alias is already set
./profile.d/vim.sh:  alias vi >/dev/null 2>&1 || alias vi=vim

it is the default if both vi and vim are installed
and it was in the cygwin package by long time


> On Sat, Dec 16, 2023 at 3:11 PM John Hein wrote:
>>
>> I just updated vim packages (including vim-minimal and vim-common) to 9.0.2155-1
> 
> I've got the same version installed
> $ grep '^vi' cygcheck-srv_2023-12-17.txt
> vim                                     9.0.2155-1                    OK
> vim-common                              9.0.2155-1                    OK
> vim-minimal                             9.0.2155-1                    OK
> 
>> Now when I run 'vi', I get this:
>>
>> Error detected while processing /usr/share/vim/vim90/filetype.vim:
>> line   11:
>    <.. snip ..>
>> and so on.

is you use /usr/bin/vi, you will bypass the alias and
hitting the same problem

  /usr/bin/vi is loading plugin intended only for vim

I will need some time to dig in the issue

Regards
Marco





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-19  2:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-16 20:11 /usr/bin/vi: errors parsing .vim files from vim-common package John Hein
2023-12-18 19:42 ` Lee
2023-12-18 20:25   ` matthew patton
2023-12-19  2:09   ` Marco Atzeri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).