15
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PHPを扱うようになったのでemacsにphp modeを入れてみた。

Last updated at Posted at 2015-05-16

普段はRubyを主に使ってますが、phpも最近読んだり書いたりしてるのでemacsに設定いれてみました。

#php-mode
まずはphp-modeをいれますー

ここを読みました。
melpa上からinstallです。

emacs上で

M-x package-list-packages

php-modeを選択。

init.elに

;; php-mode
(require 'php-mode)

を追加です。

#php-completion
PHPの補完をやってくれるものもあったのでそれもいれます。

M-x auto-install-batch

php-completion を選択です。

;; php-mode-hook
(add-hook 'php-mode-hook
          (lambda ()
            (require 'php-completion)
            (php-completion-mode t)
            (define-key php-mode-map (kbd "C-o") 'phpcmp-complete)
            (make-local-variable 'ac-sources)
            (setq ac-sources '(
                               ac-source-words-in-same-mode-buffers
                               ac-source-php-completion
                               ac-source-filename
                               ))))

これでphpの補完もしてくれる。

15
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?