Hi,

I think I found a problem in the Cygwin package vim.
The same symptom has been reported earlier to both vim and Cygwin, but I think 
the problem has not yet been found.
https://sourceware.org/pipermail/cygwin/2025-January/257202.html
https://github.com/vim/vim/issues/17039


REPRODUCTION:
1. Install Cygwin and add package vim. I have:
  $ cygcheck -c | grep vim
  vim                  9.1.1054-1                   OK
  vim-common           9.1.1054-1                   OK
  vim-doc              9.1.1054-1                   OK
  vim-minimal          9.1.1054-1                   OK

2. Run 'view'. this gives many errors:
  $ view
  Error detected while processing /usr/share/vim/vim91/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)
etc.


PROBLEM:
Package vim-minimal installs 'tiny' vim and some symlinks:
  usr/bin/ex -> vi.exe
  usr/bin/rvi -> vi.exe
  usr/bin/rview -> vi.exe
  usr/bin/vi.exe
  usr/bin/view -> vi.exe

Package vim and vim-common install 'huge' vim and filetype.vim:
  /usr/share/vim/vim91/filetype.vim
Tiny vim will attempt to read this file, but it has no builtin support for it.

Perhaps an ideal solution would make tiny vim start without errors, but I don't 
see how that is feasible.
I don't want to uninstall vim-minimal because it is a default package for 
Cygwin.
Also, I think it would not solve the problem, it would just remove the commands 
ex, rvi, rview, view.


Package 'vim' hides tiny 'vi' with with an alias to run vim instead:
  $ cat /etc/profile.d/vim.sh
  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

However, there are no aliases for ex, rvi, rview, view.
These commands will still run tiny vim and report errors about filetype.vim.
  $ view --version | grep " Features included"
  Tiny version without GUI.  Features included (+) or not (-):


PROPOSED SOLUTION:
Package vim should provide aliases for ex, rvi, rview, view in 
/etc/profile.d/vim.sh:
  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

    alias ex    >/dev/null 2>&1 || alias ex=vim -e
    alias rvi   >/dev/null 2>&1 || alias rvi=vim -Z
    alias rview >/dev/null 2>&1 || alias rview=vim -RZ
    alias view  >/dev/null 2>&1 || alias view=vim -R
  fi

(See :help vim-arguments)
Also update and vim.csh and vim.fish.


WORKAROUND:
I temporarily added these aliase to my .bashrc.


Regards,
Coen


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