While it is fun to customize, the Emacs has 100s of mode and there is lots of customization. I like to find popular choices, so it makes my life easier and I can spend time productively. It could be about hooks, registers, buffers, keybindings,bookmarks etc..
If such a thing does not exist, I am still happy to customize in my way.
Have a look at the Emacs Prelude.
A very popular compilation of popular default settings is the Emacs Starter Kit, originally developed by Phil Hagelberg, then by Eric Schulte and finally updated for emacs-24. It mentions:
The main advantage of this Emacs Starter Kit are
better default settings
inclusion of many useful libraries and configurations
"literate" customization embedded in Org-mode files
an organizational directory structure
git provides for version control, backup, and sharing
Then there are some specialized extensions of it:
the starter kit for social sciences
the emacs kicker
the emacs expert kick
For most popular "aha" settings, the Emacs NiftyTricks page from the emacs wiki has already been linked to in another question.
I don't know a single collection of settings, but Emacs nifty tricks can be a good starting place to pick up useful customizations and features you may not know.
It's not strictly customization, but this stackoverflow question list useful features of Emacs.
I personally advise:
Link - how to make Emacs settings compatible with modern conventions
Link - ergonomic keybinding scheme
There is also Emacs Prelude - a set of customization to make Emacs learning curve more gradual.
I also recommend going through Mastering Emacs - it has many of customizations, that may improve your productivity.
I tried the starter some time ago, but I found that I got better results by writing my own init.el so that I actually know what each line of cod e does. Emacs Fu is the best resource that I know, because it has blog posts about many different modes instead of just code: http://emacs-fu.blogspot.com/. And there is also sample .emacs based on the posts.
I think maintainer of Emacs rocks series ended up with a good .emacs settings and a useful start-up-kit for newbies to help them morph their finger habits quickly into Emacs'.
https://github.com/magnars/.emacs.d. The better-defaults package lives up to its title.
Related
The markdown for CIDER about configuring the CIDER repl starts off by saying:
You can certainly use CIDER without configuring it any further, but here are some ways other folks are adjusting their CIDER experience.
And then list several expressions like (setq nrepl-log-messages t). But where do those expressions need to be written to??
If you're using CIDER (maintained by Bozhidar Batsov), then also check out his own project for setting up emacs called Prelude. It's an alternative to emacs live (as pointed out by Arthur).
I've used both, but switched to Prelude as the CIDER updates tend to be more tightly matched as versions change due to it being the same author.
These examples go in a file called (assuming linux or mac)
~/.emacs.d/init.el
It's also worth knowing about the emacs live starter package which already includes a decently configured cider amongst a bunch of other stuff. I publish my much smaller config here if you're interested in something closer to the defaults or just want more examples.
Another good 'canned' configuration is Purcell's emacs.d. It has a good initial cider and clojure configuration. I also found it was easier to modify/update and (for me anyway) I found it easier to understand, which means easier to fix when something doesn't quite work the way you want. One of the big drawbacks with some of these canned emacs configurations is that you don't get to understand how they work and then when they break, your lost until the author or someone else fixes it. I found Purcell's version was a nice complete setup, but one I was able to easily modify to better fit my needs. Tweaking emacs to fit your needs rather than tweaking yourself to meet the needs of the editor is possibly the greatest strength of emacs and why people end up loving it. Unfortunately, it can also be a PITA when all you want to do is start coding!
See http://www.github.com/purcell/emacs.d.git
In the video the guy was able to insert functions and classes by pressing some buttons. How do I set up my Emacs to do that? Did he just use auto insert mode or something?
You can try yasnippet, skeletons or several other template mechanisms for Emacs.
As suvayu indicated, the guy in that video is mostly using various template mechanisms in Emacs (this is actually not that impressive). If you want your mind to really be blown, have a look at Marco Barringer's SLIME video. In it, he demos how to use the Common Lisp SLIME mode in Emacs. Along the way, he shows how an expert Emacs user effectively utilizes Emacs to write code. First, just watch the movie. Then, if you want to know more details about what he's doing, read Peter Christensen's transcript of the movie (I wrote a blog entry just after the movie came out with comments from a number of good lisp programmers who had seen the movie). Once you've seen the movie and can understand what is happening in it, attempt to adopt some of the techniques demonstrated in that video using your preferred programming language.
You can also look onto SRecode module in CEDET package - it allows to implement context-sensitive templates (for example, some are available only inside class, etc.), and there are some for elisp, c++, java, etc.
I have never used Emacs before and the first time I tried it I was so repulsed by its interface which seemed not very user friendly . But since then I have heard a lot about it improving productivity and this has rekindled my interest . But is it true for the case of web development as well? for the likes of php,python,javascript/jquery etc . How good are the code completion features?
Please suggest some resources to get me started in the right direction.
I'm a bit of a religious user when it comes to Emacs so please take this with a few bags of salt. I'll try to state my reasons for using Emacs (including for web development).
Emacs' primary strength is it's extensibility and the fact that at it's core, it's a lisp interpreter with a bunch of primitive functions useful for text editing and display. This makes it "programmable". You can customise it almost endlessly.
This has spurred a number of libraries which do (common) things like code completion, source code browsing, test harness integration, refactoring tool integration, version control integration etc. If a developer working on a project is an Emacs user, it's not uncommon to see her adding something to her project just to get it to work well with Emacs. The extensibility has also spurred a number of less that conventional libraries like mail clients, web browsers, IRC clients, music players etc.
Many Emacs users keep most of their work (except for maybe their browsers) inside Emacs. This allows them to use the same keystrokes and high level techniques for everything that they use. I myself use it for my daily coding, for my email, as my PIM and a bunch of other things. I can for example, while working on my code, just write something like "TBD" as a comment somewhere and let the PIM part remember this as a TODO item next time I open the editor. I can also for example while coding simply switch to another "buffer" (the emacs term for windows) with an IRC client and ask questions I might have to other people who are online. This makes me quite productive and quick. Also, the keystrokes are almost the same on a large number of command line UNIX programs (like my shell etc.) which helps me do my work faster.
Another advantage is that Emacs is old. People have tweaked and polished it endlessly and still do. The result is a set of commands for editing that I didn't even know that I needed. Things like "capitalise word" to make the first letter of the word my cursor is on upper case sounds trivial but while you're editing, it's quite useful.
Being extensible, Emacs has "modes". These are environments for specific programming languages. Indentation rules, syntaxes, completion etc. will change depending on the mode you're in. There are modes for almost all modern languages and they provide substantial help while editing. You have things for javascript, php etc. which help you while coding in those languages. There are also web specific tools (e.g. Emacs can talk to MozRepl so that you can refresh you browser and things while editing). People write modes all the time for what they want and it's not too hard. I recently started using jekyll to maintain my blog and wrote a mode to make my life easier). The modes add functionality but at a base level are the same (e.g. same keys to delete a character, move forward by a sentence etc.). I like this because I don't have to learn a whole new set of keys and get used to them just to code in another language.
That being said, Emacs is a tool for a different kind of developer. Most hardcore Emacs users (and there are quite a few famous ones out there) don't use many IDE type features. They usually like just a window (Without toolbars, menu bars and all that) so that the real estate for code is maximum. If you're used to leaning on a feature heavy IDE to do your work, Emacs might not be the right tool for you (I think this is what Trey meant in his comment). If however, you want a programmers editor that stays out of the way and let's you get your job done with minimum hassle, it's something you should definitely try out.
Okay, resources. The first thing to do is to start up Emacs and type Ctrl-h t. This gives you a "hands on" tutorial you can use to learn the editor basics. Once you're done with that, you can read the fine manual at http://www.gnu.org/software/emacs/manual/html_node/emacs/index.html. Once you're happy with that, you can read the Emacs lisp tutorial and start extending and customising Emacs as per your wishes. The EmacsWiki is a great place for tips, tricks and docs as is the Emacs IRC channel.
All the best!
If you don't like the interface, it's not worth it.
The question isn't is it worth learning Emacs, it is do you want to learn the interface?
If you do, then it's worth it. If you don't, then it's not.
More concretely, I'll answer your broad question with a series of links you could have gotten from the Emacs wiki:
http://www.emacswiki.org/emacs/JavaDevelopmentEnvironment
http://www.emacswiki.org/emacs/NxhtmlMode
http://www.emacswiki.org/emacs/HtmlMode
http://www.emacswiki.org/emacs/MuMaMo
http://www.emacswiki.org/emacs/PhpMode
http://www.emacswiki.org/emacs/php-completion.el
http://www.emacswiki.org/emacs/php-mode-improved.el
http://www.emacswiki.org/emacs/JavaScriptMode
http://www.emacswiki.org/emacs/FlymakeJavaScript
http://www.emacswiki.org/emacs/PythonMode
http://www.emacswiki.org/emacs/PythonProgrammingInEmacs
http://www.emacswiki.org/emacs/CategoryProgrammerUtils
Yes, people like using Emacs for web development. The above is just a sampling of modes people have written and use on a daily basis.
Is it for you? I don't know.
Is it better than editor X? or IDE Y? Yes for some things, no for others.
The code completion features are great! (unless they're not) It depends on what you want, what languages you're talking about, etc. etc. etc.
People use vi, people use Emacs, people use Notepad, people use all sorts of text editors.
Note: asking vague questions leads to vague answers.
The ultimate web programming mode is arguably nxhtml mode. You might start by taking a look at it. You might also want to check out some rich preexisting Emacs configurations like the Emacs Starter Kit or the Emacs Dev Kit.
The PHP & Python modes in Emacs are not particularly great, but are fairly decent. The JavaScript mode is certainly great. Packages such as autocomplete mode provide good completion almost everywhere.
I'm certainly biased, but I think that if you do spend some time exploring Emacs you'll find out that it will boost your productivity.
As some other posters have eluded to, it all depends on what you want out of it. If you want to feel as good about the customizations you've been able to get working in emacs as you do about the actual code that you write, then sure.. Emacs is great ;)
(Before anyone jumps down my throat, emacs is by far my favorite editor for 'nix C/C++ editing, but that's not what the OP's looking for here ;))
In my crusade to find the most productive editor for PHP, Python, Javascript etc, my favorite thus far has been Komodo Edit. It features not only code completion, but jump-to-definition (as well as many other features that a full-featured IDE should have) and is really the closest thing to Visual Studio for OS scripting development that I've seen. Oh, and it's free.
Honestly, braces against the rotten fruit/vegetables that will surely be thrown my way I've recently become a fan of the NetBeans IDE for web development. Particularly when It comes to PHP.
But to answer you question: It's only worth it if it's worth it to you. Sorry, vague questions get vague answers. ;)
If you're using an existing IDE that can do web development, than use the IDE. If not Emacs is worthwhile to learn as the text editor to go to for text editing or for programming in language that do not have a good IDE.
Emacs is the IDE of choice for programming Erlang.
There are plenty of good modes (distel, erlware-mode, the default erlang mode,...), but what are your recommendations for setting up Emacs for professional Erlang development?
Set up erlang-mode as described in the README, and then activate Flymake:
(require 'erlang-flymake)
That gives you highlighting of warnings and errors as you type.
I'd recommend using erlang-mode from the latest Erlang/OTP release (R14A as I type this), regardless of what release you normally use, as it evolves quite rapidly and is now just as good as erlware-mode, IMHO.
If you're using Emacs 24 or later, I recommend installing erlang-mode from MELPA. The 'erlang' package tracks the 'maint' branch of the Erlang/OTP Git repository, so it is always reasonably up-to-date.
If you want more than erlang-mode offers, a possible alternative to Distel is EDTS, the Erlang Development Tool Suite. To quote the readme file:
EDTS is meant to be a able to replace Distel but only provides part of the most
commonly used of Distel's features, specifically the equivalents of
erl-find-module, erl-find-source-under-point, erl-who-calls and
erl-refactor-subfunction. As far as I know, those are the only Distel features
that 98% of people use, but if there is anything from Distel that you are
missing in EDTS, please let me know.
If you are using EDTS, please remove Distel from your configuration, since
running both can create some confusion.
Look onto this article about different packages for work with Erlang from Emacs. I personally use erlware-mode + distel
erlang.el (for indentation and font-locking) and Distel (debugger, M-. etc.) are essential. ESense, I've never used, and I've no idea what the erlware mode does. You may want to use some of the standard Emacs utilities (flymake, interface to version control, and so forth) when writing Erlang.
I've found erlang-mode ok but it doesn't support kerl (which is a useful thing, kinda like rvm for erlang, except it works).
So I started this:
https://github.com/nicferrier/emacs-erlang-extras
which supports multiple erlangs.
I'm intending that it will support rebar as well:
https://github.com/rebar/rebar/wiki/Getting-started
I found out ESense on emacswiki. Might worth a try.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
Should I learn to use Emacs with no intention to learn Lisp, if my other option is to get familiar with vi?
Yes. With all the resources out there (FAQ, Emacs wiki, and the Stack Exchange Emacs site) and custom (M-x custom). You don't need to know Lisp. You just cut/paste what you find.
You can drive a Ferrari/Yugo without knowing the internals of the combustion engine or how a Formula One transmission works...
Why not?
You can still learn vi (probably Vim or Elvis).
You can learn jEdit. Or nano and Pico. Or whatever other editor, environment, and language-host you fancy.
Why put such an arbitrary restriction on things? While your Emacs experience will be better if you learn at least basic Emacs Lisp (a .. derelict .. Lisp implementation), it's not required. But at the end of the day, it's a tool. Get as many useful tools as you can. "Useful" also really depends on context.
I have used Emacs for several years with next to no knowledge of Lisp and it served me well for all of the projects I used it for.
You can always simply assume that the configuration you're writing is not in Emacs Lisp and that it is just some funny configuration format - there a lot stranger examples out there (such as Sendmail).
I should warn you though that once I started learning Emacs Lisp my Emacs mastery expanded extremely rapidly - now that I understand the details of the language I can easily bend any configuration to my needs and more importantly I started writing my own extension to Emacs, which add to it even more capabilities.
If you decided to start with Emacs, I recommend to read first this great book - it taught me a lot of things for Emacs at the beginning and it assumes no Lisp knowledge. It won't teach you any Lisp either. Afterwards my advice would be read the official Emacs manual and start exploring the Emacs Wiki and #emacs on Freenode.
Learning Emacs truly is a journey that is not for the faint of heart, but it is journey that is most certainly worth it...
Configuring Emacs is a journey, and it's something that you're going to want to do. Being able to customize your developing environment is one of Emacs' greatest strengths. It's almost unavoidable. You pick up bits and pieces just by looking at other people's .emacs files.
Knowing just a little bit of Lisp goes a long way in Emacs.
You don't need to learn Lisp to use Emacs. Even basic customization of Emacs works fine without Lisp knowledge. If you need something beyond your capabilities, there are many helpful Emacs users.
Learning a bit Emacs Lisp will later enhance your understanding of Emacs.
Emacs Lisp is a relatively simple Lisp dialect. Basic Emacs Lisp is not that difficult to learn. As an experienced Lisp user I have to say that Emacs is available quite some time and the users have written some amazing things in Emacs (like Org-mode). Some of the Emacs extensions are very very well written and it is a pleasure to read the code.
Well, if you don't want to customize your Emacs, you won't need Lisp, either. And you can also do some basic modifications using the build-in customize functionality and by copy&pasting code of others. But truth being: I have written several hundreds of lines of code to customize Emacs to suit my needs. On the other side, as far as I know, vi is not as customizable as Emacs, so in the end it is probably more about what editor you like more and you should try both.
I know little Lisp and use Emacs to edit my C and OCaml programs on Windows and Linux.
I've been using Emacs for a year and a half, and really only picked up whatever Emacs Lisp came without trying. I have a heavily extended set of configurations (first in a .emacs file, and now in ~/.emacs.d/init.el and friends), which are totally a result of cutting and pasting from the excellent resources found online.
Aside from, of course, the EmacsWiki, you should see the fine Emacs Starters Kit and subscribe to Planet Emacsen --- preferably in a feed reader. It's prettier.
Having said that, after you have a working setup you might yield to the temptation to learn a little Emacs Lisp. I've just started the free Introduction to Programming In Emacs Lisp, which comes with Emacs and is best read from within Emacs Info. It assumes neither programming ability nor Lisp knowledge, and is a friendly introduction to the 'vibe' of Emacs Lisp which I find to be well-written in the extreme, friendly and concise, and worth 10x every minute I have spent with it.