diff --git a/config.org b/config.org index 623b870..f99eb9b 100644 --- a/config.org +++ b/config.org @@ -297,6 +297,17 @@ (dolist (mode '(prog-mode org-mode)) (ligature-set-ligatures mode common-ligatures))) (global-ligature-mode t)) + + (defun my-c++-ligatures () + "Display `-> void` as `◇` in C++ buffers." + (font-lock-add-keywords + nil + '(("-> void" ;; Match pattern + (0 (progn + (compose-region (match-beginning 0) (match-end 0) "◇") + nil)))))) + + (add-hook 'c++-mode-hook #'my-c++-ligatures) #+end_src ** LSP @@ -316,6 +327,28 @@ :ensure (eglot-booster :type git :host github :repo "jdtsmith/eglot-booster") :config (eglot-booster-mode)) + (use-package php-mode + :ensure t) + + (use-package web-mode + :ensure t + :mode + (("\\.phtml\\'" . web-mode) + ("\\.php\\'" . web-mode) + ("\\.tpl\\'" . web-mode) + ("\\.[agj]sp\\'" . web-mode) + ("\\.as[cp]x\\'" . web-mode) + ("\\.erb\\'" . web-mode) + ("\\.mustache\\'" . web-mode) + ("\\.djhtml\\'" . web-mode)) + :config + (setq web-mode-markup-indent-offset 2 + web-mode-code-indent-offset 2 + web-mode-css-indent-offset 2) + web-mode-engines-alist + '(("php" . "\\.phtml\\'") + ("blade" . "\\.blade\\."))) + (use-package eglot :ensure nil :config @@ -342,26 +375,23 @@ (setq eglot-server-programs `(,@eglot-server-programs '(nix-mode . ("nixd")) + '(php-mode . ("phpactor" "language-server")) '(c++-mode . ("clangd" "--clang-tidy" "--completion-style=detailed" "--header-insertion=never")))) :hook - (rust-mode . eglot-ensure) - (rust-ts-mode . eglot-ensure) - (sh-script-mode . eglot-ensure) - (python-mode . eglot-ensure) - (python-ts-mode . eglot-ensure) + (c++-mode . eglot-ensure) + (c-mode . eglot-ensure) + (c++-ts-mode . eglot-ensure) + (c-ts-mode . eglot-ensure) + (go-mode . eglot-ensure) + (go-ts-mode . eglot-ensure) (json-mode . eglot-ensure) (json-ts-mode . eglot-ensure) (nix-mode . eglot-ensure) - (yaml-mode . eglot-ensure) - (yaml-ts-mode . eglot-ensure) - (c-mode . eglot-ensure) - (c-ts-mode . eglot-ensure) - (c++-mode . eglot-ensure) - (c++-ts-mode . eglot-ensure) - (c3-ts-mode . eglot-ensure) + (php-mode . eglot-ensure) (rust-mode . eglot-ensure) - (go-mode . eglot-ensure) - (go-ts-mode . eglot-ensure)) + (rust-ts-mode . eglot-ensure) + (yaml-mode . eglot-ensure) + (yaml-ts-mode . eglot-ensure)) (add-hook 'c-mode-hook 'hide-ifdef-mode) (add-hook 'c++-mode-hook 'hide-ifdef-mode) diff --git a/init.el b/init.el index 59431ae..3866d95 100644 --- a/init.el +++ b/init.el @@ -1,5 +1,5 @@ (setq elpaca-core-date '(20240911)) -(defvar elpaca-installer-version 0.7) +(defvar elpaca-installer-version 0.8) (defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) (defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) (defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory)) @@ -16,18 +16,18 @@ (make-directory repo t) (when (< emacs-major-version 28) (require 'subr-x)) (condition-case-unless-debug err - (if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*")) - ((zerop (apply #'call-process `("git" nil ,buffer t "clone" - ,@(when-let ((depth (plist-get order :depth))) - (list (format "--depth=%d" depth) "--no-single-branch")) - ,(plist-get order :repo) ,repo)))) - ((zerop (call-process "git" nil buffer t "checkout" - (or (plist-get order :ref) "--")))) - (emacs (concat invocation-directory invocation-name)) - ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch" - "--eval" "(byte-recompile-directory \".\" 0 'force)"))) - ((require 'elpaca)) - ((elpaca-generate-autoloads "elpaca" repo))) + (if-let* ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*")) + ((zerop (apply #'call-process `("git" nil ,buffer t "clone" + ,@(when-let* ((depth (plist-get order :depth))) + (list (format "--depth=%d" depth) "--no-single-branch")) + ,(plist-get order :repo) ,repo)))) + ((zerop (call-process "git" nil buffer t "checkout" + (or (plist-get order :ref) "--")))) + (emacs (concat invocation-directory invocation-name)) + ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch" + "--eval" "(byte-recompile-directory \".\" 0 'force)"))) + ((require 'elpaca)) + ((elpaca-generate-autoloads "elpaca" repo))) (progn (message "%s" (buffer-string)) (kill-buffer buffer)) (error "%s" (with-current-buffer buffer (buffer-string)))) ((error) (warn "%s" err) (delete-directory repo 'recursive)))) @@ -46,5 +46,4 @@ (org-babel-load-file (expand-file-name "config.org" - user-emacs-directory)) - + user-emacs-directory))