Use transient instead of hydra (#3)

* Use transient instead of hydra
* Use global map instead of my custom map
This commit is contained in:
Maciej 2023-03-16 20:47:35 +02:00 committed by GitHub
parent 835c3325ef
commit 8d81d91314
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 173 additions and 311 deletions

View file

@ -18,31 +18,26 @@
:requires (lsp-mode lsp-ui)
:straight t)
(defhydra my-php/context-hydra (:color teal :hint nil)
"
^
^ LSP ^^Buffer
^
^ _m_: iMenu _r_: Reload
^ ^ ^ _f_: Format
^ ^ ^ _i_: Indent
^ ^ ^ _e_: Show Errors
^
"
("q" nil "cancel" :color blue)
(transient-define-prefix +my-transient-php-context-menu ()
"PHP Buffer Commands"
[""
["LSP"
("m" "iMenu" lsp-ui-imenu)]
["Buffer"
("r" "Reload" revert-buffer-no-confirm)
("f" "Format" elixir-format)
("i" "Indent" mark-and-indent-whole-buffer)
("e" "Show Errors" flycheck-list-errors)]]
[""
("q" "Quit" keyboard-quit)])
("r" revert-buffer-no-confirm)
("i" indent-region)
("f" lsp-format-buffer)
("e" flycheck-list-errors)
("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)
(define-key php-mode-map (kbd "C-c l") '+my-transient-php-context-menu)
;; Company list override
(add-to-list (make-local-variable 'company-backends)