Can't read the article, but I use evil every day to do my work. I don't like vim so much as I like modal editing, and evil gets it right for about 98% of what I want. Emacs is (IMO) just a better platform, although going down the road of learning emacs, but none of its bindings is pretty rough, and probably a bit too much work for most people (m-x describe-key was my greatest friend when going through that process)
C-h k is a shortcut for that function, while C-h f gets documentation on a function, while C-h a gives you fuzzy matching, which is wonderful when you're not sure what a command is called
I don't know why, I have zero issues remembering that cab deletes everything in your current set of parens and dumps you in insert mode, but emacs key chords just fly out of my head. If I am doing something like learning a new mode, I'll start using c-h k, but then a few months later when I need it again, it will be gone and I have to re learn it.
Because viper-mode only covers vi features, not vim features. Once you start using text objects[1], its hard to go back to normal vi.
[1] Like, if your curser is anywhere inside a set of parens you can type 'yap' to copy the entire paren block or 'yip' to just copy the stuff inside the parens. And unlike 'f0y%' it always just does the right thing with nested parens.
Vim is a fairly large beast, and I was using it at at least an intermediate level. Viper does the real basics of vim, but nothing more. Vimpulse was promising, but after a day using it, I switched back since there was so many things that I wanted to do but couldn't. With evil, the only thing that irritates me all the time is how it ignores punctuation.
function foo(){
If the cursory was at the end of the line and you did db in vim, you would get
function foo
In evil mode you get
function
Because it ignores the punctuation when deciding how much to delete.
That is the really big for me. More minor issues is the b text object doesn't work right in js2 mode, and there is no support for :g. Other then that, it completely covers everything I used in vim. Only I also get all the amazing modes, and don't ever have to use vim script again
Author of the article here; never thought I'd be posting HN-worthy content, otherwise I would've picked something other than a very wimpy (but cheap) Xen VPS host (which I can't even SSH into at the moment)... For Emacs users, here's the alternative to Google cache -- the original org-mode file of the post (I use org2blog): http://dl.dropbox.com/u/2685883/evil.org
For all the Vim/Evil users here, I have a question (something that I didn't get around to mentioning in my blog post): what are the standard ways in Vim to navigate code in syntactic units? The s-expression motions in Emacs are very handy: for instance, if I am at the end of the line and I want to select foo(bar), I just do C-M-b a couple of times; likewise, if the point is before "foo", I do C-M-f. In Evil, if the point is before "foo", % works well, but not if the point is at e.o.l. That's currently one of my biggest gripes with Evil.
I actually use a whole bunch of things for motion. backward-sexp is really nice, but very lisp specific, and I only rarely get to hack on lisp stuff. I use a combination of the following to jump around, and rarely find things lacking. My exact bindings probably break common emacs-isms and would be sacrilege to a true emacsen, but they work well for me :)
If the cursor is more then a few lines away, i will use / to search (or ? to back search) and then n my way to the target.
If I am on the same line, I will use f<target char> . that will move the cursor to be on the the next occurance of that character, and semi-colon repeats the motion. so given
the quick brown fox jumps over the lazy dog
if the cursor is at the start of the line and i want to get to the o in over, I would type "fo;;" seems a bit verbose, but ; is easy to hit, and sort of a twitch motion, so it is actually pretty natural.
If the place I want to get to is close to the beginning or ending of the line, i have ^(go to first non whitespace char) mapped to H, and $(go to end of line) mapped to L. given the vim hjkl bindings, HL is very easy to hit.
If I am more just "cruising" through the file, i have c-h mapped to b (back a word) and c-l mapped to w (forward word), and c-j to } (next paragraph) c-k (prev paragraph). So holding down ctrl puts me into "move quickly mode"
If I am close to a paren, I have % mapped to <space><space>, but that is mostly situational (i find I use it most often in lispy languages)
If I am on a word and want to move to another occurance of the same word, I usually use * and n my way to where I want to be (although I also use highlight-symbol.el with m-n m-p mapped to next/prev occurance)
Finally, something I just started trying out is jaunte.el. Done by a japanese guy, but if you look at the screencap here http://translate.google.com/translate?hl=en&sl=ja&u=... you can see when you invoke it, it puts an overlay over each visible word with a 1-3char shortcut. You press the shortcut, and jump to that place.
So yeah, YMMV and all that, but that is what I use for motion. Out of all of that, / and f are by far the most common things I use.
14 comments
[ 2.9 ms ] story [ 46.7 ms ] thread[1] Like, if your curser is anywhere inside a set of parens you can type 'yap' to copy the entire paren block or 'yip' to just copy the stuff inside the parens. And unlike 'f0y%' it always just does the right thing with nested parens.
function foo(){
If the cursory was at the end of the line and you did db in vim, you would get
function foo
In evil mode you get
function
Because it ignores the punctuation when deciding how much to delete.
That is the really big for me. More minor issues is the b text object doesn't work right in js2 mode, and there is no support for :g. Other then that, it completely covers everything I used in vim. Only I also get all the amazing modes, and don't ever have to use vim script again
(Alternatively, here's the text posted on Google+: https://plus.google.com/105073748129411089493/posts/7xEUhCoh...)
For all the Vim/Evil users here, I have a question (something that I didn't get around to mentioning in my blog post): what are the standard ways in Vim to navigate code in syntactic units? The s-expression motions in Emacs are very handy: for instance, if I am at the end of the line and I want to select foo(bar), I just do C-M-b a couple of times; likewise, if the point is before "foo", I do C-M-f. In Evil, if the point is before "foo", % works well, but not if the point is at e.o.l. That's currently one of my biggest gripes with Evil.
If the cursor is more then a few lines away, i will use / to search (or ? to back search) and then n my way to the target.
If I am on the same line, I will use f<target char> . that will move the cursor to be on the the next occurance of that character, and semi-colon repeats the motion. so given
the quick brown fox jumps over the lazy dog
if the cursor is at the start of the line and i want to get to the o in over, I would type "fo;;" seems a bit verbose, but ; is easy to hit, and sort of a twitch motion, so it is actually pretty natural.
If the place I want to get to is close to the beginning or ending of the line, i have ^(go to first non whitespace char) mapped to H, and $(go to end of line) mapped to L. given the vim hjkl bindings, HL is very easy to hit.
If I am more just "cruising" through the file, i have c-h mapped to b (back a word) and c-l mapped to w (forward word), and c-j to } (next paragraph) c-k (prev paragraph). So holding down ctrl puts me into "move quickly mode"
If I am close to a paren, I have % mapped to <space><space>, but that is mostly situational (i find I use it most often in lispy languages)
If I am on a word and want to move to another occurance of the same word, I usually use * and n my way to where I want to be (although I also use highlight-symbol.el with m-n m-p mapped to next/prev occurance)
Finally, something I just started trying out is jaunte.el. Done by a japanese guy, but if you look at the screencap here http://translate.google.com/translate?hl=en&sl=ja&u=... you can see when you invoke it, it puts an overlay over each visible word with a 1-3char shortcut. You press the shortcut, and jump to that place.
So yeah, YMMV and all that, but that is what I use for motion. Out of all of that, / and f are by far the most common things I use.