Ask HN: How to force myself to learn emacs?
Any suggestions welcomed, but what I was thinking was...
Is there some module or extension that prevents me or notifies me whenever i do something that could be done easier with a shortcut? E.g. if i use the arrow keys, it stops me until i use c-b/c-f/c-p/c-n? If I go to a new line and press tab, it undoes it newline and tells me to use c-j, etc.
It would be fantastic if there was one.
33 comments
[ 0.29 ms ] story [ 89.2 ms ] threadThere's nothing wrong with using the arrow keys. There's nothing wrong with remapping return to do newline and indent. Heck, if you want to use the standard C-c, C-v, C-x for copy, paste, cut, there's a mode for that too. (http://www.emacswiki.org/CuaMode)
Put your .emacs and .emacs.d somewhere easily accessible and updateable, like GitHub or Dropbox, and you don't have to worry about not knowing the default settings.
The overwhelming majority of machines I've accessed haven't had Emacs installed, so I'm not sure if there's a huge problem with remapping your Emacs config to be something that works for you.
Part of me also thinks this is similar to the argument for buying a sedan over a coupe. For me personally, the number of times I've had to transport someone in the back seat isn't nearly sufficient to justify purchasing a vehicle with that in mind.
I don't know if suffering through the default bindings is worth the pain for the once in a blue moon that you'll be using a different system that has Emacs installed.
(Assuming your 100+ machines are capable of reaching your home directory in some way (ssh, ftp, ...). If not, you could also put your desired emacs init in a publicly accessible location.)
Edit: Or put a copy on a USB drive, or diskette, or floppy.
[1]: http://groups.google.com/group/comp.lang.lisp/msg/f499cca6b4...
I still do a few non-emacsy things like use the arrow keys, but I've installed a few new libraries and customized it a bit more to my liking... to the point where I now find Textmate a big drag on productivity.
The best way is to just start using it. And periodically read tutorials or the built-in info (C-h i) - don't worry about memorizing everything at once. Just learn a couple of shortcuts, and come back again later.
Ask people you know who use emacs for tips. Just follow your interests: if reading IRC inside emacs sounds cool, learn to do it. If org-mode sounds like something you could use, read a tutorial, start using it, and read more later.
If you like lots of window panes (C-x 2, C-x 3, repeat), window-number.el is nice. Or bind M-o to other-window.
Learn to use the kill-ring. Learn to love C-y M-y and miss it in other apps.
Learn to record and play back macros -- C-x m ( -- if you use your movement commands carefully (forward-word, end-of-line, etc. instead of single-character movements), you can get a LOT of mileage out of it.
Use customization rather than programmatic configuration wherever possible - it'll keep your init.el much more manageable later when you come back and completely forgot why you added things.
Again, just start using it, and follow your sense of interest in learning new things. Focus on features that actually help you accomplish tasks more easily or quickly.
Oh, and for the love of everything holy, rebind your Caps-lock to another Ctrl, so you don't damage your pinky finger! :-)
I guess that with a program so endless as Emacs, there's no other way.
First I never looked back and then I never wanted to look back.
The first days were painful because there was so much I hadn't bumped into yet but soon the later days were much easier. The same analogy held for the coming weeks, months, and years. I still learn new stuff that Emacs has but in 95% of what I do with it I don't even think about anymore. That's the payload I've accumulated in nearly 20 years of Emacs.
It's all in my spine somewhere and I'm always amazed when I occasionally use another editor that it doesn't do things that Emacs does, or rather that it doesn't work with me as Emacs does.
I also customized Emacs heavily in the beginning years but now I've been trying to not touch anything unless absolutely necessary. In other words, first I made Emacs grow closer to me and now I've grown closer to Emacs. I can work up another .emacs from scratch in a couple of days, fixing all remaining settings that I've accustomed to, on the fly as I bump into them. There aren't that many left.
2] When you get the reminder, spend 10 minutes reading http://www.emacswiki.org/ Find just one thing that interests you.
3] Make a point of using that one thing at least a couple of times over the course of the day.
If you want to learn all the keyboard commands, spend your first few days (re-(re-(re-)))reading the basic keylists.
It will start to stick in less time than you think, and you'll have fun doing it.
ie I'll find something new now, use it for a few hours or a day, then suddenly it will be 3 months later and I'll suddenly remember that I could be using that feature right now, if I could still remember how to use it.
Any tips?
It's very natural to type "vi <filename>", so it certainly helped.
That was my experience as well, having learned vi before emacs. Unfortunately back then computers were scarce and I frequently shared my account with friends less pleased with this strategy. One even thought it was a joke On him and after he eventually got his own account he got "even" with me by putting 'nice 5' in my .login, which I didn't find for weeks...
2) Hide the other editors
3) Hide the toolbar (if you aren't using the ncurses interface)
4) Always look at the minibuffer every time you "M-x command". Emacs tells you if there is a shortcut that does the same thing
5) "C-h a command" is your friend
6) If you are on Mac OS X use the emacs-style shortcuts in other editors too (C-a, C-b, C-d, C-e, C-f, C-h, C-k, C-n, C-p, C-u, C-v)
http://gigamonkeys.com/book/
http://landoflisp.com/
---
Learning emacs can means many different things.The first thing you will need to learn is, indeedn to use it as a text editor. But you should also learn many other things, like learning eshell, learn and use elisp to adapt emacs to your work flow, use org emacs, rectangular editing, ...
Yesterday I send this "Mastering EShell" link [1] that didn't make the front page.
[1] http://news.ycombinator.com/item?id=2002037
If you're being serious, it kinda seems like just punishing new users for no good reason. If you want that kind of self-flagellation, use vim (kidding! kidding!!)
(FWIW I use arrow keys, but also other smart navigation combinations, a lot. I consider myself a reasonable user of emacs but no pro - I have bells and whistles turned off, fairly hefty .emacs/.emacs.d file, much of which I wrote (or tweaked, to be honest) myself for specific cases, etc. but I know I only use <1% of what is out there. I try and make myself learn a new feature reasonably regularly, though.)
I think the extra pain, that you cause when you remove the arrow keys is worth because force a new user to be conscious all the time that he is not anymore in his old editor.
E.g For me the arrow keys were a good enough option to align things by hand, but after removing the them, I learned to use align-regex and rectangular editing.
Don't worry at the start about default options or the Right Way(tm), these things are likely to distract you to begin with. You probably will find yourself gradually adopting them. Make emacs a comfortable editor for your own way of working - It is intended to be extendible and configurable for this reason.
As to a module for teaching... When you run extended commands using M-x (Alt-x) it should tell you if there is a shortcut bound to that command. If it doesn't or you miss it then maybe the following functions will be helpful:
M-x where-is [C-h w] Type a command and it will tell you the key shortcut (if any)
M-x describe-key [C-h k] Type a key shortcut and it will tell you the command it is bound to
M-x describe-function [C-h f] Provides details about the function you specify
See more here: http://charsequence.blogspot.com/2010/07/setup-emacs-for-dev...
Here's a list of basic emacs keyboard commands I wrote during college: http://tamale.net/essays/effcoding.shtml#emacs
In my case, I was in undergrad school and my annoyance with MS word formatting led to latex. I did not want to learn all the keywords, so the latex mode helped me quickly to get over the hump.
Check this out for creating html in emacs : http://www.youtube.com/watch?v=EQAd41VAXWo
Pick your favorite language (something popular), load up the mode and get to work :)