Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

A Visual Walkthrough of New Features in Vim 7.0 406

An anonymous reader writes "Anybody who has used Linux or any other OS would be aware of the very powerful and feature rich text editor Vi. This interesting article takes a visual look at some of the new features in the latest version of Vim 7.0 — a Vi clone created by Bram Moolenaar. From the article: 'Just for once, I wouldn't mind siding with the beast if that is what it takes to use Vi. The modern avatar of Vi is Vim — the free editor created by Bram Moolenaar. Riding from strength to strength, this editor in its 7th version is a powerhouse as far as an editor is concerned. When ever I use Vim (or GVim for that matter), it gives me the impression of the Beauty and the Beast.'"
This discussion has been archived. No new comments can be posted.

A Visual Walkthrough of New Features in Vim 7.0

Comments Filter:
  • by oggiejnr ( 999258 ) on Tuesday September 19, 2006 @04:56AM (#16136425)
    LatexSuite at http://vim-latex.sourceforge.net/ [sourceforge.net] is brilliant for editing latex documents. It took me a couple of days to initially learn but the tutorial on their site makes starting easy.
  • by Scarblac ( 122480 ) <slashdot@gerlich.nl> on Tuesday September 19, 2006 @05:02AM (#16136446) Homepage
    No, it's Bram Moolenaar. He's Dutch, molenaar means miller, and moolenaar is an old spelling of that. Both Molenaar and Moolenaar are common names; Mölenaar is just wrong, Dutch doesn't use umlauts like that.
  • Bill Joy (Score:5, Informative)

    by Brainix ( 748988 ) <brainix@gmail.com> on Tuesday September 19, 2006 @05:06AM (#16136450) Homepage
    For the younger ones in the audience, Vim is a superset of vi [wikipedia.org], which was originally written by Bill Joy [wikipedia.org].

    Yes, the same Bill Joy who heavily contributed to BSD [wikipedia.org], TCP/IP [wikipedia.org], NFS [wikipedia.org], and csh [wikipedia.org].

    Yet I still count vi as one of his top contributions. :-)
  • While it may be free (Score:5, Informative)

    by also-rr ( 980579 ) on Tuesday September 19, 2006 @05:21AM (#16136499) Homepage
    It is also charity ware. The website asks for donations to a charity that helps children in Uganda [iccf-holland.org].
  • by laejoh ( 648921 ) on Tuesday September 19, 2006 @05:27AM (#16136512)
    Or http://hessling-editor.sourceforge.net/ [sourceforge.net], if you're into that kind of thing...
  • Re:Default mode (Score:2, Informative)

    by loxosceles ( 580563 ) on Tuesday September 19, 2006 @05:34AM (#16136534)
    You can add "startinsert" to your .vimrc

    I find ctrl sequences to be a total pain. Most of the time, I want to use several commands in a row. Rather than hit ctrl+ each time, I only have to hit escape once (all sane vim users remap capslock to escape), then the commands, then i to start inserting text again.

    I just deleted my .vimrc to make sure, and ctrl-end and ctrl-home work for me. Although G and gg tend to be faster, because home and end require significant hand repositioning.

    Any other complaints?
  • Re:Bill Joy (Score:4, Informative)

    by MickDownUnder ( 627418 ) on Tuesday September 19, 2006 @05:36AM (#16136536)
    You might also have mentioned he's the same Bill Joy who was chief architect at Sun through it's hay days.
  • Re:Default mode (Score:4, Informative)

    by swordgeek ( 112599 ) on Tuesday September 19, 2006 @05:51AM (#16136567) Journal
    Sucks to be you.

    I work on dozens of modern, high-end systems that don't have arrow keys. In fact, the only access to many of them is through an amber-on-black text-only monitor (hey, we've evolved from green on black! :-).

    If you don't like vim, fine--there are those other 99% of editors that you can choose from. However, that's not a valid reason to change it from what it was designed for (or at least what vi was designed for) and in the process piss off the people who use it the way it is.

    In short, don't try to change MY editor to suit YOUR desires. -g may be an unintuitive way to get to the end, but you can do it without having to move away from the home-row on the keyboard, it works on all terminals, and 1-g to get to the top of the file or 341-g to get to the line that some config file parser told you was the source of your error is a lot more consistent and efficient than having different keystrokes for each function, and having to scroll to a specific arbitrary line.

    It's not a friendly editor. It's an efficient and universal editor.
  • Re:Default mode (Score:5, Informative)

    by TheBogBrushZone ( 975846 ) on Tuesday September 19, 2006 @06:45AM (#16136676)
    Does Vim still default to starting in command mode? I suppose it does (...) It's a text editor, it should start in insert mode like every other editor.

    It has something called 'Easy mode' for those who dislike the mode distinction or just want to use a dubmed-down editor interface. And why should starting in insert mode be the 'right' thing to do just because other editors do it? 99% of the time when I first open a text file I don't want to start inserting text. I want to navigate somewhere, usually by searching for a string or a line number.

    Pressing some key to start typing is bloody annoying, then pressing Esc to insert commands is also annoying.

    You seem to be very easily annoyed. Use vi or ViM for a while and the dual mode system becomes second nature and you miss it in other applications.

    Ctrl-sequences are much better, and the default insert mode means I can do simple text editing and slowly learn other commands of the editor.

    I don't see any major disadvantage here. You can do the same with ViM. All you need to start with are 'i', 'ESC' and 'ZZ'. The cursor keys and most of the navigation keys work in the same way as other editors until you learn to use the more advanced navigation available.

    To be honest, I also find Vim's shortcuts extremely unintuative. Want to go to the end of the document? 99% of editors, Ctrl-end. Vim, G. Sorry, that's retarded.

    Did you actually try doing that in ViM? CTRL-END works just the same as G. Has done for a long time. And why should using one arbitary key combination be more 'retarded' than another? CTRL-END could just as correctly be used to terminate the application or insert the letters 'E', 'N' and 'D'. You are entitled to your opinion but it's just arrogance to assume your interpretation is the only valid one.

    Maybe it's based in the days of legacy terminals that didn't have arrow keys or even control sequences, but we're not in those days anymore; it's the text editor equivalent of still using a green-on-black text-only monitor.

    It's called Vi iMproved. It takes the features that people found useful with vi (and its predecessors) with newer features added (not that the Control key you seem to have an obsession with is exactly a cutting-edge invention). Most developers I know, myself included, prefer ViM because it contains a wealth of practical features and a fast, efficient user interface for those with the patience to learn a little and get past the preoccupation with Microsoft-prescribed keyboard shortcuts.
  • Re:Bill Joy (Score:4, Informative)

    by MickDownUnder ( 627418 ) on Tuesday September 19, 2006 @06:51AM (#16136697)
    Oh and he was also co-founder of Sun Microsystems...

    And a recent attendee of the Dropping Knowledge [droppingknowledge.org] forum in Berlin, where he had this to say [droppingknowledge.org]... when asked the question "Why don't we dump all patent laws all around the world and stop restraining creativity and innovation?"
  • Re:Emacs (Score:2, Informative)

    by Saval ( 39101 ) on Tuesday September 19, 2006 @07:03AM (#16136728) Homepage
    I was particularly impressed when I saw the Java refactoring things in Eclipse. Just select a few lines with a loop or so, right-click 'Extract method', name it and the rest is automatic. Emacs and vi won't get that sort of language integration ever, I think.


    Might not get, but Eclipse has got ViPlugin. So you actually can use familiar vi-editing inside eclipse with all the bells and whistles of eclipse!

  • by Spikeles ( 972972 ) * on Tuesday September 19, 2006 @07:32AM (#16136785)
    I found a vi plugin for Eclipse a while ago, it emulates almost of all vi's features in Eclipse, and it's very handy. The only problem is that it costs money and the trial has an idiotic nag screen that pops up like every 45secs, but i thought it was worth every cent when i bought it. http://satokar.com/viplugin/index.php [satokar.com]
  • Re:Default mode (Score:3, Informative)

    by epine ( 68316 ) on Tuesday September 19, 2006 @08:08AM (#16136893)

    My first serious use of vi was under OpenBSD 2.6 and I forced myself to become relatively proficient because I recognized that vi was the universal reference point for console administration. For creative work (writing code, documentation) I slogged through the emacs learning curve and eventually found a pleasant comfort level, though never equalling my old proficiency with Brief under MSDOS. Sometimes I manage to get twenty powerful psgml-mode commands embedded into my fingers, but they are soon gone again when I'm no longer working with those document types. I'm one of those people that never recovered from the CTRL key being displaced by the lawyers and losers CAPSLOCK key. As far as I'm concerned, all the lawyers out there writing license agreements should stick the 40 column upper-case only Apple ][. That's about the speed that the legal profession cleans up their own messes anyway, but I digress.

    In my view the problem with vi as a universal editor is that the rules for leaving insert mode are *not* universal. Under OpenBSD 2.6, almost any use of the arrow keys breaks you out of insert mode. Other versions of vi will leave you in insert mode within some nearby region of the inserted text region, but break you out if you move further away.

    Modes are bad enough to begin with, though I'm willing to live with a mode or two where there is a sufficient pragmatic justification. What I'm not prepared to contend with on a daily basis are inconsistent rules regarding magic-mode switches as an unintended/unexpected consequence of common actions (e.g. cursoring around).

    Nor am I prepared to memorize and apply inconsistent commands to disable or override inconsistent mode switches on a per system, per host, per revision, per version, per day-of-the-week basis. I'd rather wrangle with the hopelessly misplaced CTLR, ALT, and Mr Bill keys.

    Perhaps vim has defeated the mystery mode switches associated with cursor actions. But my purpose in learning basic vi was to have a consistent editor available on any system I might need to use, not just a consistent editor when an ideal flavour of vi happens to be installed, so it's worthless to me.

  • by Gr8Apes ( 679165 ) on Tuesday September 19, 2006 @09:00AM (#16137102)
    I still like IBM's EPM editor (on OS/2). It emulated Emacs, sed, ed, edlin or any other editor if you cared to customize it, and was GUI if you wanted it to be. The memories ... are surely better than the reality ;)

    As for GVim, I like the combo interface on Windows. On the Mac, there's a few GUI inconsistencies, but you have to love the fact that the console program is identical. And who worries about 13MB anymore for a PC when a 1GB stick costs around $65?
  • by oohshiny ( 998054 ) on Tuesday September 19, 2006 @09:07AM (#16137135)
    Well, it was natural on the terminals where it was originally developed, because those keys were marked with arrows.

    As people were using it on other terminals, they discovered that it didn't matter what the key actually said and that it was just a good key binding.
  • Returning to VI(M) (Score:5, Informative)

    by qazwart ( 261667 ) on Tuesday September 19, 2006 @09:18AM (#16137193) Homepage
    I've been programming since the 1970s when we really didn't have screen editors. We used line editors, and had to keep retyping the "list" command to see how our program was shaping.

    VI was actually not the first screen editor I used. The first I used was the old Textedit on the Mac. I thought it was wonderful. I could actually move the cursor around and see what I wrote. My introduction to VI was when I first started working with C on Unix. I hated it.

    VI was primative. Where my Mac editor was single mode, I had to switch back and forth between command mode and insert mode with VI. Where my Mac editor would wrap text, VI wouldn't. Where I could easily find a command with the menus, with VI, I had to remember archaic key strokes. Who in the hell wrote this junk!

    However, once I started getting use to it, VI grew on me. The commands I quickly learned could be combined. For example, "d" deletes. "e" moves to the end of a word. "de" deletes to the end of a word and "3de" deletes the next three words. "xp" transposes two characters. There was an order to them: "d" for delete", "f" for find, "r" for replace. It started making sense. Then I started learning the ins and outs of RegEx, and I never looked back.

    Not only that, but I quickly learned that for program editing, VI simply worked better than Textedit or Notepad. Unlike word oriented text editors, VI was line oriented just like a computer program. I've been using VI ever since. Over the years, I've tried GUI editors (Jedit, Nedit, KDEdit, TextPad, etc.) but I keep returning back to VI.

    Most of these young whipper JDs (Java Developers) with their "Object Orientation" and "Virtual Machines" think of my preference for this non-graphical editor as quaint. Sort of like the way you'd look at Grandpa playing around with his model trains. That is until they realize that I can write code a lot faster than they can.

    Last year, one developer told me it was going to take a few hours to clean up a particular program. I loaded the files in VI and transformed them in a matter of minutes. He was shocked. How can this "obsolete" little text editor do the job much more efficiently and faster than his feature ladened GUI? Why doesn't his editor support regular expressions? Why can VI load the files in less than a second while it takes VisualStudio three or four minutes? How can I write a program and never have to touch the mouse?

    My sons have just started taken up programming. My 15 year old kid likes working with PHP, and first refused to even look at VI -- to old fashion and out of date -- just like his dad. He had a *better* IDE that was made specifically for HTML/PHP web development.

    I recently caught him using VI. He had to admit that once you get over the basics, VI is faster and easier to use for his needs. My oldest is in college and I saw using VI for writing his term papers and essays. He said he found working with VI better because it kept him concentrating on content than formatting. Plus, it makes writing a lot faster. Takes a lot of time switch to the mouse each time really slows you down. He showed me how he programmed a macro spell checker using an ASCII dictionary and ispell. He also showed me the "linebreak" feature in VIM (something I didn't know about).

    After all these years, I still haven't found anything that is as efficient as VI for editing. From what I see in Linux world, a lot of younger programmers who grew up with nothing but graphical interfaces agree with me.
  • by nickos ( 91443 ) on Tuesday September 19, 2006 @09:47AM (#16137345)
    Like probably many people, I have the "inverse T" cursor key layout deeply etched in muscle memory, and I much prefer this to having left, down, up, right in a row like hjkl is (although I'm sure others prefer having all the keys on the home row). As a result I use ijkl to move the cursor and h to insert (this also means that touch typists get to keep their fingers on the touchtyping home keys and just move their second finger to i when they move the cursor up). This is what the relevant part of my .vimrc file looks like:
    " remap h to insert and use ijkl for inverse T cursor movement
    map h <insert>
    map i <up>
    map j <left>
    map k <down>

Top Ten Things Overheard At The ANSI C Draft Committee Meetings: (5) All right, who's the wiseguy who stuck this trigraph stuff in here?

Working...