I love vim. It gives me the feeling that I am reaching directly into the text and bending it to my will.
That said. I also like Clojure, and Clojurescript, and Lisp, and Org-mode. I really, really tried to like Emacs, in Evil mode, and I gave it 6-8 weeks before I gave up in frustration.
I'm considering trying again, because I've seen some really great examples of Literate Programming using ractive.js and org-mode. But I want to plan ahead this time. I have a short list of things that I want to know how to do before I just charge in willy-nilly (if, in fact, I am brave enough to go for it again):
Editor wars are silly, emacs has a lot going for it, but I like home row! Is there a way I can get the power of the emacs operating system while keeping this decent editor I've learned?
leader maps: http://wikemacs.org/index.php/Evil that doc should show you how to do things with emacs. Defining keys look like the following:
(define-key evil-normal-state-map "q" 'ido-kill-buffer) ; was previously record macro
Also be sure to read the official pdf doc. Also look at the examples of key-chord mode.
buffer commands: true, managing buffers should be quicker. Do you know ido-mode ?
Here's how I use a combination of key-chord
and ido
:
(key-chord-define-global "'b" 'ido-switch-buffer)
and I have similar keys for next-buffer
and previous-buffer
. I think it's much quicker than finding the file path on a terminal to launch vim.
Also I can't do without projectile to find new files: https://github.com/bbatsov/projectile
Now do you have more precise question ?
edit: on going to the end of a sentence:
So, evil uses evil-forward-sentence
but yes, it doesn't have the same behaviour than in vim (see comment). Emacs has forward-sentence
but it has the same behaviour. I couldn't find a function with the desired effect.
forward-sentence
is based on the sentence-end
variable (see it with M-x ielm
), which is a regexp defining end of lines. So it's possible to re-define it. Here's a simple example that needs to be extended:
(setq sentence-end "[\\.\\?\\!] +") ;; . or ? or ! followed by spaces.
now forward-sentence will stop at the next point. We can remap evil's )
:
(define-key evil-normal-state-map ")" 'forward-sentence)
Think having two children, would you ask one of them being the way excellent the other is?
WRT Emacs, forget keys, forget vi-mimicry, start with commands. If a command is bound to a key, Emacs will tell you afterward, no need to learn it explicitly.
The clue of Emacs is it's extensibility. Try M-x kill-sentence RET. Doesn't act the way you want? Come back here with a request for change, you will have it in a minute or two :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With