Slashdot Mirror


Hacking Vim 7.2

briancarper writes "Vim is an open-source text editor with a power and flexibility matched only by the steepness of its learning curve. As the author of this book states, 'Vim Can Do Everything' but configuring it to do so is sometimes daunting. Hacking Vim 7.2 aims to help the average Vimmer get the most out of customizing Vim, for fun and productivity." Read on for the rest of briancarper's review. Hacking Vim 7.2 author Kim Schulz pages 244 publisher Packt Publishing rating 8 reviewer briancarper ISBN 1849510504 summary Customizing and scripting Vim 7.2 Vim has an overwhelming number of features. Its built-in help system and documentation are comprehensive and easy to navigate once you know what you're looking for, but knowing where to start is sometimes very difficult. The best you can hope for in a book is a broad outline to point the way toward features that you didn't know much about. Hacking Vim 7.2 achieves this goal.

No topic is covered in nearly the depth you'll find in the official documentation (or even on the Vim Wiki), but every topic is covered in enough detail to let you know that a feature exists and to point you in the right direction to begin using it. Most helpfully, throughout the book are references to things to look up in Vim's help system, as well as links to various relevant scripts.

This is not a book for an absolute Vim beginner; some familiarity with Vim is assumed. And for a Vim fanatic, much of the material may be common knowledge for you already. But any seasoned Vimmer will tell you that there are always things to learn about this editor, and I think nearly everyone will learn something from this book. For someone who uses Vim and is looking to master it, this book is a great starting point, though you'll still need to dive into the official reference material to really cement your knowledge.

The book starts on an odd note. Chapter 1 is a history of vi and the various vi clones released over the past couple decades. This information is interesting trivia and serves to give credit to programmers who paved the road to Vim, but it doesn't really help anyone "hack Vim" in any way. The book probably could've done without this chapter.

Chapter 2 deals with customizing the overall look and feel of Vim. How and where to edit vimrc is covered, with brief attention given to cross-platform issues. It covers the basics (changing font faces and colors, customizing menus and toolbars), as well as pointing out some more obscure settings, like highlighting the cursor row and column (creating a kind of "cursor crosshair"), and using the match feature to highlight multiple search terms at once. This chapter is a good foundation for later chapters and a good introduction for anyone who has never edited their own vimrc.

Chapter 3 is about text navigation. Sadly, the book doesn't go into as much detail on movement commands as I would've liked. The ability to move around and manipulate text quickly in Normal Mode by combining counts and motions/operators is one of Vim's most unique and powerful features, but it only gets a few paragraphs here.

There are some interesting key mappings provided, for example how to move up and down between "virtual" lines when lines are soft-wrapped. Search is covered briefly, both plain text search and multi-file search via vimgrep, but there's little information about Vim's powerful regular expressions, which I thought was a shame. Marks are discussed, both normal "hidden" marks as well as visible "signs", the latter being a feature I've never used.

Chapter 4 is about "production boosters" and covers a wide variety of topics. Much of the chapter is devoted to "templates" and "snippets", which allow you to build skeletons of commonly-used source code (with fill-in-the-blanks markers) that can be re-used when editing new files. A system for using these templates is built from scratch using Vim script, providing a clever and useful example of scripting in action.

Auto-completion is covered in a lot of detail. Some custom key mappings are provided to help make "omni-completion" in Vim a bit easier to invoke. This chapter also very thoroughly covers Vim's multiple copy/paste registers and how they work. Recording and using macros, pointed out as one of Vim's more overlooked features, gets a good, lengthy example.

"Undo branching" in Vim is wonderful, but difficult to understand. Chapter 4 gives a simple, step-by-step example of why it's useful and how it works. This chapter also briefly discusses folding, vimdiff, netrw (editing files remotely via SSH and other protocols), and ctags. There's lots of good stuff in this chapter and you're almost certain to learn something useful.

Chapter 5 covers text formatting, both using built-in Vim commands and by piping text through external tools like par and tidy. A lot of space is devoted to using Vim to prettify plaintext, for example by centering titles on a line, adding ASCII-art dashes for headers and making bulleted lists. If you edit plaintext in Vim often, this is probably a great chapter, but I didn't find much use for most of it.

For programmers, the book discusses the different indentation styles available in Vim and very briefly shows how to write your own indentation functions, and how to indent and reformat blocks or whole files of code all at once. "Paste mode" also gets a passing mention. Personally I think a programmer reading this book would've benefited from much more detail about Vim's myriad indentation and text-wrapping options and how they work together, as this can be one of the most frustrating parts of Vim to configure correctly.

I had high hopes for Chapter 6 and 7, which deal with Vim scripting, but I was largely disappointed. Chapter 6 deals with scripting basics, and is essentially a beginner's language tutorial. It explains which variable types exist in Vim script, how if/then/else works, how for- and while-loops work, how function parameters operate, and so on, but anyone who knows a modern scripting language will learn these things quickly without much effort. There's also some basic information about how to write a syntax-highlighting script from scratch, but there's not really enough information to allow you write one for a real programming language.

Chapter 7 is supposed to be about "extended scripting" topics, but serves largely as a style guide. It details how to structure a script to check for compiled-in features and Vim version number. This chapter touches briefly on using SID and PLUG to namespace functions, but the explanation and example left me puzzled. How to use the debugger and how to make Vimballs are both explored, and the book points out that you can use Perl, Python and Ruby to script Vim without going into much detail or giving solid examples.

If you're looking for any advancing information on writing your own functions in Vim script, you're mostly out of luck here. Previous chapters in the book do include some useful and practical functions, but those functions are never really taken apart or explained in detail.

Finally there are two appendices, one of which lists a bunch of games you can play in Vim (again this could've been left out of the book and I wouldn't have missed it), as well as examples of using Vim as a mail, chat, and Twitter client. There's also a feature-by-feature comparison of Vim to MS Visual Studio, showing that many of Visual Studio's abilities can be provided in Vim given the proper scripts. I thought it was an interesting demonstration that Vim really can do everything, just in case the reader had any doubts at this point. The last appendix is a style guide for keeping your vimrc clean, mostly via common sense and splitting your configuration into multiple files.

Overall, stylistically the book is a bit dry and humorless, but it's easy enough to read and it gets its information across clearly. There were a few typos and editing errors, including a few rather glaring typos in some code examples, but overall the author seems extremely knowledgeable about Vim. The best parts of the book are where the author says "this was useful to me personally, so here's how I do X". This book is clearly written by someone who uses Vim all the time, and most of the information provided is practical and immediately usable.

I do feel the book should've gone into more detail in many areas. At 244 pages, the book is short and gives a rather shallow view of many of Vim's features. But the book hits all the right notes and leaves few features entirely unexplored.

I'd recommend this book to any person who uses Vim and wants to explore features they may have been missing. There's nothing in this book you won't find in Vim's built-in documentation, but this book lays everything out in an easy-to-read format, and should serve as a good starting point to customizing and mastering Vim.

You can purchase Hacking Vim 7.2 from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

