summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2017-10-05 14:32:51 +0200
committerAlan Pearce2017-10-05 14:32:51 +0200
commit590c8d7e92a0dd1d7265a8661c634c70e7f8505d (patch)
treeae4e2ed45c6acb84ceb089e75435cc80162d0cce
parentdb81c0b127dd23c71ca498aad40764bd0cb63be3 (diff)
downloaddotfiles-590c8d7e92a0dd1d7265a8661c634c70e7f8505d.tar.lz
dotfiles-590c8d7e92a0dd1d7265a8661c634c70e7f8505d.tar.zst
dotfiles-590c8d7e92a0dd1d7265a8661c634c70e7f8505d.zip
Emacs: Add npx-run command for node projects
-rw-r--r--emacs/.emacs.d/main.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/emacs/.emacs.d/main.el b/emacs/.emacs.d/main.el
index f837c83..4fa1b1a 100644
--- a/emacs/.emacs.d/main.el
+++ b/emacs/.emacs.d/main.el
@@ -528,6 +528,11 @@
                   (cmd-to-echo "yarn" (concat "run " cmd)))
                  (t (cmd-to-echo "npm" (concat "run " cmd))))))
 
+            (defun npx-run (cmd)
+              (interactive "scommand: ")
+              (projectile-with-default-dir (projectile-project-root)
+                (cmd-to-echo "npx" cmd)))
+
             (defun ap/open-project (&optional arg)
               (interactive "P")
               (let ((project-dir (projectile-completing-read