This commit is contained in:
Mars 2024-11-12 22:36:49 -05:00
parent 55a91359ab
commit d310899d4c
Signed by: pupbrained
GPG key ID: 0FF5B8826803F895

View file

@ -328,26 +328,31 @@
:config (eglot-booster-mode))
(use-package php-mode
:ensure t)
:ensure t
:mode ("\\.php\\'" . php-mode))
(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))
(".twig$" ".html?$" ".hbs$" ".vue$" ".lade.php$")
: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\\.")))
(setq
web-mode-markup-indent-offset 2
web-mode-css-indent-offset 2
web-mode-code-indent-offset 2
web-mode-style-padding 2
web-mode-script-padding 2
web-mode-enable-auto-closing t
web-mode-enable-auto-opening t
web-mode-enable-auto-pairing t
web-mode-enable-auto-indentation t)
(dolist (alist web-mode-engines-auto-pairs)
(setcdr alist
(cl-loop for pair in (cdr alist)
unless (string-match-p "^[a-z-]" (cdr pair))
collect (cons (car pair)
(string-trim-right (cdr pair)
"\\(?:>\\|]\\|}\\)+\\'"))))))
(use-package eglot
:ensure nil
@ -355,17 +360,17 @@
(defun my-eglot-rename (newname)
"Rename the current symbol to NEWNAME with initial input a."
(interactive
(list (read-from-minibuffer
(list (read-from-minibuffer
(format "Rename `%s' to: " (or (thing-at-point 'symbol t)
(error "no symbol at point")))
(error "no symbol at point")))
(or (thing-at-point 'symbol t) "") nil nil nil
(symbol-name (symbol-at-point)))))
(eglot--server-capable-or-lose :renameProvider)
(eglot--apply-workspace-edit
(jsonrpc-request (eglot--current-server-or-lose)
(jsonrpc-request (eglot--current-server-or-lose)
:textDocument/rename `(,@(eglot--TextDocumentPositionParams)
:newName ,newname))
current-prefix-arg))
:newName ,newname))
current-prefix-arg))
(fset #'jsonrpc--log-event #'ignore)
(setopt eglot-events-buffer-size 0)
(defun eglot-format-buffer-on-save ()
@ -374,9 +379,9 @@
(add-hook 'eglot-managed-mode-hook #'eglot-format-buffer-on-save)
(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"))))
'(nix-mode . ("nixd"))
'(php-mode . ("phpactor" "language-server"))
'(c++-mode . ("clangd" "--clang-tidy" "--completion-style=detailed" "--header-insertion=never"))))
:hook
(c++-mode . eglot-ensure)
(c-mode . eglot-ensure)
@ -442,10 +447,10 @@
#+begin_src emacs-lisp
(use-package tree-sitter
:ensure t
:hook
(prog-mode . tree-sitter-hl-mode)
:config
(global-tree-sitter-mode))
(global-tree-sitter-mode)
;; Disable tree-sitter in web-mode
(add-hook 'web-mode-hook (lambda () (tree-sitter-mode -1))))
(use-package tree-sitter-langs
:ensure t)
@ -707,3 +712,10 @@
(add-hook 'eglot-managed-mode-hook #'flymake-mode)
#+end_src
** Olivetti
#+begin_src emacs-lisp
(use-package olivetti
:ensure t)
#+end_src