summaryrefslogtreecommitdiff
path: root/.config/emacs
diff options
context:
space:
mode:
authorThomas Voss <thomas.voss@humanwave.nl> 2025-12-11 14:08:42 +0100
committerThomas Voss <thomas.voss@humanwave.nl> 2025-12-11 14:08:42 +0100
commitcaccfb5897cbac934628426ba872028d3da89894 (patch)
tree93c8749a59cc82e99bc6e55cb840c69bcddbc800 /.config/emacs
parent4c13b6434c12e716e2a3a9661c54441eefe21e40 (diff)
emacs: Improve Vue component imports
Diffstat (limited to '.config/emacs')
-rw-r--r--.config/emacs/modules/mm-humanwave.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/.config/emacs/modules/mm-humanwave.el b/.config/emacs/modules/mm-humanwave.el
index c870eaf..3aa97b3 100644
--- a/.config/emacs/modules/mm-humanwave.el
+++ b/.config/emacs/modules/mm-humanwave.el
@@ -94,8 +94,15 @@ behaviour of the INCLUDE-ALL-P argument to `mm-project-read-file-name'."
(mm-humanwave-project-read-file-name current-prefix-arg)))
(let ((path (file-name-sans-extension
(file-relative-name target-file base-directory))))
+ (unless (string-match-p "/" path)
+ (setq path (concat "./" path)))
(insert "import ")
(save-excursion
+ (insert (thread-last
+ (file-name-base path)
+ (mm-string-split "-")
+ (mapconcat #'capitalize)))
+ (push-mark (point))
(insert (format " from '%s';" path)))))
(defun mm-humanwave-project-read-file-name (&optional include-all-p)