Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I know a bit about *NIX text editors (currently migrating from nano to vim), and, after looking around a bit on the Unix & Linux SE, have noticed that a fair about of question use vi instead of 'vim'. I know that 'vim' stands for 'Vi IMproved', and, with that in mind, am wondering why anyone would rather use vi instead of vim. Does vi have any significant advantage over vim?

Edit: I think that my question is being misinterpreted. I know that vim is, for the most part, significantly more powerful and feature-complete then vi is. What I want to know is if there are any possible cases where vi has an advantage over vim, such as less memory use, prevalence on *nix systems, etc.

share|improve this question
9  
The nice thing about vi is you can expect it to be on every POSIX compliant system. –  jordanm Jan 12 '13 at 7:06
    
Actually, Ubuntu standard installation includes vi and not vim.. Ubuntu is one of the most user friendly distro btw ;-) –  amyassin Jan 16 '13 at 19:53
add comment

6 Answers

up vote 6 down vote accepted

vi is (also) a standard. There are plenty of implementations and vim is likely the most popular at least on Linux.

While many traditional Unix compliant OSes provide vi implementations very close to the standard, vim has added a lot of extra features that make it a double-edged sword.

Of course, these extensions are usually designed to ease the editing process and provide useful features and functionalities however, once you are used to some of them, not the cosmetic ones like syntax coloring but those that change the editor behavior, you can easily forget they are specific and using a different implementation, including the ones based on the original BSD code can be very frustrating. The opposite is also true.

This is quite similar to the issue that happen with scripts using non POSIX bashisms faced to more orthodox shell implementations like dash or ksh.

share|improve this answer
add comment

No vi doesn't have any significant advantage over vim rather its the other way around. Vim has more advantages then Vi. You may be interested in : Why, oh WHY, do those #?@! nutheads use vi?

Edit also read : Is learning VIM worth the effort?

share|improve this answer
3  
Yep. I don't use any IDE because the editors they force you to use just isn't Vim. –  Keith Jan 12 '13 at 7:51
1  
@Keith I use both Xcode and Eclipse and I'm still able to do editing with vi only. –  ott-- Jan 12 '13 at 9:39
    
@Keith SlickEdit has a great Vim emulation, and IDEA's is coming close to it. Also, Visual Studio has ViEmu. –  demonkoryu Apr 23 '13 at 13:50
add comment

The advantage is that vi usually preinstalled in enterprise UNIX like AIX or Solaris. Besides vim is not accessible on installation media.

share|improve this answer
add comment

I would have a hard time living without vim but I can't stand vi. However, learning the former will at least leave you with an idea of how to deal with the later when that's all that is available.

The vim interface by default is actually pretty close to vi. If I'm working on a system with vim the first thing I do is add this stuff to ~/.vimrc:

syntax enable
set nocp
set wildmenu

There's a bunch of other stuff I prefer -- nowrap and numbering on, etc -- but never mind. "syntax enable" just turns on basic syntax highlighting (somewhat beefier: filetype plugin on is fundamental too); "nocp" turns off vi compatibility and it is this that starts to distinguish vim from ye olde vi (eg, it enables showmode which makes the whole experience somewhat more human, since you now have some clue about whether you are in command or ~INSERT~ mode). "wildmenu" just gives you a horizontal completion menu when doing some things, which makes life easier too.

The text editing facilities of vim are second to none -- other than emacs, I've never seen or heard of a piece of software that comes close. They are not easy to learn, but once you know them, they are much faster than mouse menus to use and much more dynamic than the simple key macro alternatives in mouse menu based interfaces. For programming, I sometimes use vim alongside an IDE like Eclipse, but I do most of the work in vim.

If you take that path, lol, look into the autocompletion and taglist plugins. And beware the dark side.

share|improve this answer
    
I always add set mouse=a too. –  ott-- Jan 12 '13 at 16:36
    
Regarding your programming comment, you may find eclim interesting... –  ire_and_curses Feb 4 '13 at 23:41
    
@ire_and_curses : haven't tried it. Eclipse and vim both monitor the source files and allow them to be updated externally, and flipping from one desktop to another is flipping from one desktop to another. Seems like quite the idea tho. –  TAFKA 'goldilocks' Feb 5 '13 at 0:33
add comment

After spending a large fraction of my life (not including childhood) editing comfortably with Vim, I spent about a month only using vi. In doing so, I realized that I had been dependent on Vim for all of my text modification needs. Before my trip with vi, whenever I had to substitute some text or perform a similar operation in a large group of files, I would just open up the files in Vim and run a :bufdo command, and whenever I had to indent or format some files, I would open them up in Vim and use Vim's = and gw commands. I was Vim-dependent. After realizing vi did not have these commands, I was forced to perform bulk text transformations with sed and learned a great deal about other programs such as awk and indent. Though I switched back to using Vim in the end, the knowledge I gained by using a less featured editor was substantial and has proved to be extremely useful. In addition to learning about tools outside of a text editor, I also became better acquainted with vi. Whenever I am working on a new system or a server that doesn't have Vim, I feel much more comfortable using vi than I did before my month-long excursion.

Also, last month I installed Linux on a cheap WM8650 tablet and found there to be a noticeable performance difference between Vim and vi, so I tend to use vi on the tablet.

share|improve this answer
add comment

I have noticed that I only choose Vi over VIM when I am copying and pasting a text document or config file that I have used cat command. This is because when I try to ctrl-c and then ctrl-v into the VIM opened document, it forces all lines to have a comment infront of them. So when I use Vi to ctrl-v or paste into the Vi opened document, it pastes exactly what I copied from. Other than that, I use VIM all day long.

Enjoy!

share|improve this answer
    
Try :set paste –  Patrick Jan 18 '13 at 12:55
    
set pastetoggle=<F2> in .vimrc (vim.wikia.com/wiki/Toggle_auto-indenting_for_code_paste) –  Dave Jan 18 '13 at 20:01
add comment

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.