Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I think I'm right in saying RedHat and other distributions provide both vi and Vim.

Does anyone know what the rationale is behind providing both when presumably if Vim is provided it covers the functionality of vi?

ETA: It's not a symlink, they're different binaries.

$ ls -lh /bin/vi
-rwxr-xr-x 1 root root 747K Jul  7  2012 /bin/vi
$ ls -lh /usr/bin/vim
-rwxr-xr-x 1 root root 1.9M Jul  7  2012 /usr/bin/vim
share|improve this question
2  
has a possible duplicate in StackOverflow. Maybe it answers your question? stackoverflow.com/a/1159341 –  Lorenzo Von Matterhorn Mar 28 '13 at 23:15
2  
Is it really vi? I know ubuntu symlinks both /usr/bin/vi and /usr/bin/vim to /etc/alternatives/vim . . . –  ernie Mar 28 '13 at 23:17
4  
vi is in the POSIX standard. –  ultrasawblade Mar 28 '13 at 23:42
3  
Everyone seems to be ignoring the fact that the OP is not asking about the difference, but "what the rationale is behind providing both". In other words, WHY BOTH? –  That Brazilian Guy Mar 29 '13 at 0:42

2 Answers 2

RedHat and its variants/clones tend to provide a /bin/vi that is essentially Vim compiled with the bare minimum of features and fewer library dependencies so it is more likely to be able to run even with a damaged filesystem. It is also smaller than a "normal" or "huge" version of Vim, which at one time was a consideration even if it does not matter as much now.

Basically it is there as a "fallback" for users and admins that need a text editor and are at least minimally familiar with vi. For those who want a more powerful editor, they usually have to expressly install "vim-enhanced" or whatever their distribution provides for a "full featured" Vim.

I have seen even tinier versions of vi or vi-like editors that are not a stripped down Vim that some of the compact distributions use. Busybox integrates one.

share|improve this answer

No you are wrong.

Redhat and all the other distros provide both a vi and a vim commands but they are not separate executables: vi is just a symlink to vim. This happens on every UNIXy systems because the vi command is part of the standard and, as such, must be provided by a system if it claims to be UNIX-compliant.

Presumably, at some point, most distros decided to use vim instead of the original vi (for reasons unknown to me: architecture compatibility? modern features? others?). Which is why you get both vi and vim.

share|improve this answer
    
I stand corrected: you and me are partially wrong. Debian-based distros and Mac OS X have symlinks but Redhat seems to have two binaries. Yes, it sounds silly. You should ask Redhat about that. –  romainl Mar 29 '13 at 11:21
1  
I imagine it's a case of 'if it ain't broke...' - I can't imagine that it costs them more than a negligible amount of effort to provide both of these, so there's no need to risk upsetting whatever weird, unanticipated corner-cases might possibly be affected by a change. –  evilsoup Mar 29 '13 at 12:38
    
RHEL 6 has a vim-minimal package which provides /bin/vi and a vim-enhanced package which provides /usr/bin/vim. –  Cristian Ciupitu Jun 21 at 21:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.