This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: [RFC] vim-minimal in Base?
- From: Frank Fesevur <ffes at users dot sourceforge dot net>
- To: cygwin-apps at cygwin dot com
- Date: Mon, 20 May 2013 11:48:51 +0200
- Subject: Re: [RFC] vim-minimal in Base?
- References: <5191AF60 dot 3030305 at users dot sourceforge dot net> <5191E2A4 dot 9010305 at etr-usa dot com> <20130514075946 dot GA23074 at calimero dot vinschen dot de> <51920568 dot 1000102 at users dot sourceforge dot net> <20130514112705 dot GA5737 at calimero dot vinschen dot de> <5199DDF4 dot 8090506 at users dot sourceforge dot net>
2013/5/20 Yaakov (Cygwin/X):
> Basically, if you want features, keep using vim. Otherwise, ex/vi
> (vim-minimal) provides the basic POSIX functionality. The big change is
> that vi != vim anymore.
>
>> Apart from that, I guess calling vi (and that's what *many* users are
>> used to) will now result in the same error Frank reported.
>
> The workaround will be to use ~/.virc with vi.
But why vi != vim? alternatives fixes this on Debian/Ubuntu. Why not
use it on Cygwin?
vim-7.3.762 used a update-alternative in its postinstall script when
there was no conflict (at least not on my setup with X). But
vim-7.3.943 doesn't have it anymore. alternatives is in base, it is
made to solve these kinds of conflicts. Why did you stop using it now
that the conflict really started to happen?
Letting the postinstall scripts return with the proper priority fixes
the problem. It works perfectly when I run it manually. The command
"vi" is always available and automatically uses the best version of
vim.
My steps:
renamed vi.exe to vim-minimal.exe
renamed vim.exe to vim-nox.exe
Run these commands: (add as postinstall scripts):
/usr/sbin/update-alternatives \
--install /usr/bin/vim vim /usr/bin/vim-minimal.exe 10 \
--slave /usr/bin/vi vi /usr/bin/vim-minimal.exe \
--slave /usr/bin/view view /usr/bin/vim-minimal.exe \
--slave /usr/bin/vimdiff vimdiff /usr/bin/vim-minimal.exe \
--slave /usr/bin/rvim rvim /usr/bin/vim-minimal.exe \
--slave /usr/bin/rview rview /usr/bin/vim-minimal.exe
/usr/sbin/update-alternatives \
--install /usr/bin/vim vim /usr/bin/vim-nox.exe 30 \
--slave /usr/bin/vi vi /usr/bin/vim-nox.exe \
--slave /usr/bin/view view /usr/bin/vim-nox.exe \
--slave /usr/bin/vimdiff vimdiff /usr/bin/vim-nox.exe \
--slave /usr/bin/rvim rvim /usr/bin/vim-nox.exe \
--slave /usr/bin/rview rview /usr/bin/vim-nox.exe
Now vi links to the best vim available.
$ /usr/sbin/update-alternatives --display vim
vim - status is auto.
link currently points to /usr/bin/vim-nox.exe
/usr/bin/vim-minimal.exe - priority 10
slave rview: /usr/bin/vim-minimal.exe
slave rvim: /usr/bin/vim-minimal.exe
slave vi: /usr/bin/vim-minimal.exe
slave view: /usr/bin/vim-minimal.exe
slave vimdiff: /usr/bin/vim-minimal.exe
/usr/bin/vim-nox.exe - priority 30
slave rview: /usr/bin/vim-nox.exe
slave rvim: /usr/bin/vim-nox.exe
slave vi: /usr/bin/vim-nox.exe
slave view: /usr/bin/vim-nox.exe
slave vimdiff: /usr/bin/vim-nox.exe
Current `best' version is /usr/bin/vim-nox.exe.
Add the corresponding preremove scripts:
/usr/sbin/update-alternatives --remove vim /usr/bin/vim-minimal.exe
/usr/sbin/update-alternatives --remove vim /usr/bin/vim-nox.exe
Are there any reasons not to use this?
Regards,
Frank