Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 77007

Summary: /etc/profile.d/vim.* breaks compatible functionality
Product: [Retired] Red Hat Linux Reporter: grosen
Component: vimAssignee: Karsten Hopp <karsten>
Status: CLOSED WONTFIX QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: mct
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-11-12 15:43:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description grosen 2002-10-30 21:24:10 UTC
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):


How Reproducible:

every time

Steps to Reproduce:
1. Install a fresh RH system, choose "Everything" package option.
2. login
3. `which vi`

Actual Results:

$ which vi
alias vi='vim'

Expected Results:

$ which vi

Additional Information:

While I'm at it, is COMPLETELY wrong-headed. It says this:

if echo $SHELL |grep bash 2>&1 >/dev/null; then # aliases are bash only
        alias vi=vim

First, not all shells *set* $SHELL, so you lose and do the wrong thing if it's not set. Checking ARGV[0] 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.

Comment 1 Karsten Hopp 2002-11-12 13:54:48 UTC
The current looks quite different and checks for BASH_VERSION and
KSH_VERSION. I've added a check for ZSH_VERSION.

Comment 2 grosen 2002-11-12 15:43:17 UTC
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 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, 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.

Comment 3 Karsten Hopp 2002-11-12 16:03:25 UTC
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'

Comment 4 grosen 2002-11-12 16:20:19 UTC
Right then.

Guess I'll be switching all my production systems to Debian.

Thanks for your time!