3 ms·
The One Thing That Made Me Switch To Vim
- lutusp 14y agoA 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 14y agoVim 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 14y ago> 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.
- marcgg 14y agoIt's a different approach that works for some people. These days I don't like having to do ctrl+* to do an action, I find that it strains a bit my hand when repeated for days on end. To each his own.
- johncoltrane 14y agoWhat 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 14y ago> 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.
- gexla 14y agoFunny, 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 14y agoYeah, some people really go overboard when it comes to Vi configs! I still find most configs to be at least usable though.