I am running Emacs Live with Rinari. In .erb files html-mode is enabled automatically, however embedded Ruby is not highlighted according to ruby-mode. Is there any way to enable both html-mode and ruby-mode within .html.erb files?
Check out web-mode, which is designed for HTML templating. It can be installed via MELPA or Marmalade. (Note that this is not a way to run html-mode and ruby-mode simultaneously as you requested; it's a completely different mode. It's also probably your best bet.)
Out of the box, it supports .html.erb (and many others), with superficial CSS and JavaScript support (highlighting and indenting).
Install 'rinari' for emacs which is specially for ROR. It has a mode called eruby-nxhtml-mumamo-mode which hightlights the html.erb syntax as we need. This link will help you how to install it. It takes care of everything. Enjoy!
Related
Im just starting to look into Emacs as a IDE. There are lots of articles about how to setup Emacs as an IDE for languages XYZ. Most of these articles talk about how to switch content in your emacs.d. However this would only work if you use Emacs for one language?
Say for example I want to use Emacs with Clojue, Javascript and Python. For Clojure i want to use LiveMode and for Javascript i want to use some other mode and the same for Python. All highly specialized with a background repl running. How would I go about setting emacs up for this and what if I would like to use for example EVIL mode on all the IDE:s? Would it be possible to switch IDE setup at runtime depending on file ending or do i have to restart Emacs loading different settings each time?
Emacs allows to use so-called modes with files, e.g. python-mode for Python files etc. Automated enabling of modes for a specific file is either happening through file-local special variables or via associations of file-types via auto-mode-alist.
Modes actually provide these "special" settings you are talking about. If you want to add a special additional behavior in some mode, you typically add the required setup functions in the so-called mode-hook.
It might happen you run into incompatibilities between various extensions or modes, but this is a pretty rare case.
I've been using Emacs as a PHP IDE for quite some time now (with emacs-starter-kit, ECB, & Geben). With each new release for emacs-starter-kit or Emacs 24, ECB introduces new errors & window issues. It doesn't seem well-maintained anymore (last release was 2009).
Wondering if there's a project-manager / IDE emacs plugin that's today's defacto? Something that does file-browsing (like sr-speedbar), method list, possibly even auto ctags?
The answer is that unfortunately no such thing exists. emacs-nav offer a file browser similar to the one in ECB and you can use something like helm to jump to various stuff in your project (like files, tags, imenu entries, etc). Small utils like projectile might also be helpful to you.
All in all using heavyweight tools like ECB is not the Emacs way and I guess this is the reason while its development has stagnated - few Emacs users would use a tool like that given there a smaller more flexible alternatives.
I'm use sr-speedbar to file browser
http://emacswiki.org/emacs/SrSpeedbar
I'm using ecb on emacs-24 with no problems. the only thing I had to add to my .emacs was:
(setq stack-trace-on-error t)
it prevents from throwing errors on ecb startup. What kind of window issues do you experience?
According to this answer, Emacs + Slime already has much advanced functionality. So how can I get syntax coloring, auto-completion, and perhaps even version control management, set up and running in my copy of Lispbox?
If it's of any help, I have installed Lispbox on Mac OS Lion.
Syntax highlighting should already be working as soon as you load a lisp file in Emacs, regardless of whether you've got SLIME installed or not. If it's not, try doing M-x font-lock-mode and see if that turns it on.
Version control isn't provided by Emacs or SLIME, but Emacs can integrate with pretty much any version control system you care to use. I recommend Mercurial or Git. Emacs should start vc-mode automatically when you open a file that is in one of the supported version control systems. The manual includes extensive documentation, do M-: (info "(emacs)Version Control") to jump right to it.
Auto-completion is more complicated. There is more than one way to skin this cat, but for Lisp SLIME's default method should be good enough. Use M-TAB to complete the symbol at point.
OK, I know you're going to point me to EmacsWiki page, but here's the deal. I'd like to use the default Emacs mode for a given file type, and change mode after specific tag, say <% %>. By doing such, I can switch the mode inside the tags, and return to default mode when cursor is not inside tags.
And no, I don't need ASP/PHP mode, it just that I find boring M-x-ing all the time in order to change the mode. I'm using Emacs 23.2.1 on Arch Linux FWIW. Any ideas?
Have a look at mmm-mode: http://sourceforge.net/projects/mmm-mode/ or noweb-mode. Here are instructions for getting mmm-mode to work with literate Haskell documents. And here is the configuration I use for noweb-mode with literate (rst+python) Python documents.
nXhtml
nXhtml is an addon to Emacs for editing XHTML, PHP and similar things.
nXhtml comes with MuMaMo (Multiple Master Major Mode), which I think is a newer version of mmm-mode. I use it all the time when editing Django HTML files which combine CSS, JavaScript and Django-aware HTML modes.
Is it what are you looking for :
http://www.emacswiki.org/emacs/PhpMode#toc8
You probably want to adapt it to fit your need
I saw the the news that emacs 23.1 was released.
For a programmer, What are the big reasons to upgrade? I'm currently on 22.2.
None of the features listed really seem like must-haves for me. The most immediately interesting bit is that nXML is now integrated. I already have it though.
But I have to admit I don't know what is really behind "smarter minibuffer completion" or "per buffer text scaling".
Anyone have any tips or examples of what these things are?
For me, the biggest reason is the support for anti-aliased fonts. And the --daemon support is nice.
Emacs-fu has a nice write-up of some of the features.
M-x butterfly
No one said anything about multi-tty support? I have one long (LONG!) emacs session opened somewhere, and I ssh'ed into that machine remotely and use that particular emacs session (with all the temporary buffers, everything setup the way I liked, groups of buffers opened, etc.). The benefit of course, is that I don't need to worry about saving temporary buffers (you do use those as scratch pad, don't you?), etc. when switching machines (from school to home, for example).
Also, with multi-tty support, you can open emacs with emacsclient -nw to substitute your occasional needs for vi for quick terminal edits. emacsclient -nw will open even faster than vi, and you will have access to your opened emacs session as a bonus. (Before emacs 23, emacsclient cannot run from the terminal).
"Improved Unicode support (the internal character representation is now based on UTF-8)."
is a critical reason for me, but it no doubt depends on your work flow.
Some of the terms you are asking about were discussed in Set Emacs defaut font face per-buffer/mode and are also in the emacs wiki, e.g. http://www.emacswiki.org/emacs/SetFonts (under Changing Font Size - Buffer Text Resizing ).
While I was using the pre-releases, the most noticeable feature has been the improved font support. and some small things about smarter window splitting.
for me its font support and gnupg integration.
also its nice to read pdf's from within emacs.