Vim 9 problem under Cygwin64

49 views
Skip to first unread message

John Cordes

unread,
Feb 16, 2024, 4:46:45 PMFeb 16
to vim...@googlegroups.com
I'm hoping someone can help with a problem. I've had cygwin64 installed for at least a couple of years, with Vim v8 running just fine. I also have Windows Vim running; this is all under Win 10.
 I've just updated the cygwin64 installation and vim is now v9.0. When I start the cygwin vim I get these lines:

===========================
Error detected while processing /etc/vimrc:
line   90:
E484: Can't open file C:UsersOwner_vim/vim90/syntax/syntax.vim
Error detected while processing /home/Owner/.vimrc:
line    6:
E484: Can't open file C:UsersOwner_vim/vim90/syntax/syntax.vim
Press ENTER or type command to continue
===========================

Pressing ENTER allows me to continue, editing files, etc. but not surprisingly with no syntax highlighting.

:echo $VIMRUNTIME = C:\Users\Owner\_vim/vim90
Note the mixed up forward and backward slashes in that path. Note also the lack of slashes in the paths reported above as E484. 

 It seems clear that there is some sort of clash between Unix and Windows path conventions going on but I haven't been able to figure out how to fix it.

The file syntax.vim does exist and is in the right location (I think):
$ ls -l /usr/share/vim/vim90/syntax/syntax.vim
-rw-r--r-- 1 Owner Administrators 1.4K Dec 20 01:57 /usr/share/vim/vim90/syntax/syntax.vim

vim --version includes these lines:
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Dec 20 2023 06:57:02)
Included patches: 1-2155
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
 
One more item:
:scriptnames
  1: /etc/vimrc
  2: ~/.vimrc
  3: ~/.vim/keymap/insert_only_capslock.vim
  4: ~/.vim/bufferlist.vim
  5: ~/.vim/plugin/matchit.vim

Thanks for any help!

John Cordes


Salman Halim

unread,
Feb 16, 2024, 5:11:41 PMFeb 16
to Vim Users
This may be too simple, but have you tried changing the environment variables variables to have forward slashes instead of back slashes?

Salman

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/QB1PR01MB29933933E4C6D2C0145DDA0B9E4C2%40QB1PR01MB2993.CANPRD01.PROD.OUTLOOK.COM.

John Cordes

unread,
Feb 16, 2024, 5:18:39 PMFeb 16
to vim...@googlegroups.com
Thanks for the thought. In Cygwin echo $PATH shows all forward slashes. Did you mean to somehow edit things like $VIMRUNTIME? I'm not sure how that would be done.

John


Salman Halim

unread,
Feb 16, 2024, 5:43:10 PMFeb 16
to Vim Users
In my Windows environment, VIM and VIMRUNTIME are regular environment variables that I can edit like any others. If that doesn't work, maybe they're defined in your shell's RC file?

Salman

John Cordes

unread,
Feb 16, 2024, 5:47:07 PMFeb 16
to vim...@googlegroups.com
I tried something based on your original suggestion:

$ export VIM=/usr/share/vim

which seems to 'work' (no longer any interruption when opening a file with vim, and syntax highlighting is working). How would I set this to always be implemented whenever cygwin is run?

Thanks,
John


John Cordes

unread,
Feb 16, 2024, 6:09:18 PMFeb 16
to vim...@googlegroups.com
My apologies for too many posts! I have added the export VIM command to cygwin's .bash_profile; I believe that should do the trick.
Many thanks to Salman Halim for the suggestion.
John Cordes

Gary Johnson

unread,
Feb 16, 2024, 6:55:03 PMFeb 16
to vim...@googlegroups.com
On 2024-02-16, John Cordes wrote:
> My apologies for too many posts! I have added the export VIM command to
> cygwin's .bash_profile; I believe that should do the trick.
> Many thanks to Salman Halim for the suggestion.

I'm glad you and Salman got this working, and that is the most
important thing. However, I did want to mention, in case anyone
else reads this, that setting VIM in your ~/.bashrc should not be
necessary.

I've been running Cygwin and Cygwin64 for many years on Windows 10
and 11, using Windows' gvim, Cygwin's vim, and vims I've built
myself under Cygwin, and I've never had to do that. There's a root
cause that hasn't been uncovered yet; I just don't have the time at
the moment to help with an investigation.

Regards,
Gary

John Cordes

unread,
Feb 16, 2024, 8:34:59 PMFeb 16
to vim...@googlegroups.com
 Thanks for your comment, Gary. I was certainly very surprised that such a workaround would be necessary, and wondered what might be going wrong 'under the hood'. In fact, in the course of my lengthy searching on the web for advice on the problem, I saw an intriguing post from you (probably from a good many years ago) about something quite similar where I think you were saying that you had a different way of handling the combination of cygwin and windows so didn't need to fuss with an issue which somebody was experiencing. Sorry, that's just my vague recollection, and I've now closed all the tabs I had open in my searches.
 For now I'm relieved to have some sort of a fix, even though it may be a bit 'dirty'. A deeper understanding of what is causing the problem would be good to learn about—someday.

John Cordes


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages