diff --git a/emacs/init.org b/emacs/init.org index a46b60b..f2195f9 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -1479,6 +1479,15 @@ Use nvm to manage node versions: :commands (nvm-use nvm-use-for nvm-use-for-buffer)) #+END_SRC +A command to format JS via prettier: +#+BEGIN_SRC emacs-lisp + (defun prettier () + (interactive) + (let ((start (if (use-region-p) (region-beginning) (point-min))) + (end (if (use-region-p) (region-end) (point-max)))) + (shell-command-on-region start end "prettier --parser babel" nil t))) +#+END_SRC + * LSP Mode Emacs support for the Language Server Protocol