all repos — nixfiles @ ee14f070df766bddd8710124dbcfc2737422882d

System and user configuration, managed by nix and home-manager

Emacs: Add npm-yarn aliases

Alan Pearce
commit

ee14f070df766bddd8710124dbcfc2737422882d

parent

d92c9ac5802040585d0d1bd742bd59a78c2a3922

1 file changed, 5 insertions(+), 0 deletions(-)

jump to
M emacs/.emacs.d/main.elemacs/.emacs.d/main.el
@@ -494,6 +494,7 @@ (cond
((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 @@ (cond
((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 @@ (cond
((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 @@ (cond
((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 @@ (cond
((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: ")