482 points · by DavidChouinard · 14y ago · 232 comments
What I gained from the article wasn't any explanation of why Vim is great; indeed, there was little included in this respect, aside from moving "entire blocks of code with the flick of a finger." Even the cool feeling of proficiency you get from knowing a tool well, and the fun of getting to show off a skill to a "how did he do that!?" audience was secondary.
My favorite part was the implicit reminder to relax about my tools. The most effective use of hyperbole is not the emphasis of a particular point, but a caution not to take ourselves too seriously, and place our self-satisfaction in proper perspective. The most powerful instances border on satire, and in that respect, this piece was perfect.
Addendum: I use vim and pentadactyl. They are extremely awesome, fantastic, and exhilarating.
Vim is one of these tools that isn't obviously better, so that you don't really understand its power until you try it (for a few months or so).
I enjoyed this article exactly because the author didn't try to rationalize the superiority of his tool, rather depict in an entertaining way, a familiar (to me) feeling of empowerment said tool can give you.
What I usually say is something like:
There are text editors and then there are text editors. If you are only spending a few hours a month in front of a text editor, you are probably better off with something simple. If, on the other hand, you are going to be using it all the time, it is well worth your time to learn an industrial strength one like VIM or EMACS. These have learning curves, but they have big payoffs as well regarding productivity.
The Zen koan of the seeker told he would find enlightenment by acquiring the shirt of the happiest man in the world ... who turns out to be shirtless ... captures something of this essence.
I tried Vim for several months and got reasonably competent. But then I timed myself doing the Vim tutorial with Vim and Gedit, and Gedit won handily. For this reason I'm convinced that Vim is only popular because using it gives you hacker cred.
I'm open to changing my mind based on solid experimental evidence, but for now I only use Vim occasionally, for the macros.
:wq
This part make me smile... Wonder what others tough when see that?Muscle memory is not likely to kick in anyway because I almost always use :w and :q separately. I'm modifying the file in one tmux window and compiling/running it in another, so I keep the file open in vim. I don't want to replace :q with :x because I want to be alerted if I've made some changes that haven't been written yet, because that means I may have neglected to test them.
:earlier 10m
and :later 10m
to go back. Note: This is independent of undo/redo cycles as Vim keeps track of that in a tree-like structure. There's just no really great default way of accessing it. See Gundo for a plugin that tries to make it more accessible.Hell yeah! In fact, I came to Vim through pentadactyl because I wanted a way to browse without using the mouse. I second the description of "exhilarating": navigating pages from the keyboard is much, much faster than clicking on links (except in those cases where the poor site design makes the clickable buttons undetectable to pentadactyl... Psst, HN search result navigation, that means you)
I just don't get it. Ever since newer editors got block editing or multiple insertion cursors, and RegEx find & replace across multiple files, and searching filenames to open... I feel like I've already got everything I need!
What am I missing out on? I don't feel like my text editor holds back my productivity. Using something like Sublime, I never think, man, if only Sublime did x, it would save me five minutes, twenty times a week!
I've never had anyone explain to me what specific kind of code editing is so much more productive in vim than in any other editor. Can someone give me a real-world, commonly occurring example?
Or is it not about productivity? Is it an interface thing? People like the way it feels to use? The article explains the "feeling" I always hear about, how vim is so much better, but for the millionth time, fails to tell me why, in a way a non-vim-user can understand.
In vim you don't just move around with arrows, then delete and then replace the text you want. What happens is you can use noun-verb associations to do things.
For example on a line like this:
var foo = "bar";
I could be at the beginning of the line and type the following keys to change the inside of the quotation marks: ci"baz<esc>
In sublime I would do the following: <cmd>→←←⌫⌫⌫baz
The difference between the two was an epiphany for me. In vim I could actually use verbs and nouns to determine how I will edit the text in front of me. I now have a language that I can use to edit text rather than editing the text using the most manual of tools and the verbs and nouns combination are only limited by my imagination and the plugins I install.Also, not having to move away from the home row makes me feel much faster. Having to use Alt/Control/Arrows makes me cry. (I know you can't avoid Control in Vim, but in this example it is not required.)
ci"baz<esc> is 7 keystrokes, only one of which is a jump.
<ctl-F>bar<esc>baz is 8 strokes and two jumps. It also requires typing the entire string in quotes. If the example were
var foo = "The quick brown fox jumps over the lazy dog";
The vim example would not change but yours would.
I'm not trying to be an a-hole, use what you like, I'm just saying, that for me the attraction to vim is the strive toward the minimization of keystrokes, especially ones that require me to move my hands.
i think it's easier to grab the mouse, dlb click bar, foo
with vim, it's still easier than grabbing the mouse. that's the litmus test of text editor interface effectiveness. the mouse is awesome, hard to beat. so if your editor beats it, game on!
<cmd>-<right>, <option-left>, <option-shift-right>, baz
And considering you didn't have to press <mode>: beforehand, it can be just as fast.
I'm a vim user, but using it for something like Objective-C in place of the wonderful autocomplete in Xcode would be a totally dumb thing to do. It's simply not smart enough to improve my productivity, even with the slight speed increases with text-manipulation.
edit: link - https://github.com/JugglerShu/XVim
The same holds true for Sublime Text. Instead of using the arrow keys, you could do any of the following:
Ctrl+H : Replace
bar : Find what
baz : Replace with
Ctrl+Shift+H : Replace first match
<esc> : Exit replace mode
or Ctrl + I : Incremental Find (finds and selects finding)
bar : Find & select text
baz : Overwrite selection
or Ctrl+<Right>+<Right>+<Right>+<Right> : Reach the word bar
Ctrl+d : Select word under cursor
baz : Overwrite selection
or Ctrl+P : GoTo Anything
# : Goto word
bar : Goto word 'bar' & select it
baz : Overwrite selection
I agree that vim's vocabulary is very expressive and very powerfull. I switched to Sublime Text because tweaking vim to meet my needs was just too much effort, even for simple things. Couple this with even more effort to make it play nice with Greek (my native language), and the switch came naturally. f"ci"bazYou don't use your mouse to move the cursor around a document.
After a while you just look at the document and your fingers move and the cursor moves, you can get anywhere in the file in just a few jumps. It's not the same as using a mouse or a touchpad where you need visual feedback to place the cursor in a specific place and the movement is continuous. It feels like it takes less mental processing to do that and it is less distracting while you are concentrating on actual work.
It's hard to explain, and I'm one of those people who using vim, vimperator and vim keybindings in his shell. The only other times I've reached the same levels of muscle memory taking over complex behaviour (besides sports) is when playing video games or driving a car. You concentrate on what you want done and some lower level part of your brain and your hands just takes care of it.
A pointer based system just can't compete in terms of immersion.
I have a feeling I just typed a lot and didn't do any better of a job explaining it.
Explaining nifty Vim backflips is the wrong way to sell Vim. A 15 minute session of `vimtutor` was enough to enlighten me. If I had needed a proficiency in Vim to appreciate Vim, I would've never started.
I never felt it either, back in my TextMate days. But one Thanksgiving holiday week, I told myself, you know there's got to be something to this if all these people I respect swear by it. I decided to use vim-only for two weeks, no matter what, and I'd switch back if I wasn't hooked. I was.
The biggest advantage I find in using something like vim or emacs is that you never have to switch between the mouse and the keyboard — in fact its awkward to use the mouse and that makes it difficult to get accustomed to. It allows you to seamlessly transition between code navigation and code writing, and you develop a kind of rythme that I never felt like I achieved with a graphical text editor.
Other nice features are the ability to write custom scripts and repeat actions, but these can generally also be done in other editors. One huge reason I made the switch is I end up writing code on remote machines on occasion, and I can almost always do so in my everyday editor: vim. All my personalization can be transferred over to the remote machine in a single scp command and the experience remains the same no matter where the files live that I'm working on.
Intuitive: most commands resemble natural language, without awkward or arbitrary mappings. For instance:
- w: (forward) word;
- cw: change (forward) word;
- c2w: change 2 (forward) words;
- 2cw: twice change word;
- ciw: change inner word;
There is no intervening translation. For instance, to change a word in mainstream editors, you delete it first, then start entering the new text. In Vim, it's one command: you think "change forward word", you issue the "change forward word" command.
Consistent. For instance, double letters work on lines:
- cc: change line;
- dd: delete line;
- yy: yank line;
and capital letters work till the end of the line:
- C: change till the end of the line;
- D: delete till the end of the line;
- Y: yank till the end of the line (not so in vanilla Vim, but I've remapped it because consistency matters to me).
Modular: you compose commands. For instance, / is the search command and then:
- d/testo: delete until the next occurrence of "testo";
- c/testo: change until the next occurrence of "testo";
- etc.
Comfortable: limited usage of modifier keys. Vim saved me from RSI.
Portable: letters and Shift keys are in the same position on any keyboard, be it on a desktop, a laptop, etc. whilst each laptop manufactures has its own idea about where Control, Alt, Arrows, PageUp and PageDown should be.
Hope this helps.
A lot of people here have made the point that vim has a steep learning curve that eventually pays off, which, to me implies that intuitiveness is either lacking or besides the point. Still, I agree with your other points. I'm thinking of going back to it to minimize hand strain.
If I learn the new verb c, which deletes and puts me in insert mode, I already know that I can type c3w to change 3 words, or ci" to change the phrase inside quotation marks.
Because all verbs work on the same set of nouns and adjectives I can intuitively know what many commands do - even though I've never tried them - as long as I understand the parts that make up the command.
I think the steep learning curve comes from the need to learn a richer and more precise way of editing, while you may be used to get by with a sloppy one. I had a similar experience when I switched to the Dvorak keyboard: I learned for the first time how to touch-type, while the Qwerty grew on me from hunt-and-peck.
Since you are considering about going back, here are some useful custom mappings of mine: - swap p and P; - map Space as PageDown; - map Shift + Space as PageUp; The last two mirror the way most document-displaying applications work. Generally, don't think twice about remapping some commands either to correct historical quirks of Vim or make it behave consistently with other applications you may be using, hence lowering your memory load.
Have fun
Change forward word is in a mainstream editor: [Shift]+[Ctrl]+[Right]
Change line: Home, [Shift]+[End]
...and so on...
Moreover you forgot to mention that you always need to switch modes...
Mainstream editors are pretty efficient, unfortunately in the UNIX World there are hardly any good ones. The best ones I can think of are Eclipse and gedit.
Unfortunately there is no Notepad++-like thing on UNIX. (And Kate just became messy and buggy when KDE4 came out.)
BTW: Has any vim fan ever used the refactoring feature in Eclipse? Or edited Code during runtime using the Graphical Debugger? I doubt it... ;-)
I stand corrected.
> Change line: Home, [Shift]+[End]
Here there is a translation at work: the editor lacks an atomic "change line" command, so users resort to "move cursor to the beginning of line, then select text up to the end of the line", which is something you could do in Vim, too, if you wanted.
> Moreover you forgot to mention that you always need to switch modes...
I don't understand. Do you mean you have to switch between Insert and Normal mode? If so, this is where newbies - including me some years ago - make their bigger mistake: you don't linger in Insert mode, you hit Esc as soon as you end entering text. Either you are typing text, or you are in Normal mode. This is the reason you need the Esc key as easily accessible as possible. On my keyboard, it is on the Caps Lock key. And : is unshifted.
> BTW: Has any vim fan ever used the refactoring feature in Eclipse? Or edited Code during runtime using the Graphical Debugger? I doubt it... ;-)
I'm with you on this. Still, people confuse Vi-style editing with either Vim or other Vi clones. Vi-style editing is neither Vi nor Vim nor Elvis nor [name an editor]. I used Eclipse and Visual Studio, yes, and guess what: I had Vi-style-editing plugins on both. What people call "the best of both worlds".
EDIT: Vi-style editing rocks at editing text, which is a subset - or not the same - of editing code. A user editing code with a mainstream editor offering powerful code-completion and refactoring facilities may have at her disposal a more powerful tool than a user editing code with a Vi-style editor lacking such facilities.
I don't have to think about how to perform most tasks in vim. My fingers just execute what my brain wants to see happen. That doesn't mean that vim is the greatest thing ever, just that I'm used to it and it's fast enough to get the job done.
One concrete benefit to vim is that it works very well over crappy network connections, and it's installed on most every Linux system you're going to touch.
You often don't notice how useful something is until you're used to it.
This can't happen in emacs because editing isn't modal (though commands are very contextual). vi* is certainly easier on the hands than all the cording but getting rid of modal editing means no more wasting time when your brain is out of sync with the editor.
Having said all that, I'd still pick a nice IDE over either of them, since the IDE understands the language I'm editing and can e.g. change from simple minded "mass edits" to actual refactoring.
That's not to say it's the best overall. If you like to customize your environment, emacs is better. If you like tight OS integration and advanced GUI features, many editors are better. If you want the most productive environment for a specific programming language then some IDE is probably better.
But when it comes to raw keyboard editing, why is vim so powerful?
Well, it starts with normal vs insert mode. Because insertion is a specific mode, it means every single key on the keyboard is available for direct editing commands. Of course you can have modifier commands as well, but that's nowhere near the convenience and efficiency of plain typing.
So right off the bat you start with an order of magnitude more command possibilities in an easier to access position (chordless). The commands of the basic keys are designed to be a solid fundamental set of building blocks for all common editing tasks, and they are assigned mnemonically.
The power of the fundamental commands is then multiplied by the vim grammar, whereby commands are applied to objects, which again are a terse and mnemonic description of some chunk of the file.
In practice this means that very short unmodified alphanumeric strings you type can produce powerful changes. It's not just keystroke-counting, it's the fact that these keystrokes are also a meaningful language that makes sense mnemonically, not just through muscle memory. The more you practice, the more different ways you start to see to effect a given change. As you become more proficient, you can do more and more with a single command.
This is important because commands are atomic, and you can repeat the previous command by hitting '.'. The power of this isn't really apparent until you grok the breadth of things a single vim command can do, but have you ever wanted to do a regexp search and replace and spent a long time crafting it and still had to step through it because you were afraid it might screw something up? With vim commands you can often times use simple command repetition to avoid complex regexps ('n.n.n.n.n.n.n.n.' to find next/repeat command).
Sometimes I'm surprised by the mileage I get out of that, but it's really the tip of the iceberg. Because you also have macros, which are just recorded sequences of commands. But the cool part is that commands are made up mostly of regular characters, so the macros look like plaintext, and vim treats them that way as well. Vim has 26 clipboards called registers, and these registers function both as text storage and executable macro space. Meaning you can record a macro, and then paste it into a buffer, and tweak it via normal text editing, and then pull it back in and run it. Because the commands are so simple and mnemonic, it's actually astonishingly easy to do this. Once you are comfortable with it, you find yourself recording, running and dropping macros in less than the time it takes to write a single regexp. I have spacebar bound to a specific quick-macro slot so I can record and then hold down space to mass-apply a macro (my key repeat-rate is maxed as well :), this lets me do the types of things in seconds that previously would have me busting out the sed/awk book. It's very hard to communicate the impact this has on your editing workflows to someone who doesn't get it. It's sort of like a git user telling a svn user why easy branching is so awesome, the svn user just doesn't get it because they've already convinced themselves they don't need branches precisely because they are so hard to use.
In short, the vim advantage is about powerful editing primitives and easy ways to compose them. There are certainly many great editing ideas that are not in vim, but in terms of the fundamentals for keyboard editing, it's hard to imagine anything better.
:!make
Then run with:
:!./myprog
In both cases, the output will be viewable in a temporary window. You can also pipe the output of a shell command into a vim buffer (aka file) by prefixing you command with "r":
:r !./myprog
This takes all the output from ./myprog and lets you view/edit it in vim.
If your language has a more involved build process, chances are someone has written a plugin to help you and posted it on the vim scripts page: http://www.vim.org/scripts/script_search_results.php.
Enjoy :)
I use CUA and can be productive everywhere immediately, even if it may be a bit less efficient.
Then you reap productivity benefits for the next couple decades.
I mean, I've never really felt the need to program an add-on to text editor. I download syntax highlighting packages, and there are common macros like "remove trailing whitespace" already installed. Keyboard shortcuts can be changed in lots of editors and OS's. In the past, I've definitely been upset that a particular editor didn't support a particular feature, but by now they've progressed enough that I don't really feel that anymore.
- A little hook to use an external Python program (cheating, I know) to look up the definition of the word under the cursor in the OS X dictionary.
- Several customizations for org-mode, which I use for anything where I want to make an outline, including and especially to-do lists.
- I actually still have some code to do "smart tabs" (http://www.emacswiki.org/SmartTabs) for some modes, though that's now probably obsolete if I would only configure up the code mentioned in that list for C modes. (I'm already using it for e.g. Python code.)
- Some configuration for LaTeX editing, like packages AUCTeX doesn't know about, converting words/phrases into \gls (glossary) references.
I actually have less custom stuff in .emacs than I thought. Having a programmable editor does mean that it's relatively easy for other people to write some really useful stuff which I then get to use. I have some local modifications to other people's packages which I don't have time to enumerate right now.
"Common" macros are the least interesting. The most interesting macros are the ones with no name, the one-time ones that you build on the fly. You have a file with ten thousand lines of:
foo.rb
bar.rb
baz.rb
…
… [9997 more lines like these]
and you need to turn the file into something like this: // Run the foo command
def foo()
end
// Run the bar command
def bar()
end
// Run the baz command
def baz()
end
… [9997 more blocks like these ]
That's 56 keystrokes in emacs: You record a macro that transforms one line appropriately, then execute it 9999 more times, all on the fly in about twenty seconds.Also, you don't have to actually program the editor yourself to reap the benefits of a programmable editor. Let's be honest, most modern editors have mostly overlapping functionality. However, one of the benefits of emacs being programmable is that it's self documenting. I can find out how to capitalize a word problematically without having to go to google by using `M-x apropos RET capitalize RET`.
It's not always about programming. It's about configuring and extending to suit it to your problem.
Pylinting and running python code. ,c(mapped to :make, not shown here) to pylint(not need as I run syntastic but still), ,x to run
augroup python
au!
autocmd FileType python nnoremap<buffer> ,x :w<CR>:!/usr/bin/env python % <CR>
autocmd FileType python setlocal nosmartindent
autocmd FileType python setlocal makeprg=pylint\ --reports=n\ --output-format=parseable\ %:p
autocmd FileType python setlocal errorformat=%f:%l:\ %m
autocmd BufRead python setlocal efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
autocmd FileType python setlocal path+=$PYTHONDIRS
augroup end
ERB and Jinja2 shortcuts. \1 for <% {cursor_here} %>, \2 for <%= {cursor_here} %> etc inoremap \1 <%<Space><Space>%><Esc>2hi
inoremap \2 <%=<Space><Space>%><Esc>2hi
inoremap \3 {%<Space><Space>%}<Esc>2hi
inoremap \4 {{<Space><Space>}}<Esc>2hi
A mini calculator function, lots of snippets, some saved macros etc.It's not about changing keyboard shortcuts. It implies you can only remap what already exists. It's about giving you infinite canvas to paint on. This isn't unique to Vim. I am just saying having the capability to do so is important.
I have a function for my work log which gets the date, figures out the previous Monday's date and dumps a formatted weekly log for me to fill out.
I wrote an entire budget tracking application which generates a forecast and dumps it to a csv file
Wrote a utility to mark and optionally delete duplicate files in a dired buffer
Convert a windows path name to a cygwin one
Functions to add local sales tax and remove local sales tax, same for tips.
Perforce source control, helpers to do blame functionality and other stuff that benefits from pulling Perforce output into a buffer
The most used feature would be keyboard macros which are endlessly useful for any repetitive editing task, which can show up unexpectedly at any point of the day
Occasionally have to write throw away custom code to create some boiler plate code, such as turn the API documentation for some errors into a C++ array of structures that can be manipulated in code
Full client for Redis
Yes, but you can't change the editing model as easily, e.g. converting a modeless editor in a modal one just by changing a few shortcuts.
My take is that there are two camps: people who adapt themselves to the tools they use and people who try to adapt their tools to their ways and their ever-changing view of the world. The former want the tool to help them to get things done, the latter want the tool to help them to get things done their own way. The former look at tools as tools, the latter look at tools as extensions of themselves.
Highlights: a Python IDE with refactoring, inference, search, etc.
Some hacks for TRAMP which lets me remotely edit content on arbitrary servers transparently.
A Python repl.
A generic compliance checker for Python code.
An undo module that presents undo/redo history as a visible tree that you can traverse arbitrarily.
A git client that has some EXCELLENT features.
A function to dynamically reload my environment.
A macro for my python debugger injector.
Code to unhtml HTML content and a whitespace cleaner-upper.
An interactive environment to experiment with and test regex.
A mode for CSS that highlights hex-values with the colors they represent, making their properties visual.
An interactive HTTP REST client interface for testing HTTP APIs.
A clone of hacker-typer in elisp.
Modes for clojure, erlang, haskell, rust, etc.
And a nyan-cat for my progress bar.
either you share this or not. If you saw anything else, you are probably misreading or reading too much there.
* This is how you log in.
* This is ls.
* This is cd.
* This is man.
* This is apropos.
* Learn vi.
* Have fun.
What came from that 5 minute intro to Unix has been applied orders of magnitude more often than anything from 5 years of an EE degree.
$ man apropos
apropos searches a set of database files containing
short descriptions of system commands for keywords and
displays the result on the standard output.
It answers the question "I wonder how to do [this English word]."For example: "I wonder how I copy a file."
$ apropos copy
Dumps out all of the matching entries from the man pages for the word "copy". If you just wanted general commands, as opposed to library functions, and assuming your system organizes man page sections in the typical manner, you can filter it down with: $ apropos copy | grep "(1)"
cp (1) - copy files and directories
cpio (1) - copy files to and from archives $ apropos -s1 copy
bsdcpio (1) - copy files to and from archives
cp (1) - copy files and directories
dd (1) - convert and copy a file
.... $ apropos printf
fmtcheck(3) - sanitizes user-supplied printf(3)-style format string
format(ntcl) - Format a string in the style of sprintf
fwkpfv(1) - FireWire kprintf viewer
fwprintf(3), swprintf(3), vfwprintf(3), vswprintf(3), vwprintf(3), wprintf(3) - formatted wide character output conversion
printf(1) - formatted output
printf(3), fprintf(3), sprintf(3), snprintf(3), asprintf(3), dprintf(3), vprintf(3), vfprintf(3), vsprintf(3), vsnprintf(3), vasprintf(3), vdprintf(3) - formatted output conversion
wprintf_l(3), fwprintf_l(3), swprintf_l(3), vwprintf_l(3), vfwprintf_l(3), vswprintf_l(3) - formatted wide character output conversionYes, its a fantastic editor. Yes, its probably going to make you more productive. Yes, its every bit as capable as any other IDE or editor out there.
No, it will not make you a better person. No, mastery of vim does not make you fart sunshine. No, it won't make you an enlightened buddha.
Yes, it is. Yes, it will. Yes, it is.
Yes, it will. Yes, it does. Yes, I am.
Editing text is a solved problem: vim or emacs. Pick one and get back to work.
An argument I hear a lot is: 'vim is fine for editing files on a remote server, but not suitable for everyday work'. I believe it is a common belief outside of the HN crowd.
I'm trying to tell you that it's probably a waste of your time to agonize over text editors, when there are two very powerful editors available to you, with decades of development and refinement, millions of active users, hundreds or thousands of contributions of plugins and scripts and support tools, copious documentation and examples, and the tools you need to embark on any text editor task you may have without ever feeling limited by the editor (assuming you have learned your editor).
Do you want to work on your software, or do you want to work on text editor scripts? Sure, sometimes you need to write a macro or script or something...but, I can count the lines of vim code I've written in my entire 20+ years of programming on my fingers and toes (if I count vimrc stuff, it'll require a few other people's fingers and toes, but it's still statistically zero compared the amount of code and docs I've written in that time).
I'll leave it to Bram Moollenaar figure out how to improve vim. He's added Python support to vim years ago. Is Python really insufficient for you? I've never needed it, but if I were making something big for vim, I'd probably look into it. But, again, I'd rather be working on the stuff I'm passionate about. Editing text is not a problem I'm excited about; if it's your bag, that's great. But, for the rest of us, it's just a form of procrastination to fiddle and futz around with new tools when the old ones are more than sufficient (and probably superior, on the whole, to new ones...sure, TextMate is super-badass and awesome; but it's missing tons of capabilities that vim and emacs have, and you'd probably be better off learning how to maximize your efficiency in those more powerful editors, than learning new tools which will come and go).
"Ed is the standard text editor."
And ed doesn't waste space on my Timex Sinclair.What is wrong with sharing them?
It inspires the same kind of nostalgia.
http://everything2.com/title/You+have+a+sad+feeling+for+a+mo...
http://www.cryptonomicon.com/beginning.html
464gg for the greatest chapter about an OS ever written.
Since then, I've only used vim for editing config files on a remote unix system.
I understand that this post was tongue in cheek. I also understand that not all text editors are equal, if you see someone writing their first hello world program in Notepad yes you should tell them about much better alternatives. But this post confuses ability to program with ability to use Vim.
Being really good at using Vim will definitely let you say you're part of the club of people who are really good at using Vim. It just might make you more efficient at manipulating code. But let's not perpetuate the elitism that is pervasive enough in hacking, it's a text editor. It doesn't make you more intelligent, better at problem solving, or writing more efficient code.
Its probably likely that there is such a correlation; those who are willing to put in the time learning vim/emacs are probably those who spend the most time coding, and thus have the most practice.
Either way the funny thing is when someone asks me "how do you do THAT in vi?" I often find myself typing in the air to replay the muscle memory that executes those instructions.
For better or for worse I've become muscle programmed to execute vi commands in flashes of thought that really never reach my normal cognitive functions. I love to watch people stunned as they see me do something I've taken for granted for years or figured everyone else knew how to do.
All that said, all tools are not for all situations and all people. I do at times find myself jumping into eclipse (Java I'm looking at you!!!) because of the many additional features available in a good IDE.
I know you can run the vim extensions in eclipse but I've never bothered. I figure if I'm going to mouse my way through an IDE I'm not sure what having vi commands will do to make my life easier. :-)
I even tweeted it. With TwitVim, naturally. http://vim.sourceforge.net/scripts/script.php?script_id=2204
I make no claim that emacs keybindings are superior to vim's native keybindings, but for whatever reason, I type more naturally using them at this point. (Which somewhat mystifies me, since for years I used vi/vim as a primary editor with it's normal keybindings.)
I still think that vim keybindings are faster than Emacs for actually editing text, but the emacs keybindings feel more pleasant to me (unless I'm using something without a dedicated control key - like a phone or tablet).
I can't speak for how vim feels under Windows (I'm not knocking your OS, just commenting on possible issues you may have). If it seems non-native it may serve you to spin up a virtual Ubuntu instance and give it a try there.
Also, temper your expectations. The comment above by StavrosK [1] is good to keep in mind. Using vim feels liberating and fluid, but it will not improve your programming ability.
http://www.youtube.com/watch?v=71YTkxUNwmg <--Covers the basics and helpful commands. I had never used vim before watching this video, and now I'm reasonably competent at basic text editing.
I needed to do find and replace on a short story I'm working on (changed a character's name), and I found this one helpful: http://www.youtube.com/watch?v=J1_CfIb-3X4
I wanted to understand/use the .vimrc file, so I googled until I hit this one, which I found quite informative: [UPDATE: put in the wrong link, serves me right for picking the last history item with .vimrc in it instead of watching it. The actual video I found helpful was this one of a guy showing his .vimrc file and what various things in it do: http://www.youtube.com/watch?v=xZuy4gBghho]
Lastly, once you're comfortable using it, try going into command mode and typing Shift-a, and notice that it moves your cursor to the end of the line and puts you in insert mode. I saw this tip on HN awhile back, and I hadn't seen it in any basic tutorials, but it is the single most useful command I've come across.
It will teach you 'The Vim Way' which is a MUST if you want to get most out of it.
When starting with Vim, it can be very daunting and I can't emphasize that enough. If you are in NJ/NY, please email me and I can walk you through 'The Vim Way' to make it easier to get up to speed.
http://www.derekwyatt.org/vim/vim-tutorial-videos/vim-novice...
Or, if you get bored: http://vim-adventures.com/
But to somehow claim that one editor or another is going to make you a better programmer and make your 10 pages of crap code become 4 elegant lines is pretty nonsensical.
No matter what editor you use; if you're not good at problem solving, you're not going to make a good programmer.
So I designed my own system. One key press drops the piece instantly into the correct spot, with the correct rotation. It's making my brain hurt practicing because it requires so much thinking, but once I get it into muscle memory, things are going to get really interesting. My 40 line best using the arrow keys is 45 seconds and with my new scheme it is 2:21. But I'm dropping time quickly and I'm sure very soon I'll beat my record.
I was expounding on this concept with an idea of my own and speculating about its potential benefits using analogous logic to that used in the reasoning about Vim's efficiency.
Better?
Of course, knowing how to cut isn't the same as knowing how to cook. Vegetables chopped slowly taste the same as vegetables chopped fast. But if you already know a thing or two about food, you can cook a little bit better if your cutting technique is better.
A long time ago I narrowly escaped being like that exactly, but with TECO :-)
I've learned not to fret about people's choice of editor. FOr instance, if someone was happy in NotePad, as long as it didn't affect me, I learned not to care. (I might grit my teeth in frustration, watching them flail for minutes at something I could do in seconds with my choice of editor, but that's my problem).
Some vi variant, save but for a few instances. But not necessarily vim.
Being stuck to use old-school vi a few times in the not-to-distant past made me realize how massive an improvement over it vim is.
Yes, I can GSD with vi, but I can really GSD with vim.
Just as pragmatic, and I get to use all my nice normal Emacs features at the same time.
All text editors have crazy shortcuts that do magic, but only vim has the ironically named NORMAL mode with its verbs, movements and registers...
I treated it like a new game to learn. Sometimes I will write a macro because it is more fun, even though it might not save me raw time.
Thanks all.
Of course, if you like it by all means continue using it. But if you think it has anything to do with your talent as an engineer, you are wrong. And if you see other engineers not using it and think it implies anything about their talent, you are wrong.
Side note: if anyone wrote in such a breathless tone about Apple, they would be skewered as a fanboy and a drinker of the Kool-Aid.