Live data from Hacker News

Vim is the worst editor, except all the other editors

andre.arko.net

91–100 of 145 posts

Re: Vim is the worst editor, except all the other editors

#91
post #81
post #64

Earlier quoted context omitted.

You'll need to provide explicit examples of where any of those operations requires more keystrokes in vim than any other editor - I can't think of any. You're calling vim commands "modes" to deliberately make it sound more complex than it is. I want to change to next 3 words. I type 'c3w' - you're saying that's modal - which it sort of vaugly is. I could have done 'v3w' to highlight the next 3 words (something you wo…

> You're calling vim commands "modes" to deliberately make it sound more complex than it is. * I am moving the cursor, but I want to enter text. To do so, I need to enter colon, i, Enter, then my first text entry. * I am entering text, but I want to move the cursor. To do so, I need to type Esc, Esc, then commence moving the cursor. * If while entering text, I want to do something besides move the cursor, I need to t…

Vim has changed a lot since when you were using vi or your memories are off - either way your descriptions are inaccurate. They lead to the explanation of the miscommunication about modes though.

You don't type ':i' to get to insert mode, you just hit 'i'. You don't hit Esc, Esc - it's just Esc (though lots of people remap it to 'jj').

Really these are the two modes I was referring to - you need to move between them, yes, but you'll always be in normal mode except for times you're inserting a bit of text. The way you describe using it is the mindset of everyone who first starts using vim and wants to stay in insert mode. I started that way - but it's not the way vim is used. It's the first thing beginners have to understand - normal mode is where you'll spend almost all of your time.

I don't understand what's comical about 'c3w' - "Change 3 Words". You know what's comical? Reaching for the mouse to highlight 3 words to change. Though, you can make that choice - vim supports the mouse too these days. I used it when I first started on vim - it was a bad idea as it's so much slower than using the commands.

Again, I stand by my assertions; Vim is faster and more powerful - other editors are easier to learn. You still haven't provided a shred of evidence to the contrary.

I think your condescending tone is really unhelpful. I've given you the time and respect you deserved to address each of your comments. It would be honourable of you to treat me in the same way.

Re: Vim is the worst editor, except all the other editors

#92
post #77
post #66

Earlier quoted context omitted.

I'll point out that any modern version of vim uses mice just fine. It also uses the system clipboard just fine. The reason most vim users stick with the keyboard is because using a short key combination to select and manipulate text is measurably faster than moving your hand off the keyboard, manipulating a mouse or touchscreen, and then moving it back to continue typing.

> I'll point out that any modern version of vim uses mice just fine. It also uses the system clipboard just fine. What you see as vim appearing to exploit a mouse and system clipboard is actually Bash and (sometimes) a command-line app (example Konsole) doing so, or equivalent utilities outside vim in a non-GUI level. Those features work with any editor in exactly the same way. As to using the system clipboard just f…

... Vim (and plugins) can respond to mouse actions (for example, to open a file tree in NERDTree or Tagbar), so your mouse stuff is pure misinformation. This includes console vim or gui vim.

As for integrating with the system clipboard, that clipboard lives somewhere (X11, OS-X, Windows System), it isn't magic, and vim can integrate with it in various ways dependent on the OS. On windows for example "set clipboard=unnamed" basically makes vim use the system clipboard, period.

So... not sure if you are lying or misinformed.

Re: Vim is the worst editor, except all the other editors

#93
post #81
post #64

Earlier quoted context omitted.

You'll need to provide explicit examples of where any of those operations requires more keystrokes in vim than any other editor - I can't think of any. You're calling vim commands "modes" to deliberately make it sound more complex than it is. I want to change to next 3 words. I type 'c3w' - you're saying that's modal - which it sort of vaugly is. I could have done 'v3w' to highlight the next 3 words (something you wo…

> You're calling vim commands "modes" to deliberately make it sound more complex than it is. * I am moving the cursor, but I want to enter text. To do so, I need to enter colon, i, Enter, then my first text entry. * I am entering text, but I want to move the cursor. To do so, I need to type Esc, Esc, then commence moving the cursor. * If while entering text, I want to do something besides move the cursor, I need to t…

