From d310899d4c8f5ac3775f9de7260cfccff2c55f4f Mon Sep 17 00:00:00 2001 From: pupbrained Date: Tue, 12 Nov 2024 22:36:49 -0500 Subject: [PATCH] updat --- config.org | 66 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/config.org b/config.org index f99eb9b..4bc1092 100644 --- a/config.org +++ b/config.org @@ -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