use poper emacs namespace, move keys to dedicated minor mode

This commit is contained in:
Maciej 2021-03-06 10:52:54 +02:00
parent 7f5f90ae4d
commit 76c7d665c7
Signed by: maciej
GPG key ID: 41D62D42D3B0D765
38 changed files with 337 additions and 221 deletions

49
lang/php.el Normal file
View file

@ -0,0 +1,49 @@
;;; php.el --- summary
;; Author: Maciej Szlosarczyk
;; Maintainer: Maciej Szlosarczyk
;; Version: 0.1-snapshot
;;; Commentary:
;; php related settings
;;; Code:
(require 'icejam-pkg-prog-mode "$HOME/.emacs.d/pkg/prog-mode.el")
(require 'icejam-pkg-flycheck "$HOME/.emacs.d/pkg/flycheck.el")
(require 'icejam-pkg-hydra "$HOME/.emacs.d/pkg/hydra.el")
(use-package php-mode
:requires (lsp-mode lsp-ui)
:ensure t)
(defhydra my-php/context-hydra (:color teal :hint nil)
"
^PHP actions^
^^^^^^^^-----------------------------------------------------------------------
_r_: Reload buffer
_i_: Indent buffer _m_: iMenu
"
("q" nil "cancel" :color blue)
("r" revert-buffer-no-confirm)
("i" indent-region)
("m" lsp-ui-imenu))
(defun activate-php-mode ()
"All things php."
(set-indent 4)
(column-enforce-n 80)
(define-key php-mode-map (kbd "C-c l") 'my-php/context-hydra/body)
;; Company list override
(add-to-list (make-local-variable 'company-backends)
'(company-capf company-yasnippet)))
(add-hook 'php-mode-hook 'activate-php-mode)
(provide 'icejam-lang-php)
;;; php.el ends here