Slashdot Mirror


Vim 7 Released

houseofmore writes "After many years of development, Bram Moolenaar, creator of Vim, today announced version 7 of the widely used editor. New features included spell checking in up to 50 languages, intelligent completion, tab pages, extended undo branches and much more. Downloads available here for Unix, Windows, Mac and more."

110 of 665 comments (clear)

  1. waiting by yagu · · Score: 4, Funny

    I'm waiting for the emacs emulation mode. (kidding, kidding)

    1. Re:waiting by quokkapox · · Score: 4, Funny
      M-x shell<enter> vim<enter>

      Creating a macro is left as an exercise to the reader.
      ^X^S
      dammit

      --
      it's a blue bright blue Saturday hey hey
    2. Re:waiting by Anonymous Coward · · Score: 3, Funny
      I'm waiting for the emacs emulation mode

      Vim now runs on more than 15 different operating systems, so I'm sure emacs can't be far behind.

    3. Re:waiting by goombah99 · · Score: 3, Interesting

      I've never understood the attraction of Vim, maybe someone could explain. It seems like a throwback to keyboard command line editors with it's modal editing.

      For my needs I either want a nice gui, in which case I will use kwrite, or bbedit, or some IDE.
      or I want something simple from the commandline, in which case pico is almost useful, though I prefer emacs for that. I am not an emacs power user. All I can do is do primive searches, cut and paste. But that's really all I need for quick command line edits.

      The other reason I like emacs and it's non-modal behaviour is that on a mac, those simple key bindings are available in every cocoa test window.

      So why is Vim so popular?

      --
      Some drink at the fountain of knowledge. Others just gargle.
    4. Re:waiting by grazzy · · Score: 2, Insightful

      I find it easier to remember keyword shortcuts in Vim's way. Honestly, ctrl-random-char just doesnt cut it for me. Esc for command mode, and then one key. Thats all it takes. Works better with strange terminal emulations too.

    5. Re:waiting by Nos. · · Score: 4, Informative

      Once you've learned vim, it becomes probably the fastest editor to use. Never having to use the mouse. Being able to quickly move around a document. Complex (regex) searching/replacing. It has a steep learning curve, but it a very powerful and arguably intuitive editor. I first started using it in the mid-90s when I first got onto the big unix boxes at the university I attended. Since then, I continually find myself trying to use vim syntax in different editors. Its not uncommon to see ZZ or :wq at the end of some of my emails or other documents.

    6. Re:waiting by OrangeTide · · Score: 4, Informative

      It's popular because it's like vi with some extensions to make it more modern.

      It's especially handy for editing source code. Where you have commands to reformat comments, move between functions, jump to definitions and things like that. I'd rather hit [[ to go to the top of the previous function than have to enter a search for it. This is especially useful when you're going through all your callback routines and adding a little bit of code to them.

      The ability to have multiple cut/paste buffers is also nice. The modal behavior makes people think Vi is a throwback, but honestly only a handful of editors are able to provide even 90% of Vi's editing features. And none (not even emacs) can do it with so few keystrokes (that does make the learning curve on Vi rather steep).

      The disadvantage to such an effecient input system is when the cat jumps on your keyboard, you can have hours of work erased in Vi.

      ps- I have vi-like bindings in my Cocoa windows. you can actually change how the input works and plug in something else. Or you can just tweak it to use Ctrl-vi key without even using a plugin by editing DefaultKeyBinding.dict. The emacs bindings that are there by default are pretty weak anyways.

      --
      “Common sense is not so common.” — Voltaire
    7. Re:waiting by VE3MTM · · Score: 3, Funny

      And this, folks, is the sound of a joke going right over someone's head... *WHOOSH*

      --
      09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 Whoops, silly middle mouse button...
    8. Re:waiting by Tack · · Score: 5, Informative
      I've never understood the attraction of Vim, maybe someone could explain. It seems like a throwback to keyboard command line editors with it's modal editing.
      A lot of it, I'll admit, is habit. My brain is tightly wired to vim's keyboard shortcuts (some of which are quite obscure) to the point where thinking about some action in vim is roughly equivalent to that action actually happening. I've also become accustomed to vim's slightly more esoteric features. Would other editors do the same job and be less obscure about it? Quite probably. But the truth is that vim works for me, I've already overcome the steep learning curve, and there's really very little incentive to use something else.

      Now, if I were to start fresh, would I still choose vim? I think the answer is a resounding "probably." Here are some reasons why:

      • vi is ubiquitous, and vim is pretty common itself. vim is usually available, and when it's not (on older unixes say) I can still apply what I know to vi to get my job done. Obviously for those who aren't sysadmin types who only use one unix, this isn't much of an argument.
      • vim is text-mode; I can shell in and use it remotely just the same as using it locally. Obviously there is a trade-off here, and any text-based editor (joe, nano, etc.) have the same advantage. But it's why I don't use gedit.
      • vim is agile and powerful. I never have to reach for a mouse (or rather, I can't reach for the mouse) so you get quite proficient at common operations. vim has features like syntax highlighting and folding that I like for coding. Any modern programmer-oriented editor does this too, but vim does it all while being fast.

      vi[m]'s ubiquity I think is its strongest argument. Other editors exist to satisfy the other requirements, and some of them might even do it in less obscure ways. But if you're the type who needs to bounce around on different systems running different unixes, vi is always just there. And once you become proficient enough, you're really not strongly inclined to use anything else.

    9. Re:waiting by CastrTroy · · Score: 4, Informative

      The thing that most people don't realize about VI(M), is that it works very well when using things like telnet to edit your files. There are many characters like ctrl, alt, home, and such that don't travel well over telnet. Having a program like VI(M) is great when you're accessing from a remote system, and can only use the keyboard.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    10. Re:waiting by AnonymousKev · · Score: 3, Informative
      I can only speak for myself. I like vi because my hands never leave the keyboard. In just a few keystrokes, I can perform actions that take an annoyingly long time with a mouse. (This is coming from a longtime Mac user). There are some tasks that I don't mind using a mouse. But when I'm writing code, I never want to go groping about for the dang mouse. For me, using vi means working much much faster.

      I'll admit the initial learning curve is a pain, but once you've mastered the basic cursor movement/find/save set of commands, vi has an easy learning curve. You can use the basic command set for years and add one or two new commands as you need ("There has to be an easier way to do this..." [reaches for vi reference]).

      Efficiency is the main reason, but there are many others. Black backgrounds are easier on my eyeballs; syntax highlighting keeps me from making stupid mistakes; it's on every UNIX box by default; and I've been using it for 17 years -- muscle memory is a good thing.

      --
      Anonymous Kev
      Proudly posting as AC since 1997
      (Finally got a dang account in 2004)
    11. Re:waiting by jsveiga · · Score: 2, Insightful

      For me, it became the most used editor when I was an AIX customer support, and vi was what I could expect to find in any default installation (and most clients had only serial terminals).

      So either remotely accessing a client's system, or doing on-site support, I could always count on vi to be there. That's why when I took the holy decision between diving into vi or emacs, I picked vi.

      Now, I agree it has the most user-unfriendly interface, but once you know how to use it, it is very powerful. I still use it a LOT today, on Linux and Windows - certainlly not for making the company's catalog, but for configuration files, perl programming, html writing, comparing text files, etc.

      Learning to ride a motorcycle is (arguably) harder than learning to drive a car, but for certain jobs, the bike is better.

    12. Re:waiting by hackstraw · · Score: 2, Insightful

      So why is Vim so popular?

      For me, I don't want a GUI editor. I do to much (almost 100%) of my work over a terminal connection, and the GUI overhead is not worth anything to me. In fact, I have vi aliased to vim -X which turns off some X support. I don't remember what, but it gave me grief for some reason years ago enough to turn it off.

      Vim is way above vi. One thing I use all the time is "visual" mode, which is like selecting areas of text with a mouse and I can pipe that data through a filter, do a search and replace on that data, etc. Its a feature that came out in version 3 or maybe earlier, and I find it invaluable.

      I like a moded editor. I like infinite levels of undo. I like :q!. AFAIK, no other editor has an explicit option to "get me the hell out of here, I'm done, don't bother me about it. Thank you."

      Its hard to verbalize why I like vim because I've been using it for over 10 years now. All of my emails are composed in vim. All of my code is written in vim.

      Oh, color syntax highlighting. When I reopen a file that I opened last week, it goes exactly to the line that I left the file from last time. I can scoot from the top of the file, to the bottom, to the first comma, to the end of a line, I can do "cw", and it erases the current word and then allows me to start typing. I many times wish vi[m] keybindings were available in GUIs. It took me a couple of years to "get over it", but I still wish it exists.

      Vim is here to stay. Its one of the least buggy (I don't remember the last time I've had a bug in it actually) complex applications that I use on a daily basis.

      Its quick, dirty, and powerful. Just like me :)

    13. Re:waiting by kuzelnik · · Score: 3, Interesting

      1. Regular expressions even more powerfull than those in pearl
      2. I can configure vim to my tastes from "out of the box" state in a couple of minutes (I was tewaking my .emacs file for years and Xemacs still felt awkward)
      3. very, very powerfull and simple way to create macros and scripts
      4. Absolutely magnificent documentation
      5. fantastic mailing list where gurus and newbies are treated very, very well. I have seen Bram himself answer very simple beginers questions.
      6. great site with hundreds of scripts, tips, and other useful stuff.
      7. Bram has accepted several of my suggestions for improving some details in documentation and even suggestion for improvement of some code (a script for gunzipping files) ((It wasn't even proper patch, because I have never created patch file))

    14. Re:waiting by Bluesman · · Score: 2, Informative

      >And none (not even emacs) can do it with so few keystrokes (that does make the learning curve on Vi rather steep).

      Not so! That's why there's Viper.

      I was firmly on the vi side of the argument until I realized that emacs includes everything you could possibly want to edit code, including vi.

      --
      If moderation could change anything, it would be illegal.
    15. Re:waiting by Obfuscant · · Score: 2, Informative
      The disadvantage to such an effecient input system is when the cat jumps on your keyboard, you can have hours of work erased in Vi.

      You can have hours of work erased just by forgetting that vim has multi-level "undo", and that instead of being able to undo the undo you just accidentally undid, you'll be undoing something else, maybe even an entire paragraph somewhere else in the file.

      Plus, if you count on being able to know where you will start editing a file, vim can be a real surprise when it drops you somewhere into the middle of a file instead of row 1 column 1. If you've not edited that file for months, it is ridiculous for vim to assume that you want to go back to the last place you were. (You can remove this "feature" by making an unwritable .vimrc, I've found. It can't remember where you were in a file, so you start at the beginning.)

      And colorized editing!?! What a treat for text to show up as dark blue on black when you've set your xterm colors to white on black.

      Yes, I appreciate the work put into vim. I'd appreciate a "strict vi mode" command to tell vim not to do all the extra stuff that gets in the way of fingers that learned vi a long time ago.

    16. Re:waiting by PGC · · Score: 3, Funny

      <Esc>uuuuuuuuuuuuuuuuuuuuuuu <Ctrl>-R <Ctrl>-R <Ctrl>-R

      Or ... faster :
      <Esc>23 u 3 <Ctrl>-R

      --
      The Dutch will inherit the earth. If not, we'll settle for a bit of ocean. Beta delenda est!
    17. Re:waiting by say · · Score: 4, Informative

      I'll bite. A little enlightenment on vim can't hurt.

      instead of being able to undo the undo you just accidentally undid

      Well, almost every text editor and word processor in the world has this. The command for 'redo' (undo the undone) is :red or CTRL+R.

      vim can be a real surprise when it drops you somewhere into the middle of a file

      set viminfo='0 in .vimrc.

      And colorized editing!?!

      :syntax off (in .vimrc syntax off). Many color hints are given in :help syntax, you might wanna look. A hint could be :set background=dark.

      I'd appreciate a "strict vi mode" command

      vim -v

      --
      Roses are #FF0000, violets are #0000FF, all my base are belong to you
    18. Re:waiting by fbjon · · Score: 3, Insightful

      Since when has ctrl not travelled well over telnet/ssh? Typing e.g. Ctrl-X means you send a control code of the low-ascii kind.

      --
      True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
    19. Re:waiting by pilkul · · Score: 3, Informative
      You can have hours of work erased just by forgetting that vim has multi-level "undo", and that instead of being able to undo the undo you just accidentally undid, you'll be undoing something else, maybe even an entire paragraph somewhere else in the file.

      Ctrl-R to undo undos

      Plus, if you count on being able to know where you will start editing a file, vim can be a real surprise when it drops you somewhere into the middle of a file instead of row 1 column 1. If you've not edited that file for months, it is ridiculous for vim to assume that you want to go back to the last place you were.

      Put "autocmd BufRead normal gg" in your .vimrc

      And colorized editing!?! What a treat for text to show up as dark blue on black when you've set your xterm colors to white on black.

      :syntax off

      I'd appreciate a "strict vi mode" command to tell vim not to do all the extra stuff that gets in the way of fingers that learned vi a long time ago.

      :set compatible

      You're welcome :).

    20. Re:waiting by GigsVT · · Score: 3, Informative

      vimtutor

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    21. Re:waiting by Anonymous Coward · · Score: 3, Insightful
      for editor in "$editors"; do

      echo "Once you've learned ${editor}, it becomes probably the fastest editor to use. Never having to use the mouse. Being able to quickly move around a document. Complex (regex) searching/replacing. It has a steep learning curve, but it a very powerful and arguably intuitive editor. I first started using it ${some_time_ago} when I first got onto ${some_machines} at ${some_place}. Since then, I continually find myself trying to use ${editor} syntax in different editors. Its not uncommon to see ${popular_sequence} at the end of some of my emails or other documents."

      done

      Personally I use a number of editors depending on the machine I'm using and whatever it is I need to edit at some particular moment. The list goes something like emacs, vim, gedit, nano, and then whatever editing mode is available in IDEs I have to use, such as MonoDevelop.

      I understand that people might feel compelled to promote the use of their favourite editor(s), but in all honesty it never ceases to amuse me how some people have the charming naiveness to confidently declare to the world things like "once you learn it, $my_editor is probably the fastest editor to use". It reminds me of a nice interview with Rob Pike where, presented with the stupid question "Emacs or Vi?", he replied:

      [..] I don't expect any Slashdot readers to switch editors after reading these papers [..], but I think it's worth reading about them to see that there are ways of editing - and working - that span a much larger gamut than is captured by the question, 'Emacs or vi?'
    22. Re:waiting by RLiegh · · Score: 5, Funny

      >Have you heard of google?
      Nope. What can you tell me about it?

    23. Re:waiting by grmoc · · Score: 3, Informative

      $ vimtutor
      This is an effective little program for learning basic vi/vim.

    24. Re:waiting by kfg · · Score: 2, Insightful

      I might add the caveat that you have be a "real" touch typist to appreciate and be able to fully "unlock" the power of vim.

      Hunt and Peckers and "half and halfers" may not be able to utilize vim to it's full potential, and thus not actually realize any benefit from using it.

      Please forgive me, however, if I suggest to these people that the solution is to "learn to type." :)

      KFG

    25. Re:waiting by kfg · · Score: 2, Insightful

      >>Never having to use the mouse.
      >>
      >Sounds like every other editor in the world.
      >
      >>Being able to quickly move around a document.
      >>
      >Again, how is this unique?

      It isn't, but, as per my other post in this thread, it is unique in that its keyboard command sequences are optimzed for true touch typists, so once you learn them you can work at whatever your typing speed is, assuming that you think that fast (or type that slowly I guess).

      Isn't "intuitive" the *opposite* of "steep learning curve"? (Peopleware calls this "lying by repeated assertion.")

      Well, yes, but bearing in mind that calling anything but the nipple an "intuitive" interface is lying by repeated assertion. You even had to learn that your hands were good for something other than grabbing the tit. You just did it so long ago that it feels intuitive to pick something up.

      The only way software can be "intuitive" is by mimicing some already learned skill. Sometimes, however, this already learned skill can be inappropriate for a piece of software, like "knobs" that have to be "turned" with the mouse pointer.

      vi/m is "intuitive" (even though the commands themselves are not) to a trained touch typist, because it is, as per above, optimized for that already learned skill. The command sequences, although needing to be learned, are not entirely arbitrary.

      However, to a nontouch typist they are, because such a typist does not share the same skill set and reference plane. For vi/m to be "intutive" touch typing has to first be "intuitive."

      Which means you have to first spend a lot of time learning to touch type.

      KFG

    26. Re:waiting by chud67 · · Score: 2, Insightful

      Once you've learned vim, it becomes probably the fastest editor to use. Never having to use the mouse. Being able to quickly move around a document.

      Agreed. If you ever want to see a thing of beauty, look over the shoulder of a very experienced Vim user and watch how they unconsciously use the key combinations and edit files at near light speed; it will inspire you to learn Vim in earnest.

    27. Re:waiting by Eideewt · · Score: 2, Informative

      Vim is one of the fastest editors I've used. I haven't used them all, but I have used Vim, Emacs, ed, notepad and its ilk, and Sam. Its first big strength is that instead of hitting your down arrow twenty times then doing the same with the right arrow, for example, you can navigate to the same spot with five keypresses or so. "20j5w" would take you down 20 lines and forward five words. Compare that to the hold a key and wait that's commonplace in other editors, or the alternative, which is to fumble for the mouse and attempt to line up your cursor with a tiny row of text then attempt to click between the correct pair of letters. Vim takes away the wait between thinking and acting. It takes a single keypress to start appending a line. It takes two to delete or copy a line, and adding a number before that will extend it to take as many lines as you please. The thing that limits your speed most is deciding what to do.

      Vim is my first choice for any quick edits. When coding, I like to have the comforting weight of Emacs behind me, but there's no way it's as fast as vim. Maybe it could be almost as fast if you got really quick with c-u.

    28. Re:waiting by Kehvarl · · Score: 2, Funny


      >Have you heard of google?
      Nope. What can you tell me about it?


      It's a fully featured calculator, email, calendar, and chat system. Oh, it does searches too.
      It's really rather like emacs in that, someday, it may even get its own text editor.

    29. Re:waiting by BrokenHalo · · Score: 2, Informative
      In the case of Vim it is correct, with the possible exception of Teco.

      I would concur with the latter; indeed, Data General (back in the days of AOS/VS) used to bundle a version of Teco under the name of SPEED. Its only drawback was that the memory usage was quite heavy - but only at the user's end when trying to remember all those commands. ;-)

      But, of course, most people these days tend to forget that Emacs started out as a set of macros for TECO (Tape Editor and COrrector).

  2. syntax highlighting! by Gothmolly · · Score: 5, Funny

    I, for one, welcome our upgraded syntax highlighting overlords. I can't remember the last time I wrote syntactically incorrect code since I switched from vi. Of course, I can still write BAD code, or silly code, but vim catches my typos every time.

    --
    I want to delete my account but Slashdot doesn't allow it.
    1. Re:syntax highlighting! by dotgain · · Score: 5, Funny
      What I really love about vim is that no matter what obscure language I might end up writing in during my computer science studies, there always seem to be a syntax highligt setting for vim.

      Dude, you could edit /dev/kmem and vim would somehow figure out syntax highlighting for it.

  3. What's that odor ? by alexhs · · Score: 2, Funny

    This thread smells the troll, don't you think ? :)

    --
    I have discovered a truly marvelous proof of killer sig, which this margin is too narrow to contain.
  4. Vim 7 by Anonymous Coward · · Score: 3, Funny

    :%s/vim 6.4/vim 7/
    :wq

  5. This alone is worth it... by digitalhermit · · Score: 4, Funny

    Intelligent completion for C, HTML, Ruby, Python, PHP, etc.

    Yup, this one alone is worth it. Need to write some code? Forget your IDE and just use the C "autoprogram" feature of the new Vi. This message was composed with :set autorespond .

  6. Let's try it out by suso · · Score: 4, Funny

    quit
    q
    stop
    exit
    [esc]
    quit damnit
    ahhhhh

    (just kidding, I know how to quit from vim)

    1. Re:Let's try it out by gEvil+(beta) · · Score: 5, Funny

      ctrl-q
      alt-q
      alt-F4
      ctrl-c
      ctrl-d
      esc-esc-esc-esc
      awww, screwit...
      *power button*

      --
      This guy's the limit!
    2. Re:Let's try it out by ZombieRoboNinja · · Score: 2, Interesting

      You jest, but VI made me hate all coding for about a day.

      I was trying to contribute to a project using Mercurial, when lo and behold! It dumped me into VIM.

      Apparently, all I *really* was supposed to do here was enter a line of text describing my patch, save, and quit. But damned if I couldn't find a single menu to do that. The mouse was useless, and the menus were unnavigable.

      By the time I figured out :wq, I'd messed up my entire Mercurial depository and had to reinstall and manually patch the whole damn project because I'd botched it. Frigging :wq...

  7. Spell Check by Danathar · · Score: 3, Funny

    Now I can die.

    1. Re:Spell Check by Zontar_Thing_From_Ve · · Score: 2, Funny

      Now I can die.

      Or if you use Emacs you can wish you were dead.

      (ducks)

  8. vim 8 will do email by Tack · · Score: 3, Informative

    A spellchecker? Now, to be fair, I'll probably find that useful. Still I can't help but feel vim is one step closer to proving jwz's law.

  9. I just can't get the hang of vim by ylikone · · Score: 4, Interesting
    I've tried on and off since 1995 to get into using vi/vim and I just can't. I am unable to make it work as smoothly as "joe". That's right, for my choice of console-based editor, I use niether vi or emacs! "joe" has been doing everything I need a text editor to do easily since 1995. I cringe when I have to use vi/vim.

    I know I will get flamed for this. Oh well, it's the truth. I'm sure there are a few others that would agree with me.

    --
    Meh.
    1. Re:I just can't get the hang of vim by eln · · Score: 2, Informative

      Everyone has their editor of choice, but really vi is not that difficult. These days, you can even use the arrow keys to navigate to make it even easier (although I still prefer the letters). If you can't learn how to use vi well enough to perform basic text editing functions within about 20 minutes, maybe system administration is not for you.

      Vi is simple, elegant, and light-weight. It takes only a few minutes to learn, but years to truly master. Vim is a misguided attempt to add the bloat of emacs to vi.

      Other editors like joe may have their uses, but vi has two major advantages:

      1.) It has a deceptively simple command set that hides a tremendous amount of power. This is the Unix way.

      2.) It's included in virtually all Unix and Unix-like systems, which makes it a vital skill for any sysadmin.

      Vim is unnecessary and its "most useful" feature, syntax highlighting, is the first thing I disable whenever I use it, and I use it for development work (on systems where vi has been replaced by vim).

    2. Re:I just can't get the hang of vim by Gulthek · · Score: 2, Interesting

      I do some development from Windows and Linux.

      You just can't do stuff like:

      Delete ^M DOS returns - :%s/\r//g
      Turn ^M into "real" returns - :%s/\r/\r/g

      with Joe.

      More VIM tricks.

      Then there's block editing (quickly comment out sections of code), recording, complete access to all commands (including navigation) from the homerow of the keyboard, etc.

    3. Re:I just can't get the hang of vim by thePig · · Score: 2, Interesting

      I guess different people use VIM for different reasons -
      I *never* ever use syntax highlighting, but after using VIM for last 3 years (after using VI for around 2 years) I find that I cannot use VI at all nowadays.
      For ex - I got so used to multiple undo that VI is a real pain the neck now.
      Other VIM features I use a lot are multi window , remote editing (I work on a m/c which is almost half way across the globe, and remote editing is ONE important feature) & MACROs.

      Not to mention all the small (for ex: expandtab/visual mode etc) features.

      One anecdote -
      I had an activity, where I had to convert around 80K lines from PASCAL to a different (proprietary) language. A very boring and _no_use_ work indeed. We were given 2 months to do that. With the help of quite a bit of macros, I converted the whole thing in less than 3 weeks.

      So I dont think that VIM is a misguided attempt at all.

      --
      rajmohan_h@yahoo.com
    4. Re:I just can't get the hang of vim by cicho · · Score: 3, Funny

      "These days, you can even use the arrow keys to navigate to make it even easier"

      Said with a straight face too, I'm sure. Only on slashdot!

      --
      "Only the small secrets need to be protected. The big ones are kept secret by public incredulity." - Marshall McLuhan
  10. My history with VIM by ThePopeLayton · · Score: 4, Interesting

    I was a TA for a basic CS class for over a year. Upon first exposure the VIM (the editor that our system admins installed) many students got really frustrated. Most of them didn't understand how as they scrolled up on down with the mouse that random pieces of text got inserted all over their programs causing a tons of errors.

    I too was pretty annoyed with VIM at first as that it is set up in such a way that it expects you to be a power user. I haven't downloaded the latest version but will do so shortly. But I would like to see a version of VIM that the everyday joe shmoe could use. Less clunky font, easier to set preferencess, and a way to turn of all those linux short cuts that we non-linux people are plagued with. I think there is a definate need for a more userfriendly version of VIM

    1. Re:My history with VIM by AnonymousKev · · Score: 5, Insightful
      I was forcefully introduced to vi in 1989. It was in a two-week "Introduction to C" class from Cray. The instructor (I am not making this up: his name was Kermit) had made sure that vi was the only editor on the class computer. I'll never forget his words:
      vi is the most efficient editor ever written. You will hate it intensely for the first two weeks, after that you will discover you can't live without it.
      He was absolutely right.
      --
      Anonymous Kev
      Proudly posting as AC since 1997
      (Finally got a dang account in 2004)
    2. Re:My history with VIM by Anonymous Coward · · Score: 2, Informative

      There is a more user-friendly version of Vim for Windows types, at least: 'gVim Easy' is installed in Vim's 'Start' menu entry when you use the Vim all-in-one installer for Windows. It's Vim with a GUI and no command mode. No ESCing; no arcane shortcuts; everything accessible from a graphical menu.

      Has anyone who complains about how "difficult" Vim is actually tried it more recently than 1991?

    3. Re:My history with VIM by Buck2 · · Score: 2, Informative

      For exactly the reason you mentioned, cursor placement. Insert inserts and append appends. They're fundamentally different approaches and, as such, they have different behaviors. They also extend to such places wherein you can also use "shift-i" to insert at the beginning of the line or "shift-a" to append to the end of a line.

      Append becomes very useful if you're writing a quick macro to tack or change something onto/in a filename and you don't want to bother with a shell script.

      Suppose, for example, that you have a few files in a directory:

          pic1.gif pic2.gif pic3.gif pic4.gif

      And you want to convert them all to PNG. You can do this a few ways, but, these are what I use most commonly:

      method 1, with bash)
      for i in `ls *.gif`; do convert $i ${i%gif}png; done

      method 2, with vim)
      bash> ls *.gif > dothis; vim dothis
      [now, in vim]
      q1 [macro in register 1]
      yy [yank this line]
      p [paste it below]
      k [move back up a line]
      J [join the two lines together]
      A ["append"]
      bksp-bksp-bksp [erase the gif extension]
      i ["insert"]
      png
      esc
      0 [go back to the beginning of the line]
      j [move down a line]
      q [quit the macro]
      10@1 [do that ten times]
      1G [go back to the first line]
      q1iconvert j0q10@1 [insert a bunch of converts] :wq [save and quit]
      bash> sh dothis

      It looks more complicated than it is. Each step is simple and easy. It's only when you write it all down that it looks hard. The whole point of vi(m) is to stay the hell out of the way and let you move things around as easily as possible.

      --

      As my father lik@(munch munch)... ....
  11. vim plugins by kwench · · Score: 3, Interesting

    Now I'm waiting for a vim-plugin for Firefox and Opera, just like the Konqueror guys did it. So I can finally spellcheck and syntaxcheck my slashdot comments... ;-)

  12. Cut and Paste? by hey · · Score: 2, Insightful

    I wonder if it has a nicer way to cut and paste.
    I have always been unhappy with yank-number of lines
    or marking, etc.

    1. Re:Cut and Paste? by thePig · · Score: 2, Informative

      Try Esc V + use arrow keys to copy.
      Paste is usual Shift + Insert.

      Also you can use -

      Esc v -> visual mode - character wise
      Esc Cntrl+V -> Visual mode - coloumns

      Whatever is in the visual mode also copies. So very easy

      --
      rajmohan_h@yahoo.com
    2. Re:Cut and Paste? by initsix · · Score: 2, Interesting

      I love vi, but I have always had a paste issue using vim. I typically use vim over ssh from a windows machine. I run into problems when I switch to insert mode and paste from (Windows) clipboard. Vim likes to insert a tab on every new line.

      I end
                up with text
                          that tends to format
                                        like this.

      It is very annoying and I end up either trying to find an old school vi binary or use pico or the old cat > foo.txt trick. Does anyone have any idea to stop the auto indent feature?

    3. Re:Cut and Paste? by AveryT · · Score: 2, Informative

      1. position cursor on the first line you want to cut/copy
      2. mx (create mark "x")
      3. position cursor on the last line you want to cut/copy
      4. y'x (yank from mark "x" to current)
        or
      4. d'x (delete from mark "x" to current)

      x can be any letter from a to z

    4. Re:Cut and Paste? by Mister+Furious · · Score: 5, Informative

      Try this: :set paste

      That should fix that problem, but it has some other weirdnesses. So, once you're done pasting set it back to nopaste: :set nopaste

      You could probably map that to a shortcut if you wanted to make it quicker. I don't need it that often, so I haven't bothered.

    5. Re:Cut and Paste? by Anonymous Coward · · Score: 2, Informative

      For a permanent fix, comment out the line with 'set autoindent' in /etc/vim/vimrc

    6. Re:Cut and Paste? by thePig · · Score: 2, Informative

      for VIM, I found that it comes default with autoindent and smartindent switched ON.
      Just set it OFF. :se noai nosi

      And try the same.

      --
      rajmohan_h@yahoo.com
  13. On OS X, it's all about SubEthaEdit by spud603 · · Score: 2, Informative

    For years I tried to indoctrinate myself with vi, too.
    Then i found SubEthaEdit for mac os x.
    I've really found no need for anything else since. I highly recommend anybody on an apple try it out. I feel like it follows the philosophy of vi (lightweight, responsive, simple, functional), but integrates well with the rest of the OS (uses apple's spell check, plays well with os x services and keyboard shortcuts). and, though i know this isn't for everyone, it follows apple's emacs-style ctrl-f, ctrl-b, etc navigation.

    1. Re:On OS X, it's all about SubEthaEdit by caseih · · Score: 3, Funny

      Sure but SubEthaEdit has a very annoying and on-going bug that the developers cannot seem to reproduce or fix. Invariably, SubEthaEdit litters my code with random ":" and sometimes ":w". It's very annoying. Occasionally I see other random sequences appear like "gg", "yy", "dd", and "x".

  14. slightly different paradigm by everphilski · · Score: 4, Interesting

    The paradigm is different that most other editors. Most other editors use control keys (of some sort) for functions. Vi you enter into edit mode and type away, then leave edit mode and operate on your work. It is a different concept but it has its advantages. (For one: Except for capital letters I've never had to press two buttons at once, ever ... you escape to exit your edit mode and then it is all single key sequences to do what you want. Simple things but, for example, hitting the control button requires shifting your hand in an akward position wheras :w you don't have to move whatsoever ... )

    1. Re:slightly different paradigm by hackstraw · · Score: 2, Informative

      Except for capital letters I've never had to press two buttons at once, ever

      ^X^F in insert mode to complete files. Gotta have it. Better than trusting my fingers, and takes less typing.

    2. Re:slightly different paradigm by abiessu · · Score: 2, Interesting

      It is that huge chasm between 'edit' and 'command' modes, along with the "optimizations" in command mode that are geared towards the QWERTY keyboard layout (HJKL for movement? not so easy/intuitive in Dvorak-* layouts...) that keep me away from vi. By 'chasm', I mean the fact that you have to jump all the way to the escape key and then come back. And what about being in command mode and (accidently) trying to enter text? Suddenly you've just executed some set of commands (which can presumably be undone), but you don't necessarily realize it right away. Oh... and if your only complaint is that the Ctrl key is difficult to reach, why not remap it in place of Caps Lock (or just switch the mapping of the two)?

      I'm not going to claim that emacs is the epitome of greatness, nor that vi is evil. It's just that emacs seems to work a lot better for me than vi does.

      --
      Let S_n = {nst+us+vt : s,t in Z \ {0}, u,v in {-1,1}}. For all n in Z where |n| > 2, Z \ S_n is infinite... right?
    3. Re:slightly different paradigm by hackstraw · · Score: 2, Insightful

      You can't beat the simplicity of c-x, c-c, or c-v for editing and the cursor keys for moving about. I don't care if vim has 10,000 other features, I use only those ones I mentioned for perhaps 99.9% of everything I do.

      Cut, copying, and pasting others' code :) What a job!

      Sure, ^S is simple. But then you are in "the mercy of the editor" mode. Then your editor is going to ask you, "Do you want to save your changes?" "Do you really want to overwrite the file?" "Are you really, really sure you want to save this file?" "What filename do you want?"

      In vim, I can do ":w newfilename". ":q!" ":w!" ":wq!" or what have you. I'm in control, not my editor.

      Moded editing is "strange", but all editors have it. When you're doing finds or search and replaces, like it or not, you're in a different mode. Emacs has "^" mode, and a certain "^" sequence to get out of it.

      Its just that vi[m]s modes are more powerful and discrete.

      I guess I am religious about my editor, because its my editor and I know how to use it, and it gets the job done. But I don't push my religion on anybody. I tell new *NIX people, you have to learn a editor. Its imperative. I don't care if its pico or sed. You have to know an editor. It kills me when people get all "emacsy" on me and they only use it because they know 3 or 4 features, and the arrow buttons work. I work with an emacs guy that uses vim for macros because they are so easy to do, and then goes back into emacs for typing.

      I have _never_ met an emacs user that knew how to use it. Its sad.

    4. Re:slightly different paradigm by Coryoth · · Score: 3, Interesting

      I have _never_ met an emacs user that knew how to use it. Its sad.

      That's sad, because someone who truly knows how to get the most out of Emacs can be very impressive. Most of the people I know don't really know how to use vi. Sure they can do i for insert, and dd for delete line and so forth, but they hardly use the full feature set. Of course I have witnessed a few people who really know how to use vi, and that is something to behold. A real Emacs user is no different. Just because you haven't met one doesn't mean they don't exist (I've met many myself).

      Jedidiah.

  15. My favorite editor by bennomatic · · Score: 4, Funny
    When all the other websites were putting badges on saying, "made with dreamweaver", or "made with go-live", or whatever, I made the following for my site:
    made with vi

    --
    The CB App. What's your 20?
  16. still hungry people in Uganda by Anonymous Coward · · Score: 2, Informative

    http://www.vim.org/htmldoc/uganda.html ... while RMS could finish Hurd from his emacs fundraising

  17. Re:No Mac Version 7 by aardwolf64 · · Score: 4, Informative

    The link from the main MacVIM page is broken, but here is 7.0 for OSX:
    http://macvim.org/OSX/index.php

  18. Re:Vim mean... by h4rm0ny · · Score: 3, Insightful


    Typing with two fingers is simpler than trying to remember which of the "correct" fingers go on which keys. But take the time to learn it properly and you can type far faster than you ever did before, even if there's a temporary drop in speed while you learn.

    It's the same with Vi. Even if you don't learn everything that it can do, the simple fact that I can do all the major operations without having to use a bloody mouse is a plus for a touch-typist like myself. Vi is very small, very quick and very powerful. The learning curve is worth it.

    --

    Aide-toi, le Ciel t'aidera - Jeanne D'Arc.
  19. The ESC key annoys me by ylikone · · Score: 2, Interesting

    I find continually having to use the ESC key to be highly annoying. And really, to save a file, I don't really see CTRL-S being harder or slower to type than ESC :w

    --
    Meh.
    1. Re:The ESC key annoys me by cortana · · Score: 2, Informative

      I realise that this isn't going to make you jump ship, but if you find yourself on a machine with only vim, try :behave mswin. It enables windows-like shortcuts such as C-z for undo, C-s for save, C-x for cut, C-c for copy and C-v for paste. Probably more but those are the only ones I use often enough to remember.

  20. Someone had to... by Nightreaver · · Score: 3, Funny

    Someone had to remind slashdotters of the superior editor... Ed, man!

    1. Re:Someone had to... by stinerman · · Score: 2, Funny

      The best part:

      And ed doesn't waste space on my Timex Sinclair. Just look:

      -rwxr-xr-x 1 root 24 Oct 29 1929 /bin/ed
      -rwxr-xr-t 4 root 1310720 Jan 1 1970 /usr/ucb/vi
      -rwxr-xr-x 1 root 5.89824e37 Oct 22 1990 /usr/bin/emacs

  21. You mean ed users by Cleveland+Steamer · · Score: 5, Funny

    From: patl@athena.mit.edu (Patrick J. LoPresti)
    Message-ID:
    Sender: news@athena.mit.edu (News system)
    Subject: The True Path (long)
    Date: 11 Jul 91 03:17:31 GMT
    Path: ai-lab!mintaka!olivea!samsung!zaphod.mps.ohio-stat e.edu!think.com!snorkelwacker.mit.edu!bloom-picayu ne.mit.edu!athena.mit.edu!patl
    Newsgroups: alt.religion.emacs,alt.slack
    Organization: Massachusetts Institute of Technology
    Lines: 95
    Xref: ai-lab alt.religion.emacs:244 alt.slack:1935

    When I log into my Xenix system with my 110 baud teletype, both vi *and* Emacs are just too damn slow. They print useless messages like, 'C-h for help' and '"foo" File is read only'. So I use the editor that doesn't waste my VALUABLE time.

    Ed, man! !man ed

    ED(1) UNIX Programmer's Manual ED(1)

    NAME
              ed - text editor

    SYNOPSIS
              ed [ - ] [ -x ] [ name ]
    DESCRIPTION
              Ed is the standard text editor.
    ---

    Computer Scientists love ed, not just because it comes first alphabetically, but because it's the standard. Everyone else loves ed because it's ED!

    "Ed is the standard text editor."

    And ed doesn't waste space on my Timex Sinclair. Just look:

    -rwxr-xr-x 1 root 24 Oct 29 1929 /bin/ed
    -rwxr-xr-t 4 root 1310720 Jan 1 1970 /usr/ucb/vi
    -rwxr-xr-x 1 root 5.89824e37 Oct 22 1990 /usr/bin/emacs

    Of course, on the system *I* administrate, vi is symlinked to ed. Emacs has been replaced by a shell script which 1) Generates a syslog message at level LOG_EMERG; 2) reduces the user's disk quota by 100K; and 3) RUNS ED!!!!!!

    "Ed is the standard text editor."

    Let's look at a typical novice's session with the mighty ed:

    golem> ed

    ?
    help
    ?
    quit
    ?
    exit
    ?
    bye
    ?
    hello?
    ?
    eat flaming death
    ?

    Note the consistent user interface and error reportage. Ed is generous enough to flag errors, yet prudent enough not to overwhelm the novice with verbosity.

    "Ed is the standard text editor." Ed, the greatest WYGIWYG editor of all.

    ED IS THE TRUE PATH TO NIRVANA! ED HAS BEEN THE CHOICE OF EDUCATED AND IGNORANT ALIKE FOR CENTURIES! ED WILL NOT CORRUPT YOUR PRECIOUS BODILY FLUIDS!! ED IS THE STANDARD TEXT EDITOR! ED MAKES THE SUN SHINE AND THE BIRDS SING AND THE GRASS GREEN!!

    When I use an editor, I don't want eight extra KILOBYTES of worthless help screens and cursor positioning code! I just want an EDitor!! Not a "viitor". Not a "emacsitor". Those aren't even WORDS!!!! ED! ED! ED IS THE STANDARD!!!

    TEXT EDITOR.

    When IBM, in its ever-present omnipotence, needed to base their "edlin" on a UNIX standard, did they mimic vi? No. Emacs? Surely you jest. They chose the most karmic editor of all. The standard.

    Ed is for those who can *remember* what they are working on. If you are an idiot, you should use Emacs. If you are an Emacs, you should not be vi. If you use ED, you are on THE PATH TO REDEMPTION. THE SO-CALLED "VISUAL" EDITORS HAVE BEEN PLACED HERE BY ED TO TEMPT THE FAITHLESS. DO NOT GIVE IN!!! THE MIGHTY ED HAS SPOKEN!!!

  22. On any UNIX box vi is always there for you by rasper99 · · Score: 3, Insightful

    The best reason to know vi is that it is unsually installed on every UNIX box. It is a hoot to see someone who doesn't know vi working on a system that doesn't have emacs do cat >file

    1. Re:On any UNIX box vi is always there for you by RPI+Geek · · Score: 2, Interesting

      I'm a fresh college grad breaking into the consulting business and the guys I work for insist that I learn vi for that exact reason. The example they gave me was: when you're sitting at a client's terminal with them breathing down your neck to make some simple changes, vi (or ed, but I won't go there) is simply the fastest way to do it, and when you do it fast enough it looks like magic to an inexperienced bystander. My preference is for the windowed editors like Crimson Editor or even Notepad, but I'm learning how important these "low level" tools can be.

      --

      - "Nobody came out that night, not one was ever seen. But Old Man Stauf is waiting there, crazy sick and mean!"
  23. Cool. As a Debian user... by just_another_sean · · Score: 2, Funny

    I guess I can look forward to getting a package sometime in 2007 :-)

    --
    Creationist Textbook Stickers Declared Unconstitutional by CowboyNeal
  24. Version 7? by yet+another+coward · · Score: 5, Funny

    GNU Emacs is at version 21.4. Can we really trust such an immature editor?

    1. Re:Version 7? by MimsyBoro · · Score: 2, Informative

      You do know that Emacs is at version 1.21.4. They stopped using the major version number because it hasn't changed in the last couple of decades...

      --
      God made the natural numbers; all else is the work of man - Kronecker
    2. Re:Version 7? by Coryoth · · Score: 4, Funny

      You do know that Emacs is at version 1.21.4. They stopped using the major version number because it hasn't changed in the last couple of decades...

      I had heard they dropped the major version number, but I always presumed it was 0.21.4, with the expectation that Emacs would finally hit 1.0.0 once it was feature complete.

      Jedidiah.

  25. And shockingly enough... by ylikone · · Score: 4, Funny

    ..your site looks like it was made by someone that only uses vi.

    --
    Meh.
    1. Re:And shockingly enough... by Cal+Paterson · · Score: 4, Funny

      A quick look at your linked site reveals the following; 91 HTML errors by the W3C html validator A horrible Mac OS X design 8 "use *"/"created by *" buttons "This site best viewed at 1024x768 or higher resolution" Links to Opera and Skype (obviously two perfect examples of good GNU/Linux software) and more a bunch of crappy amazon "paymepaymepaymepaymepaymepaymepayme" links Perhaps you should keep it down.

  26. Re:Why vim is worse than vi by Anonymous Coward · · Score: 2, Informative
    It needs an option: "justlikevi=true"

    For vi-compatible mode try
    :set compatible
    or on the command line
    vim -C
    If it still insists on syntax highlighting type
    :syntax off
  27. I 3 VIM by Gunark · · Score: 5, Informative

    I'm a long-time-VIM-hater-turned-lover. I've been working with Linux systems for years, but always refused to learn my way around VIM, choosing to stick with nano instead. Why for the love of god not at least make Ctrl-C or Ctrl-Q or 'quit' or SOMETHING work???

    After sitting through a presentation of a heuristic analysis of VIM in one of my HCI classes, where VIM was ridiculed for being the most un-intuitive, un-user friendly pieces of software since MS-DOS, I never thought I'd find myself using this tool... and actually LOVING it.

    Well... fast forward a few months... I got fed up with nano's lack of a search-and-replace feature, and didn't feel like learning awk or sed. I finally decided to give vim a serious try. The key was finding this cheat sheet.

    Now I love it... I'm cw'ing, y'anking, dd'ing away. Mind you I still prefer Eclipse for full-fledged development, but there's nothign like super quick and efficient scripting with vim.

    Learn it. It's worth it.

    1. Re:I 3 VIM by lawpoop · · Score: 2, Insightful

      I got fed up with nano's lack of a search-and-replace feature

      Are you talking about ctrl+backslash functionality, or something else?

      ^\ (F14) (M-R) Replace text within the editor

      Though it doesn't say so, you first enter a search string and then a replace string. You then get a confirmation on each instance.

      --
      Computers are useless. They can only give you answers.
      -- Pablo Picasso
    2. Re:I 3 VIM by pjt33 · · Score: 2, Insightful
      I got fed up with nano's lack of a search-and-replace feature
      Which version of nano? I use Debian so I don't even have the most recent version (I'm at 1.2.4), but it does have search-and-replace, including regex support.
    3. Re:I 3 VIM by YoungHack · · Score: 2, Informative

      My favorite cheet sheet is the one here:

      http://limestone.truman.edu/~dbindner/mirror/#Vi-R ef

      "The spirit of Vi on one page."

  28. Re:Ahhhhh.... by stuntpope · · Score: 4, Informative

    This feature (ctrl-n auto-complete) was available in vim 6. The change in 7 is that the possibilities for completion now appear in vertical group; before, I had to press ctrl-n multiple times to cycle through the possibilities.

    From what I'm reading in the vim7 docs, what *is* new is "omni completion". You press ctrl-x ctrl-o to invoke it. But when I tried that on a Python file with vim 7 installed from their Windows binary, I got "Error. Required vim compiled with +python."

  29. Re:Interesting... by Macrobat · · Score: 4, Funny
    .. When did Perl get demoted to 'etc'?

    It didn't. It's right there in '/usr/bin/' where it's been all along.

    --
    "Hardly used" will not fetch you a better price for your brain.
  30. it is what it is by toby · · Score: 2, Informative

    There's always pico, nano, Diakonos, gedit, ... But frankly I love using vi[m] :)

    --
    you had me at #!
  31. Steep learning curve...? by mogrify · · Score: 2, Funny

    I tried to figure out exactly how steep vi's learning curve is, and I got a DivideByZeroException... :(

    --
    perl -e 'foreach(values %SIG){$_="IGNORE";}while(){}'
    1. Re:Steep learning curve...? by Ymerej · · Score: 2, Informative

      The standard Cognitive Psychology term "learning curve" refers to a graph of the amount learned as a function of time. See the "learning curve" question in this quiz. So a graph of your skill with vim as a function of time would be rather shallow. But "steep" sounds harder, like climbing a steep hill. I know, I know, resistance is futile, and usage trumps the original offical definition. OK, I think I can go a couple of years now without saying this.

  32. Re:Ahhhhh.... by Coryoth · · Score: 2, Interesting

    This feature (ctrl-n auto-complete)...You press ctrl-x ctrl-o to invoke it.

    Now forgive my ignorance because I'm not a Vim user, but I thought (and what I keep hearing) is that vim is supposed to be better than emacs because it doesn't use complicated multi-key shortcuts using the control key etc. What happened? At this rate why not just use emacs with gnuclient (for fast access) and viper mode (for your basic vi keybindings)?

    Jedidiah.

  33. No praise for Bill Joy? by hogger · · Score: 2, Informative

    This thread isn't complete without mention of Bill Joy, the creator of vi. He's the one that should be thanked for most of the things that everyone has mentioned that they love about vim.

    http://www.theregister.co.uk/2003/09/11/bill_joys_ greatest_gift/

  34. Re:Ahhhhh.... by drinkypoo · · Score: 2, Insightful

    At this rate why not just use emacs with gnuclient (for fast access) and viper mode (for your basic vi keybindings)?

    Because firing up emacs in order to edit a text file is like using a backhoe to dig a post hole. Sure, you can do it with the right attachments (the auger) but you could get it done just as quickly and a lot more cheaply by just using a post hole digger. Emacs probably uses at least twice the system resources vim does (I'm not doing a comparison so I'm sticking with small statements) and most people will never want to use any of emacs' features besides text editing.

    So basically, for the average user, emacs is either the slowest-loading editor ever, or an extremely bloating text editing service (if used in daemon mode.) Loading it every time is for retards. Keeping it in memory if the only thing you're using it for is editing text files is only marginally less stupid, especially since it will periodically decide to swap itself out, and then you have to page it back in before you can edit.

    The reason that any vi-clone is "better" than emacs is the lower overhead, and the ability to do everything using typewriter keys, which are present (and typically in the same location) on every terminal. Also, you don't have these bizarre key combos that destroy your hands. I have an ex-boss who blames his carpal on emacs, now he has to use one of those kinesys keyboards that don't require wrist movement during typing, and he still can only type for about three or four hours a day total - pretty crap for a programmer. Of course, that's purely anecdotal, but it's pretty funny, if you're not him.

    --
    "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  35. First vi encounter by Arandir · · Score: 2, Interesting

    My first vi encounter was back in the days of the dinosaur. It was the later cretaceous, to be exact. At the time people used a wide variety of terminals to connect to the computer. The terminals themselves tended to be system specific, so that some had function keys, other didn't; some had arrow keys, others didn't; and some had meta keys, while others didn't. Using such a variety of terminals for Unix was a major problem, ranking up there with the problem of using a huge variety of printers. But then came vi and it didn't need function keys, arrow keys or meta keys. I could finally have a full screen text editor on ANY terminal I chose. With a tiny handful of commands I could be productive. In comparison to the other editors, it was easy to use. At the time vi was a huge step forward.

    Modern interfaces with mice and menus and toolbars may have made vi somewhat obsolete, but I would still rather write software using vi than with <hack> MSWord...

    p.s. The problem with emacs was that it requried two meta keys, which weren't always available, and even if they were, may be in different keyboard locations under different names. It also required chording which slows down typing (especially if you weren't sure where the meta keys were on this keyboard). And as other people have pointed at, at the time you were guaranteed that vi would be available on any Unix system, while access to emacs was hit or miss.

    --
    A Government Is a Body of People, Usually Notably Ungoverned
  36. Re:Ahhhhh.... by MrBlue+VT · · Score: 2, Informative
    Here's a very useful code completion mapping I use. It lets you just hit Tab in insert mode to perform the completion instead of having to do Ctrl-N or whatever. Still lets you insert regular tabs too. Just stick it in your .vimrc file.
    function InsertTabWrapper()
        let col = col('.') - 1
        if !col || getline('.')[col - 1] !~ '\k'
            return "\<tab>"
        else
            return "\<c-p>"
        endif
    endfunction
     
    inoremap <tab> <c-r>=InsertTabWrapper()<cr>
  37. Isn't Vi part of POSIX and Unix Specification? by HighOrbit · · Score: 2, Interesting

    IIRC, the presence of vi and ex are part of required compliance for POSIX and the Single UNIX Specification. So, it is not just there by convention or convenience, but is a requirement for guaranteed inter-operaability, along with ed, sed, and awk. Or does POSIX simply define the behavior of those tools and not require their presence?

  38. Notepad++ by netrage_is_bad · · Score: 2, Interesting

    Ever since I found notepad++ http://notepad-plus.sourceforge.net/, I have never looked at another editor.

  39. Re:I HATE VI. Convince me otherwise. by the_greywolf · · Score: 4, Informative
    ...does Vim do all the stuff jEdit can do?

    in a word, yes.

    more specifically, Vim can do everything Emacs can do, and has a lot of features i find every other editor lacking in. there's even an IRC client.

    Line Numbering,

    :se nu or :set number

    Folding,

    there are lots of ways to do it. there is also a good deal of built-in support that works with most of what you'd do out-of-the-box. (note: i don't use folding much, but i instead rely on '%' to jump around and '#' or '*' to find definitions.)

    Bracket Scope Highlighting

    in the standard distribution of Vim in Gentoo, that's on by default. as you type, opposing brackets are highlighted and missing pairs are marked with color. elsewise, you can use '%' to find matching parens, brackets, braces, whatever very quickly.

    ... What's with search and replace across directories, etc.
    Or is it that one is expected to use other CLI tools for that?

    personally, i find sed to be more than adequate for the job. if you want integration in your editor, these commands might work:

    :argdo %s/foo/bar/
    :bufdo %s/foo/bar/
    :windo %s/foo/bar/

    ...although if you want to modify files not already open in the editor, again, sed works just as well and can be run from within vim with :!. of course, being somewhat of a fairly new user to Vim (only been using it for a couple years now), i'm always learning new features.

    --
    grey wolf
    LET FORTRAN DIE!
  40. My knowledge of vim... by FuzzyDaddy · · Score: 3, Informative
    I've been using vi or vim in some context for over ten years. Here's what I know about it:

    Right slash to search

    Period to repeat a command

    I to insert at the beginning of the line, i to insert at the cursor

    :w to write, :q to quit, :wq to do both, :q! to quit without saving

    :23 to go to line 23

    yy to copy a line, 5yy to copy 5 lines

    dd to delete a line

    cw to change a word

    :syntax on for syntax coloring

    ma and y'a or ma and d'a to delete or copy a block

    p to paste

    u for undo

    x to delete a character

    % to find a closing bracket or parenthesis

    That's really all I've ever learned or needed. It's a pretty small subset (and getting smaller with each release), but I get by on it!

    --
    It's not wasting time, I'm educating myself.
  41. Vim Crash Course :wq by Baricom · · Score: 2, Informative

    In addition to the above (all excellent, and probably recommended, resources), here's an absolute beginner's crash course to getting around in vim. (RTFM for much, much more.)

    Once you launch vim, you're in command mode. You do stuff in command mode.
    When you need to type something, you need to switch to insert mode. Type i in command mode for that.

    Type all of these in command mode to use them. To move from insert mode to command mode, press ESC.

    j - move down
    k - move up
    h - move left
    l - move right
    i - insert mode :w - save file :q - quit :wq - save file and quit :q! - quit without saving :help - self-explanitory

    If this was all vim was, nobody would use it. The power comes in the ability to do complicated text manipulations with just a few keypresses. For example, you can do many commands more than once by prefixing them with a number. Typing 25l is equivalent to pressing the right arrow key 25 times in a typical text editor. You just saved 22 button presses.

    I would personally recommend vimtutor, as another poster suggested. Just type that at a shell and vim will start with a text file that explains how it works. That's how I learned the basics. It took about 10 hours over the span of five days to go from absolutely no knowledge to being comfortable using vim regularly.

    Good luck.

    1. Re:Vim Crash Course :wq by dlbornke · · Score: 2, Informative

      Yep ... or s.th. like that:

      "Delete all lines which do not begin with the work 'ERROR'" (for log files):
      :g!/^ERROR/d

      "Comment out all lines that contain the word 'debug'":
      :g/debug/normal I//

      "Indent the whole file":

      gg=G

      "Sort the file and delete double entries":
      :%!sort|uniq

      etc., etc. ... and once you know how to use the help, it's really easy to find this über-stuff

  42. Another Cheat Sheet by students · · Score: 3, Informative

    I saw this Quick Reference linked elsewhere on slashdot. It is less comprehensive but prettier and easier to tape to the wall because it is printer-friendly. Normally I'm not printer friendly, but who wants to start a browser just to look up Vim features?

  43. Comparing with Eclipse by zerosignal · · Score: 2, Insightful

    I've never used vim or emacs, but would like to learn. However, I'm concerned that I'd be losing out on a lot of Eclipse's functionality when it comes to writing Java, e.g. refactoring, object-sensitive method name autocompletion, etc. Would vim or emacs really be better?

  44. Cream by pajama · · Score: 2, Informative

    If you like Vi try Cream:

    Cream

  45. aside from bash... by gregorlowski · · Score: 2, Interesting

    vim is the program that I use most. I used to code mostly shell stuff as a sysadmin and RAD niche programs: bash, perl, python, ruby... I always use vim for that. I also use vim for html, css, javascript, latex, and plain-ol' writing any kind of text.

    These days I've been using eclipse a lot in emacs mode because my current job requires lots of java coding of a program with a huge code base, and my wrists are starting to hurt. Seriously, emacs is also good (IMHO not as fast as vim if you know both really well -- I use emacs mode in bash and know it pretty durn well too), but the weird stretches that you do in emacs will give you serious hand and wrist problems from awkward repetitive hand movements.

    The other reason I prefer vim is that I REALLY LIKE having an editing mode separate from an insert mode. I like using vim to navigate through my code without worrying that I'll accidentally delete a character or make a typo. I actually do that all the time when I use emacs mode in eclipse, and then I have to undo my changes (but sometimes it takes a second to figure out which was the last intentional change).

    With vim I can navigate through my file with little worry that I'll mess anything up.

    And vim is FAR superior to old vi!!! Syntax-highlighting, word completion (C-n, C-p, dictionary completion, file completion...)

    Emacs may be somewhat more powerful/extensible, and I believe it's quite good for coding in C/C++ and integrating with build tools -- a wonderful editor and environment. But for shear editing speed I think NOTHING can beat vim.

    1. Re:aside from bash... by doti · · Score: 2, Informative

      Have you tried the vi mode on bash (set -o vi)?
      Now I can live without it.

      Oh, and remap your caps-lock key to behave as escape too, it's much more comfortable.

      In X:
              xmodmap -e 'remove Lock = Caps_Lock' -e 'keysym Caps_Lock = Escape'

      On the console:

              echo 'keycode 58 = Escape' | loadkeys -

      On Windows:

      REGEDIT4

      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contr ol\Keyboard Layout]
      "Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,01,00 ,3a,00,00,00,00,00

      --
      factor 966971: 966971
  46. Anyone got some time? by sdfad1 · · Score: 2, Interesting

    Can someone tell me how easy is it to extend vi/vim? I know it's in the manual and all that, but this is a question about the workflow. Can I define a function to be called anytime I want in vi/vim? In Emacs, it's quite trivial:

    C-x b
    That's control-x b, to change buffer ...

    *scratch*
    ... to change to scratch (as in scratchpad)

    (defun blah (arglist) (interactive) (...))
    just type away the function, ... is the required action - it's just code.

    C-x C-e
    evaluate last-sexp. No need to compile. No need to make or whatnot.

    To run it now,
    M-x blah

    That's it. That takes no effort at all. This can be bound to a key by M-x local-set-key (tab completion is your friend here). For frequently used functions, save it in ~/.emacs

    Or alternatively,
    C-x (
    to start defining a keyboard macro.

    ... keystrokes ...
    type your commands here, put some thought into this, could be tricky

    C-x )
    end keyboard macro

    C-x e
    Execute keyboard macro, subsequent e to repeat keystroke sequence.

    To name the macro,
    M-x name-last-kbd-macro (or somesuch, check manual for your specific version), it now looks just like a function. Can be saved, edited, etc by:

    M-x edit-kbd-macro
    or M-x insert-kbd-macro
    Too easy...

    I've heard of users coming up with a Java bytecode disassembler in under 20 minutes using these methods...see here

    Newer versions of Emacs has macro rings for storing multiple macros or whatnot. I know vim has numbered keyboard macros, seems slightly better, but I cannot judge until I've tried it.

    How about vi/vim?

  47. I suspect Bram is reading, so... by IDontLinkMondays · · Score: 2, Interesting

    I had the pleasure to meet Bram several years back at Linux Expo NY 1999. The man is truly a unique individual. While the majority of Linux geeks (especially the Slashdot crew, who tended to through things at their audience and just act goofy) clowned around a great deal, everyone bragging about thier accomplishments, and of course everyone bragging about all their stocks and options, Bram was very down to earth. This is a man that has legitimately made a tremendous impact on the UNIX world.

    There is a fairly funny story about Bram, we were sitting at the hotel, waiting for a Taxi or something, having a nice discussion about the evolution of Unix (I think, could have been that I was asking him about the Netherlands, who knows, doesn't matter in this context) and this gentleman, a man that I would have otherwise considered a fish out of water in my home town of NYC, performed an amazingly interesting feat.

    There was a man sitting at the bar behind the bench we were sitting on. He had left his overcoat resting on the railing surrounding the bar. Another man came in off the street. He didn't look particularly unusual, maybe a little dirty for someone that belonged in a $300 a night hotel, but construction workers have conventions to, so why not, right? The man from the street stood next to the bench minding his own business as my conversation with Bram progressed, and then out of nowhere, Bram's arm flyed past my head and I found this other man nearly falling on me.

    What had happened was the man from the street began to walk off as if he was heading to a Taxi himself and in the process had tried to take possession of the overcoat of the man at the bar when he wasn't looking. Bram had stopped the thief in the act and after the whole occurance was over, the hotel guard was resolving the issue and the man at the bar was brushing his jacket off and leaving his mouth gaping, Bram sat down and we continued our conversation as if nothing had ever happened.

    Well, it's an interesting story to me at least. Sadly, it really takes a foreigner in NYC to be honest enough to go out on a limb to stop a thief. But the man with the overcoat should be thankful I hope.

    Anyway, Bram, I don't typically talk about where I come from in this board, I like the minimal anonyminity that you're allowed as a logged in poster. But it's good to hear you're back in action. I'd also like to express the considerable pain and suffering I survived having ported a 1.2million line application to QNX using your VIM, I can at least say thanks for :make

    Good luck with future versions, send me a private message if you'd like. It would be good to hear from you again.