Bug #206

Vi doesn't act like vi

Added by tjc almost 16 years ago. Updated over 15 years ago.

Status:Closed Start date:
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:- Spent time: -
Target version:-

Description

Running vim in nocompatible mode (see /etc/vimrc) can cause a bunch of grief for anyone who isn't a vim user. Most Unix people know how to at least limp along in vi, but this breaks that. I ended up having to delete /etc/vimrc before it would behave like a "normal" vanilla vi.

History

Updated by nickca over 15 years ago

VIM is the standard vi on pretty much every major Linux distribution and on MacOSX. When people say "vi" nowadays, they usually mean VIM. This is not a bug, it's a feature. It's not like VIM is even that different from vanilla vi, all the most common commands are there, and it has a ton of extra useful features besides. If you really hate it, you can always install nano or some other editor instead, but installing any other vi-clone but VIM as the default vi would be ludicrous on a modern Linux distribution. It's now the standard.

Updated by tjc over 15 years ago

Sorry, but I have to disagree. When you ssh into a box, say:

vi /etc/X11/xorg.conf

go to the appropriate spot and hit "o", then try to paste in a chunk of text with the mouse, and it doesn't work, that's broken IMO.

These are the very basic types of vi commands that you expect to just plain work everywhere in any kind of Unix/Linux/Posix environment. The type of thing that a newbie user following a vi tutorial or someone with 20+ years of Unix and Linux experience expects to work.

Updated by nickca over 15 years ago

Huh? Standard BSD vi doesn't even support using a mouse. In fact, I think VIM is the only vi clone that does. If you, say, go to a line, hit "5yy" to yank 5 lines, then go to another line and hit "p" to paste it, it works the same in VIM as it does in nvi or elvis or any other vi. In your example, if you hit "o" to open a new line and paste in text in, say, gnome-terminal with Ctrl-Shift-V or right-click/Paste, that works as well, same as in regular vi. In fact, the only differences when you set "compatible" is it disables things like multi-level undo, setting it to one level of undo like in vanilla vi. The only thing VIM is missing from vanilla vi regardless of the compatible setting is the :Q command (capital :Q, not :q for quit), which no one ever uses. I forget what it even does.

Are your terminal settings correct? Is there a line setting TERM to something other than "xterm" in .bashrc on the machine you're ssh-ing in from?

Updated by jams over 15 years ago

Thats the mouse support that was added to vim, it's truely annoying.
set mouse-=a should fix the cut/paste stuff with a mouse. I'm kicking around the idea of changing that setting, but have not decided yet.

Updated by tjc over 15 years ago

Exactly. Vim is trying to be too clever for it's own good with mouse support and it ends up being an anti-feature. When an app breaks classic window system cut & paste it's jumped the shark.

Also available in: Atom PDF