9 ms·
Exploring Emacs
- __david__ 14y agoThis is one of the huge reasons I'm still an emacs user in the face of so many IDEs. Until you've used emacs for a while you don't realize that emacs was built in emacs and has great tools like the ones described in the article to poke around its innards. Writing emacs lisp in emacs is a joy because it's so easy to drill down when things don't work and figure out exactly what is going on.
- babarock 14y agoI was a Vim exclusive for several years before shifting cold turkey to emacs on the 01/01/2012 (first new year resolution I keep in my life!). My impression is still the same as day one: I will never reach the same raw speeds in emacs as I used to (and still do) in Vim, but I've never had as much fun exploring the inner workings of any system as I have with emacs. The functions described in the article are crucial. You should rewire your brain to type them every time you ask yourself a question. Generally speaking, Unix is very good at self documenting. Whether it's text editors (vim/emacs), shells (bash, zsh, ksh) or just plain man pages (did I mention the info pages for GNU tools?), the systems are great at holding their own full documentations. I cannot recommend enough adopting the reflex of checking the local documentation before opening your web browser and hitting Google.
- happy4crazy 14y agoThis is my experience exactly. I was a long-time, very fast Vim user, but I wanted to play around with Proof General, an Emacs mode for using proof assistants like Coq[0]. Emacs slowly cannibalized my Vim usage from there: I started using it for Clojure, and was amazed that M-. would hop me into Clojure source. Then I started using it for Erlang, and then I started taking all my notes in org-mode. It wasn't until I was already pretty comfortable in Emacs that I learned about the C-h commands. For pure text surgery, I'm still significantly faster in Vim. But the fact that Emacs is so explorable/discoverable is just so fun! [0] http://proofgeneral.inf.ed.ac.uk/ http://proofgeneral.inf.ed.ac.uk/
- __david__ 14y ago> For pure text surgery, I'm still significantly faster in Vim. Have you tried viper mode or one of the equivalents? I'm curious how it compares to vi. One of the things that I (as a long time Emacs user) have considered is to switch to using viper mode, even though I only know vi enough to edit a config file on a remote machine that lacks emacs. But I'm curious how it compares to the real thing, and if it gets in the way of ancillary emacs stuff (I can't live without stuff like "C-x v =" and "M-/").
- numbnuts 14y agoEvil[0] is where it's at for vi/m emulation. In my, albeit short, experience Evil is much less obtrusive than Viper and Vimpulse. [0]: https://gitorious.org/evil/pages/Home https://gitorious.org/evil/pages/Home
- happy4crazy 14y agoI haven't. Oddly, I find that the Vim and Emacs parts of my brain are completely separate. When I open Vim, my fingers do Vim stuff, and when I open Emacs, my fingers do Emacs stuff.
- Hemospectrum 14y agoSkip viper-mode and go straight to evil-mode, which is based on modern Vim rather than classic vi. It even supports a plugin system, so that missing features and popular extensions (like surround.vim) can be reimplemented with ease (https://github.com/timcharper/evil-surround https://github.com/timcharper/evil-surround). The difference between Vim and the original vi is pretty huge. Just as an Emacs user might be stymied by the missing Lisp support in uemacs or zile, a habitual Vim user leans on stuff like text objects and visual selections, which were never even a twinkle in Bill Joy's eye.
- vsbuffalo 14y agoI'm very curious about this. I've had the opposite experience: I was a slow Vim users (but stil, Vim lover), and I switched to emacs to use ESS-mode for R. Soon I realized the core movement operations I clumsily had to switch modes for in Vim were the same in bash (by default configuration) as they were in Emacs. Even textboxes in OS X behave somewhat same way. C-a, C-e, C-k, C-y M-b, M-f, are all the same for example. So is searching (C-r, C-s). I was fast at these in bash, so learning them in emacs was a breeze. So, how do you use bash? Do you use these bindings?
- evmar 14y agoRe switching: I did the same thing. After a year or two of doing my best to use Emacs as it was intended -- to ensure I "got" it -- I recently switched to evil-mode (another one of those vim-in-emacs implementations) and have been quite happy with it. I still get the good Emacsian stuff like using C-x C-e to eval one-offs in a scratch buffer but I also get the superior vi keybindings for navigating text. (To respond to another comment here, I also tried viper mode but it never stuck. It might have been too soon after switching, or it might have been that it was missing some integrationy magic that I gave it the wrong feel.)
- aerique 14y agoAnother vote for evil-mode. I'm a long time Emacs user that started using Emacs after being quite proficient in Vim. One reason I switched was for Emacs' Common Lisp environment, the other is I never really liked vi's modal editing paradigm. However after many years of searching for the perfect keybindings I rediscovered Vim's charm for navigating and editing text, although I will never leave Emacs for it. The latter is too powerful. With Vim bindings finding their way in more and more applications they start to become pretty universal. (That said, it still prefer Emacs bindings in my shell.) Evil really does give me the best of both worlds even wrt to keybindings and because of the muscle memory also makes firing up Vim on the shell or another server really convenient. If you're a pure Vim user you will have to get used to some Emacs behavior, it is no drop-in replacement but it is pretty darn close. Some modes (Magit - a Git mode) are not supported.
- lucian1900 14y agoEvil mode is excellent. I used emacs for about 3 months without learning almost any emacs-specific key bindings.
- webreac 14y agoC-h k C-h k gives me: C-h k runs the command describe-key, which is an interactive compiled Lisp function. It is bound to C-h k, <f1> k, <help> k, <menu-bar> <help-menu> <describe> <describe-key-1>. I have no link to the source file. I am running version 23.1.1
- __david__ 14y agoWhere did you get your binary? Many linux packages have the .el source files as a separate package and only put the compiled .elc files in the main package.
- drothlis 14y agoYou don’t have the elisp sources installed. If you're on a unixy system, use your system’s package manager to install the "emacs-el" package.
- webreac 14y agoemacs23-el. Thank you very much
- hollerith 14y agoThe features that make Emacs self-documenting are superbly done. I wish other software systems emulated them. Another example: if you write "(funcall " (or if the insertion point happens to be an existing call to "funcall") and then hit C-h f, Emacs prompts you with "Describe function (default funcall)". If "funcall" is the function you wanted documentation about, you do not have to write out "funcall" again -- you just hit enter at the prompt.
- deleted 14y ago[deleted]
- olgeni 14y ago"In Soviet Russia..."
- jaequery 14y agocould you guys explain why vim is faster in text editing than emacs?
- Derbasti 14y agoBecause you use single keystrokes instead of chords. Most editing actions are single keystrokes im Vim. This is especially true for complex things such as macros or command repetitions. In a way, this lends itself better to muscle memory. At times, you will do terrifically complex things in Vim without even knowing how you did them. This does not happen to me in Emacs as much. But then again, my Emacs is growing with me and with every tweak I do it is becoming more of an extension of my mind and my particular way of working. This is not something I experienced in Vim.
- PuercoPop 14y agoAlthough I agree with your explanation I always wonder if using something like keychord in emacs could allow me to move as seemlessly around the text in emacs as in vim. P.D.: Also something the the . command in vim is only posible due to the mode switching being an implicit start macro/end macro.
- Derbasti 14y agoIn my experience, fluidity of simple commands is not much of a problem, because muscle memory will take care of that eventually anyway. However, C-x C-S-8 is certainly a more complex move than qq. And the one for recording a macro to a register is even more complex. So complex in fact that I don't remember it. Hence I use those commands less often. But the flip side is that something like occur or REPLs or magit or org-mode offer different benefits that you can not quantify in keystrokes as easily. I guess there are different kinds of fluidity. To my mind, Vim is unmatched in low-level text manipulation fluidity. Emacs optimizes for a kind of higher level work flow fluidity. Maybe Evil is the answer. But my brain has seemingly disparate modes for Vim and Emacs that are weirdly incompatible to each other. Also, it helps to reimplement your favorite commands in Emacs. For example, I have M-s and M-r bound to something like f/F in Vim. Similarly, M-o and C-o act like o/O.
- numbnuts 14y agoEmacs' help system is fantastic and is one of my favorite things about it. But I had no idea you can navigate to the C source code too. That makes me so happy. :D
- drothlis 14y agoAn extended tutorial using Emacs's self-documentation: http://david.rothlis.net/emacs/howtolearn.html http://david.rothlis.net/emacs/howtolearn.html Random testimonial: «The guide has been extremely helpful and without it, I wouldn't be making the switch from vim. I particularly like that you present just enough information about various tools that I can use them productively, while referring to the excellent built-in docs. A lot of the programmer-critical tools have good documentation, but no "here's the bare minimum you need to know not to go back to your more comfortable environment" guides.»
- happy4crazy 14y agoYour guide was indeed very helpful when I was getting to know Emacs. Thanks!
- drothlis 14y agoThat's great to hear -- thanks. :-)
- rustc 14y agoSerious question: If you switched from Vim to Emacs, and are happy with it, how fast/slow are you in Emacs for pure text manipulation (moving lines, changing text within quotes, joining lines, etc)?
- Derbasti 14y agoFrankly, not quite as fast. But much faster in a lot of other interactions such as note taking, organizing stuff, writing structured text, interacting with git, using REPLs, using shells and many more.
- aerique 14y agoI don't find the the difference between Emacs and Vim too big, but this is because I rebinded most of Emacs' default keybindings. Vim is faster for most things but not all, having to switch back to normal mode gets in the way sometimes. However, Vim's '.' command is just so convenient! Emacs does have some packages to imitate it but they never worked quite alright for me. Now that I am using evil-mode (Vim keybindings) in Emacs I am in a happy place.
- jbp 14y agoHow Emacs changed my life by "matz" http://www.slideshare.net/yukihiro_matz/how-emacs-changed-my-life http://www.slideshare.net/yukihiro_matz/how-emacs-changed-my...