someisaac
someisaac

Reputation: 1047

Using Emacs for Web Development? (Php/mysql/javascript/css/html

I'm a Web developer. I had been using a variety of editors and ide-s for web development(php, javascript,html,css) six months before I decided to learn a true editor and started using emacs. I learned all the basics, used the starter kit, practiced using buffer, windows etc..

I got a grip in 2 months. A month ago I started learning about vim and I found a lot of plugins to achieve the things I want. I'm finding to achieve the same effect in emacs you have to do a lot(for php/js/css/html editing).

Here are the list of things I'm finding hard. Note: These things are related when I'm editing php/html/css/js.


I love ido mode and switching b/w files in tramp,buffers,local files using ido-mode.

Can anyone point me in the right direction? Do you use emacs for same kind of editing I do? What is your work flow?.

Upvotes: 13

Views: 8169

Answers (4)

Jérôme Radix
Jérôme Radix

Reputation: 10533

  • syntax hightlighting(php/smarty). -- the php major mode is too old and it always highlights html/smarty inside the php code incorrectly.

The simplest and best way to manage mixed languages in one single buffer is to clone the window showing it with C-x 4 c and use different major modes for each window showing this single buffer, for example, one window with the php-mode, one window with the nxhtml-mode to correctly highlight the HTML syntax.

Upvotes: 0

Déjà vu
Déjà vu

Reputation: 28840

I like Emacs for small projects and quick editing.

There are things like C-x ( to make a repeat-macro, delete-matching-lines, describe-function (...), apropos, the quick C-x 2 to split window, the warnings (text was edited elsewhere do you really want...) and the quick Lisp fix in .emacs that make me having an Emacs open at all times.

But for bigger projects, when you want to hover a keyword and have its definition, the call hierarchy, the updated syntax highlighting etc... Emacs is not enough for me. I use Eclipse (which is slow and not perfect anyway for C C++).

Upvotes: 0

phils
phils

Reputation: 73274

Manual lookup I want to lookup the manual for a particular word
under the cursor without opening the browser. (in the messages area (mini-buffer))

It sounds like you are after eldoc-mode support for PHP? (enable it on a lisp file to see example)

;; Major modes for other languages may use ElDoc by defining an
;; appropriate function as the buffer-local value of
;; `eldoc-documentation-function'.

A search for eldoc-documentation-function and PHP turns up this: http://www.emacswiki.org/emacs/php-doc.el

Upvotes: 0

Bozhidar Batsov
Bozhidar Batsov

Reputation: 56595

nxthml-mode is the ultimate mode for web development.

You can easily define a project in terms of its VCS or .dir-locals.el with find-file-in-project.

Fuzzy matching is called flex matching in ido. You can enable it with:

(setq ido-enable-flex-matching t)

I've never had any problems with ctags, manual lookup is trivial to implement...

Upvotes: 6

Related Questions