6 ms·
Both Emacs (reportedly, I use vim) and vim have a system that allows you to be more effective in every thing you do when manipulating text. I cannot give exampl
by e12e 14y ago
Both Emacs (reportedly, I use vim) and vim have a system that allows you to be more effective in every thing you do when manipulating text. I cannot give examples for Emacs, but for vi(m) the interface is based around a few basic concepts:
Two modes: command mode and insert mode
You type in insert mode. You do everything else in command mode. You'll end up doing most work in command mode (well, sort of).
Command mode is centred around verbs, modifiers and nouns (objects).
A typical verb is "d" for delete. Example noun are "w" for word, and "double" for line. So in command mode, "dw" deletes a word, "dd" (you see what I mean by double now) deletes a line.
Yank "y" copies a noun, paste "p" pastes it after the current position.
How do you copy a word? That's right: "yw". A line? That's right, "yy".
For how vim works, see eg:
http://yanpritzker.com/2011/12/16/learn-to-speak-vim-verbs-nouns-and-modifiers/ http://yanpritzker.com/2011/12/16/learn-to-speak-vim-verbs-n...
For how you can become more effective with vim, or any similarly powerful editor, I recommend watching:
"7 Habits for Effective Text Editing 2.0"
http://video.google.com/videoplay?docid=2538831956647446078 http://video.google.com/videoplay?docid=2538831956647446078
It's not about the esoteric hotkeys - it's about having a consistent framework and tool set.
When I first started with Linux in the mid 90s I didn't get vim at all. As most people I had a hard time closing the thing when I accidentally opened a file with it -- I seem to recall switching to another virtual terminal and fiddling around with "ps", "grep" and "kill" (I didn't know about pgrep/pkill at the time).
Now I cringe everything I have to use a web browser that doesn't support vimperator/pentadactyl -- and I'm not even much of a vim power user.
edit removed erroneous and confusing reference to "l", some spelling errors.