FS#20778 - [vi] replace ex-vi with vi from busybox.

Attached to Project: Arch Linux
Opened by Florian Pritz (bluewind) - Wednesday, 08 September 2010, 14:32 GMT
Last edited by Stéphane Gaudreault (stephane) - Wednesday, 16 February 2011, 21:49 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Tobias Kieslich (tobias)
Thomas Bächler (brain0)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No


vi is more or less unusable and buggy whereas busybox vi is working quite well. busybox also has a lot of tools which might come in handy when there are library problems (busybox is static) and it's small.

Please replace vi in core with busybox (all features, not stripped down) and generate a symlink vi -> busybox.
This task depends upon

Closed by  Stéphane Gaudreault (stephane)
Wednesday, 16 February 2011, 21:49 GMT
Reason for closing:  Won't fix
Additional comments about closing:  We examined all option for VI replacement. None are satisfactory.

http://mailman.archlinux.org/pipermail/a rch-dev-public/2011-February/019368.html
Comment by Thomas Bächler (brain0) - Wednesday, 08 September 2010, 17:40 GMT
busybox configured to be only vi:

shared: 43KB (links to libc.so.6 only)
static: 653KB

Attaching the busybox .config file for this build. An alternative would be to use the mkinitcpio-busybox binary, but that has some useful features disabled (namely Unicode, iirc).

I'd like to hear what Tobias thinks here - anyway, nobody seems happy with ex-vi.
   .config (28.6 KiB)
Comment by Dan McGee (toofishes) - Wednesday, 08 September 2010, 18:26 GMT
I don't agree with the "all features not stripped down" part if that was meant to get busybox on every system, but a vi-only build of busybox used as the system vi seems fine to me.
Comment by Florian Pritz (bluewind) - Wednesday, 08 September 2010, 19:12 GMT
Okay, a vi-only build is fine too.
Comment by Tobias Kieslich (tobias) - Wednesday, 08 September 2010, 20:48 GMT
I don't think I'll have objections here, if that's what people are happy with. I saw one config, the 8bit one, how does the busybox vi play with encodings? Anyone has experiences?

And here seems to be the list of limitations:
* It does not support all common vi commands.
* It does not support the '!' command to execute a child process and capture its output
* It also lacks the normal vi crash recovery feature.
* It always assumes a vt102 type terminal (emulator)
* Only very few settings are configurable via :set
* .exrc configuration and configuration via environment variables are not supported
* Line marks are not correctly adjusted if lines are inserted or deleted before the mark.
* Only whole-line undo (uppercase 'U'), no last-change undo (lowercase 'u') is supported.
* Search is done case-insensitive.
* Command-counts need to prefix a command, and
* command counts for a, c, d, i, r, y and several other commands are not supported.
* Ex commands are not supported.

some stuff is serious though: command count (At least I use that a lot, and there are some build scripts or at least used to be that use ex-commands, they would then require vim?)
Comment by Thomas Bächler (brain0) - Wednesday, 08 September 2010, 21:40 GMT
I see that busybox-vi might not be the best solution.

Tobias, another question: Why did we drop nvi in favor of ex-vi? I find ex-vi very hard to use, but I'm ususally not a vi user - I only use it when nothing else is available.
Comment by Tobias Kieslich (tobias) - Wednesday, 08 September 2010, 22:11 GMT
unicode support, or better the lack thereof. It was either not existent or after patching buggy at best; all together really annoying.

Here is my take on it:
The original purpose of all of that, and I think it still holds up, was to ship a reasonable small vi with the (very) core of Archlinux. This is a minimum, mainly to say we have it, to make it compliant. There are only a few viable solutions out of it:
- stick with the minimalistic ex-vi. Cumbersome but bearable. If you need more, install vim but I wouldn't wanna have the (huge!) vim runtime in core
- stick vi built from the vim sources into core. this vi is small and quite usable but the runtime that comes with it is huge (>30 MB after deflation, IIRC) (we had that before, the second downside is that every (g)vim is held up by the testing for the core vi package)
- built a custom minimized vi from vim sources with a custom stripped runtime. That means building a compliment runtime for the actual vim. That's a lot and cumbersome work - leave alone error prone. Did someone say, Debian?
- find a better minimalistic and maintained!! vi clone. Altogether, I think busybox is too limited over ex-vi, but might be less buggy. I can't say. I just install vim where I need it but I get by with ex-vi if I have too.
Comment by Florian Pritz (bluewind) - Wednesday, 08 September 2010, 22:49 GMT
- ex-vi sometimes fails to exit and loops, which can be quite annoying. Only way to get rid of it is t use kill (from an other terminal).

- Our current vim + vim-runtime is just under 30MB, but I admit that's huge. Maybe we can let the vim package replace vi and create a symlink so if you can vim installed it gets used instead of ex-vi. Already happened to me that some program started vi (forgot to set $EDITOR; $EDITOR got removed by su -l; ..) and sometimes the bug I mentioned earlier appeared.

- building vi from the vim source is too much work imho

Currently I believe the best solution is to either not change anything or let vim replace vi. (conflicts=vi; provides=vi; symlink)
Comment by (Lavandero) - Monday, 06 December 2010, 08:59 GMT
whats wrong with nvi?
Comment by Karol Błażewicz (karol) - Monday, 10 January 2011, 01:07 GMT
@ Lavandero
Thomas Bächler (brain0) asked the same question https://bugs.archlinux.org/task/20778#comment65858

How about vim-slim https://github.com/BlackIkeEagle/herecura/tree/master/herecura-stable/vim

./configure --prefix=/usr --localstatedir=/var/lib/vim \
--mandir=/usr/share/man --with-compiledby=ArchLinux \
--with-features=tiny --disable-gpm --enable-acl --with-x=no \
--disable-gui --enable-multibyte --disable-cscope \
--disable-netbeans --disable-perlinterp --disable-pythoninterp \
--disable-rubyinterp --enable-luainterp=no

Download Size : 381,44 K
Installed Size : 1000,00 K

It doesn't need the vim-runtime.

Is it too big? How to make it play nice with vim (full edition)/gvim?