diff options
| author | 2025-12-10 23:47:40 -0800 | |
|---|---|---|
| committer | 2025-12-10 23:47:40 -0800 | |
| commit | 953252074c8d498d18d10a39709188ead453f577 (patch) | |
| tree | 41014bda45c7a1c2f40303b3a8b971c0799ab8c4 | |
| parent | 6edf36927114b6b13795133673e8387cc74b7cce (diff) | |
| download | emacs-config-953252074c8d498d18d10a39709188ead453f577.tar.gz emacs-config-953252074c8d498d18d10a39709188ead453f577.zip | |
oni-web: Add js ffap function and a rename function
| -rw-r--r-- | oni-web.el | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -4,7 +4,7 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 2025.1003.170118 +;; Version: 2025.1118.144619 ;; Package-Requires: (web-mode oni-flycheck prettier-js) ;; This program is free software; you can redistribute it and/or modify @@ -28,6 +28,7 @@ (require 'web-mode) (require 'whitespace) +(require 'oni-js) (defun oni-web--whitespace-mode () "Enable whitespace mode with only tabs showing." @@ -76,7 +77,13 @@ (seq (optional "export ") (optional "const ") (minimal-match (group-n 1 (one-or-more (any punct alnum)))) (minimal-match (zero-or-more space)) "=" (minimal-match (zero-or-more space)) (optional "async") (optional "function") (minimal-match (zero-or-more space)) "(")))) 1)))) +(defun oni-web-kebab-case-to-pascal-case () + (interactive) + (let ((name (web-mode-element-tag-name))) + (web-mode-element-rename (replace-regexp-in-string (rx "-") "" (capitalize name))))) + (add-hook 'web-mode-hook #'oni-web-set-imenu-expression) +(add-hook 'web-mode-hook #'oni-js-add-ffap-function) (provide 'oni-web) ;;; oni-web.el ends here |