One last reply from me for the time being:

> * I am moving the cursor, but I want to enter text. To do so, I need to enter colon, i, Enter, then my first text entry.

That's incorrect. You can just press 'i' to enter insert mode in place. Or upper case 'I' to have Vim enter insert mode at the end of a line. Or upper case O for insert mode at the beginning of freshly inserted line below the current. Or 'a', 'A', 'c', 'C' and many other's for other kinds of movement/change+enter insert mode combos.

> * I am entering text, but I want to move the cursor. To do so, I need to type Esc, Esc, then commence moving the cursor.

No, the arrows work (should work, may be a problem on some terminals/terminal emulators, but that's common for console editors) in insert mode. No need for (and it's single , not double, anyway) if you want to move by a few characters. Ctrl+ works in insert mode, too, so you can move by words. You lose prefixes and other kinds of movements though.

> * If while entering text, I want to do something besides move the cursor, I need to type Esc, colon, then a command letter, then its arguments.

That's only true if the command is not bound to a sequence of keystrokes. If it is, it's frequently as efficient to type as in modeless editors, for example going to a certain line in Vim is done with G, while in Emacs it's default binding is M-g g . If the command is not bound, both : and M-x beat navigating through menus with mouse in terms of efficiency and that's what they are for, not for the commonly used commands which should be (nv)maped or global-bind-key'ed anyway.

> I don't need to "make it sound more complicated than it is."

Well, you do, as shown above.

> I wold pass the mouse cursor across the desired characters, thus selecting them (any subset of characters or words or paragraphs, and very, very fast)

Well... I would like to measure this somehow.

You assert that using a mouse for this is quicker, but present no evidence. I have no evidence for the contrary, so we can't really argue about this. I personally feel that reaching for the mouse and using it is slower than selecting text with keyboard and that the latter requires less manual precision, which matters to me. You can feel differently and I respect and accept it.

We - Vim users here - can probably show you shorter and more efficient counterpart to any example you'd come up with. That you don't know these more efficient ways is a valid criticism of Vim in itself - which is not a popular claim among Vim users, but I think so - but it's argument for Vim not being friendly to beginners, not for it being inefficient.

Re: Vim is the worst editor, except all the other editors

#94
post #81
post #64

Earlier quoted context omitted.

You'll need to provide explicit examples of where any of those operations requires more keystrokes in vim than any other editor - I can't think of any. You're calling vim commands "modes" to deliberately make it sound more complex than it is. I want to change to next 3 words. I type 'c3w' - you're saying that's modal - which it sort of vaugly is. I could have done 'v3w' to highlight the next 3 words (something you wo…

> You're calling vim commands "modes" to deliberately make it sound more complex than it is. * I am moving the cursor, but I want to enter text. To do so, I need to enter colon, i, Enter, then my first text entry. * I am entering text, but I want to move the cursor. To do so, I need to type Esc, Esc, then commence moving the cursor. * If while entering text, I want to do something besides move the cursor, I need to t…

The truth is, Vim gives you lovely model editing and full use of the mouse, it isn't either or, you get both! ":set mouse=a" and you can use it like you probably expect, select stuff, move around the file, use your scroll-wheel, etc.

Remember with no .vimrc vim defaults to vi emulation mode for historical reasons. ":set nocompatible" to fix that, compatible mode turns off a lot of the wonderful Vim features us Vimmers have come to love.

> * I am moving the cursor, but I want to enter text. To do so, I need to enter colon, i, Enter, then my first text entry.

... you can enter insert mode a variety of ways, i, I, o, O, a, A, etc -- each has a specific meaning.

> * I am entering text, but I want to move the cursor. To do so, I need to type Esc, Esc, then commence moving the cursor.

... you just hit escape to go back to normal mode, which generally pay dividends on that single keypress with an better group of movement keys (move by word, sentence, paragraph, tag, search, etc). Or just use the mouse (works perfectly well, doesn't even change the mode, set mouse=a)! If you are in insert mode, you remain in it, same for normal mode!

> * If while entering text, I want to do something besides move the cursor, I need to type Esc, colon, then a command letter, then its arguments.

... actually, vims insert mode has many features for editing without leaving it for convenience, C-W, C-U, C-J, C-M, C-N, C-P, C-R and a bunch more for deleting words, lines, interacting with registers, etc.

> No, in any other modern editor, I wold pass the mouse cursor across the desired characters

Sure, and you can do that in vim (console or gui, works in both with mouse=a), but some of us (myself included) consider this an inferior way to select 3 words via sloppy indirect abstracted pixel pointing. Not to mention pulling your hands off the keyboard... to the mouse, then back again re-seating to continue typing. Mice are for FPS games, not selecting text!

EDIT: Even if Vim someday dies (decades from now maybe), modes have spread, I use modes in Word, Outlook, Visual Studio, Xcode, Sublime, Eclipse, Firefox, Chrome even on my ZSH prompt. Once you get used to modes based editing, it is an amazing addition to any editor or GUI, and people keep creating plugins so Vim mode lives on! Editing text hasn't change radially, because text hasn't changed radically... the reason emacs and vim live on is because of fitness for the task at hand, editing text.

Re: Vim is the worst editor, except all the other editors

#95
post #81

Earlier quoted context omitted.

> You're calling vim commands "modes" to deliberately make it sound more complex than it is. * I am moving the cursor, but I want to enter text. To do so, I need to enter colon, i, Enter, then my first text entry. * I am entering text, but I want to move the cursor. To do so, I need to type Esc, Esc, then commence moving the cursor. * If while entering text, I want to do something besides move the cursor, I need to t…

One last reply from me for the time being: > * I am moving the cursor, but I want to enter text. To do so, I need to enter colon, i, Enter, then my first text entry. That's incorrect. You can just press 'i' to enter insert mode in place. Or upper case 'I' to have Vim enter insert mode at the end of a line. Or upper case O for insert mode at the beginning of freshly inserted line below the current. Or 'a', 'A', 'c', '…

I agree with all your points. Minor correction: it's 'O' to insert above the current line, 'o' to insert below.

Re: Vim is the worst editor, except all the other editors

#96
post #26
post #18

1) Dump Janus, add the plugins you actually want 2) True 3) :set paste 4) Then wrap it in a function 5) I've always found ctrl-p to be snappy actually. You can replace the matcher with ag or similar > write the Vim configuration lines required to cause those files to be ignored. You have got to be kidding me. Write a small amount of config once per project? It's no more complex than adding things to a UI set wildigno…

But that's kinda the problem with vim. Having a sane configuration takes hours of setup and googling.

That's not the problem. The problem is some people's assumption that they can pick up Vim just like any other editor and use it right away.

It takes time to be productive with Vim. There's no way to get around that.

Re: Vim is the worst editor, except all the other editors

#97
post #27

Earlier quoted context omitted.

I would actually love to hear some specific and insightful criticisms of Vim, but referring to its history is not a particularly compelling one (for me, at least). In today's terms, the above "without wasting too much paper during editing" argument translates into "with as few keystrokes as possible". In some situations, I definitely find my ability to type (or in general, to edit text) to be the bottleneck in gettin…

> I would actually love to hear some specific and insightful criticisms of Vim ... Sure, no problem: * It's still a command-line editor. Just like vi. * To perform multiple operations, like moving the cursor around, entering text, deleting text, searching the document, saving and loading files, requires you to switch modes. Just like vi. * It cannot take advantage of the modern computing environment -- mouse navigati…

> * No clipboard support -- all copying and pasting operations, apart from being another example of bizarre vi incantations requiring the recall of a raft of magic characters, is within vi/vim and disregards the system clipboard.

I was under the impression, vim does have clipboard support. Putting "set clipboard=unnamed" in ~/.vimrc integrates it with system clipboard (at least on OSX).

Re: Vim is the worst editor, except all the other editors

#98
post #14

The reason there's no project-wide find and replace in vim is that vim has no concept of a project. It's designed to be one of many tools, which works really well for some workflows and not for others. #5 is the same deal -- they're limited by the design of vim, and that design doesn't fit anything like TextMate's project search. It would drive me _crazy_ if vim saved without me telling it to. I think a lot of people…

The only thing that drives me crazy about the save/do-you-want-to-reload prompt is actually a git related issue. When you commit, git updates all committed files in some way that triggers vim change detection. You go back to vim, write some code, try to save and then you get this DANGER WILL ROBINSON message. It's horrible because you're not quite sure sometimes if there was a legitimate change made in another proces…

Really? That sounds misconfigured and it certainly doesn't happen for me. Are you on windows? Maybe it's just a problem there. I'd take a look a bit deeper to see if I could figure that out if I were you as it does sound like a nuisance.

Personally (regarding the original gripe in the post) I'd be horrified if my text editor was silently ignoring edits or just updating the code under me. If that was really a concern while I was working on my software I'd take a look at the workflow to see what could be done about it.

Re: Vim is the worst editor, except all the other editors

#99
post #27

Earlier quoted context omitted.

I would actually love to hear some specific and insightful criticisms of Vim, but referring to its history is not a particularly compelling one (for me, at least). In today's terms, the above "without wasting too much paper during editing" argument translates into "with as few keystrokes as possible". In some situations, I definitely find my ability to type (or in general, to edit text) to be the bottleneck in gettin…

> I would actually love to hear some specific and insightful criticisms of Vim ... Sure, no problem: * It's still a command-line editor. Just like vi. * To perform multiple operations, like moving the cursor around, entering text, deleting text, searching the document, saving and loading files, requires you to switch modes. Just like vi. * It cannot take advantage of the modern computing environment -- mouse navigati…

Thanks for the reply. I guess we have a difference of opinion on the concept of modal editing, which is fine.

I find it a plus that I'm not having to move my mouse hand off the base row all the time, and find that vi offers elegant solutions to many oft-recurring tasks people normally accomplish with a mouse (copying a row or two, highlighting text inside brackets / inverted commas, editing a variable name up to a specific point, etc). While I agree that the incantations required are relatively complex, they do become second nature (e.g. I'm an on-and-off user of perhaps 2 years, and I'm comfortable with the basics). This of course comes at the cost of having to switch modes often (and specifically, exit current mode using ESC, which is irritating), but this normally only involves 1 key. I guess a complete cost-benefit analysis would be highly subjective, in my personal experience the trade-off is worthwhile. In short, I'm not aware of anything that comes close to the terseness of vi(m) for basic editing.

Re: Vim is the worst editor, except all the other editors

#100
post #70

Earlier quoted context omitted.

On the contrary, you seem to be the "True Believer" refusing to be dissuaded. Is it so hard to believe there might be a degree of personal preference and intuition to a certain approach that one might want to keep using it? Typically, a good engineer prides himself on using The Right Tool For The Job (TM) modulo by an appropriate degree what works well for him. (Especially in something like editor where the choice is…

> Typically, a good engineer prides himself on using The Right Tool For The Job ... Do you also write Fortran? You may or may not be surprised to learn that I have nearly identical debates with diehard Fortran programmers who try to argue that Fortran is anything but a way to support a vast amount of legacy code that no one wants to rewrite (for very good reasons). Fortran is not the right tool for the job. It once w…

As someone who was within recent memory a "young programmer", I find this somewhat of an untrue statement. At the risk of defending my argument with anecdote, VIM was the tool of choice for my entire circle of friends in my undergraduate/graduate, and many of them now sit at MS, Google, and prestigious universities, I would not consider their (or my) careers crippled by this choice, rather facilitated by a tool which has worked well for our needs, and in application (and yes, I have tried other editors) I have not found lacking.

I would not say I "write Fortran" (given that soon to be father in law does, and I would be an embarassment to his competencies) I am familiar with it, and even so would not argue maintaining huge truckloads of legacy code. There does need to be lines for when you "burn it down" or realize that you've been accumulating technical debt that just maintaining compatibility for and of is only contributing to. I would not say that modern vim falls under this category at this point in time.

Post reply on HN