The One Thing That Made Me Switch To Vim
marcgg.com
marcgg.com
The above sounds like one of the most peculiar reasons to settle on an editor -- however difficult to use, it's likely to be installed. Pico and/or Nano are also likely to be installed on most servers, and they're much easier to use.
This explanation sounds a lot like George Mallory's reason for climbing Mount Everest -- "It was there." But using an editor shouldn't require an epic struggle.
Also Vim is not as complex as it seems. It's just very weird at first because of the fact you have to change modes - hence the struggle, but you feel a boost in productivity after a while.
Yes, but do avoid mentioning "modes" to a true Vim fanatic. I've watched Vim true believers gradually grow cherry red at mention of "modes", which they insist aren't really modes, just extra keystrokes.
The modes in Vim are inherited from vi, because vi was originally used on mechanical paper-roll terminals (as I did while working for NASA in the 1970s) -- in those days the mode switching saved both time and paper.
It's funny to think that Vim users still have to switch modes, to save nonexistent paper on a nonexistent roll, while the rest of the world has moved on. In fact, my now-ancient word processor Apple Writer, first released in 1979 for the Apple II, did away with modes entirely, while running on a processor so slow that it would be put to shame by a modern pencil sharpener.
Different strokes.
Sure, modes may look old and weird when you are used to more "normal" paradigms but "normal" programs also use modes heavily: search/replace, open/save, preview… Vi[m] is just a little bit more extremist.
In my opinion, Vim's normal, insert and command modes (the main ones) are very beneficial.
One of the benefits is that it removes the need for chords almost entirely for the most basic text editing tasks. In a modeless editor, moving to the next word requires to hit at least one modifier and the right arrow while in Vim, thanks to its modal nature, you only need one keypress. Selecting word by word would require chords and many keypresses. What if we have 6 words to select? We have been trained, somehow, to keep the left hand on the two necessary modifiers and hit the arrow as many times as needed. How could we make it faster? v6e is Vim's answer: because it's modal, typing 6 won't input 6 in your text but how could we tell our "normal" editor to execute the next operation 6 times without altering the text? The obvious answer is "modes".
The main problem with conventional multi keys shortcuts is that a lot of tem are already taken by the OS or the windowing system or the GUI toolkit. A lot of Ctrl+[a-z] are reserved, same for their Ctrl+Shift variants and so on. If you want to provide "advanced" capabilities to your users you are forced to invent weird shortcuts with limited meanings and mnemonics. A nice and quite funny example of this limitation is Sublime Text 2: it is a very powerful "normal" text editor in its own right but it is also MORE powerful when you enable vintage mode. Liberated from the limitations of conventional shortcuts, ST2 is able to show its true capabilities.
You mean, compared to not having the modes, as is true for all modern editors? In a normal editor, to put it in the simplest terms, I enter content with the letter keys, I delete content with the backspace key, and I navigate with the arrow keys -- no extra keystrokes required. If we count keystrokes, to put this plainly, a modern editor is much more efficient, and requires much less time to learn. If we count the time required to learn how to use an editor from a state of perfect ignorance, a modern editor is clearly more efficient.
When I designed Apple Writer in the late 1970s, I knew about vi and I knew what I didn't like about it. Even then, it was accommodating a nonexistent roll of paper, and its superfluous keystrokes were my primary target. I designed an editor that didn't follow vi's model, didn't have modes, and every editor since then has done likewise (except Vim).
If someone told me in 1977 that, 35 years later and counting, people would still be using vi's descendant with its modes unchanged, and explaining how beneficial it is, I would have laughed out loud.
But that's not all of what I do when editing text and I need more than those basics.
What's special with Vi[m] is that it offers me modes that make it possible to do more advanced stuff or the same stuff in a smarter way with a very simple and easy to learn language.
Do you always move character by character and line by line? How do you paste something 12 times? How do you delete a block of code? How do you type over the current word? How do you open a newline below the current one if you are somewhere in the middle? Don't you ever think "this task is too repetitive or involves too many steps, I'd like to do it more efficiently"? Because of its modality Vi[m] has you covered. In style, with a simple vocabulary and an expressive grammar while other normal editors only offer a comparatively smaller feature set and horrible Ctrl+Sift+Alt+Char combos.
That's what makes Vim, and modality, special, in my opinion. And still extremelly useful, 30+ years after.
But I may be wrong. The incredible productivity boost I had in the last 2 years may completely be a construct of my imagination.