More vim options it turns out that I want

January 31, 2010

Much to my displeasure, Ubuntu seems to have been steadily making the version of vim that they ship more and more superintelligent. I do not want a superintelligent vi; in fact, superintelligence is a net negative in vim, because unlike with GNU Emacs it is almost always wrong. So, unlike the first set of vim options, these are negative options that I need, things that turn off settings.

So far, I have wound up with:

set formatoptions=l
Turns off automatic line wrapping. Since vi is my sysadmin's editor and sysadmins edit configuration files a lot, automatic line wrapping is anti-feature.

(I hate it in Emacs too, when it happens.)

let loaded_matchparen = 1
Turns off blinking matched delimeters, like () and [] and so on. I find this irritating and distracting.

filetype plugin off
This turns off all sorts of superintelligent automatic formatting that I aggressively don't want.

(At some point I may look into the best way to fix the line ending issue, but I haven't been annoyed enough yet.)

Some reading in the vim help files suggests that 'set paste' will also do a lot to turn off all of the superintelligence that I so dislike. Using Ubuntu's 'tiny' version of vim also goes a long way to disabling various things I don't like, but it has the side effect of making vim not like the latter two .vimrc settings here (and it's not something that I can turn on globally on our systems and so have all the time, no matter what environment or UID I am at the moment).

All in all, I really wish vim had a mode where it just settled for being a better vi instead of trying to be a bad imitation of GNU Emacs. As before, if I want GNU Emacs, I know where to find it.

Comments on this page:

From at 2010-02-01 01:55:18:

I see vim as a vi-inspired editor with a separate identity, not a vi clone, and as such I prefer vim to try to be a better vim, not a better vi, which doesn’t mean it’s a bad imitation of Emacs. (There are vi clones if you want something truly close to vi.) Filetype plugins are something I specifically like; the only things I dislike with some universality are the autoindent behaviours they specify. But that can be disabled surgically without throwing out the rest.

(I’ve noticed that vim tends to be a point of contention and thus a distinction between the old guard of Unix and its more recent adherents.)

Aristotle Pagaltzis

From at 2010-02-01 06:26:59:

When you get sufficiently annoyed about the line ending issue, I think the place to start looking will be set fileformats=unix and that'll solve the problem pretty quickly.

Also it should be possible to insulate the filetype setting from tiny-vim with if has("autocmd") or so, but you probably already know that.


-- John

By cks at 2010-02-01 11:35:09:

I should have clarified: I don't mind if vim is superintelligent when invoked as vim. What I mind is getting superintelligence when I type 'vi'. If people are going to install vim as vi, they should make sure that it actually has vi's virtues, including not mangling pasted text and so on.

(I think I said this in an earlier entry, but I should have re-said it in this one too.)

And thanks for the pointer to 'if has("autocmd")', as I didn't already know it. Because I'm not very interested in vim's advanced features, I've basically read the minimal amount of vim documentation possible, so I'm sadly ignorant of these helpful bits.

From at 2010-02-01 12:49:00:

Speaking as one who likes vim's "fancy" features, I haven't tried it, but have you tried vim -C?

-C Compatible. Set the ’compatible’ option. This will make Vim behave mostly like Vi, even though a .vimrc file exists.



By cks at 2010-02-02 11:57:46:

I've found that true vi (and really good immitations) are now too uncomfortable for me; I really do want multi-level undo and so on.

Written on 31 January 2010.
« Thinking about syndication feeds and spoilers
What charging credit cards doesn't prove »

Page tools: View Source, View Normal, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Sun Jan 31 23:02:28 2010
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.