|
|
Subscribe / Log in / New account

Vim's newest features (Linux.com)

Linux.com takes a look at new features in Vim. "New features include multiple windows, syntax highlighting, multiple levels of undo, and color themes. All of these improvements are made possible by the use of vim plugins."

to post comments

Vim's newest features (Linux.com)

Posted Aug 30, 2005 19:36 UTC (Tue) by marduk (subscriber, #3831) [Link] (5 responses)

As one of the comments on the article say. None of those "new features" are new, and none of them require pluglins. Also, does the author mention anywhere which "new" version of vim he is reviewing? Perhaps he recently upgraded his Red Hat 4.2 box or something?

Vim's newest features (Linux.com)

Posted Aug 30, 2005 20:24 UTC (Tue) by ncm (guest, #165) [Link] (4 responses)

Maybe he means "new" since Bill Joy released vi.

I have to admit I don't use many features beyond what was in the vi I learned in ... 1984? Let's see: multiple undo, "gq}" paragraph formatting, up-arrow for search- and command-line history retrieval, and arrow-key cursor motion. Oh, and it's nice when it goes back to the same spot you last edited in a file when you open it again. That's all. Maybe I should look again at what else it can do.

It's pretty annoying that Emacs's viper-mode copies nvi's multiple-undo semantics and not vim's. If I want the former, I can always use Emacs native undo, which is even more annoying.

Vim's newest features (Linux.com)

Posted Aug 30, 2005 22:01 UTC (Tue) by AnswerGuy (guest, #1256) [Link]

I've learned that the * and # commands (search forward or backward for
word under cursor) is pretty handy.

However, I do concur that this article was fluff and the content would
have easily been posted as a simple link to the top ten VIM scripts
and tips at vim.org.

JimD

Vim's newest features (Linux.com)

Posted Aug 31, 2005 7:41 UTC (Wed) by zooko (guest, #2589) [Link] (2 responses)

The trick in viper is to hit "u" to undo, and then to hit "." for the next undo. Once you get used to it it works just as well as vim's multilevel undo.

Vim's newest features (Linux.com)

Posted Aug 31, 2005 12:54 UTC (Wed) by rsidd (subscriber, #2582) [Link]

That's what ncm meant by "nvi semantics".

Vim's newest features (Linux.com)

Posted Aug 31, 2005 18:35 UTC (Wed) by zblaxell (subscriber, #26385) [Link]

I prefer nvi's use of the "u" key, which is compatible with other vi's (pressing 'u' twice takes you to the start of the last change). For short editing sessions nvi is similar enough to traditional vi's that I can use the traditional vi on other people's systems (at least as long as my window is less than 132 columns wide, the file contains no binary data, and various other limitations are avoided).

The other nice thing about nvi is that it doesn't leave the damn .swp files in random places on the filesystem, where they can e.g. be executed when the system crashes in the middle of editing an /etc file.

The thing that amazed me (until I had been using editors for a few years at least) is just how annoying it can be to have even trivial differences in behavior between editors. nvi has zillions of little implementation quirks (e.g. what happens when you press backspace at the beginning of an indented line?) which are different from vim and all the other vi clones. These quirks are critically important since I tend to edit files by typing commands into the editor and expecting the machine to do exactly as I specified. The feedback loop of looking at the screen to see what effect my commands are having cuts into my productivity, especially if there's any non-trivial delay in screen updates (e.g. editing files at remote sites or on busy machines).

It is certainly possible to configure most editors to one's liking and just copy the config files into one's home directory on any new machine one encounters; however, I have found that after a while I have zillions of little configuration files that I have to move around as a tarball. If I'm going to be unpacking a tarball on every new machine, it's not much more expensive to pack the source code for the various packages I use. So while I tend to use a lot of packages in their default configurations, I will insist on having specific packages.

I'm sure vim is a useful and worthwhile editor (I actually install nvi, vim, nano, kedit, emacs and half a dozen other text editors on all the machines I maintain at work as a courtesy to the users), but until it behaves exactly the same way as nvi, I'd never even consider using it. ;-)

vim vs. (original) vi, not vs. older versions of vim.

Posted Aug 30, 2005 20:59 UTC (Tue) by dwheeler (guest, #1216) [Link] (24 responses)

The article states at the top he's comparing vim to the original vi, not to older versions of vim. You're right, these features are very old to vim. If you're a Linux user, then you've had these for many years, because vim became the usual "vi" implementation many years ago. Some Unix systems still come the original vi, though, so if you've only used certain Unix systems, vim's features could seem new to you.

Which actually raises an interesting point. OpenOffice.org is still catching up to the feature list of Microsoft Office in some areas, such as its spreadsheet (though I find OOo Writer far more reliable than Office's Word for big documents). But here, the OSS/FS implementation (vim) has far surpassed the pay-for implementation (original vi), so much so that it's hard to believe anyone many people bother using or shipping the original one any more.

vim vs. (original) vi, not vs. older versions of vim.

Posted Aug 30, 2005 21:09 UTC (Tue) by arcticwolf (guest, #8341) [Link] (22 responses)

You'd be surprised how many people are not only willing to stick with inferior products but also willing to defend those to the death when you suggest they exchange them for something better. The GNU coreutils are a good example of that; I think it's pretty much clear to anyone that they're much better and more feature-rich than the proprietary versions found in, say, Solaris, but I still know people who would never touch the GNU versions even with a ten-foot pole.

Of course, the same thing could also be said about vi (and its newer versions such as vim) in general. ;) But I don't want to start a vi-vs.-emacs-vs.-everything-else flamewar, so I won't actually say that.

vim vs. (original) vi, not vs. older versions of vim.

Posted Aug 30, 2005 21:42 UTC (Tue) by nix (subscriber, #2304) [Link] (1 responses)

I've heard people say that the GNU coreutils are `bloated'.

(Many of these people also statically link the lot of them --- shock, it makes them larger --- and then run them on a box so large that it could run a hundred emacsen side-by-side without straining. Ridiculous.)

coreutils

Posted Aug 31, 2005 13:37 UTC (Wed) by eru (subscriber, #2753) [Link]

Something like Emacs is not a good comparison. Most of the traditional unix programs are often used as "operators" in scripts. This means they may get started thousands of times during the execution of the script, so it pays to ensure that they are "non-bloated" in the sense that they start quickly and don't hog memory unnecessarily (to be a better citizen in a pipeline).

vim vs. (original) vi, not vs. older versions of vim.

Posted Aug 30, 2005 22:05 UTC (Tue) by rfunk (subscriber, #4054) [Link] (13 responses)

OK, I'll bite.

If I want an editor to think for me, I use emacs. When I don't, I use
nvi.

vim occasionally comes in handy for one feature or another, but normally
its extra features just get in my way.

I could take the time to figure out how to turn everything off, but it's
a lot quicker to use nvi. And once again, if I want to take a lot of
time to figure out how to change annoying defaults, I'll use emacs.

Of course, I'm one of those weirdos who uses both emacs and vi all the
time.

vim vs. (original) vi, not vs. older versions of vim.

Posted Aug 30, 2005 23:13 UTC (Tue) by tjc (guest, #137) [Link] (10 responses)

I could take the time to figure out how to turn everything off, but it's a lot quicker to use nvi.

I used nvi for a while for the same reason, but I got tired of it "flashing" when I tried to scroll past the end of the buffer, so I finally dug around for vim configuration information. Adding

filetype off
set noautoindent

to ~/.vimrc took care of my major complaints. This is with Debian; last time I used Redhat they had the whole "Christmas Tree" thing going, but that can be disabled as well.

vim vs. (original) vi, not vs. older versions of vim.

Posted Aug 30, 2005 23:55 UTC (Tue) by parimi (guest, #5773) [Link] (1 responses)

I have alway's found redhat's default vimrc configuration annoying. Two options I hate the most are highlighting search (hlsearch on) and no autoindent for c/perl programs. I turn off these options in my ~/.vimrc but some of the default options (like noai) still remain set. As another solution, I execute vim -u ~/.vimrc <filename> but running :scriptnames in the editor still shows that /etc/vimrc was read. Does anyone know how to ask vim to only read my vimrc and nothing else?

vim vs. (original) vi, not vs. older versions of vim.

Posted Aug 31, 2005 7:35 UTC (Wed) by philips (guest, #937) [Link]

Please notice RH never had Vim in default instalatation.
Probably it is a sign.

Normally I end up recompiling vim since I use sometimes gvim and RH's gvim is just dumb [CENDORED] of [CENSORED], [CENSORED] and [CENSORED].
Most annoying features are text anti-aliasing and ridiculous GNOME integration, which kills bunch of standard vim shortcuts. I cannot imagine any sane person who can use that.

Recompilation helps. (Same goes for Solaris too.)

On SUSE and Debian, I found vim to be pretty okay - after few options tuned.

P.S. Most interesting thing, from another side of the fence, as I heard, hard-core Emacsers who use RH, normally insits on removing standard Emacs and using pacakges directly from GNU. Dunno why, but with all RH braindamages, I easily beleive that too.

redhat defaults

Posted Aug 31, 2005 0:26 UTC (Wed) by ccyoung (guest, #16340) [Link] (7 responses)

I've always thought the RH defaults were pretty good, esp when compared to Suse or Ubuntu.

You're right, need to do the :ai for indentation.

But accidental user modes are annoying: Sometimes it decides to start word wrapping. F1, being clumsily close to '2' gets pressed way too much. And frequently I'm asked about encrypting the doc and have no idea how I got there. And sometimes I work half an hour while recording a macro. All of these mysteries and more for someone too lazy for manual labor.

redhat defaults

Posted Aug 31, 2005 0:55 UTC (Wed) by bronson (subscriber, #4806) [Link] (4 responses)

Amen! Add this to your ~/.vimrc:
" F1 is too close to other keys.  Besides, help is :help.
map  <F1> <Nop>
map! <F1> <Nop>

How about Gnome's F1

Posted Aug 31, 2005 1:18 UTC (Wed) by kh (guest, #19413) [Link] (3 responses)

Any way to get Gnome terminal to ignore or capture F1??? (Or remap to the Esc key I meant to hit?)

How about Gnome's F1

Posted Aug 31, 2005 7:44 UTC (Wed) by philips (guest, #937) [Link] (1 responses)

Try xterm.

I have tried `God only knows how many` "better" xterms and in the end came back to basics - xterm itself. Other terminals are so much to graphics/GUI/bells/whistles/etc what makes them poor utilities. xterm just works and need very very few changes to configuration. Was at time first and only terminal to properly support UTF-8. Properly support reverse video. Has no GUI - so nothing stands in a way of job. And has most comprehensive text selection around.

man xterm - it is infinite source of knowledge, only comparable to vim's :help ;-)

xterm + bash + vim is what I use all the time.

P.S. Thou if you are on RH/Fedora Core, RedHat ships screwed xterm.ad. Replace it with standard one from XFree86/X.Org.

How about Gnome's F1

Posted Sep 1, 2005 18:17 UTC (Thu) by tjw.org (guest, #20716) [Link]

Has no GUI - so nothing stands in a way of job
Although users are unaware, xterm actually has a GUI of sorts. Hold down CTRL while clicking on any of the 3 mouse buttons on the xterm. Obviously it doesn't stand in the way, but it's there.

How about Gnome's F1

Posted Aug 31, 2005 9:11 UTC (Wed) by micampe (guest, #4384) [Link]

Edit -> Keyboard Shortcuts, scroll to bottom, select the "Help" row and hit back space. You might also want to uncheck the two checkboxes there for maximum effect.

redhat defaults

Posted Aug 31, 2005 1:12 UTC (Wed) by spiv (guest, #9031) [Link]

And sometimes I work half an hour while recording a macro.
Hit q. See :help recording.

Encrypting the document

Posted Aug 31, 2005 21:22 UTC (Wed) by peace (guest, #10016) [Link]

You got there by issuing ":X" while trying to quickly exit and save your document. You must learn to control your pinky.

(I do this all the time, and because I'm obviosly in a hurry, it's real annoying.)

Kind Regards

vim vs. (original) vi, not vs. older versions of vim.

Posted Aug 31, 2005 7:57 UTC (Wed) by joib (subscriber, #8541) [Link] (1 responses)

Of course, I'm one of those weirdos who uses both emacs and vi all the time.

Yeah, I used to do something like that too. Emacs for programming and other "big" tasks, and vi for quick-and-dirty editing (config files etc.). However, at some point I got the idea that it's a waste of time to learn two editors, so nowadays I use a lightweight editor with emacs keybindings (zile) for quick-and-dirty stuff.

learning multiple editors

Posted Aug 31, 2005 13:42 UTC (Wed) by ecashin (subscriber, #12040) [Link]

In order to use an editor efficiently, to really "get it",
you have to understand the way its creator gets editing done.

So I'm glad to use vi and emacs, and to learn any other
good editor (like plan 9's acme), because learning how
other people work is a great way to grow. I'm convinced
that, far from wasting time, it leads to improvements in
efficiency.

vim vs. (original) vi, not vs. older versions of vim.

Posted Aug 31, 2005 3:10 UTC (Wed) by drosser (guest, #29597) [Link]

Haha! Nothing like being on a big Unix machine with 32Gigs of RAM, only to have to transfer logs files to a Linux machine because vi "Ran out of memory"...

vim vs. (original) vi, not vs. older versions of vim.

Posted Aug 31, 2005 7:23 UTC (Wed) by Nickus (guest, #32179) [Link] (1 responses)

One of the reasons why you may not touch the GNU utils is that they have a lot of extensions that simply won't work on other platforms native tools. For people living in a Linux only world it may not be a problem but the rest of us needs to take the rest of the world into account.

GNU is not Linux (only)

Posted Aug 31, 2005 17:51 UTC (Wed) by AnswerGuy (guest, #1256) [Link]

You can use the GNU tools on virtually any version of UNIX.
They are not exclusive to Linux.

So, if you need the enhancements from GNU in your work and scripts
on $PROPRIETARY_UNIX then simply install the GNU suite on it.

(I routinely install the GNU tools suite on Solaris boxen when
I need to maintain them).

JimD

vim vs. (original) vi, not vs. older versions of vim.

Posted Aug 31, 2005 18:52 UTC (Wed) by zblaxell (subscriber, #26385) [Link] (1 responses)

To a Solaris developer, the GNU coreutils are like crack rocks.

They're so nice to use that if you ever started using them, you'd start having unpleasant withdrawl symptoms whenever they're not available.

Due to legal reasons, they're just not available in many of the places where Solaris developers like to work, although enforcement is sometimes not very effective.

You can get hooked after the very first use.

If you're caught using them at work, you could face legal or disciplinary action, or even lose your job.

So it's not surprising that most Solaris developers Just Say No.

;-)

Solaris developers

Posted Aug 31, 2005 23:56 UTC (Wed) by xoddam (guest, #2322) [Link]



> they're just not available in many of the places where Solaris
> developers like to work ...
> ... If you're caught using them at work, you could
> face legal or disciplinary action, or even lose your job.

I can't understand how *anyone* would "like to work" in that
sort of place.

Even Solaris developers.

vim vs. (original) vi, not vs. older versions of vim.

Posted Sep 1, 2005 10:48 UTC (Thu) by janpla (guest, #11093) [Link]

'You'd be surprised how many people are not only willing to stick with inferior products ...'

No, but I AM surprised at how some people instinctively 'know' what is best for everybody.

So I assume you'd say 'vim' is better than the original vi? Let me tell you why I prefer the vi; it's very simple really. I work on many different UNIXes, and in the beginning when I used vim with all its bells and whistles it gave me all sorts of problems when I went to a platform without vim. So I started using vim in compatible mode, turned off all the stupid syntax highlighting etc, and learned to use it properly.

What I find surprising is how many things you can do in vi, and how well you can do them. The bells and whistles are simply irrelevant.

vim vs. (original) vi, not vs. older versions of vim.

Posted Aug 31, 2005 9:26 UTC (Wed) by grmd (guest, #4391) [Link]

the OSS/FS implementation (vim) has far surpassed the pay-for implementation (original vi), so much so that it's hard to believe anyone many people bother using or shipping the original one any more.
If anybody wishes to use a close to original implementation of vi, take a look at the ex-vi project page at SourceForge.

I use this version because it is small. When I built it for my Gentoo systems, it didn't require the installation of any other packages, unlike the larger vi clones.

Vim's newest features (Linux.com)

Posted Aug 31, 2005 11:29 UTC (Wed) by nurhussein (guest, #16226) [Link]

I'd like to have tabbed documents in gvim. I wonder how hard that would be to implement.

Vim's newest features (Linux.com)

Posted Sep 1, 2005 0:41 UTC (Thu) by oki (guest, #19862) [Link] (1 responses)

okay this is lightly off-topic. I use vim for small scripts and
kate/kwrite for larger ones. Never could get my teeth into emacs. If I
can access the big scripts via a windows box I prefer to use ultraedit.
This is ofcourse annoying. I would prefer to stay on the linux box. I use
UE for just one feature it provides a little panel on the side with all my
subs in an alpha-sorted list. Click on a sub and you are there. Does
anyone here know how I can achieve something like this in _any_ editor,
text or gui. Ultraedit is now the only thing I use my windows box for
apart from games.

Vim's newest features (Linux.com)

Posted Sep 1, 2005 18:38 UTC (Thu) by tjw.org (guest, #20716) [Link]

taglist is a vim plugin for doing this. You'll have to juse gvim to make it useful (e.g. mouse actions) in my opinion though.


Copyright © 2005, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds