And entirely topical. Young programmers who read such posts may not realize how many more efficient options are now available. Speaking about vim as though it's an obvious choice in 2013 would be like insisting that everyone code in Fortran in 2013.
And entirely topical. Young programmers who read such posts may not realize how many more efficient options are now available. Speaking about vim as though it's an obvious choice in 2013 would be like insisting that everyone code in Fortran in 2013.
Speaking about vim as though it's an obvious choice in 2013 would be like insisting that everyone code in Fortran in 2013.
Oh, now talking about how to use vim effectively is like insisting that everyone uses an archaic programming language? I suppose if we were to have a post here talking about how to use the command line effectively, you'd feel obliged to educate young programmers that we've moved on from the 1970s.
Yes, and what better place?
> Oh, now talking about how to use vim effectively is like insisting that everyone uses an archaic programming language?
Based on the number of objections to a discussion of vim's alternatives, yes -- that's a legitimate comparison.
> I suppose if we were to have a post here talking about how to use the command line effectively, you'd feel obliged to educate young programmers that we've moved on from the 1970s.
Only in the midst of an amazing discussion that included various "cheat-sheet" strategies to get around the behaviors of an editor that demands cheating to be productive. Given that context, saying that newer editors don't require you to cheat seems entirely topical.
Otherwise - in a slightly less nice way than last time - get lost.
If that's your argument in favor of vi/vim, then other vi/vim users may ask you not to be on their side.
And when talking about IDEs and code writing remember to include VIM plugins in comparison.
In answer, I have to say that nearly every other text editor that exists is more efficient than vi/vim. Modern editors are mode-free, meaning (don't faint) you don't have to change modes to insert, delete and navigate. These editors don't need "cheat sheets" to help you figure out how to switch modes and navigate, because you don't have to cheat.
Vi/vim is the oldest editor still commonly available. I used it in the 1970s when I worked for NASA, on a "paper terminal". In that environment, its quirks made sense because they saved paper. Since then, it has been completely superseded by newer, better programs.
Even my now-ancient program Apple Writer (http://en.wikipedia.org/wiki/Apple_Writer) was easier to use, largely because my program addressed and solved some of vi's more annoying problems. There's a reason Apple Writer became a best-seller -- one of them was that fact that, by eliminating modes, it represented a huge improvement over existing editors, including vi.
But that was the early 1980s. If I had been told then that I would still be trying to get people to use more efficient editors over 30 years, later I would have laughed -- impossible!
> These editors don't need "cheat sheets" to help you figure out how to switch modes and navigate, because you don't have to cheat.
I haven't used a cheat sheet with vim in years now. I don't think I used a cheat sheet after a month of using vim. `:w` is as natural to me as ctrl-s. Slightly more natural, because I don't have to think in order to turn a save into a save as, if I want to write the contents to another file.
And if we want to talk cheat sheets, wouldn't you consider menus in non-modal editors to be cheat sheets, since they show both the keyboard shortcut, and the action, side by side?
Yep. And it is two keystrokes instead of one. Wouldn't it be more efficient to eliminate one of those keystrokes rather than committing them to memory? That's the approach taken by all editors written since about 1980, so it seems to be an idea whose time has come -- and passed.
> And if we want to talk cheat sheets, wouldn't you consider menus in non-modal editors to be cheat sheets, since they show both the keyboard shortcut, and the action, side by side?
The "cheat sheets" I refer to are those that map multiple-keystroke sequences to the actions that, in a modern editor, require one keystroke.
Technically, it's three keystrokes instead of two. And you have to commit ctrl-s (or cmd-s if you're on a mac) to memory just as much as you do :w. Nothing really saved there.
> The "cheat sheets" I refer to are those that map multiple-keystroke sequences to the actions that, in a modern editor, require one keystroke.
Like delete the next four words? How do I do that in a modern editor with a single keystroke? How about "replace everything inside these quotes"? Or repeat the last action I just took again?
I'm glad you like your modern editors (there's lots there to love), but they are not inherently better than vim just because they're non-modal. There is typically a more shallow learning curve than VIM, but the simple virtue of being non-modal doesn't guarantee that (sorry, Emacs).
In the end, two things sealed the deal for VIM for me. 1) it's on every remote server I have to access, and 2) I've put the time into it, so I'm quite efficient in it.
In my last job, since I was only doing local development, I tried out Sublime Text 2 for a good 3 months before giving up on it. I was constantly thinking "I know how to do this in vim - how do I do it here?", and ultimately, I got tired of constantly reaching for the mouse for trivial things like selecting and moving text. I felt that 3 months was sufficient to really give ST2 a fair shake, so I didn't (and still don't) feel bad when I went back to the terminal.
Yes, in point of fact, they are better than vi/vim because they are non-modal. When all is said and done, dropping vi's modes makes an editor better and more efficient.
> Like delete the next four words? How do I do that in a modern editor with a single keystroke?
You can't delete four words with a single keystroke. You can delete [N] words, but only after switching modes and choosing the desired number.
Source: http://www.lagmonster.org/docs/vi2.html#delete
Quote: "ndw : Deletes the next n words starting with current"
The above assumes you're already switched to the required mode, so a minimum of four keystrokes if the number [N] is a single digit. Then, to continue typing, you have to switch back to the mode you started from. Total five keystrokes minimum.
> In the end, two things sealed the deal for VIM for me. 1) it's on every remote server I have to access, and 2) I've put the time into it, so I'm quite efficient in it.
This is circular reasoning. The reason vi or vim is out there on all those servers is because of the number of people who haven't learned anything else.
Plenty of us switched to vim after using mouse-oriented editors for years or decades. Why are you so offended that we have different preferences than you?
Second, in VIM there are three modes, that's true, but not the ones you enumerate. There is: insert mode, normal mode and visual mode. All modern editors have at least the last one: the editor (all of them) behaves differently when you have some text selected.
Third, in VIM you can freely delete and navigate (with arrows!) in insert mode. No problem at all. Even things like ctrl+left for to skip a word backwards work.
Fourth, sheer amount of commands and functions makes the cheatsheets you mention valuable, they are not needed because the functions are so weird, they are needed because there is so many of them. I saw cheatsheets for Word and Photoshop too. You could argue that paint is better than photoshop because you don't need a cheatsheet to use it, but I doubt you'd want to do that. It's the same for editors: you don't need a cheatsheet for notepad...
Fifth, VIM evolved to the point that it is effectively a platform for building text processing apps, similar to Emacs. There's VIMScript and Python, Ruby and Lua support. With this there is practically no limit to what you can make VIM do for you.
To summarize: you seem to mistake VIM for vi; please take a closer look at modern VIM and then come back with a critique that makes sense in 2013.
That's a nice improvement -- an indicator to tell you which of the three exclusive modes you're in at the moment. But imagine this -- imagine eliminating both the indicator, and the modes, all in one fell swoop, as modern editors have done.
> ... please take a closer look at modern VIM and then come back with a critique that makes sense in 2013.
When I wrote Apple Writer in 1978, I rendered vi/vim obsolete (and my program became a best-seller based on its ease of use). Among other things, Apple Writer didn't either have or require modes. Neither have any more recent editors, all of which had to compete with Apple Writer or its descendants.
I was using modeless editors all my life; I was working with Zend Studio and Komodo IDE which are definitely modern editors. Yet I chose to have modes and switched to VIM. In other words I have no problem with imagining editors you talk about, I just don't like them.
"When I wrote Apple Writer in 1978 ..."
That's a funny thing, because VIM appeared in 1993 and only really became what it is now around 2006. Whatever you did deprecate, it was not VIM.
With all due respect, you seem to know next to nothing about modern VIM. You didn't use it, right? I am using it every day and I can compare it with several other editors and I can assure you that VIM offers nearly everything other editors do inside the insert mode - you can work never leaving it, then it's like it was modeless - and that normal mode is an additional feature that accomplishes things not possible in other editors at all.
Anyway, I'm alright with you convincing people not to use vi. It's archaic and cumbersome, has many missing features and so on. On the other hand, please stop bashing modes - it's ok that you don't like them, but that's your personal choice - and stop including VIM in your rants.
I identified my subject very clearly. Are you really unaware that vim derives from vi, and contains the same core code and strategy? That a discussion of vim is a discussion of vi? But let's allow Google to decide this for us:
Search for "vi/vim" : "About 482,000 results" ... Q.E.D.
> On the other hand, please stop bashing modes ...
You won't get far with this as an argument. All modern editors bash modes by not having them (the sincerest form of unflattery). Not one editor written since 1980 has used modes (except vim, of course), because they're an idea whose purpose has vanished.
> and stop including VIM in your rants.
Vim is vi brought back to life -- old wine in a new bottle.
I agree that VIM derives from vi, it's obvious - my point, however, is that the additions and improvements and changes in VIM are many times larger (in terms of code and "user facing surface" like commands) than the core itself; and that essentially creates a new, separate product. Take MS DOS and MS Windows 95 as an example - IIRC Win95 still ran under DOS, yet it exposed completely new APIs and model of user interaction. Would you say that discussing Win95 means discussing DOS? Would you say that Win95 is the same as DOS?
As for modes - I didn't want to get into this - you seem to be convinced that having modes is a bad thing. Your argument is that "every other editor is modeless" - and it's false. The truth is that almost every modern, serious editor includes vi emulation mode and hence can work in a modal fashion - from Visual Studio to PyCharm to SublimeText all of them have an option to have modes. So your argument is simply wrong.
Is modal editing objectively worse thing? I don't believe so. I think that, while introducing some overhead for simple commands (one additional key press for changing modes) it significantly simplifies complex things, because you don't need modifiers and chaining commands is easier.
As for VIM being vi brought back to life - see Win95 argument above.
New, yes, separate, no. Vim has the same modes, the same handicaps, as its predecessor.
> As for modes - I didn't want to get into this ... (long discussion of modes)
This reminds me of a famous and very funny monologue in "Five Easy Pieces" in which a woman talks endlessly about some truly boring topic, punctuated with "But I don't want to talk about it" over and over again. It's priceless.
> Your argument is that "every other editor is modeless" - and it's false.
It's true. Apart from the occasional editor that ridicules vi by including a vi emulation mode, just as a comic riff for modern programmers who aren't aware how bad things were and how far they've come ...
> The truth is that almost every modern, serious editor includes vi emulation mode
... ah, so that's what you were talking about. Obviously an editor that includes a vi emulator mode can't be accused of requiring what vi requires. Or don't you see that?
> So your argument is simply wrong.
Hospitals are equipped with wheelchairs and crutches -- does this mean that's their goal? No, it means they realize something may go very wrong and they want to be prepared.
The reason for vi emulation mode is to accommodate people who are beyond meaningful retraining. Have you heard that you can't teach a dead dog new tricks?
What I find shocking is that new programmers will start learning vi/vim without realizing how primitive it is by modern standards. This thread can only perpetuate the fantasy that vi/vim is anything but a way to avoid abandoning older programmers and their skill set entirely.
> Would you say that Win95 is the same as DOS?
Does it still require drive letters? There's your answer -- drive letters stand for (but doesn't exhaust) all the things that are wrong with Windows. By the same token, requiring mode switches stands for all the things that are wrong with vi/vim.
This may come as a surprise, but modern programming editors don't require the operator to switch between three mutually exclusive modes -- insert, delete and navigate. That's because modern keyboards have keys dedicated to those purposes, which means the operator doesn't have to either wonder which mode he is in, or switch modes, which saves an enormous amount of time when programming.
The first step toward modern editing is use of the arrow keys for navigation. The next step is to realize, if the arrow keys can reposition the cursor without using letter keys, then maybe there's no reason to have to switch modes.
Vim's focus on keyboards that no longer exist, and on displays that no longer exist (including the paper terminal I used with vi while working for NASA forty years ago), requires an incredible number of unnecessary keystrokes, as exemplified in this typical conversation:
http://stackoverflow.com/questions/1379198/in-vim-how-do-i-d...
Notice that no one says "have you considered solving the problem by changing editors?"
You speak as if modal editing came first and universally agreed upon better things evolved afterwards. I know this isn't true. I know you know this isn't true. You're being highly disingenuous.
Your link is equally disingenuous since you either don't understand that the operation involved there is not one you can do in-stride or with as few keys in any other "modern" editor, or if I give you slightly more credit but presume malice then you're being willfully misleading again.
That's exactly what happened, and think before objecting, because I was there. I used vi while working for NASA during the 1970s, when mode changes made sense (it saved paper on paper terminals). Since then, it has stopped making sense.
> I know this isn't true. I know you know this isn't true. You're being highly disingenuous.
When I wrote Apple Writer in the late 1970s, I suspected it would become popular because it eliminated the modes that plagued most contemporary editors including vi. I was right -- it did. Apple Writer became a best-seller because people hadn't yet realized that modes and mode switching were pointless burdens in a era of glass terminals and extended keyboards.
I can't believe there are people who haven't learned this elementary lesson now, over 30 years later.
Why would you let something like this bother you? There are many popular text editors and IDEs in the world, and of all these myriad, there is only one popular editor that is modeful: vi. Why would you begrudge the people who prefer to do their editing modefully, a single editor that does things this way?
It's not like vi is going to corrupt the yout's of today, as the yout's are fully exposed to IDEs such as Eclipse, IDEA, Xcode, and Visual Studio, all of which are modeless, not to mention Word, Pages, Google Docs, etc.
SublimeText2: Ctrl-Delete: deletes the rest of the current word.
To fix my blunder:
Delete rest of the current word (and go to insert mode when applicable)
Vim: ce -> ST2: Ctrl+Delete
Delete current word (and go to insert mode when applicable)
Vim: caw -> ST2: Ctrl+D, Delete
And no, universally agreed upon better things did not evolve afterwards. I have no idea what the numbers are, but Vim is immensely popular amongst developers and I would highly suspect more popular amongst experienced developers than any editor whose name isn't emacs.
You are deluding yourself if you think that the modern world uses modal editors because their ancestors had keyboards that were too cramped.
But that site's purpose is to show how clever people have become in fighting vim's innate inefficiencies. If someone posted to that forum using a modern editor, he would be thrown out for cheating, for suggesting that there's a better way.
That's not to say that modern editors don't have their advantages but I think it is a bit of a stretch to argue that modern editors are substantially better at editing text than vim.
Yes, well put, except it's true -- modern editors are much more efficient at editing large code bases than vi/vim. None of them require a "cheat sheet" of keyboard arcana, for the simple reason that to use a modern editor, you don't have to cheat.
It gives one pause to consider that Pico, the tiny, throwaway command-line editor, is easier to use than vi. The proof? It has become the default choice when someone wants to save time.
I didn't say Pico was easy to use. I said it was easier to use than vi/vim.
Sure those F-keys can be useful. If I'd like to change the screen brightness or skip to next song. Pause/Home/Insert/Print... Half of the time they don't do anything the other half they don't do anything useful. And then there are a bunch of keys that toggle a light and change the behaviour of keys to annoy everyone. Because switching the num block from one duplicated set of functionalities to another greatly increases the available keys!
No wonder 'modern' editors use so many shortcuts. There are simply far more useful functions to perform than keys. Most newer editors go the emacs way and make you press a bunch of modifier keys. Vim makes you go through modes. I prefer to hit easy to reach keys multiple times, but to each his own.