Red Hat Bugzilla – Bug 77007
/etc/profile.d/vim.* breaks compatible functionality
Last modified: 2007-04-18 12:48:03 EDT
Description of Problem:
Vim, good-naturedly, behaves very much like traditional vi if you call it as "vi" including, but not limited to, not slathering my terminal with colored text. But Every RH 7.x system I just checked (and, I presume, RH 8 as well) installs /etc/profile.d/vim.[c]sh, which does nothing more than alias vi to vim, completely breaking Vim's compatible behavior.
Is the presumption that a new user will be able to deal just fine with a moded editor as long as they have context coloring? Does that actually make sense to *anyone*?
Please, when I say "vi", give me vi, and when I say "vim", give me Vim.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Install a fresh RH system, choose "Everything" package option.
3. `which vi`
$ which vi
$ which vi
While I'm at it, vim.sh is COMPLETELY wrong-headed. It says this:
if echo $SHELL |grep bash 2>&1 >/dev/null; then # aliases are bash only
First, not all shells *set* $SHELL, so you lose and do the wrong thing if it's not set. Checking ARGV would be the best choice.
Second, the comment is flat-out wrong (unless it's meant to imply that Red Hat default files only *set* aliases for shells that are bash, though that's also untrue). The only Bourne-derived shell that doesn't have aliases is real sh (and you're shipping an sh that's actually bash anyway). ksh, ash, zsh... all of these use exactly the same format for alias definition.
Granted, I wouldn't want to see this changed and the file left; it's saving me from getting this silly alias set in my regular user accounts, since I use the Z shell there, but it seems mighty remiss to have default system files stating outright false information.
The current vim.sh looks quite different and checks for BASH_VERSION and
KSH_VERSION. I've added a check for ZSH_VERSION.
I don't see how this resolution specifically addresses the real problem:
You're removing functionality from Vim by forcing vi to be an alias for vim.
Is that behavior gone in Rawhide?
(I'd check for myself, but I can't seem to find Rawhide tagged sources anywhere
in sources.redhat.com. Sorry, I'm used to NetBSD, where cvsweb gets me an easy
answer for "what's current". Are RH sources even available.)
As near as I can tell, this "feature" is the result of a commit on 02 Jun 2001
by email@example.com, because "too many people complained about missing features
in vi even though I installed vim-enhanced".
I understand why you caved, but you're wrong to. Vim installs itself a certain
way because people who know what they're doing expect to get vi when they say
vi and expect to get Vim when they say vim. Why is Red Hat catering to the
lowest common denominator on this? The documentation of this behavior is plenty
clear in Vim's man page.
You're wrong here. By setting the vi alias to vim, you get all the functionality
of vim, you don't loose it.
You're right that Bero added this behaviour because too many people complained
and I agree with his decision. Most people really want vim with all its features,
/bin/vi was intended for sysadmin tasks where /usr wasn't mounted and such things.
If you want the plain, minimal /bin/vi, please feel free to
- remove /etc/profile.d/vim* or
- remove the vim-enhanced package or
- start /bin/vi instead of 'vi'
Guess I'll be switching all my production systems to Debian.
Thanks for your time!