Vi and Vim vs. Emacs Shootout and Deal
oreillynet.com
oreillynet.com
I know things are relatively stable in Emacs world, but a fair bit has changed just from 23.x to 24.0.
http://news.ycombinator.com/item?id=2059909 http://news.ycombinator.com/item?id=1181589
And another link I found helpful:
http://batsov.com/Emacs/2011/08/19/a-peek-at-emacs24.html
But yes, your plan is a good one. Start by running
C-h t
to get the native tutorial, then ramp up from there. I'm afraid I don't know many good online tutorials as I work with Emacs power users, but Stack Overflow has always been quite helpful for learning Elisp.Once you have emacs 24 ready to go, it's a good idea to take a look at the emacs starter kit: https://github.com/technomancy/emacs-starter-kit
There's also a pretty good peepcode screencast on emacs, its a bit old, but gives a good overview of a lot of the basics.
Once you feel like delving deeper, your best bet is to snoop around on emacswiki.org
Try to read the source and understand what it's doing. You will learn how to configure emacs, and the basics of elisp.
Emacs (and most of the Emacs clones) come with a tutorial. It's pretty decent.
After a while you may find yourself feeling bad that you've not done any customization. "Argh," you say, "This is supposed to be a customizable editor. I should start customizing it so that I can realize the awesome power of this fully operational editor!" No worries. I'm guessing that most Emacs users really don't change much. For C hacking or writing I usually just tweak some settings, add a few macros and I'm good to go. Most of my customizations are turning /off/ things that other folks thought were good features. No names, now. :)
tl;dr; Don't worry about the new shiny. There's plenty to learn before you get there.
[emacs user since 1979]
Honestly, at least one of my attempts to get into Emacs died because of disgust of tutorial. It could teach the very same content without being that condescending and outdated. I loathe it.
Funny enough, the gnu.org guided tour through Emacs is really good! Just rewrite the tutorial in a slightly more modern style. I am sure this would increase Emacs adoption quite significantly.
As I quickly scan through the tutorial:
The tutorial assumes I am using a terminal. To be fair, I might. However, it specifically assumes that I am using a terminal from the 1980s. However, I actually have working arrow keys, a mouse and an ALT key. Not META or EDIT. This is what PCs, Linuxes and Macs have converged on. ALT keys, arrow keys and mouses.
Quote: "there should be a tall rectangular area called a scroll bar on one side of the Emacs window...", "Try pressing the middle button at the top of the highlighted area within the scroll bar. This should scroll the text to a position determined by how high or low you click". And so on. First off, it is left mouse, not middle mouse. Then, some of the described behaviors are plain wrong on a modern Windows system (or Mac or Linux for the matter). But really, does Emacs have to explain what a scrollbar is? Honestly?
Then there is stuff like "when saving is finished...". Saving files does not take time any more. Especially not for novices, who are less likely to open several megs of log files.
Quote: "If you are using a graphical display that supports multiple applications in parallel...". What does Emacs think? That I am using Emacs on an iPhone, probably. It has been a really long time since I have seen a "graphical system" that did not support multiple applications in parallel.
Oh well. This should give you an idea. Apart from that the tutorial is not that bad. Just pretty boring. For what it's worth, I remember having quite a bit of fun doing the Vim tutorial, while the Emacs tutorial left me bored and confused. But maybe that has other reasons than the objective quality of the tutorials.
Exploring Emacs that way is like browsing Wikipedia going from article from article: you don't follow a predetermined itinerary but end up learning a lot along the way.
I felt the book was a nice overview, both covering the basic terms and techniques and giving a tour of important features like dired and in-emacs shells. You'll want to augment by reading other online sources (there was no emacswiki in 1999, that I knew of) but the book is probably still worth the money. This is emacs. You'll appreciate having more than one tour guide, because the world is big and everyone knows one part better than others.
My intention was pointing out a promo for two DRM-free e-books (I own both) and the related Emacs vs. Vim vote.
summary: I didn't buy any of the books because I didn't know how much I would have to pay.
That said, I've never been even remotely tempted to move to anything besides Emacs, and at this point, it's ingrained in my fingers, so non-Emacs things really piss me off.
I'm just glad that C-x doesn't quit most applications while I'm trying to save.
I know there are alternatives like It's All Text extension [1] which lets me hook emacs into Firefox, but it's not been updated for recent versions of Firefox.
[1] https://addons.mozilla.org/en-US/firefox/addon/its-all-text/
There's conkeror that use the same renderer engine of Firefox but with emacs mentality of keybindings and customisability.
Also, I've read that some people like to rebind their ctrl+W to something else so they don't have the habit to close their windows in other os/apps. IIRC, C-w is kill-region? Personally, as stated earlier, I use evil so I don't have that problem (I press d to delete the selected region).
Also, mostly everything is a command in Emacs.. So, when you press "a" it basically translate to "call the function insert-character 'a'". So, in a way, Emacs keybinding are really just a little api over the real commands.
In vim, it's a totally different philosophy. Everything is based on making the editor as efficient as possible. Yes you can hack stuff and go on IRC with Vim but conceptually, it's not what it's been designed for and you'll likely hit lots of problems down the road and will have to use all kinds of hack.
So, is putting emacs in Vim possible? Vimscript, even thought being an abomination (my opinion), could implement elisp.. with all the necessary wrapper. So, maybe that'd be possible.. but rather useless.
Finally, my personal opinion.. with Vim, I really felt like "tweaking/hacking" it when I tried to customize it. For instance, I'd try lots of different mapping/paste things found on internet and hope it'd work. Sometime it'd fail for obscure reasons.. and you'd add another hack on top of the hack to fix it.
On the other hand, in Emacs, I feel like I'm really coding my editor as I want it. I'm not surprised by its behavior or its interface. I.e. You can bind an event to call a function when a buffer opens. If you know a little bit of lisp, you'll feel right at home. And if not, there's no better way to get started with that fabulous language.
* The action + (motion | text object) system. I haven't tried evil yet, but viper and vimpulse just don't seem to get this right. It's there but it's incomplete, which kinda kills it for an experienced user. More importantly, though, it's broken. Text objects aren't real, atomic elements at the deepest level -- they're simulated programmatically, which means the illusion breaks down if there are errors in the middle. It also means there are things which vi gets for free in all circumstances that the emulator has to laboriously simulate each time -- like atomic undo. Of course, you CAN do all the programming (hasn't happened yet) but all of that circumlocution has a cost, which is...
* Performance. I was shocked, when I tried out vimpulse on a relatively modern machine several months ago, 15 years after I last used emacs regularly, to find that emacs still feels like a movie with the framerate set too low. It's especially noticeable when, courtesy of viper and vimpulse, you can compare commands somewhat apples to apples. There's just this little delay. It might be milliseconds, but when it's something you're doing all day every day, that really starts to annoy.
So, no. I don't think emacs CAN emulate vi, if you actually consider what most vi users value in their editor. At best, it reaches the level of, say, eclipse emulating emacs movement keys. I would love an editor with vi speed and the movement model, but a sane programming environment. I'm still waiting.
(Sublime text 2 seems like it might be heading there, though for now its vi mode is not much better than vimpulse.)
Also, I think it's important to point out that these mode try to "integrate" as best as they can with Emacs. So, it's not Vim in Emacs, but more, Emacs with Vim' best features and keybinding. (Arguably the best feature of vim). For instance, evil for emacs is a little bit like clojure for Java. I.e. it's a totally different beast but doesn't force you to make dozen of wrappers.. you simply use both at the same time.
I really really like Vi for doing text editing, but Vim's integrated tools are pretty crappy. The sorest point is definitely the lack of a decent debugger interface, but there are other tools I'd like to use too. Emacs is far superior when it comes to integrated tools.
So I'm looking for a good Vi mode for Emacs, or rather, any sort of language agnostic IDE that has a decent Vi-like text editor mode.
I have not used evil, so I'm not sure how vimpulse compares with evil.
The great thing about evil (and other vim-mode) is how it is easy to customize it as you wish. IMO, it's even easier to hack than with vimscript. For instance, I rarely use shift+j in normal mode and decided to use it to go go 4 lines down.. same for K and I want it to work in visual mode. Here's how I did it with evil:
(define-key evil-normal-state-map "J" "jjjj")
(define-key evil-normal-state-map "K" "kkkk")
(define-key evil-visual-state-map "K" "kkkk")
(define-key evil-visual-state-map "J" "jjjj")
(define-key evil-normal-state-map "0" "^")
So basically, I find it pretty cool that I can customize how I want my vim-mode to behave. And obviously, from vim-mode I can call any normal elisp functions.It's impossible to find an editor that'd fit exactly your need without you customize it because that's how we are.. everyone using Emacs or Vim use it because they want to have their own personal editor with their own function/binding.
However, Emacs with Evil was what I was seeking for a couple of years. I wish I could have made the switch sooner.
:map J jjjj
But I guess using existion elisp functions might be useful. (map J jjjj)My guess is that you get some areas where it is a crazy franken-editor and some areas where it may actually be pretty cool.
It has a text editor? I thought it was just a text adventure game!