~w96k/dotfiles

56a7a86bc21e74674cba22344ef1beae23c4d163 — w96k 3 months ago d881dae
Add phpactor
1 files changed, 42 insertions(+), 3 deletions(-)

M emacs/.emacs.d/.emacs-config.org
M emacs/.emacs.d/.emacs-config.org => emacs/.emacs.d/.emacs-config.org +42 -3
@@ 157,6 157,7 @@ https://git.sr.ht/~w96k/dotfiles/tree/master/item/emacs
      (package-install 'expand-region)
      (package-install 'flymake-php)
      (package-install 'flycheck)
      (package-install 'phpactor)
      ;;(package-install 'robe)
      (package-install 'geiser)
      (package-install 'geiser-guile)


@@ 1188,22 1189,60 @@ Sudo-edit

** PHP
*** PHP-Mode
Не осуждайте. Необходимо скачать и распаковать мануал PHP (в формате
html) в директорию ~~/.emacs.d/php-manual/~.
Необходимо скачать и распаковать мануал PHP (в формате html) в
директорию ~~/.emacs.d/php-manual/~.
#+begin_src emacs-lisp :tangle init.el
  ;; (add-to-list 'load-path "~/.emacs.d/site-lisp/realgud-xdebug/")
  ;; (require 'realgud-xdebug)

  (when (package-loaded? "transient")
    (progn
      (transient-define-prefix
       php ()
       "Php"
       [["Class"
	 ("cc" "Copy" phpactor-copy-class)
	 ("cn" "New" phpactor-create-new-class)
	 ("cr" "Move" phpactor-move-class)
	 ("ci" "Inflect" phpactor-inflect-class)
	 ("n"  "Namespace" phpactor-fix-namespace)]
	["Properties"
	 ("a"  "Accessor" phpactor-generate-accessors)
	 ("pc" "Constructor" phpactor-complete-constructor)
	 ("pm" "Add missing props" phpactor-complete-properties)
	 ("r" "Rename var locally" phpactor-rename-variable-local)
	 ("R" "Rename var in file" phpactor-rename-variable-file)]
	["Extract"
	 ("ec" "constant" phpactor-extract-constant)
	 ("ee" "expression" phpactor-extract-expression)
	 ("em"  "method" phpactor-extract-method)]
	["Methods"
	 ("i" "Implement Contracts" phpactor-implement-contracts)
	 ("m"  "Generate method" phpactor-generate-method)]
	["Navigate"
	 ("x" "List refs" phpactor-list-references)
	 ("X" "Replace refs" phpactor-replace-references)
	 ("."  "Goto def" phpactor-goto-definition)]
	["Phpactor"
	 ("s" "Status" phpactor-status)
	 ("u" "Install" phpactor-install-or-update)]])))

  (when (package-loaded? "php-mode")
    (progn
      (add-hook 'php-mode-hook 'php-enable-symfony2-coding-style)
      (setq lsp-intelephense-php-version "8.1.6")
      ;; (defvar phpactor-executable "~/.bin/phpactor")
      (defvar phpactor-executable "~/.bin/phpactor")

      (add-hook 'php-mode-hook 
		'(lambda ()
		   (require 'yasnippet)
		   (require 'yasnippet-snippets)

		   (set-fill-column 120)

		   (make-local-variable 'eldoc-documentation-function)
		   (setq eldoc-documentation-function
			 'phpactor-hover)
		   (yas-minor-mode t)
		   (define-key php-mode-map (kbd "C-c h") 'php-quickhelp-at-point)))