

The One Thing That Made Me Switch To Vim - marcgg
http://marcgg.com/2012/09/04/one-reason-to-switch-to-vim-editor/

======
lutusp
A quote: "It felt terrible to be so lost with a task as simple as editing a
file ... This is why I decided to use Vim as my primary editor. It already had
enough qualities to be a good choice, but the fact that it is set up on most
servers was the final selling point for me."

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.

~~~
marcgg
Vim is a good editor in itself. People have debated for ages about why, and
how it could be better than others. I didn't want to do that in this article.
Here I just explain the final selling point for me (might not be for most
people).

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.

~~~
lutusp
> It's just very weird at first because of the fact you have to change modes
> ...

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.

~~~
johncoltrane
What happened gradually between then and now is that Vim's authors and users
somehow rationalized that whole "modes" thing and built a very effective text
editing machine on top of it.

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.

~~~
lutusp
> In my opinion, Vim's normal, insert and command modes (the main ones) are
> very beneficial.

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.

~~~
johncoltrane
Well, there's nothing stopping you from entering the content with the letter
keys, deleting it with the backspace key and navigating with the arrow keys in
any editor, Vi[m] included. If that's all you do when working with text,
Vi[m]'s modes won't bug you at all. Stay in insert mode as long as you want:
you can even use <C-o>… to execute normal mode commands while staying in
insert mode or consider the command mode exactly as you would consider the
menus of any GUI editor.

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.

------
gexla
Funny, as a long time Vim user I still feel this was about certain Vi
configurations. I guess that means I'm not yet far enough along to know all
the keys that I should know, but even then, certain setups with Vi can be
really painful.

~~~
marcgg
Yeah, some people really go overboard when it comes to Vi configs! I still
find most configs to be at least usable though.

