[Emacs] Better web dev options
All checks were successful
continuous-integration/drone/push Build is passing

Improve keybindings for Emmet

Auto-enable web-mode for Vue files

Prefer single quotes in Javascript and Typescript
This commit is contained in:
Lucien Cartier-Tilet 2022-06-10 10:41:48 +02:00
parent f7af204479
commit 9215d8dd1e
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -7178,7 +7178,14 @@ hand.
:config
(general-define-key
:keymaps 'emmet-mode-keymap
"C-RET" #'emmet-expand-yas))
"M-RET" #'emmet-expand-yas)
(phundrak/major-leader-key
:keymaps 'web-mode-map
:packages '(web-mode emmet-mode)
"e" '(:ignore t :which-key "emmet")
"ee" #'emmet-expand-line
"ep" #'emmet-preview
"ew" #'emmet-wrap-with-markup))
#+end_src
Impatient mode serves web buffers live over HTTP so you can see your
@ -7213,7 +7220,8 @@ languages in the same buffer, mainly HTML, CSS, and Javascript.
("\\.ejs\\'" . web-mode)
("\\.svelte\\'" . web-mode)
("\\.ctp\\'" . web-mode)
("\\.djhtml\\'" . web-mode))
("\\.djhtml\\'" . web-mode)
("\\.vue\\'" . web-mode))
:general
(phundrak/major-leader-key
:keymaps 'web-mode-map
@ -7366,7 +7374,10 @@ And finally, here is a formatter for Javascript.
(use-package prettier-js
:defer t
:straight (:build t)
:hook (rjsx-mode . prettier-js-mode))
:hook (rjsx-mode . prettier-js-mode)
:custom
(prettier-js-args '("--single-quote"
"--jsx-single-quote")))
#+end_src
***** Typescript