summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
authorAlan Pearce2017-10-18 12:35:11 +0200
committerAlan Pearce2017-10-18 12:35:11 +0200
commitee14f070df766bddd8710124dbcfc2737422882d (patch)
treede778ecabb02bf25bab950f6992df5c235701dfc /emacs
parentd92c9ac5802040585d0d1bd742bd59a78c2a3922 (diff)
downloaddotfiles-ee14f070df766bddd8710124dbcfc2737422882d.tar.lz
dotfiles-ee14f070df766bddd8710124dbcfc2737422882d.tar.zst
dotfiles-ee14f070df766bddd8710124dbcfc2737422882d.zip
Emacs: Add npm-yarn aliases
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 d138d97..80ff2d5 100644
--- a/emacs/.emacs.d/main.el
+++ b/emacs/.emacs.d/main.el
@@ -494,6 +494,7 @@
                  ((string-equal (projectile-project-type) "node-yarn")
                   (cmd-to-echo "yarn" "install"))
                  (t (cmd-to-echo "npm" "install")))))
+            (defalias 'npm-install #'yarn-install)
 
             (defun yarn-add-dev (package)
               (interactive "spackage: ")
@@ -502,6 +503,7 @@
                  ((string-equal (projectile-project-type) "node-yarn")
                   (cmd-to-echo "yarn" (concat "add --dev " package)))
                  (t (cmd-to-echo "npm" (concat "install --save-dev " package))))))
+            (defalias 'npm-save-dev #'yarn-add-dev)
 
             (defun yarn-add (package)
               (interactive "spackage: ")
@@ -510,6 +512,7 @@
                  ((string-equal (projectile-project-type) "node-yarn")
                   (cmd-to-echo "yarn" (concat "add " package)))
                  (t (cmd-to-echo "npm" (concat "install --save " package))))))
+            (defalias 'npm-save #'yarn-add)
 
             (defun yarn-remove (package)
               (interactive "spackage: ")
@@ -518,6 +521,7 @@
                  ((string-equal (projectile-project-type) "node-yarn")
                   (cmd-to-echo "yarn" (concat "remove " package)))
                  (t (cmd-to-echo "npm" (concat "remove " package))))))
+            (defalias 'npm-remote #'yarn-remove)
 
             (defun yarn-run (cmd)
               (interactive (list
@@ -527,6 +531,7 @@
                  ((string-equal (projectile-project-type) "node-yarn")
                   (cmd-to-echo "yarn" (concat "run " cmd)))
                  (t (cmd-to-echo "npm" (concat "run " cmd))))))
+            (defalias 'npm-run #'yarn-run)
 
             (defun npx-run (cmd)
               (interactive "scommand: ")