246 comments

  1. but... by Keebler71 · · Score: 1, Interesting

    but does it tell you how to pronounce "Vim"??? (first post?)

    --
    "It takes considerable knowledge just to realize the extent of your own ignorance." - Thomas Sowell
    1. Re:but... by Keebler71 · · Score: 2, Funny

      I'm actually being serious... at great loss of nerd-cred... I've always wondered if it is pronounced "vim", "five-immm" or "six-mmm" or is the "i" sound a hard "I"? I've used to use it a lot when I had a linux file server in the house but it is not a word that has ever come up in casual conversation so I've never had a need to actually know...

      --
      "It takes considerable knowledge just to realize the extent of your own ignorance." - Thomas Sowell
    2. Re:but... by morgan_greywolf · · Score: 0, Offtopic

      but does it tell you how to pronounce "Vim"??? (first post?)

      Yup! You pronounce it "ee - mah - ks".

    3. Re:but... by c++0xFF · · Score: 4, Informative

      I've always pronounced it with vim and vigor. That seems to help.

    4. Re:but... by Anonymous Coward · · Score: 0

      I pronounce it like "veem"

    5. Re:but... by swanzilla · · Score: 4, Informative

      Vim stemmed from vi, which was never pronounced "six", so mostly, you are barking up the wrong tree. Vim is loosely "Vi IMproved" and the "i" sound is a soft "i" by convention.

    6. Re:but... by Nadaka · · Score: 1

      I have always pronounced vi as (Vv eye). So i would pronounce vim as Vyme (Vv eye mm). like vine, but with an m.

    7. Re:but... by Idiomatick · · Score: 1

      Rhymes with rim.

    8. Re:but... by sconeu · · Score: 1

      Well, it has been pronounced "six", but only as a joke.

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    9. Re:but... by Tawnos · · Score: 1

      And is often the best way to get the job done.

      Why are you looking at me like that?

    10. Re:but... by just_another_sean · · Score: 1

      Hmm, I always heard vi was supposed to be pronounced "vee eye" so I always
      say the whole name when speaking about Vim, therefore "vee eye improved".

      Not sure it's right though and I suddenly feel like just saying Vim (as
      in your vim and vigor example that is) would have saved me at least a
      small portion of my time over the years! :-)

      --
      Creationist Textbook Stickers Declared Unconstitutional by CowboyNeal
    11. Re:but... by smithberry · · Score: 3, Informative

      The Vim documentation tells us "Vim is pronounced as one word, like Jim, not vi-ai-em." So I guess it sounds like Jim. http://vimdoc.sourceforge.net/htmldoc/intro.html

    12. Re:but... by Jurily · · Score: 1

      Being Hungarian, I find 'weem' most natural.

    13. Re:but... by thetoadwarrior · · Score: 1

      vim is an existing word so I've pronounced it like that meaning it sounds like trim, imo.

    14. Re:but... by swordgeek · · Score: 0, Redundant

      Interesting question, to which there is a definitive and correct answer: A single syllable word.

      From the docs:
            "Vim is pronounced as one word, like Jim, not vi-ai-em. It's written with a capital, since it's a name, again like Jim."

      vi, on the other hand, is pronounced as two separate letters:
            It's pronounced as if it were initials: ``vee eye''.
            Not ``six''.
            Not ``vye''.
            But ``vee eye''.

      --

      "People who do stupid things with hazardous materials often die." -- Jim Davidson on alt.folklore.urban
    15. Re:but... by Anonymous Coward · · Score: 0

      Am I the only person who thinks that User Friendly is shit? Usually people's art improves after they do it for a few years, but this guy has been doing it THIRTEEN and if anything it looks worse now than when he started.

      Then there's the jokes, if they could be laughably named as such. I mean, seriously. UF's idea of a good joke is pretending someone mixed up vi for VI. I can't even imagine the kind of brain damage I would need to laugh at that.

    16. Re:but... by psithurism · · Score: 1

      ... at great loss of nerd-cred... I've always wondered if it is pronounced...

      How can we take your nerd cred for admitting to a lack of face to face communication?

      btw: the projects I worked on, interacting with 50 or so people use the pronunciation: vee with the ee like in fee for vi, but pronounce vim like whim but starting with a v sound instead of a wh.

    17. Re:but... by Anonymous Coward · · Score: 0

      Bah, all UNIX beards can be burnt. I don't use vim at all but have always pronounced vi(1) as /vi/, not /vi:/, not /vai/, not the official /vi: ai/.
      Why waste sounds in the name of a minimalist editor?
      Next thing you learn they call ed(1) /i:di:/.
      Fuck off, emacsorzrotflmaoenloading... users!

    18. Re:but... by turbidostato · · Score: 1

      "Being Hungarian, I find 'weem' most natural."

      Being Hungarian I thought you'd find vIm to the most natural.

    19. Re:but... by socceroos · · Score: 1

      Careful. His nerd cred is forfeited because when he was involved in face-to-face communications he failed to mention vi or vim.

    20. Re:but... by Anonymous Coward · · Score: 0

      nine hundred and ninety four

    21. Re:but... by Macka · · Score: 1

      Same as "him" just replace the first letter. There are no vowels after the i so there's nothing to change the sound. You wouldn't pronounce zip as zeep or z-eye-p, and vim is no different.

  2. Short version by Anonymous Coward · · Score: 5, Funny

    Use EMACS

    1. Re:Short version by Anonymous Coward · · Score: 5, Funny

      I'm trying! It's been loading since 2005, so give me some more time dude.

    2. Re:Short version by eviloverlordx · · Score: 0, Offtopic

      Hold on, I need to set up my Beowulf cluster just to run it...

      --
      'Loose' is when your pants are three sizes too big. 'Lose' is when you misuse 'loose'.
    3. Re:Short version by eln · · Score: 4, Funny

      Use EMACS

      But I already have an OS, why would I want to install another one just to edit text?

    4. Re:Short version by Tetsujin · · Score: 4, Funny

      I'm trying! It's been loading since 2005, so give me some more time dude.

      See, there's your problem... Rather than wait five years for it to load, you should have waited a year or two, upgraded your machine, and tried again. :)

      --
      Bow-ties are cool.
    5. Re:Short version by yuriyg · · Score: 3, Funny

      I tried Emacs a while ago. While I found it to be a superb operating system, I couldn't find a good text editor for it.

    6. Re:Short version by Anonymous Coward · · Score: 0

      HAHAHA.

    7. Re:Short version by Marcika · · Score: 1

      I tried Emacs a while ago. While I found it to be a superb operating system, I couldn't find a good text editor for it.

      You can open the text editor in Emacs by typing "M-x viper-mode". HTH.

    8. Re:Short version by K.+S.+Kyosuke · · Score: 1

      And we already have physical machines, so why should we install Java and .NET virtual machines just to run software? I.e., this way, your text processing code can run on two dozens of platforms, on some of which there is no better alternative as far as sane text editing is concerned. Add to this the surprisingly sane XML editing functions of Emacs and you've won big time if you have to hack XML configs etc. at least from time to time.

      --
      Ezekiel 23:20
    9. Re:Short version by Anonymous Coward · · Score: 1, Insightful

      why should we install Java and .NET virtual machines just to run software?

      We don't.

    10. Re:Short version by Svippy · · Score: 1

      Real men use ed.

      --
      Clicked pie.
    11. Re:Short version by Anonymous Coward · · Score: 1, Funny

      This is Ed, and I am tired of being used.

    12. Re:Short version by DMUTPeregrine · · Score: 1

      M-x viper-mode solves that.

      --
      Not a sentence!
    13. Re:Short version by Anonymous Coward · · Score: 0

      Do I actually type "M" "dash" "x" or , just the m and the x, hold both of them down, or do I hold down some command sequence and x? That's what's fucking confusing about emacs.

    14. Re:Short version by ailnlv · · Score: 0, Redundant

      real men read the appropriate xkcd comic.

      They also know when to stop a joke.

    15. Re:Short version by Anonymous Coward · · Score: 0

      I tried using Emacs, but I only have ten fingers so it was too difficult.

    16. Re:Short version by TheRaven64 · · Score: 1

      In this context, M means meta. Unfortunately, if you're not using a proper UNIX system, you may not have a meta key, so meta will be remapped to something random, possibly alt or control. Of course, some EMACS control sequences also use alt and control, so you will end up confused either way.

      --
      I am TheRaven on Soylent News
    17. Re:Short version by aBaldrich · · Score: 0, Redundant

      Real programmers use vim, ed, cat, a magnetized needle or butterflies.

      --
      In soviet russia the government regulates the companies.
    18. Re:Short version by Bratmon · · Score: 0

      so meta will be remapped to something random, possibly alt or control.

      Or *cringes* open start menu.

    19. Re:Short version by Anonymous Coward · · Score: 0

      I tried Emacs a while ago. While I found it to be a superb operating system, I couldn't find a good text editor for it.

      It has one--check out viper mode.

    20. Re:Short version by slashsloth · · Score: 1

      ois@zig:~$ EMACS
      -bash: EMACS: command not found
      ois@zig:~$ echo $?
      127
      ois@zig:~$

      --
      The ducks in the bathroom are not mine. [http://www.27bslash6.com]
    21. Re:Short version by Anonymous Coward · · Score: 0

      While I found it to be a superb operating system, I couldn't find a good text editor for it.

      What are you talking about? Emacs comes with it's own installation of Vi.

    22. Re:Short version by Anonymous Coward · · Score: 0

      :%s/EMACS/vi/g

  3. Bloatware? by Anonymous Coward · · Score: 0

    First things first: VIM is a wonderful tool and I use it almost daily, for hours a day.

    But I'm getting a bit miffed by all the cruft that's added. From a lean and mean editor it is growing into a bloated monstrosity. If I wanted that I'd just as well use Emacs...

    What I would like is a way to compile in (or rather, to leave out) all the gimmicky stuff I never use anyway. That way it loads faster and is a much more responsive tool.

    1. Re:Bloatware? by Jason+Quinn · · Score: 3, Interesting

      I just trying starting up and shutting down vim a few times on an old machine. There was absolutely no noticeable startup time. This is on an older machine that was running *simulations* in the background. Just exaclty how much faster do you want it to load?

    2. Re:Bloatware? by beleriand · · Score: 3, Informative

      If you ever look at :version, it spits out this huge list of features, each with a "+/-" in front.

      I suppose when you build your own custom verion, there is a way that you can configure your version to leave most of those features out.

      In fact debian seems to have done just that, they ship "vim.tiny" in the base install with just 640k, which should be enough for everyone.

    3. Re:Bloatware? by ThePhilips · · Score: 1

      Add :filetype off to your .vimrc. That should disable most of the cruft.

      Last bit is this (sorry for ma poor Engrish).

      To lesser extent, but yes, VIM is slowly getting more and more bloated - more and more time one has to invest into disabling all the annoyances. Though it is still worth it. (Unlike Emacs, where you can't configure much. You either take it as a whole or look for another editor.)

      --
      All hope abandon ye who enter here.
    4. Re:Bloatware? by Runaway1956 · · Score: 1

      Perhaps we should define "old machine". To some people, my dual core Opteron on an Asus SK8V clocked at 2.2 Ghz might be an old machine. To other people, you might have to go all the way back to a socket 7 to be "old". Yet others might argue, and insist that it isn't "old" unless you're running a 286. *shrug* I don't know what you mean by "older machine"!

      --
      "Windows is like the faint smell of piss in a subway: it's there, and there's nothing you can do about it." - Charlie Br
    5. Re:Bloatware? by Anonymous Coward · · Score: 0

      What I would like is a way to compile in (or rather, to leave out) all the gimmicky stuff I never use anyway.

      Well, there's always nvi and Elvis...

    6. Re:Bloatware? by Anonymous Coward · · Score: 0

      You don't get Emacs. If you want to configure it, do it. Its configuration language is Lisp.

      --A Haskell Writing Vim User

    7. Re:Bloatware? by ThePhilips · · Score: 1

      Have you tried it? I did.

      I once wanted to make sure that Emacs always indents with tab, but even cc-mode developers couldn't help me. I have tried to unroll the nested hooks which are responsible for the handling of keys where the broken indentation was happening but at the IIRC 7th level of nesting I have simply given up.

      That's [*BEEP*]ing unmanageable. I have a full-time job already. And configuring Emacs is a full time occupation, a luxury I can't afford. Nor I wanted to become dependent on something so unmanageable for the crucial task of source code editing, which takes about 90% of my working time.

      No, I do not like modes of VIM. In fact I hate them. Yet I learned to live with them. Because I still could make out of VIM precisely the editor I needed - within few days - without wasting precious time (I spent two weeks configuring Emacs) hacking through endless megabytes of the unmaintainable elisp mess.

      --
      All hope abandon ye who enter here.
    8. Re:Bloatware? by The+boojum · · Score: 1

      Honestly, Emacs does have a lot of stuff, but it's pretty much all load-on-demand these days. Jokes aside, a basic startup can be pretty darn quick:

      % time emacs -nw -Q --kill

      real 0m0.089s
      user 0m0.067s
      sys 0m0.012s

      If I force it to load CC mode with a ~4kloc C++ file to edit, that rises to about 0.185s real. More importantly I only pay the extra delay the first time. Things are pretty much instant after that. If that's not enough, I can amortize the cost over a persistent session running for weeks at a time with multiple clients attached from different terminals.

    9. Re:Bloatware? by agrif · · Score: 1

      I have no idea what version of emacs you tried to configure, but I have mine configured to use tabs only, and it was definitely not a hassle. It took me a few days, yes, but now it works exactly how I want it to.

      If you ever give it another whirl, try (tab-width 4) and (c-basic-offset 4). This will force emacs to use tabs for all indentation.

      Sure, configuration in lisp is certainly a bit harder, but it is also way more flexible. You can also configure emacs with the built-in configuration editor, too, if you like handy documentation with your settings.

    10. Re:Bloatware? by Anonymous Coward · · Score: 0

      vim.tiny would be great, but it's a bit TOO stripped down. No support for multiple buffers (E.g. :b2, call that what you will) for a start, which is a huge pain in the ass. vim.tiny is fine for editing a single file but not for everyday use.

    11. Re:Bloatware? by Anonymous Coward · · Score: 0

      it was definitely not a hassle

      and

      It took me a few days

      Jeepers! What's your definition of hassle ?

  4. That word... he doesn't seem to know what it means by clone53421 · · Score: 4, Interesting

    Customizing something is not “hacking” it. Hacking something is taking it and using it to do something that it wasn’t originally designed for in a creative way that most people would never think of.

    This is the only part of the book that is illustrative of “hacking” Vim:

    Finally there are two appendices, one of which lists a bunch of games you can play in Vim (again this could've been left out of the book and I wouldn't have missed it), as well as examples of using Vim as a mail, chat, and Twitter client. There's also a feature-by-feature comparison of Vim to MS Visual Studio, showing that many of Visual Studio's abilities can be provided in Vim given the proper scripts. I thought it was an interesting demonstration that Vim really can do everything, just in case the reader had any doubts at this point.

    --
    Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
  5. You know you're doing something wrong when by Anonymous Coward · · Score: 0, Insightful

    ... you have to hack your text editor

    1. Re:You know you're doing something wrong when by John+Whitley · · Score: 4, Insightful

      How on earth is this insightful? I don't know of a single software dev who doesn't end up adding significant hacks/customizations to their editor to make the tool fit their working style better. There's even a nice spectrum in most popular dev editors between "customize" and "hack" -- which goes right up through the occasional feature addition or bug fix in the app itself.

    2. Re:You know you're doing something wrong when by IICV · · Score: 5, Funny

      ... you finish your subject in the comment body

    3. Re:You know you're doing something wrong when by idontgno · · Score: 1

      You know you're doing something right when you can hack your editor.

      You know there's something terribly wrong with you when you don't feel the urge to hack your editor.

      Don't confuse those.

      --
      Welcome to the Panopticon. Used to be a prison, now it's your home.
    4. Re:You know you're doing something wrong when by clone53421 · · Score: 1

      He didn’t finish his subject in the comment body of his post, he started his comment in the subject line of his post. There’s a difference.

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
    5. Re:You know you're doing something wrong when by Anonymous Coward · · Score: 0

      He didn’t finish his subject in the comment body of his post, he started his comment in the subject line of his post. There’s a difference.

      Much like the difference between you and a comedian. You make jokes. Comedians make people laugh.

    6. Re:You know you're doing something wrong when by Anonymous Coward · · Score: 0

      Personally I prefer to concentrate on solving the problem at hand instead of thinking of ways I can waste time playing with toys.

    7. Re:You know you're doing something wrong when by clone53421 · · Score: 1

      Unlike you, I wasn’t trying to be funny.

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
    8. Re:You know you're doing something wrong when by ljw1004 · · Score: 1

      I suspect most users of Visual Studio don't add significant hacks (other than installing third-party plugins like Resharper)

    9. Re:You know you're doing something wrong when by amRadioHed · · Score: 3, Insightful

      Configuring your editor is something you pretty much do once then forget about. The time wasted by not configuring your editor is ongoing.

      --
      We hope your rules and wisdom choke you / Now we are one in everlasting peace
    10. Re:You know you're doing something wrong when by Anonymous Coward · · Score: 0

      But both are equally deserving of death.

    11. Re:You know you're doing something wrong when by asc99c · · Score: 1

      My main one is using this plugin: http://www.viemu.com/ :)

    12. Re:You know you're doing something wrong when by Anonymous Coward · · Score: 0

      Configuring and hacking are not the same things. Do not confuse them.

    13. Re:You know you're doing something wrong when by sorak · · Score: 1

      So I assume you use notepad?

    14. Re:You know you're doing something wrong when by John+Whitley · · Score: 1

      That's in no small part because Visual Studio tries its level best to avoid any sort of sane portability of user customization settings. It's nominally possible to export and import some settings these days, but it's such a PITA that even experienced VS users I know of mostly don't bother.

    15. Re:You know you're doing something wrong when by TheRaven64 · · Score: 1

      A minute of customisation of a tool that you use every day can save a huge amount of time. I have a huge blob of vim script that I copy to every machine that I use, and it means that I can do some common tasks on one keystroke rather than a dozen or so. Multiplied by the amount of times that I do such things, it's a huge net win.

      --
      I am TheRaven on Soylent News
    16. Re:You know you're doing something wrong when by UnknownSoldier · · Score: 1

      > I don't know of a single software dev who doesn't end up adding significant hacks/customizations to their editor to make the tool fit their working style better.

      *cough* Like hex-editing Notepad++ to support 6 pt fonts ... (faster then building from source :)

    17. Re:You know you're doing something wrong when by Anonymous Coward · · Score: 0

      thAn.

  6. Wow by Anonymous Coward · · Score: 2, Insightful

    Vim has an overwhelming number of features. Its built-in help system and documentation are comprehensive and easy to navigate once you know what you're looking for, but knowing where to start is sometimes very difficult.

    It's really intuitive, once you get to know how to use it.

    1. Re:Wow by Tetsujin · · Score: 2, Insightful

      Vim has an overwhelming number of features. Its built-in help system and documentation are comprehensive and easy to navigate once you know what you're looking for, but knowing where to start is sometimes very difficult.

      It's really intuitive, once you get to know how to use it.

      I hate to ruin a perfectly good joke by being all serious, but, actually, that would be true of a lot of applications. (Or, perhaps, it's not accurate to call them intuitive at all - rather, they just offer enough support via documentation, etc. to help you muddle through) Anything that's hard to get started with, but offers a lot of assistance once you're up and running. I'd say Emacs fits this description to some extent - cryptic keyboard shortcuts (which are quite handy once you learn 'em) - and then there's commands you can search for, and even execute, by name. It's handy when I have a pretty good idea what the command name might be, but not what the shortcut is, or where it's located in the menu system or customization system, etc. I'd say the same could be true of MS Word as well - it confronts you immediately with a wall of controls, and it can be hard to find your way around, but it also offers a lot of support. Then there's specialized applications, content creation stuff especially like Photoshop or 3DS Max - which can be complicated just due to the amount of power they offer... There's a lot to learn, in other words, but the application helps you to learn it.

      --
      Bow-ties are cool.
    2. Re:Wow by ThePhilips · · Score: 1

      Very true.

      Sounds bit stupid, but in VIM one has to learn even how to type text.

      When I started with Linux 10+ years ago, I have dedicated two weeks to each: Emacs and VIM. Everybody had recommended Emacs, but after spending two weeks with it, reading mail lists and talking to devels I still couldn't configure it to work as I wanted it to. Next came VIM and it really took me two days to learn the basics and how configure it to my liking - and start working efficiently without further digging.

      Otherwise, compared to Emacs, VIM is magnitudes more easier to configure, mainly thanks to the excellent, thoroughly indexed documentation. Emacs' hooks are the dependency hell and I wouldn't want to dig through them even if given money.

      --
      All hope abandon ye who enter here.
    3. Re:Wow by assertation · · Score: 1

      It's really intuitive, once you get to know how to use it.

      Isn't that true for anything?

      If it was really intuitive a book like this wouldn't have been necessary.

    4. Re:Wow by turbidostato · · Score: 1

      "I hate to ruin..."

      Wow! a meagre 218-word paragraph to define "consistency".

      I think Merriam-Webster is wanting to rewrite "concise". I'll vote for you.

    5. Re:Wow by Draek · · Score: 1

      Isn't that true for anything?

      If only. Take MS Office, for instance: most people can do the basics on it well enough, but even after years of using them, if you were to ask them "how would you set up separate 'profiles' each with a different default formatting?" for instance, they'd go menu hunting *everywhere* rather than replying with a conscise "if it can be done, it should be over here".

      Something similar happens with Eclipse and Photoshop but it's not as bad. Though I suspect it's due to the relatively higher level of competence from its users rather than an objectively better interface.

      And just before anybody thinks I'm just flaming Microsoft, let me state that in my opinion Visual Studio is one of the best IDEs in that respect. It does things in its own, slightly unusual way (though nowhere near as quirky as Emacs or Vim), but once you 'grok' it you can pretty much tell where everything is or should be.

      --
      No problem is insoluble in all conceivable circumstances.
  7. Yes, but... by FreeFlyer · · Score: 2, Funny

    Can it help me find the holy-grail?

    1. Re:Yes, but... by Yvan256 · · Score: 1

      Ni!

    2. Re:Yes, but... by blair1q · · Score: 1

      Yes. Once you have vim, you can install cscope, and there you are.

    3. Re:Yes, but... by aix+tom · · Score: 1

      Yes:
      /holy-grail

    4. Re:Yes, but... by Anomalyst · · Score: 1, Informative
      try

      /holy\-grail

      for proper results

      --
      There is no right to feel safe thru security vaudeville at the expense of everyone's freedom, privacy and tax money.
    5. Re:Yes, but... by mario_grgic · · Score: 1

      Why yes it can. Type :h holy-grail in VIM and see what happens :D.

      --
      As the island of our knowledge grows, so does the shore of our ignorance.
    6. Re:Yes, but... by freakxx · · Score: 0, Troll

      > Can it help me find the holy-grail?

      Listen, VIM is a text editor, and if u expect it to find u the holy-grail, u r a complete moron. However, there is something out there to help u in your quest. It's called EMACS. Happy now?

  8. Re:That word... he doesn't seem to know what it me by clone53421 · · Score: 1

    That was directed at the author of the book, by the way, not the reviewer or Slashdot editor who posted the story.

    Additionally, I think she’s a woman, although the extra letter in “she” wouldn’t have fit in the size limit for the subject of my post. (“Kim” could be either male or female but I looked on Google and it seems her full name is Kimberly.)

    --
    Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
  9. For those wondering how to stop reading by Anonymous Coward · · Score: 0

    A first-time reader might have trouble figuring out how to stop reading the book. You just type escape, colon, q, exclamation point, click your heels three times and say "There's no place like the command prompt."

    1. Re:For those wondering how to stop reading by clone53421 · · Score: 1

      Pff. I never do that; it’s much easier to just flip the (light)switch.

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
    2. Re:For those wondering how to stop reading by Kell+Bengal · · Score: 1

      Easy!

      --
      Scientists point out problems, engineers fix them
      altslashdot.org: The future of slashdot.
    3. Re:For those wondering how to stop reading by ThePhilips · · Score: 1

      ... how to stop reading the book.

      Funnily enough, F1 works in VIM as expected: open the help. And the :qa! tip is right there close to the top (in my VIM is on 4th line).

      --
      All hope abandon ye who enter here.
    4. Re:For those wondering how to stop reading by Arker · · Score: 1

      ^:q!

      The mnemonic is "ESCape this COLON thingy - Quit and do !RETurn

      Seriously, though, emacs vs. vi jokes aside, either one is a decent editor, and pretty much nothing else comes close.

      --
      =-=-=-=-=-=-=-=-=-=-=-=-=-=-
      Friends don't let friends enable ecmascript.
    5. Re:For those wondering how to stop reading by TheRaven64 · · Score: 1
      Or, as one user I found had done, you hit control-z. He was complaining about a weird error, something like 'fork: resource unavailable' whenever he tried to run a new program. It turned out that he'd been suspending his vi processes because he couldn't work out how to exit them, and had ended up hitting the system's per-uid process limit.

      Oh, and ZZ also works for exiting vim - some people find this easier to remember.

      --
      I am TheRaven on Soylent News
  10. Re:That word... he doesn't seem to know what it me by NonUniqueNickname · · Score: 3, Funny

    for fun and productivity

    That's two counts of *hacking* right there. As vim wasn't originally designed for either use.

  11. Re:That word... he doesn't seem to know what it me by jd · · Score: 0, Offtopic

    Kim Kimberley. Wasn't she the detective in the Level 9 adventure Snowball?

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  12. "Steep" learning curve by Dracker · · Score: 4, Interesting

    This is one of my pet peeves.

    A steep learning curve refers to something that is quickly learned, as the curve that represents knowledge over time would indeed be steep in that case.

    Something difficult would have a shallow learning curve, not a steep one.

    1. Re:"Steep" learning curve by Tetsujin · · Score: 5, Insightful

      This is one of my pet peeves.

      A steep learning curve refers to something that is quickly learned, as the curve that represents knowledge over time would indeed be steep in that case.

      Something difficult would have a shallow learning curve, not a steep one.

      I think usually when people talk about learning curves, the horizontal axis represents knowledge and the vertical axis is your investment to acquire that knowledge.

      Is there some established convention that contradicts this?

      --
      Bow-ties are cool.
    2. Re:"Steep" learning curve by tnordloh · · Score: 1

      The knowledge it takes to get you up and running in a VIM editor can easily fit on a post-it note. After that, you can learn at whatever pace you want. In my opinion, the learning curve is whatever you choose it to be; also, who would buy a book on VIM, have we not heard of google?

      --
      Always remember the chickens that have gone before
    3. Re:"Steep" learning curve by Idiomatick · · Score: 1

      Climbing a steep mountain doesn't mean you go upwards super fast. It means that it is tiring and laborious. So rather than thinking that the curve is knowledge_rate x time. Think effort x total_knowledge.

    4. Re:"Steep" learning curve by Moridineas · · Score: 1

      You're right about the technical / original intent of the phrase, but it's clearly entered the colloquial more literally (you have a steep [ie, difficult] path ahead of you to learn).

      Think of it this way...if you have a revolutionary new product that's very easy to learn to use, would you advertise it as having a "steep learning curve" and expect people to think that's a good thing?

      This phrase, like many others (think "begging the question") due to the literal meanings of the words has a different meaning from the original. Good luck trying to change it...

    5. Re:"Steep" learning curve by boneclinkz · · Score: 0

      This is one of my pet peeves. A steep learning curve refers to something that is quickly learned, as the curve that represents knowledge over time would indeed be steep in that case. Something difficult would have a shallow learning curve, not a steep one.

      An exponential learning curve.

    6. Re:"Steep" learning curve by Clueless+Moron · · Score: 4, Informative

      This is one of my pet peeves.

      A steep learning curve refers to something that is quickly learned, as the curve that represents knowledge over time would indeed be steep in that case.

      Something difficult would have a shallow learning curve, not a steep one.

      I think usually when people talk about learning curves, the horizontal axis represents knowledge and the vertical axis is your investment to acquire that knowledge.

      Is there some established convention that contradicts this?

      The problem is that in mathematics, the independent variable normally goes on the X axis (horizontal). In the case of learning, "effort" is the independent variable since "knowledge acquired" depends on "effort" and not the other way around. By that model a steep learning curve is one where a little bit of effort gains you a lot of knowledge. Unfortunately this doesn't match the classic usage of the phrase.

      And that's why I don't use that phrase. Instead I say things like "python has a gentle learning curve" or "emacs has a tough learning curve"

    7. Re:"Steep" learning curve by adonoman · · Score: 1

      Think of the X axis as the amount of stuff you can do, and the Y axis as the amount of time/effort involved in learning. Then for VIM you end up getting something roughly like a square root graph.

    8. Re:"Steep" learning curve by clone53421 · · Score: 3, Funny

      He’s assuming that the horizontal axis is Time, which would be pretty typical for most graphs. Not for learning curves, though.

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
    9. Re:"Steep" learning curve by blair1q · · Score: 1

      Wrong-o. Something with a steep learning curve is somthing that has a lot to be learned in a short period of time in order to put it into productive use.

      It's not about how easy it is to learn the stuff, it's about how much stuff there is and how much of it you need up-front.

    10. Re:"Steep" learning curve by blair1q · · Score: 1

      my latest vim post-it note is at eye level:

      s symbol
      g definition
      d called by this fn
      t text string
      e egrep pattern
      f file
      i including this file

      extra credit for anyone guessing what it's a list of

    11. Re:"Steep" learning curve by Garble+Snarky · · Score: 1

      Yes, the convention of placing independent variables on the horizontal axis and dependent variables on the vertical axis. Though I think the expressive use of "steep" to mean "requiring effort" justifies ignoring that convention.

    12. Re:"Steep" learning curve by Anonymous Coward · · Score: 0
    13. Re:"Steep" learning curve by lahvak · · Score: 1

      The problem is that in mathematics, the independent variable normally goes on the X axis (horizontal). In the case of learning, "effort" is the independent variable since "knowledge acquired" depends on "effort" and not the other way around.

      Hm, I disagree with that. Assuming that knowledge acquired is a one-to-one function of effort, it does not matter which of the variables is dependent and which is independent. I think more common question is going to be "how much effort do I need to acquire certain knowledge?", rather than "how much knowledge do I acquire with given effort?".

      --
      AccountKiller
    14. Re:"Steep" learning curve by Anonymous Coward · · Score: 0

      You're right about the technical / original intent of the phrase

      I can has citation plz?

    15. Re:"Steep" learning curve by ChipMonk · · Score: 1

      It looks like the list of CScope's pipe commands.

      Do I also get an extra point for not having to look it up?

    16. Re:"Steep" learning curve by autophile · · Score: 1

      It is steep because people have a hard time trudging up a steep hill, and said hill curves upwards. So if you absolutely had to equate that sense of "curve" with the mathematical sense of "curve", then if difficulty = steepness = dy/dx, and difficulty means higher effort put in for lower reward, then y = effort and x = reward. If, that is, you were enough of a pedant to insist that a learning curve was a mathematical entity and not a metaphor :)

      --
      Towards the Singularity.
    17. Re:"Steep" learning curve by Anonymous Coward · · Score: 0

      Maybe the guy/gal who coined the phrase was an economist.

    18. Re:"Steep" learning curve by Yvanhoe · · Score: 1

      You can either see it as a cycling metaphor or as a parametric curve : Y being knowledge acquired, X being the mastery it provides. But the thing is, most people don't know how to read graphics anyway so the cycling metaphor is your best bet.

      --
      The Wise adapts himself to the world. The Fool adapts the world to himself. Therefore, all progress depends on the Fool.
    19. Re:"Steep" learning curve by Moridineas · · Score: 1

      Wikipedia?

      http://en.wikipedia.org/wiki/Learning_curve

      I interpreted that to mostly agree with the OP.

    20. Re:"Steep" learning curve by Abcd1234 · · Score: 1

      The problem is that in mathematics

      Hint: Not everything anyone says can be fitted to the world of mathematics.

      Or: Maybe quit being such a pedant, already. Yeesh.

    21. Re:"Steep" learning curve by turbidostato · · Score: 1

      "A steep learning curve refers to something that is quickly learned"

      You explain where you see the curve and what you prefer to meter at X and Y axis.

      You surely asked those who told you something had a steep learing curve what their coordinate system were too, didn't you?

      Duh!

    22. Re:"Steep" learning curve by agenaud · · Score: 1

      the independent variable normally goes on the X axis (horizontal). In the case of learning, "effort" is the independent variable since "knowledge acquired" depends on "effort" and not the other way around. By that model a steep learning curve is one where a little bit of effort gains you a lot of knowledge.

      That was the first insightful thing I've read on /. Thanks for making me go 'huh'.

      --
      3E51A207
    23. Re:"Steep" learning curve by agenaud · · Score: 1

      "how much effort do I need to acquire certain knowledge?", rather than "how much knowledge do I acquire with given effort?"

      Those are identical directed statements: "how much effort --(to)--> knowledge?" vs "how much knowledge --(from/with)-- effort?"

      --
      3E51A207
    24. Re:"Steep" learning curve by ilyag · · Score: 1

      I think you should imagine walking uphill, say up a mountain. Which takes less time:
      walking up a winding trail or scaling the rock's face directly?

      For an even more pronounced difference, try biking uphill.

    25. Re:"Steep" learning curve by Anonymous Coward · · Score: 1, Funny

      I do not think this happens

    26. Re:"Steep" learning curve by Anonymous Coward · · Score: 0

      I'd put it the other way around. Knowledge acquired is the independent variable - how to write text, how to cut and paste text, how to search and replace, and so on - but the effort required to learn these concrete things is what varies.

      Conversely, effort has no milestones. It is the effort that differs between editors, not knowledge gained. Cut and paste in one is the same as cut and paste in another.

    27. Re:"Steep" learning curve by Gubbe · · Score: 1

      Learning curve

      X-axis: How useful the program/thing is to you.
      Y-axis: Learning needed to reach that level of usefulness.

      Questions?

    28. Re:"Steep" learning curve by Brad+Eleven · · Score: 1

      Given that the x axis represents time and the y axis represents knowledge and/or skill ... The curve is steep when one must get knowledge/skill to a high level in a short amount of time. Your point is well taken, though; I've used this description many times in the past without realizing that some really do spend more time mastering a tool. My vi learning curve looked more like a staircase. I'd dig in and figure out how to do whatever I needed next (the rise), then rely on that for as long as I could (the run).

      --
      "Press to test."
      (click)
      "Release to detonate."
  13. Re:Anything but Vim, please by Nursie · · Score: 1

    Please tell me you're not using OO.o for writing code!

  14. Re:Anything but Vim, please by h4rr4r · · Score: 1

    regex.
    Not having to waste time with the mouse.

  15. Mod parent by Tetsujin · · Score: 5, Funny

    up

    --
    Bow-ties are cool.
    1. Re:Mod parent by DJ+Jones · · Score: 1

      ... You moderate by posting a comment

    2. Re:Mod parent by IICV · · Score: 1

      -1 wooosh

      The subject's changed, so you have to change how you finish it. Duh.

    3. Re:Mod parent by Anonymous Coward · · Score: 0

      mod this up

  16. Only ever been interested in one hack... by Anonymous Coward · · Score: 0

    This is probably the only "hack" you need: http://www.vim.org/scripts/script.php?script_id=300 ;-)

  17. Get the following volumes too: by Ancient_Hacker · · Score: 5, Funny

    Get the followup volumes too:

    Noise cancelling algorithm design using sh. ( Shhhhhh... )

    Real-time traffic control with bash.

    Time-domain-reflectometry made easy, with sed.

    GPS satellite tracking with tr.

    Build a species database with Python. ... and many more ...

    1. Re:Get the following volumes too: by khedron+the+jester · · Score: 1

      Go on... give him some mod points!

    2. Re:Get the following volumes too: by cyberthanasis12 · · Score: 1

      Get the followup volumes too:

      Noise cancelling algorithm design using sh. ( Shhhhhh... )

      Real-time traffic control with bash.

      Time-domain-reflectometry made easy, with sed.

      GPS satellite tracking with tr.

      Build a species database with Python. ... and many more ...

      The funny thing about this list is that the last sentence is not funny; it's true.

  18. Re:Anything but Vim, please by Tetsujin · · Score: 1

    If all I had was a text terminal... maybe. But I don't know of anything that Vim does that I can't do quicker in Open Office. Can someone allay my ignorance as to the virtues of Vim over anything but Emacs?

    I can't imagine editing code in Open Office would be at all enjoyable, personally...

    VI isn't exactly my cup of tea, either, and I can appreciate people's complaints about Emacs - but I'd hate to edit code in something that didn't simplify the process of formatting code, and which didn't let me adjust the rules for how code should be formatted...

    --
    Bow-ties are cool.
  19. Obligatory Response by MozeeToby · · Score: 0, Redundant

    We all know EMACS is a great OS, but what it really needs is a text editor.

  20. Vim most definitely can't "do everything" by melted · · Score: 1

    Case in point: I want it to show me a vertical line at 80 chars, like TextMate or GEdit. Not even GVim can do this. :-)

    1. Re:Vim most definitely can't "do everything" by Anonymous Coward · · Score: 0

      I was under the impression that peoples using vim should be able tu submit a patch for that long ago, but there isn't anything along that line yet. The closest you can get for now is by highlithing text after the 80s characters on each line (which somewhat does the job)

    2. Re:Vim most definitely can't "do everything" by lahvak · · Score: 1

      Well, you could create a syntax rule that would highlight the 80th character on each line, or the first 80 characters, or the 81 and higher characters...

      The problem is, what is a character?

      --
      AccountKiller
    3. Re:Vim most definitely can't "do everything" by Bugamn · · Score: 1

      What do you mean by "vertical line at 80 chars"? And why are you sure that VIm can't do it?

    4. Re:Vim most definitely can't "do everything" by Obfuscant · · Score: 1
      Case in point: I want it to show me a vertical line at 80 chars, like TextMate or GEdit. Not even GVim can do this. :-)

      My copy of vim does. It's called "the right edge of the window". That's why running an xterm in 80x24 is good.

      My main peeve with vim is when it goes into "recording mode" or whatever that nonsense is, when I try to ":q" and hit something by mistake and the screen splits. I still don't know what I did wrong. And that vim always wants to go back to the last place in the file you edited, even if you edited the file ten years ago and really want to start at the top. The only way I found around that one is to make the .viminfo file chmod 000 so it can't save status.

    5. Re:Vim most definitely can't "do everything" by Anonymous Coward · · Score: 1, Informative

      Not exactly what you're looking for, but it solves the same problem:

      http://stackoverflow.com/questions/235439/vim-80-column-layout-concerns#235970

      highlight OverLength ctermbg=red ctermfg=white guibg=#592929
      match OverLength /\%81v.\+/

    6. Re:Vim most definitely can't "do everything" by Clueless+Moron · · Score: 2, Informative

      My main peeve with vim is when it goes into "recording mode" or whatever that nonsense is, when I try to ":q" and hit something by mistake and the screen splits. I still don't know what I did wrong. And that vim always wants to go back to the last place in the file you edited, even if you edited the file ten years ago and really want to start at the top. The only way I found around that one is to make the .viminfo file chmod 000 so it can't save status.

      Recording mode is your friend. It means you hit "q" followed by some letter. It's a macro recorder. Let's say you want to do some complicated operation on a number of lines. Type "qq" to start recording into "q" and do the commands in a generalized fashion on one line, making sure that at the end you end up with the cursor on the next line. Type "q" to stop recording. Now type "@q" to execute those commands again, and the current line should get fixed. Or type "20@q" to do it 20 times. You get the idea.

      Splitting the windows is done with the ^W commands. ^Ws splits horizontally, ^Wv vertically. Do ^Wq to quite a split window. Or do ^Wo to make the current window the "o"nly window.

      I'm a bit puzzled about why you don't like vi remembering where you last edited. If you want to go to the start of the file, just type "1G".

    7. Re:Vim most definitely can't "do everything" by Dracker · · Score: 2, Funny

      A miserable little pile of bits.

    8. Re:Vim most definitely can't "do everything" by Miffe · · Score: 1

      My main peeve with vim is when it goes into "recording mode" or whatever that nonsense is, when I try to ":q" and hit something by mistake and the screen splits. I still don't know what I did wrong.

      You entered q: which open the command line window.

      And that vim always wants to go back to the last place in the file you edited, even if you edited the file ten years ago and really want to start at the top. The only way I found around that one is to make the .viminfo file chmod 000 so it can't save status.

      There is a autocommand defined for this by default. Do a au! vimrcEx BufReadPost to disable it.

    9. Re:Vim most definitely can't "do everything" by briancarper · · Score: 1

      In normal mode, if you type q: instead of :q, you'll open the command line window. You can disable this this easily enough:

      nmap q: <Nop>
      nmap q/ <Nop>
      nmap q? <Nop>

    10. Re:Vim most definitely can't "do everything" by Anonymous Coward · · Score: 0

      :match ErrorMsg '\%>80v.\+'

      From the vim wiki http://vim.wikia.com/wiki/Highlight_long_lines

    11. Re:Vim most definitely can't "do everything" by agenaud · · Score: 1

      Recording mode is your friend...Type "qq"...Now type "@q"

      Or "@@" to repeat the previous macro, in the above case 'q'.

      start of the file, just type "1G"

      Similarly 'gg' is slightly easier to type and 'G' will take you to the end.

      --
      3E51A207
    12. Re:Vim most definitely can't "do everything" by CronoCloud · · Score: 1

      "But enough talk...have at you."

    13. Re:Vim most definitely can't "do everything" by unwastaken · · Score: 1

      Case in point: I want it to show me a vertical line at 80 chars, like TextMate or GEdit. Not even GVim can do this. :-)

      I don't know if they discussed this hack in the book, but one simple fix for that is to "drag" the vim "window" to the edge of your monitor. Continue to drag to the right until the line on the edge of the monitor overlaps 80 characters. If you have a dual monitor setup, you can even view the remaining characters. Of course, this may not work if you don't have a window manager!

    14. Re:Vim most definitely can't "do everything" by Anonymous Coward · · Score: 0

      No, it can't do that. But I have it do something that I find better... highlight the characters in a line that go beyond 80 characters (well, 120 in my case) as an error when I'm writing code, but not in XML or other things where I don't want it. No "artificial" vertical line to get in my way so long as I'm obeying my own rules, but a big red marker when I break them. Sweet :)

      :exe "hi BadInLine gui=bold guifg=red guibg=black"

      :matchadd('BadInLine', '\%121v.*', -1)

      The sexiness of setting it up to automagically turn on per file type is left as an exercise for the reader.

    15. Re:Vim most definitely can't "do everything" by Anonymous Coward · · Score: 0

      What do you mean by "vertical line at 80 chars"?

      Is it really that hard for you to understand what that means? Wow.

      And why are you sure that VIm can't do it?

      Because it can't.

  21. Re:Anything but Vim, please by joggle · · Score: 1

    It's primarily best as a code editor. It has syntax highlighting support for many different language, probably more than any other text editor other than Emacs.

    It is extremely fast at doing search and replaces, both of which can be quite complicated (although using a bastardized version of RegEx that requires a lot of backslashes to do anything complicated). It also provides a ridiculous amount of control over cursor position via keyboard commands which can certainly increase your efficiency at editing code (since you rarely need to take your hands off the keyboard to move the mouse).

    One ideal use of vi is to quickly write some similar code (such as copy constructors). Simply write the initialization of variables once, copy this from the default constructor to the copy constructor and equal operator, do a couple of search and replaces then you're done. I can't imagine doing it quicker in any other editor.

    The only feature it lacks that an editor like Visual Studio provides is refactoring. You can effectively do it for a single file, but across multiple files it wouldn't be as easy as it would be using Visual Studio. It also doesn't provide good support for auto-completion (yes, there are plugins but I've never seen one that works as well as the one in Visual Studio).

  22. First Step in hacking VIM by Anonymous Coward · · Score: 0

    Use Emacs to open the .vimrc file :)

  23. VIM totality by fluffernutter · · Score: 1

    I know about 5% of VIM and that does everything I need in a text editor. I always wonder why the other 95% was created and who the heck uses it.

    --
    Laws are rules for the court, but merely a bottom bar to hit for life. Think beyond laws in your actions always.
    1. Re:VIM totality by blair1q · · Score: 1

      ppl w lk tpg les

    2. Re:VIM totality by thetoadwarrior · · Score: 1

      I'd agree. I'm by no means a vim master but I know enough to do what I want which is PHP, Python (just used it to write my first test app engine app), HTML, JS and Perl. I would never waste my time writing Java with Vim. It's just easier using Netbeans. But for the mentioned languages you don't really need much more than vim, it's fast and won't drive you nuts waiting for i to scan projects like Netbeans or Eclipse. Plus you can use it on any OS and guarantee that it (or vi) will be there so knowing it makes it easier to jump onto a server and edit your stuff without freaking out about not having an IDE or use something worse like Notepad or Nano.

    3. Re:VIM totality by ari_j · · Score: 1

      The other 95% was created about 80% by and for people who want Emacs but are afraid of it and 20% (we're talking portions of the 95%, not of the whole, here :P) for people who resist using a WYSIWYG word processor for some reason. I use vim for most of my text editing and all of my C-family programming other than when I use Xcode. I use Word or Google Docs for my word processing (except at work, where we use WordPerfect and curse a lot) and Emacs for a few things, including reading Usenet and coding in Lisp. Because I use other, appropriate tools for such tasks, I too only use about 5-10% of vim and don't have any problem with learning curves.

    4. Re:VIM totality by Draek · · Score: 1

      People who need a different 5%.

      Though still, browse the user scripts section of vim.org, and I guarantee you that percentage will at *least* double ;)

      --
      No problem is insoluble in all conceivable circumstances.
    5. Re:VIM totality by gmhowell · · Score: 1

      I know about 5% of VIM and that does everything I need in a text editor. I always wonder why the other 95% was created and who the heck uses it.

      People who will never have any need to figure out how to pleasure a woman need to do something with their extra cycles.

      --
      Jesus was all right but his disciples were thick and ordinary. -John Lennon
  24. Re:That word... he doesn't seem to know what it me by Anonymous Coward · · Score: 1, Informative
  25. Re:Anything but Vim, please by tempest69 · · Score: 1
    sure.. lets say that you need to find and replace some text
    you can go
    esc:%s/old/new/g
    of course you can do that in OO without stretching the neurons.
    but let's say you need to be trickier and only remove it from the end of line
    esc:%s/old\n/new/
    sure you can figure that out too..
    ok how about find numbers at the end of the line and you want them on a new line as well
    esc%s:/([0-9]*)\n/$1\nEndLineNumber was: $1\n/
    ok now that is getting a bit odd in OO. now Vi can go quite a bit further before you throw up your hands and run to perl.
    when I want to delete something of known length I can type in 12x to remove 12 characters.

    And really my favorite piece is the syntax highlighting file. I make mistakes plenty of them.. when I'm bleary working on something put off far too long. I have a highlighting file that notifies me that I typed:
    retrun result;
    or
    if (x=7) {do something silly;}
    vector (vector (int)) myIntMatrix; // [parens standing in for angle braces] )) and ) ) are deeply different here.

    just my .02

    Storm

  26. Re:That word... he doesn't seem to know what it me by clone53421 · · Score: 1
    --
    Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
  27. Re:Anything but Vim, please by Hatta · · Score: 1

    You can hardly do anything in OpenOffice without using the mouse. You can do everything in Vim without taking your hands off the keyboard.

    --
    Give me Classic Slashdot or give me death!
  28. Re:Anything but Vim, please by fl!ptop · · Score: 1

    Can someone allay my ignorance as to the virtues of Vim over anything but Emacs?

    :%s/ChangeAllInstancesOfThis/ToThat/g

    And I didn't need to use the mouse or a Function key. Plus I get the power of a regex to boot. It's by far my most favorite feature of Vim.

    --
    When you recognize love in another and realize how precious it is, everything else seems so insignificant.
  29. Re:Anything but Vim, please by blair1q · · Score: 2, Informative

    But if you really must waste time with a mouse to feel superior, you can just run vim as gvim.

  30. Re:Anything but Vim, please by Chad+Birch · · Score: 3, Informative

    Well, I'm not sure that I believe that you actually use OpenOffice to edit code, but here's my standard example of something I can do much faster in vim than people can in other editors:

    Imagine you have the following line of code:

    $welcome_message = "Welcome to my site!"; // message displayed at the top of the main page

    How would you go about changing the welcome message?

    Most people I know would use a combination of Home, End, Backspace, Shift, and the arrow keys to select or delete the string, and then type in a new welcome message. Some would reach over to grab the mouse and select the string, then type over it. In vim, I just need to get my cursor between the quote marks (and there are many ways to do this, personally I'd probably use a quick find and then a couple pushes of w or e). Once anywhere inside the quotes, I just type ci" (a 3-part command, change inside ") and it erases everything inside the quotes and puts me into insert mode. I can easily do this faster than your hand can even get to your mouse.

    Yes, vim is hard to learn, and it's frustrating for quite a while. But once you start actually understanding the "language" of its commands and how they fit together, you'll wonder how you ever used anything else.

    --
    Sturgeon was an optimist.
  31. Don't tell me by Anonymous Coward · · Score: 0

    ... what I did in the first post. I finished the subject in the body. I did it on purpose. And I will do it again.

  32. /ESC/ /ESC/ :wq! by stakovahflow · · Score: 1

    "/ESC/ /ESC/ :wq!" was the first thing I ever learned in vi/vim back 11 years or so ago...

    I tried using nano, pico, emacs, etc.

    I just couldn't get over the lack of real-estate (standard terminal).

    A lot of folks swear at VI/VIM...
    I, for one, swear by it...

    Now, all I have to do is convince the wife that ANOTHER "computer" book is necessary...

    Cheers, guys!

    --Stak

    --
    Holy happy hippy crap!
  33. Re:Anything but Vim, please by u17 · · Score: 2, Informative

    Wow, that's useful. I normally do: f"ldt" (find", l: move one right, delete 'till ")

  34. Re:Anything but Vim, please by value_added · · Score: 1

    ... using a bastardized version of RegEx that requires a lot of backslashes to do anything complicated

    Actually, that's not correct. My terminology and details may be a bit off, but Vim (along with ed, sed, grep, awk, etc.) uses Basic Regular expressions. Extended regular expressions (along the lines of egrep, etc.) came later. Those did away with most of the escaping that you're referring to. Then, of course, there's Perl (and Perl-compatible) regular expressions. They make everything else look unwieldly by comparision. Vim does have offer integration with Perl (a compile-time option) so that's your answer if you find Vim too old fashioned.

    It also provides a ridiculous amount of control over cursor position via keyboard commands which can certainly increase your efficiency at editing code (since you rarely need to take your hands off the keyboard to move the mouse).

    And once you've discovered that, you'll never quite get used to the fact that everything else is positively clumsy, awkward, and inefficient.

  35. Rating inflation by jmilne · · Score: 4, Interesting
    I read the review before I really noticed the rating. How does this book earn an 8 for a rating? The reviewer states that Chapters 1 was unnecessary, and has some harsh things to say about several other areas:

    Chapter 3 is about text navigation. Sadly, the book doesn't go into as much detail on movement commands as I would've liked.

    I had high hopes for Chapter 6 and 7, which deal with Vim scripting, but I was largely disappointed.

    If you're looking for any advancing information on writing your own functions in Vim script, you're mostly out of luck here.

    Overall, stylistically the book is a bit dry and humorless

    I do feel the book should've gone into more detail in many areas. At 244 pages, the book is short and gives a rather shallow view of many of Vim's features.

    There's nothing in this book you won't find in Vim's built-in documentation

    At best, it seems like this would earn a 5 rating.

    1. Re:Rating inflation by Anonymous Coward · · Score: 2, Funny

      Rating System Explained:

      98% - Product cures cancer (scale stops here)
      95% - Revolutionary product
      92% - Extremely good product
      85% - Moderately good product
      78% - Average product
      72% - Mediocre product
      68% - Bad product
      63% - Horrible product
      60% - Should have been in the 50s, but 50s is too harsh so we had to do the opposite of what the merchants charging $X.99 do to at least try to maintain a pretense of fairness.
      59% - Product causes cancer (scale stops here)

    2. Re:Rating inflation by gmhowell · · Score: 1

      At best, this reads like a book report, not a book review.

      --
      Jesus was all right but his disciples were thick and ordinary. -John Lennon
    3. Re:Rating inflation by gmhowell · · Score: 2, Funny

      That makes the scale twice as wide as that used by video game mags.

      --
      Jesus was all right but his disciples were thick and ordinary. -John Lennon
  36. Re:um... by ThePhilips · · Score: 2, Insightful

    Who cares? Emacs is far superior anyways due to its superior customization.

    Yeah... If only mere mortals could do it. Or the mythical sages of Emacs configuration left their caves once and enlightened us all.

    The simple truth is that yes, Emacs is much much much more customizable. But the extreme customize-ability makes it impossible for normal users to customize anything without breaking something else. I yet to see a single Emacs user who has written the .init.el her/himself - not grabbed some decade old copy off the net.

    --
    All hope abandon ye who enter here.
  37. History of Vim is more necessary than you think by LSU_ADT_Geek · · Score: 1

    While reading the review of the book, I thought the reviewer's comment about the history of Vim being unnecessary to be wrong. Having used Vim on various systems including RHEL, Fedora, Mac OS X, Windows (gvim), and BSD there are some differences that catch unaware users off guard. Most Linux operating systems will install Vi as a standard editor and add an alias for Vim to use Vi. This is seems all well and good, however Vi has some pain points in particular the inability to backspace / delete characters on the current line. Anyhow, I'm not sure ignorance is the best policy especially as there are so many variations out there on different OSes.

    1. Re:History of Vim is more necessary than you think by amRadioHed · · Score: 1

      Most Linux operating systems will install Vi as a standard editor and add an alias for Vim to use Vi.

      Really, are you sure you don't have that switched up? Every Linux system I recall has had vi as an alias to vim.

      --
      We hope your rules and wisdom choke you / Now we are one in everlasting peace
  38. eBook by Anonymous Coward · · Score: 0

    Interesting that this book is not available as and eBook.

  39. Re:That word... he doesn't seem to know what it me by chammy · · Score: 1

    Vi was made for productivity. It was built to help you edit text efficiently over low bandwidth connections (specifically Bill Joy's 300 baud modem). Since Vim has more features designed for convenience, you could argue that it was made so you could be even more productive when editing text.

  40. No kidding he must have meant python by Anonymous Coward · · Score: 0

    import antigravity
    import soul

  41. Re:Anything but Vim, please by h4rr4r · · Score: 1

    Just thought I would mention it, vimperator is the best firefox plugin of all time.

    Brings the glory if VIM to firefox.

  42. Decline & Fall, "Back in my day ..." by psbrogna · · Score: 1

    Seems like just yesterday that X in the statement "'[X] Can Do Everything' but configuring it to do so is sometimes daunting." would have been Emacs. Further evidence of the decline of civilization ... what's next- "'a GUI Can Do Everything' but configuring it to do so is sometimes daunting?"

    1. Re:Decline & Fall, "Back in my day ..." by Chelloveck · · Score: 1

      Seems like just yesterday that X in the statement "'[X] Can Do Everything' but configuring it to do so is sometimes daunting." would have been Emacs. Further evidence of the decline of civilization ... what's next- "'a GUI Can Do Everything' but configuring it to do so is sometimes daunting?"

      Already got it. And in this case, the X really is X.

      --
      Chelloveck
      I give up on debugging. From now on, SIGSEGV is a feature.
  43. Re:Anything but Vim, please by briancarper · · Score: 2, Interesting

    although using a bastardized version of RegEx that requires a lot of backslashes to do anything complicated

    Put \v at the beginning of your regex and you won't need as many backslashes. This is the so-called "very magic" mode. You can even switch back and forth between magic and non-magic in the same regex via \v and \V.

  44. RTFM (No, seriously) by Anonymous Coward · · Score: 0

    All 250+ pages of it: http://www.eandem.co.uk/mrw/vim/usr_doc/index.html

    Read a chapter a day/week. Dive in and out of the doc every now and then to refresh. There's an incredible amount that can be done easily with vim, without having to install a single plugin or script.

  45. Are you serious? by Burnhard · · Score: 0, Troll

    Vi - designed and used by people far off into the distance on the autistic spectrum.

    1. Re:Are you serious? by swordgeek · · Score: 1

      Oh really? And here I thought it was designed by touch typists who needed powerful editing features, and were willing to put some effort into achieving it.

      Ah well, guess I'm autistic then.

      --

      "People who do stupid things with hazardous materials often die." -- Jim Davidson on alt.folklore.urban
    2. Re:Are you serious? by eabrek · · Score: 1

      Vi - designed and used by people far off into the distance on the autistic spectrum.

      Aka Slashdotters.

    3. Re:Are you serious? by Burnhard · · Score: 1

      Yes. Yes you are.

    4. Re:Are you serious? by TheRaven64 · · Score: 1

      Vi and vim are not the same thing. Vi is part of the Standard UNIX Specification and is the editor that you are guaranteed to find on any UNIX system. Knowing it is important for disaster recovery, but not much else. Vim is a powerful modern editor designed to be mostly compatible with vi.

      --
      I am TheRaven on Soylent News
  46. There are cases where VIM is Better than Emacs by GNUALMAFUERTE · · Score: 1

    For example, most censors at the FCC use Vim to generate the BEEPs over forbidden words. For everything else, you there is Emacs.

    --
    WTF am I doing replying to an AC at 5 A.M on a Friday night?
  47. Epic by Anonymous Coward · · Score: 0

    fail.

  48. But does it tell you how to do animation? by Fry-kun · · Score: 1

    I remember seeing a vim hack once, a few years back, where someone used the stdin/paste to make vim animate a picture of ASCII art.
    Can't find the link, though :(

    --
    Did you know that "FTW" ("for the win") is a direct translation of "Sieg Heil"?
    1. Re:But does it tell you how to do animation? by flowsnake · · Score: 2, Interesting
      You may find these helpful:
      C source code
      Hints

      From the 2004 International Obfuscated C Code Contest!

  49. Re:um... by ignavusinfo · · Score: 2, Informative

    Or the mythical sages of Emacs configuration left their caves once and enlightened us all.

    I yet to see a single Emacs user who has written the .init.el her/himself - not grabbed some decade old copy off the net.

    It's probably just me, but these statements seem contradictory.

    Seriously, emacs users are actually a really helpful bunch, check out the emacs wiki for instance. Or consider the amount of effort that's gone into making the customization system (M-x customize) easy for both end users to use and emacs-lisp developers to incorporate into their extensions. Or the quality (and price!) of the Emacs manual, Introduction to Programming in Emacs Lisp, or Emacs Lisp Reference Manual.

    Emacs users might be perceived as elitist or something, but the feeling I've always had is that it's a community that strives to be welcoming and not holier-than-thou.

  50. Re:Anything but Vim, please by amRadioHed · · Score: 1

    Cool, that's a new one for me. Thanks!

    --
    We hope your rules and wisdom choke you / Now we are one in everlasting peace
  51. Re:um... by ThePhilips · · Score: 1

    Emacs users might be perceived as elitist or something [...]

    I have learned VIM already. It's too late.

    But actually my impression of an Emacs user is far from "elitist." It's more like a "helpless baby."

    I have worked in company where 90% of people used Emacs. And literally nobody could customize it. They had ~120K init.el from somebody else, it got copied all over the company, everybody used and nobody had a clue what was in it.

    I also knew real pro Emacs user who knew pretty much all shortcuts and modes of the Emacs. But he also hardly ever tried to configure it: he tried it in past, failed and learned to live with the defaults instead.

    In my past two (failed) attempts to learn Emacs, I also found out that even Emacs mode developers are not always aware what's going on inside of it and how to change it: modes are layered on top of each other and changing something in one mode might break inadvertently other modes in a non-obvious fashion.

    --
    All hope abandon ye who enter here.
  52. Eight Megabytes And Constantly Swapping by billstewart · · Score: 1

    Obviously your problem is that your machine has more than 8 MB of RAM in it; otherwise it'd be running fine just like its name says.

    --

    Bill Stewart
    New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
    1. Re:Eight Megabytes And Constantly Swapping by 16384 · · Score: 2, Funny

      I thought it meant Escape Meta Alt Control Shift :)

  53. History of vi editors by massysett · · Score: 1

    The review pans the inclusion of a history chapter in the book. I haven't seen the book's history chapter, so maybe it is not a good one. However, I can say that knowing the history of vi helps enormously if you're trying to "hack" it so I think such a chapter is needed.

    By knowing the history of vi you will know that it was built on top of a line editor, ex. That helps the beginner understand why vi is a modal editor and why some commands are available both as ex commands (with a colon preceding them) and as normal mode commands. One of the powerful things about all those ex mode commands is that they are easy to script. You can feed a bunch of ex commands into vim from standard input, thus completely scripting an editing session without learning a bizarre scripting language. (You do however have to learn bizarre ex commands :) This is an easy workaround for some Unix conundrums--that you can't, for example, easily stick text onto the beginning of a file from the command line. I've got shell scripts that do this. (One could also use ed, but again, it helps to know the history of vi to know this stuff.)

    Knowing the history also explains other vim oddities. For search, vi uses patterns under which some characters, like curly braces, only have special meaning if they are escaped. When you understand that old Unix utilities used regular expressions that are like this, and that the vi patterns thus resemble the patterns that you use with grep (not egrep) or sed, this makes more sense. It also makes all the vim "magic" settings make more sense.

    Also, understanding the history of Unix made it easier for me to understand vim's limitations. For awhile I tried to learn vim script so that I could write scripts that would automatically generate certain text for me. Maybe this would be easy with, say, emacs, but vim script just seemed painful to me--and then it would only work with vim. With time I learned that vi fits in with the Unix toolbox model. Rather than use your editor to generate boilerplate text, it's very easy to generate that sort of thing in a shell script or using m4. Then just load it up into the editor. Vim also uses some external programs, such as ctags.

    Unix is a big grab bag of tools that have a long history. I have always found that knowing the history of these tools and where they came from and how they were meant to be used together is enormously helpful.

  54. Ironic by assertation · · Score: 1


    "Vim Can Do Everything' but configuring it to do so is sometimes daunting."

    That was one argument people made in school for using VI instead of EMACS......and they were right.

  55. Re:Bloatware? Foo by billstewart · · Score: 1

    Vim has about twice as many options as vi did back when I ran it on dumb terminals on a Vax 11/780. My laptop CPU is about 3000 times as fast (per core), and the 4GB RAM is 4x as large as the disk drives on my VAX, or 1000 times as large as the RAM. And yes, running it on top of WinXP is probably tougher than running on top of X Windows, but X ran just fine on a Sun3/60 or 25 MHz 386. (I suppose I should pay more attention and turn off random modes like +farsi, though :-)

    --

    Bill Stewart
    New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
  56. Re:Anything but Vim, please by mario_grgic · · Score: 4, Informative

    That method is fine too and it works in plain old vi. You only save one keystroke really: instead of your f"ldt" (i.e. 6 keystrokes), you type f"ci" (i.e. 5 keystrokes) :D.

    However, ci" (or ci{ etc) are most useful when you are inside the text object. Then you don't have to find or move to the boundaries of the text object to modify its contents. This is even more useful for XML tags, e.g.

    <tag>
          line 1
          line 2
          line 3
    </tag>

    If your cursor is in line 1 or line 2 etc, you can type dit (delete innner tag) and delete everything between <tag> and </tag>

    similarly

    if (condition) {
          line 1
          line 2 ...
    }

    if your cursor is anywhere in the {} block (line1, 2 etc) the command ci{ will delete all lines between { and } and put you in insert mode. Very useful.

    For a complete list of all supported text objects type :h object

    --
    As the island of our knowledge grows, so does the shore of our ignorance.
  57. My review--it hasn't improved by bill_kress · · Score: 0

    From the point of view of someone who doesn't remember or want to remember shortcuts, VI is an abomination.

    I use VI occasionally when I can't avoid it. You have to know a few commands (:wq, :q!, a, i, x, dd, /) to be able to use it, but at that it is the most annoying system possible.

    If possible I use "cat > file" instead.

    VIM is supposed to have help, so I gave it a try. Here's my review of VIM

    It comes up with a little help screen.

    It says a bunch of stuff I don't really want to read--I just want to know how to navigate to a position visible on the screen--something you should be able to do with a mouse.

    I see that :help or f1 gives me "on-line help". worth a try.

    I hit f1. It splits the screen and gives me a bunch of other help commands. WTF. I'd already be done twice if I had started with notepad!

    Wait, it says I can type ":set mouse=a" to get my mouse to work.

    Now I'll type in a little bit to see if it works. I know how to do that, it's "i".

    I returns "Cannot make changes, 'modifiable' is off.

    Screw this, I'm done. :q!

    Damn, they did break the one key I knew! :q! ALWAYS quits out. I'll do it again.

    There that worked. Crap, so much for this improved VIM functionality, I'll stick with vi in cases of extreme emergency when cat >> file just won't do the job.

    Yeah, I realize I could put in a little effort and get much further, but I've already wasted more time just in this session than I could possibly gain back in the next the years by knowing VI inside and out.

    The funny thing is that the arguments by the pro-vi guys are just as ridiculous as this.

    I do wish all editors had "dd" though.

    1. Re:My review--it hasn't improved by Draek · · Score: 5, Insightful

      Yeah, I realize I could put in a little effort and get much further, but I've already wasted more time just in this session than I could possibly gain back in the next the years by knowing VI inside and out.

      And therein lies the crux of your problem. You're simply not a serious programmer.

      Think of Vim as a mainframe: for those that require heavy computing power the investment pays for itself practically the moment you turn it on, but for a regular Joe a mainframe is nothing but an insanely expensive computer that you can't even use to browse Facebook on.

      I don't recommend mainframes to regular Joes looking to browse the web, I don't recommend Hasselblads to grandmas looking to photograph their grandchildren, and I don't recommend Vim to people that need to make slight changes in a plaintext file only sporadically. But that doesn't mean they don't have a market out there.

      --
      No problem is insoluble in all conceivable circumstances.
    2. Re:My review--it hasn't improved by Anonymous Coward · · Score: 0

      From the point of view of someone who doesn't remember or want to remember shortcuts, VI is an abomination.

      They aren't "shortcuts", they're commands. You're expected to learn them before using the software, which will reward your efforts with increased productivity. If the idea of investing time and effort learning a complex tool that you will use almost every day of your life is not appealing to you, feel free to use Notepad or gedit.

    3. Re:My review--it hasn't improved by Lord+Bitman · · Score: 1

      I use Vim every day, and I still don't see how anything which requires manually counting lines on the screen prior to typing a command is supposed to be faster than something which allows lines / characters / words to be highlighted visually prior to typing a command.

      --
      -- 'The' Lord and Master Bitman On High, Master Of All
    4. Re:My review--it hasn't improved by Lord+Bitman · · Score: 1

      I don't think I'll ever understand people who claim that vim has good / extensive help.

      VIM has perhaps the absolute worst help system I've ever come across. It's pretty much impossible to find the answer to anything unless you already know the exact command you're trying to find (and very often the exact misname for that command, since so many keywords have multiple meanings, and help just jumps to the first one)

      VIM's help is utterly worthless, and shouldn't even be mentioned in a discussion of vim.

      --
      -- 'The' Lord and Master Bitman On High, Master Of All
    5. Re:My review--it hasn't improved by bill_kress · · Score: 1

      I'm a 20 year programmer, I've worked on it just about daily in C, C++, Java and a few others. I find that if I'm typing at my limit then I'm not thinking enough and probably messing something up and putting out WAY too much code for others to maintain.

      I spend more time reducing the amount of code "Faster" typests put out.

      I do know programmers who use vi and have used Eclipse as well. They generally call it a wash--although I did have one guy say something that kind of made sense--he had gotten so used to the way eclipse code-completes and brings up documentation mid-line at a keystroke that he had forgotten how to code without it, so he uses vi to force him to work harder and remember all that stuff. That sort of made sense to me I guess, although I'd just install eclipse myself.

  58. Re:Anything but Vim, please by allo · · Score: 1

    i think you two doubled my productivity in vim again ...

  59. Re:Anything but Vim, please by yacoob · · Score: 1

    Code editor? Excellent. Let's make a python editor out of it. [1]

    Syntax coloring? Check. Proper indentation? Check. Well, almost (backspacing over automatically inserted spaces doesn't seem to remove them in one go). Tab completion? Ch... hmmm. Omni completion is almost there. Almost, because it opens a scratch buffer with documentation. While this is understandable when running in terminal, it looks rather bad in GUI. It also doesn't seem[2] to be aware of local modules. There's some basic support for inspection, in the form of taglist plugin, but - again - separate buffer. And if you want something more IDE-like, ie. integrated debugger - good luck with that.

    Don't get me wrong, I like VIM, and it's a fine editor. It's a good, ubiquitous tool. I'm just not exactly convinced that it's a decent programming editor. I've tried to use it as such, with various amount of success. Things probably look different for C, though.

    [1] yes, I've read http://blog.dispatched.ch/2009/05/24/vim-as-python-ide/
    [2] perhaps it can do this after flipping some option, but I haven't looked at it closer yet.

    --
    -- we're here you're not
  60. Re:um... by ignavusinfo · · Score: 1

    I have worked in company where 90% of people used Emacs. And literally nobody could customize it. They had ~120K init.el from somebody else, it got copied all over the company, everybody used and nobody had a clue what was in it.

    I also knew real pro Emacs user who knew pretty much all shortcuts and modes of the Emacs. But he also hardly ever tried to configure it: he tried it in past, failed and learned to live with the defaults instead.

    With respect, I'm not sure either of these issues are the fault of the software.

    For instance, the default Apache httpd.conf reads:

    # Do NOT simply read the instructions in here without understanding
    # what they do. They're here only as hints or reminders. If you are unsure
    # consult the online docs. You have been warned.

    I suspect that a similar warning may have been missing from the init.el that was being passed around.

    Of course, emacs-lisp doesn't look much like C (or a language whose syntax derived from C), so there's certainly some getting over the parenthesis and function-first syntax. After that hurdle (and a bit of understanding what a symbol is and how to quote a list), it's just a matter of looking up unfamiliar functions (online, with C-h f), isn't it?

  61. Re:Anything but Vim, please by joggle · · Score: 1

    Thanks! I will use that feature a lot I'm sure.

  62. Re:Why? by pwnies · · Score: 1

    You're right. If you're just using it to touch up config files, then vim isn't for you.
    However, if that's all you think vim is good for, then you don't grok vim. Vim is a fully featured IDE that's coded for terseness. It's made to get things done in the quickest way possible - where "quickest" is mostly defined by the fewest keystrokes. Every key on your keyboard is a hotkey, and every key does something different. Chances are you wont be changing every character to the end of your current line very often, but for that time you need to, there's the command in vim "C". Just a capital c. No highlighting the line, cutting it so you can save it in case you need it back with ctrl+x, etc. Just C.
    Make sure it's a capital c though, because just "c" will do something entirely different. With vim it's waste not, want not. You don't waste any key on the keyboard. It makes for, once you get past the rough learning curve, an editor that runs with the best (and then some - I would argue that emacs is the only editor that puts up a fight against vim, but that's an argument for another day). I challenge you to find something that a modern day IDE can do that vim can't.

  63. Re:Anything but Vim, please by TheRaven64 · · Score: 1

    And I'd really recommend this to people starting using vim. The really nice thing about gvim is that it shows the text commands in all (most?) of the menu items. I learned vim by using gvim. When I started using it, I was clicking on the menus for pretty much everything. After a while, I gradually used the keyboard commands more and more.

    Now I use vim in a terminal, because then the vim buffer and the clipboard are two different things and I can select and copy text without moving the insert point. This is something that I really miss in all modern editors that I've tried. Under RiscOS, if you selected with the right mouse button instead of the left, it didn't move the insert point, but no one seems to have copied that.

    --
    I am TheRaven on Soylent News
  64. Re:Anything but Vim, please by TheRaven64 · · Score: 1

    But I don't know of anything that Vim does that I can't do quicker in Open Office.

    I can only really think of one thing that I do faster in vim than OpenOffice.org: edit text. Not really surprising, considering that vim is a text editor and OO.o is an office suite. I've written three books (total around 1,600 pages), around 200 articles, a few papers, a PhD thesis, an undergraduate dissertation, and over a hundred thousand lines of code in vim, and I can't imagine trying to use OO.o for most of that.

    --
    I am TheRaven on Soylent News
  65. Re:That word... he doesn't seem to know what it me by Anonymous Coward · · Score: 0

    So.....it can't do what Visual Studio does by default? hmmmm I might keeping staying away from an editor that uses :q then.
    Let me know if there are vim plugins for VS so that I can reduce the learning curve and i'll reconsider.

    2c

  66. Re:Why? by Abcd1234 · · Score: 1

    Then why use it in the first place?

    Because we like it?

    I would spend a few hundred dollars to a tool that will let you do your work without adding work to be able to use the tool.

    Or you could invest a little time up front to learn the tool, and then not pay anything. *shrug* It's a matter of priorities. Believe it or not, some people's priorities aren't the same as yours. Shocking, isn't it?

  67. Re:Anything but Vim, please by Abcd1234 · · Score: 1

    It doesn't give me RSI from all the chording.

    No, seriously, that's basically the only reason I switched from Emacs to Vim (although Vim's much faster startup time is also a real boon).

  68. one question by Nom+du+Keyboard · · Score: 1

    How do I get vim onto my Motorola Droid?

    --
    "It's the height of ridiculousness to say for those 9 lines you get hundreds of millions."
    1. Re:one question by oakgrove · · Score: 1

      Root it and install busybox which has vi built in. I got actual vim on my G1 by rooting it and installing Debian in a chroot environment. Now whenever I touch the terminal icon, it automatically starts up in Debian. It only takes about a second to set the mount points and have me logged in and since I did a bind mount of my sdcard inside of the chroot, I have access to all of my data.

      --
      The soylentnews experiment has been a dismal failure.
  69. Re:Anything but Vim, please by Nom+du+Keyboard · · Score: 1

    OO won't run on my M-Droid. Vim might. Especially since all I need is Notepad functionality (e.g. text entry and find ability ).

    --
    "It's the height of ridiculousness to say for those 9 lines you get hundreds of millions."
  70. Re:Why? by shutdown+-p+now · · Score: 1

    There are many people who have "grown up" with those tools, so to speak, and are extremely good at them because they know all ins and outs, and even the more esoteric operations are already on muscle memory level. This isn't true just of Vim, but many other pieces of mature software, and not just on Unix, but elsewhere as well. E.g. I grew up on DOS and NC, and can't live without this thing in Windows even today.

  71. Re:That word... he doesn't seem to know what it me by Anonymous Coward · · Score: 0

    Let me know if there are vim plugins for VS so that I can reduce the learning curve and i'll "reconsider."

    Let me know about a "professional" that gives more credit to "reduce the learning curve" than to "achieve higher productivity" and I'll show you a moron I certainly won't hire.

  72. Re:That word... he doesn't seem to know what it me by Anonymous Coward · · Score: 0

    He's a guy. A simple google search yielded this:

    http://www.schulz.dk/en/blog/

    His name is kim schulz, as mentioned on the top of this page.

  73. Re:Anything but Vim, please by marciot · · Score: 2, Funny

    So y'all are saying I should learn more than "i" for insert and arrow keys and backspace for everything else?

  74. Re:Anything but Vim, please by Anonymous Coward · · Score: 0

    In vim, I just need to get my cursor between the quote marks (and there are many ways to do this, personally I'd probably use a quick find and then a couple pushes of w or e).

    You might know this already, but if you're in the line, you can use fW or Fw. I'm a pretty advanced power user, but was (as usual) blown away when I found this little nugget out. :help f for more info.

  75. Because it does more. by krischik · · Score: 1

    For starters: vim comes with an optional GUI as well. So it is not just a command line editor. In fact the GUI version is pretty neat.

    And secondly Vim just does more. At least more then Eclipse or Net beans does in the edit department. It might not compete against SlickEdit without tons of plug-ins but then a 3+ platform licence cost $649.00. Note that I have use Vim on 5 different platforms - one for which SlickEdit is not even available.

  76. I am better than you by Anonymous Coward · · Score: 0

    Pro's use emacs. Followers use vim.

  77. shrubbery by skywhale · · Score: 1

    :Ni!

    --
    :wq!
  78. Re:Why? by pandrijeczko · · Score: 1

    Here's why:

    1. Vim or vi is on pretty much every UNIX or UNIX-like system - therefore if your sysadmining a number of different UNIX flavours, vi is a common factor on them all meaning the way you edit files is the same.

    2. It doesn't use any control keys for navigation - therefore no messing about getting keymaps and emulations right, as long as you have the standard alphanumeric and punctuation characters on a keyboard, you can do any editing you need in it.

    3. Your .vimrc config file should be transportable across many flavours of vi - so you can quickly install your favourite shortcuts, macros and syntax highlighting.

    Can I just also make a point that this is *ONLY* about familiarity with a particular application and nothing more. Yesterday, for example, it took me a couple of minutes to work out how to print a document in Office 2007 on my missus' PC when I only use OpenOffice (on XP and Linux) - yet I'm a demon editing in vi and even install it on XP because I can edit much faster in that than in Notepad or any other GUI-based Linux/Windows text editor.

    --
    Gentoo Linux - another day, another USE flag.
  79. Re:Anything but Vim, please by rob_osx · · Score: 1

    If I had mod points I would give you + for educational! You taught me something new today. Thanks!

  80. What is the difference, oh wise one? by Anonymous Coward · · Score: 0

    The object didn't arrive at its destination, it started at its origin.

    The client didn't receive the data, the server sent the data.

    You are not in Soviet Russia, Soviet Russia surrounds you.

    1. Re:What is the difference, oh wise one? by clone53421 · · Score: 0, Redundant

      Comment and subject are, or should be, distinct.

      “You know you're doing something wrong when you have to hack your text editor” was his comment, not his subject.

      I suppose it could also be argued that if your comment is your subject you’re doing it wrong.

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
  81. Re:Why? by assertation · · Score: 1

    For years, if not decades there have been better and easier tools for anything people use VI/VIM/EMACS/Sundry CLI utilities for (mostly).

    I think it happens because professors push these free as in beer tools on students (rightly) for their education, the students get used to them, they get an unjustified sense of pride from learning to use something that *looks* scary and then they are too lazy to learn new things.

    A few years ago I almost got my head put on a pike in the ubuntuforums by suggesting that Ubuntu, keeping with its mission of making linux user friendly, remove VI from a default install.

    Desktop users will never miss it. Network people looking to quickly touch up config files could be redirected to simplier CLI editors for the job like "nice editor/NE editor" and programmers who STILL develop in a pure CLI environment could download it easily.

    IMHO there is a streak of OCD in the tech field and the VI thing is just one of them.

  82. What a waste of time by FreekyGeek · · Score: 0, Troll

    Saying "I'm going to hack vim (or vi)" is like saying "I'm gonna go bolt some rear spoilers onto my horse-drawn plow."

    Just let vi die, already. Put a stake in its heart. Constantly Franken-retrofitting it to be slightly less annoying is a complete waste of time when there are 65 billion real text editors available out there, plenty of them FOSS.

  83. Gasp! An eight line paragraph! by Tetsujin · · Score: 1

    "I hate to ruin..."

    Wow! a meagre 218-word paragraph to define "consistency".

    Huh? "consistency" is not at all what I just described.

    I was making a point about how it's possible for software to have really great facilities to help you learn how to use it - but still be a complicated piece of software to learn.

    It's really not very much text. If it's "tl;dr" for you, then just take a fucking hike.

    --
    Bow-ties are cool.