Master Emacs in one year
github.com
github.com
I haven't found that to be true at all. I find that due to archaic idiosyncrasies and the customization possible with emacs, the more time I spend with it the more difficult it becomes to use different editors.
On the other hand, they run everywhere and are open source, so it's probably no problem.
Then there's the fact that Emacs really isn't an editor. If anything, it's a shell that runs elisp programs, chief among which is a text editor. Programs like magit and ansi-term (and gnus and compile and dired and TRAMP and…) are good examples of this.
Germane to the conversation that emacs make you "good at other editors" (nb: Are other editors as programmable/versatile as Emacs and vi -- certainly edtiors need to be able to rise to a level required by the operator... I haven't worked w/ textmate or sublime, etc., etc.) -- I've recently shelved Emacs for vi to "level-up" my vi skills. I'm as I delve into vi, I'm finding facilities that I really hadn't imagined in my previous episodes w/ vi, and I think part of it can be attributed to my years w/ Emacs, and the attitude that it instilled: "There has to be a way to do what I'm imagining".
I then spent a few years working on Windows where I had Vim, but other editors I used were, well, 'standard'.
Then ViEmu came along and I now move between Vi-like editing in VS and Vim, and 'normal' editing in other apps.
It's not too bad, to be honest. I'm editing in a non-vi-like-manner in this comment box. I could probably install something to make Chrome do vi-like editing here, but my brain is happy to switch modes, if you'll forgive the pun.
I was thinking more about programming and system administration. After years of using emacs, I find it harder to adapt to the popular mainstream tools like Visual Studio, TextMate, etc.
To amplify your comment: I'm going on 33 years, and one of the great things about emacs is how it has changed with the times.
Your comment made me realize I'm about the same (ouch.)
I started on TECO EMACS on a DEC-20, then Gosling Emacs on Unix, then GNU Emacs on Unix, then various mini-emacs on PCs, finally back to GNU Emacs.
>how it has changed with the times
Heh, even a glacier will surprise you.
I moved to Windows ten years ago for my day job, and had to use many editors which didn't support vi keybindings, so ended up learning to work with only the keys on the PC keyboard.
This has worked out quite well, as these days I have vi keybindings in some Windows apps (thanks ViEmu!), but when they're not available, I can fall back to 'no help' mode and still be comfortable enough with most editing tasks.
Still more<esc>bimuch <esc>ea productive with vi keys!
Don't you mean "bcw"? ;)
Yours would be: Still much productive with vi keys!
I'm not afraid. After 22.5 years on Gnu Emacs, I'm considering a jump to Textmate 2.
(I probably would not be considering a jump, however, without the boost to sustainability caused by Textmate 2's having been open-sourced. ADDED: also, being able to edit files on remote hosts is not important to me.)
I keep thinking that what I really need is to switch all the machines I use to Plan9 to abstract away the remote sessions, I guess then I'd have to learn Acme :)
# stop ssh connections from freezing
KeepAlive yes
ServerAliveCountMax 10
ServerAliveInterval 10
# Lets you bounce through an arbitrary number of hosts.
# ex: ssh 1sthost/2ndhost/3rdhost
Host */*
ProxyCommand ssh $(dirname %h) nc -w1 $(basename %h) %pWhy should I?
I'll peg myself as a half-competent developer, the kind who codes everyday and can lose a weekend to a spontaneous side project. I am completely in agreeance that tool mastery is vital for enjoying and being productive in programming, I just have no concept, not from this guide, and not from many others, why Emacs is better for me than Sublime Text, nevermind why I should consider taking a year (an eternity in technological time) to master it.
And I realize that's a question that requires an unfair amount of trivial knowledge (e.g. the way I work and design)...but that's kind of the core concept for me...I feel pretty productive in ST3, I can sense the shortcuts and power tools I haven't taken the time to master and where they would help me, and for the most part, I design my projects in a way that fit the ST3 navigational flow...which I imagine is a side-effect of ST3's overall excellent design. In general, though, the bottleneck for me in programming isn't the typing of code or navigating through files, it's the sitting and thinking...rarely do I ever feel that ST's navigational functions cause me to lose context or concentration.
So all things considered, what value does Emacs bring me? Is it better in general programming situations? Or for ones in which a highly customized environment is needed? In that case, then fashion the argument properly...I would never argue that Ruby is the best language for all purposes, but I could certainly argue that it's a great contender for specific domains, and as a "glue" code.
Maybe the OP lists some compelling use cases further down in this document, but I pretty much stopped reading at this line, which gives me low confidence that me and the OP share the same worldview of how things work:
> No job ad will list Emacs as a required skill. That’s actually a good thing. It ensures that only honest technical guys exist in Emacs community.
I don't want to proselytise, but maybe that hints at one of the core appeals of emacs. A year is nothing in terms of the span of time emacs has been around, and so time invested in making emacs your editor is effort that won't be discarded in the next technological cycle.
The other aspect is what I mean by "making emacs your editor"; emacs has had a lasting appeal because it is so general, and so malleable. Emacs becomes a construction material for your personal editor, and everyone who uses it seriously ends up with something idiosyncratic and ad hoc, in the best senses of those words.
The difference is: the flexibility of IDEs stops after a while, and then there's nothing new to learn to become more efficient. With Emacs, you can keep on learning and optimizing your work environment.
Disclaimer: I work with Eclipse almost exclusively these days, also because for Java it's so much better, IMHO.
For example, I gave Visual Studio another shot recently (VS2013); and I mean, I read books on using it productively, I read the various tip blogs, advice for customization online, et cetera; I used it extensively. Unfortunately, I just don't see what people see in it. From my point of view, it's still slow, cumbersome, expensive (for any version with features that are actually useful), much less featureful than (customized) emacs, and doesn't run on most of the platforms I use to develop software. In theory, I could dedicate a few years writing extensions for one of these IDEs to duplicate all the emacs modes I use, but I'd probably never be able to fix, for example, buffer switching, or all the places where the mouse is the preferred form of interaction, or where modal dialogs steal focus (let alone all the dialogs that inexplicably aren't resizable). Meanwhile, the nice features like Intellisense and so on are the kind of customizations I've had in emacs for most of my prefered languages for years anyway.
For me, it was the realization that emacs can be configured to do anything you want. If you don't like how it works (and you probably won't), you can change it. Do you wish that Alt-<left arrow> would delete all of the whitespace in front of your cursor and translate the rest of the line to piglatin? You can to that. Do you want to send a copy of your file to an ftp site in addition to your local disk when you hit 'save'? And also push to github? Go for it. I guess you could say that you get out of it what you put into it. I sometimes find the auto-complete in emacs a bit lacking and I'll try another editor/IDE, but once I find something I don't like and I can't change it, I'll go back.
That being said, I think you're probably right that it is better in general and other tools can be better in specific situations.
That said, I'm going to hold off of emacs at the moment. My goal has still been to learn vim :)
In contrast, you will never see emacs inside of vim.
The value in emacs is all the language specific modes and utilities that will allow you to turn emacs into a customizable IDE where you can run your builds, tests and debuggers from inside the editor.
There are "proper" IDEs out there but all of them are more or less language specific. Emacs is a general purpose text editor and can be used with any language, and customized to the tools and conventions around that language.
I use so many tools and languages that having a single language IDE (or many of them) is not an option. And I don't want to go back to running a simple text editor and running my builds on the command line separately.
I've been a Vim user for quite a long time but I'm slowly making the transition to emacs and evil-mode (I recently started doing some symbolic math Scheme code in emacs). Vim is a great editor but tool integration is the weak spot. Especially debuggers don't really play nice with Vim.
Do you use a text editor only for programming? Or do you use your text editor to edit all kinds of text, including emails, letters, notes, to-do lists, etc.? I do the latter, and the last time I evaluated text editors, Emacs was the best choice for editing all the text that I work with daily.
For example, the last time I evaluated Sublime Text, it didn't have package nearly as powerful as Org mode for Emacs. Org mode is the best note-taking tool I've ever used.
In addition to note-taking, another example is email. format=flowed is one of my requirements, and when I search the web for "Sublime Text" "format=flowed", I get fewer than 744 results, and none of the top results are relevant. When I search the web for Emacs "format=flowed", I get 135,000 results, which includes many relevant results.
Steve Yegge wrote a classic programming read "Tour De Babel"[1], which has a bit on Emacs under the Lisp section. He also wrote "Effective Emacs"[2], which just the intro tries to explain why you should use Emacs. Lastly, there's Vivek Halder's "Levels of Emacs Proficiency"[3] which will either amuse/awe you or scare you.
[1] - https://sites.google.com/site/steveyegge2/tour-de-babel
[2] - https://sites.google.com/site/steveyegge2/effective-emacs
[3] - http://blog.vivekhaldar.com/post/3996068979/the-levels-of-em...
Interesting to see he uses evil-mode. I've just started using it, and so far the jury is out. I have yet to find an equivalent to move by sexp (move by sentence [()] doesn't do the same thing for me) for instance. I'm less interested in an exact replica of Vim than a more efficient editing experience. Perhaps this will ease with more experience.
This is the kind of exaggeration that makes a lot of people to avoid even trying Lisp. Any programming language that uses a different programming paradigm than the one you are familiar with will make you a better programmer.
Maybe the people who wrote the Clojure tutorials considered that question to be SO natural they didn't even mention it, but I found it very unintuitive. And running a very slow tool on every code change and waiting for the build and then starting the program is very unnatural and un-lisp-like.
Common Lisp is a bit old by now, but it's always been very stable and fast. Maybe Racket is a more modern+mature Lisp family member that's nice to try.
I don't understand what age has to do with anything... CL is still a good language.
As some have said, it's worth learning because of the way it can change the way you think about things. It sounds hokey and trite, or like someone's trying to be smug ("I'm in the secret lisp club!"), but I genuinely feel profoundly grateful to have been exposed to Lisp. (To be fair, I also really like programming in Python for _many_ of the same reasons I enjoyed programming in Lisp.)
I mean, however cheesy some Smug Lisp Weenies(tm) may be, why not learn something new? Lisp (the language family) is really cool, you should try it. elisp may not be the most exciting family member, though.
Just saying... I assume you have your reasons to refuse Lisp.
Whether or not lisp is worthwhile to learn has nothing to do with how some people advocate for it, right?
Emacs is developed by Lisp whose syntax is different from common programming languages. A developer who is curious enough to try Lisp is possibly more intelligent than average. Lisp is often the third language he/she learns (Java/C/C# is the first, a script language like Bash/Python/Perl/Ruby is the second).
Now I'm starting to do my own changes to his config, but there's still a lot of stuff I'm afraid to touch. I'm thinking of declaring ".emacs bankruptcy" soon, or maybe start from something more minimal like the Starter Kit linked in the article (I wish I knew about it before starting with purcell's)
Biggest thing I miss when I moved from Vim was tmux. Window management in Emacs is a nightmare, and the shells suck as well.
Emacs is a stern taskmaster, but she repays the investment in multitudes.
Glory be to the thermonuclear text editor.
2. Emacs macros.
3. Lack of hopping between terminal and editor.
* speed of typing : I really appreciate not having to take my finger off of the main part of the keyboard to use arrows or the mouse, I also don't like the 2 stack (2 mode) switching for vi. Somehow I find it easier to remember the few keyboard cords the toggling of modes.
* works in a terminal : launch with emacs -nw and you can work across an ssh terminal with same syntax highlighting, same shortcuts
* available for most OSes : my co-workers use fancy new editors except they have to rsync code from the server back to their latest Ubuntu, OSX or Windows just to edit it.
* people like to customize it and there are modes for all kinds of esoteric languages and build systems : i don't fiddle much with my .emacs so it is not benefiting me personally but others swear by it
I use vim now though, and I find that the keybindings feel much more natural, being based on the positions of the keys rather than mnemonic-based ones in Emacs (e.g. ctrl-n for "next line").
2. First-class functions that can be bound to anything. I always bind "goto-line" to a single key (like f7). That alone saves me lots of time. And custom functions work the same way. You can put a macro to insert that if __name__ == '__main__' in python scripts with a single keypress, or with a "M-x <function_name>".
In addition to language boilerplate, you can use these facilities to help enforce arbitrary coding standards. I have a function template for C that adds a comment "/* end <function_name> */" after the close bracket, for example.
These facilities apply to any file you might want to work with. This is in addition to whatever editing modes might already exist for the language.
3. Working in text-only terminal on a remote server is only slightly different from working on my desktop. Not having to manually sync files or mess with X configuration is a huge win for me.
1) "the kitchen sink" thing, which is commonly cited as a drawback, is (to me) emacs most compelling feature. If this isn't compelling to someone, then a lot of the rest of emacs probably won't be, either.
There's a learning curve to doing everything in emacs. I've written some guides on it before to ease the transition to starting to use it (basically introducing a few very important basic concepts that introduce major and minor modes, keybindings, and how to investigate those and customize them), but when you have that core understanding down, when you realize that you can apply those same concepts to everything you do - it's incredibly, incredibly powerful and you understand why people want to live in emacs.
eshell or shell-mode for your shell interactions is amazing. searching through a shell buffer with emacs' regexes or incremental search is fantastic. Running your whole shell in that buffer and being able to run simple but useful commands like "occur" (essentially letting you grep through multiple preceding lines of output) is something I use all the time. The commands to jump up / down through the buffer to prior prompts in the shell history - all of that stuff is great.
Similarly, using dired (directory editor) as my shell browser is great. If I need to do a batch file rename, I could jump through some hoops to do this with shell script one-liners or something, but putting dired into editable mode and then treating the file names simply like text and using search & replace operations the same way I would on regular content in a file is a natural, fast, and powerful operation.
And of course all of these are the same commands and same environment as I have for editing text.
I don't do everything in emacs but I do as much as I can in it. And I didn't mention org-mode but I use it for 100% of my note taking and publishing to HTML - it's incredibly awesome.
1. terminal based 2. key chords 3. (e)lisp 4. open source 5. stable 6. extensible
Emacs easily is a text-based IDE. I for example use the SLIME extension with GNU Emacs to make it into a Common Lisp IDE.
Now we can ask if the depth of GNU Emacs makes sense and if the UI usable. But there is little doubt that Emacs is WAY beyond being a simple text editor. See ORG mode, GNUS, ...
I guess it's time once again to mention the Kinesis Advantage keyboard on HN. You can rebind every key. You can rebind control and meta to keys that are under your thumbs, and put one copy under each thumb so you don't have to use the same thumb all the time. And everyone who walks by your desk will have an excuse to start a conversation about your incredibly strange keyboard.
https://news.ycombinator.com/item?id=105026
(Incidentally, since writing that N years ago a physical therapist talked me out of the Aeron, which has poor upper back support. I've got a Steelcase Leap now.)
If you ever find yourself getting a job as a programmer, convince them to buy you a fancy keyboard and a proper chair and some Ergotron products. These things all last at least half a decade, so it's not as if you're spending that money every month.
Or buy them yourself... But if your company can't be convinced to budget $750 per year to keep you healthy and happy as you sit at your desk all day pounding out code for them at ludicrous speed, I've got bad news about your company.
I've heard that one of the main benefits to emacs is that it can be used to tool itself to one's needs; curious to know if that's what others have found?
Many IDEs are pretty veneers on sequences of complex commands that must be learned by rote. Emacs gives you text buffer interfaces to whatever you want to do, a mostly consistent model for dealing with them and the programmability to change whatever you like.
Can't blame them for not learning what the previous teachers didn't teach, but I'd sure blame myself if they got to day 2 in my class and I didn't correct it. Now I tend to start my classes by haranguing them to install Notepad++ or whatever alternative exists for Mac users.
I'm getting a little sick of Notepad++ and this thread has me thinking I should give emacs a try. (Probably not for my students though!)
Nano or gedit in comparison would be sensible choices if you were interested in teaching students about the language rather than indoctrination in the editor wars.
Unless of course it's a lisp class in which case Emacs is a sensible choice, but i think you would have mentioned that if it were the case.
I wanted to say that it's not true, but fortunately I went and checked and found this (in my programming-mode hook):
(local-set-key (kbd "<return>") 'newline-and-indent)
in my Emacs config. I thought that it's configurable via `customize-*` interface, which is as nice as any other editor "settings" dialog, but apparently it's not...OTOH I'd rather write Lisp than JSON or Python for editor configuration, but you're right in that it's personal preference.
Anyway, I wouldn't recommend making Emacs the required editor for any programming course (if not using Lisp). Just disallow using IDEs and let the students choose their editors. Make a list of mandatory features, like syntax highlighting, and let them use whatever they feel comfortable with. That way you can focus on teaching programming instead of teaching how to use an editor.
I have asked before if I will gain anything moving from Eclipse / Aptana to Emacs or VI. It will take a lot of learning, and while Eclipse is far from perfect, I have wrestled with it enough to know what I am doing. And it has lots of plugins.
(I am a not especially young programmer).
This sounds like the first line of a Kafka-esque horror story.
What can emacs and vi do that a regular IDE can't ?
emacs: incredibly customizable, you can re-write the way your editor works. Some features that I find important: editing files remotely over SSH, running a shell inside the editor (so the same editing commands work in the shell), easy to write custom file finding functions for searching different parts of a codebase, git integration (a semi-GUI interface to git), and if another editor has a feature, someone has probably created a package that adds that functionality to emacs. Also has tetris and pong.
http://stackoverflow.com/questions/1218390/what-is-your-most...
Receiving and sending emails. Being an IRC/Jabber/others client. Displaying images and pdfs directly. Bulk editing of many lines, even from different files, at once. Drawing ASCII-art diagrams. Playing tetris. Being an amazingly powerful "calculator" (http://nullprogram.com/blog/2009/06/23/). Transparently editing file on remote machines, also executing commands on remote machines transparently. Formatting ASCII-art tables. Editing outlines/todos with support for semantic movement inside it (Org-Mode). Working in a terminal. Working in a background (--daemon mode) so that new instances just connect to the backend, reducing startup time to almost zero. Dumping a whole Emacs into single binary - all the memory Emacs uses is written to disk and next time you run it it starts very quickly, because you don't need to compile,, load and run any libraries; it's like suspend/hibernate for OSes. Having a decent mode for almost every file format out there. Displaying info about currently running OS processes, like top (proced). Multiple cursors. Rectangular selection and manipulation of rects. Registers for storing pieces of text, locations in files and others. Easy running of external commands, with or without capturing their output. Find&replace with an Elisp function as replacement (quick and effective way to transforms more complex files). Being a terminal emulator (you can run mc inside Emacs, although it's not the best possible experience). Being a shell (Eshell). Easy integration with external REPLs (like IPython, with colors and all). Displaying and working with IPython Notebooks. Splitting windows horizontally and vertically as many times as you want. If you made a bit too many windows (these are Emacs windows, they live inside one OS level window) you can enable tiling window manager for them. Easy integration with external linters for many languages. Displaying man and info pages. Having easily reachable docstrings for all the functions implemented in the editor. Hierarchical keymaps. Semantic editing of sexp (any lisp) code.
And probably much more - I still learn about some new, crazy useful feature at least once a week.
IDEs win in the autocompletion department and project navigation, but that depends on a language being used. For example editing Python with Jedi and Jedi.el (and Rope) in Emacs feels like working with full-featured IDE, with very accurate, context sensitive autocompletion, refactoring support, visual debugger and others.
Helm (https://github.com/emacs-helm/helm) is another way of doing this, although I don't use it (yet - I'm going to check it out sooner or later).
The "command palette" (M-x or <esc>: in Emacs/Vim respectively) is a very useful tool for both exploring and working with the editor. It's kind of sad that people forgot about it for a few decades and only rediscovered it recently thanks to Sublime and similar.
There is a wonderful presentation called '7 Habits For Effective Text Editing 2.0' [1] explaining this philosophy. The idea is to get the basics down upfront and then get more proficient gradually over time. When you use the tool you stay aware of what you are doing. When you find an inefficiency in the way you use the tool, find a quicker way and make it an habit. This is the most efficient.
If you only care about the code you have to type right now and never read the editor's documentation nor learn new commands you'll keep using only basics commands and never will gain proficiency. Not efficient.
If on the other hand you try to learn every feature immediately you'll waste time learning things you won't use and forget most of them anyway. Not efficient.
Whatever problem you got, Emacs has a soluton.