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

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to