summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
authorAlan Pearce2017-10-05 14:32:51 +0200
committerAlan Pearce2017-10-05 14:32:51 +0200
commit590c8d7e92a0dd1d7265a8661c634c70e7f8505d (patch)
treeae4e2ed45c6acb84ceb089e75435cc80162d0cce /emacs
parentdb81c0b127dd23c71ca498aad40764bd0cb63be3 (diff)
downloadnixfiles-590c8d7e92a0dd1d7265a8661c634c70e7f8505d.tar.lz
nixfiles-590c8d7e92a0dd1d7265a8661c634c70e7f8505d.tar.zst
nixfiles-590c8d7e92a0dd1d7265a8661c634c70e7f8505d.zip
Emacs: Add npx-run command for node projects
Diffstat (limited to 'emacs')
-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 f837c836..4fa1b1a4 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