xcwen / ac-php

emacs auto-complete & company-mode for php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document (non-)compatibility with web-mode

PhilHudson opened this issue · comments

Can you use ac-php in web-mode? If so, how? I think we should be told. Thanks.

commented
(add-hook 'web-mode-hook
          '(lambda ()
             ;; Enable auto-complete-mode
             (auto-complete-mode t)

             (require 'ac-php)
             (setq ac-sources '(ac-source-php))

             ;; As an example (optional)
             (yas-global-mode 1)

             ;; Enable ElDoc support (optional)
             (ac-php-core-eldoc-setup)

             ;; Jump to definition (optional)
             (define-key web-mode-map (kbd "M-]")
               'ac-php-find-symbol-at-point)

             ;; Return back (optional)
             (define-key web-mode-map (kbd "M-[")
               'ac-php-location-stack-back)))

Thanks very much.

commented

I can't say why, but after some trial and error, I determined that this* caused mouse-1 and mouse-2 to output M-] and M-[ for somereason in spacemacs. This caused control character strings to be written to buffer.

(define-key web-mode-map (kbd "M-]")
               'ac-php-find-symbol-at-point)

             ;; Return back (optional)
             (define-key web-mode-map (kbd "M-[")
               'ac-php-location-stack-back)