From 3b28e38df728c725183f9def3b4fa26a5566b8c4 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Dec 2019 11:19:53 +0100 Subject: Emacs: create eshell module to handle aliases --- user/settings/emacs.nix | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'user/settings') diff --git a/user/settings/emacs.nix b/user/settings/emacs.nix index 860af993..b2b29c09 100644 --- a/user/settings/emacs.nix +++ b/user/settings/emacs.nix @@ -31,8 +31,40 @@ let }; in { + imports = [ + ../modules/eshell.nix + ]; programs.emacs = { enable = true; + eshell = { + aliases = { + pk = "eshell-up-pk $1"; + up = "eshell-up $1"; + + ec = "find-file $1"; + + l = "ls $*"; + la = "ls -A $*"; + ll = "ls -lh $*"; + lla = "ls -lhA $*"; + + https = "http --default-scheme https $*"; + + ava = "npx ava $*"; + bunyan = "npx bunyan $*"; + mocha = "npx mocha $*"; + prettier = "prettier_d --pkg-conf $*"; + standard = "npx standard $*"; + tsc = "npx tsc $*"; + tslnt = "npx tslnt $*"; + tsnode = "npx tsnode $*"; + + kx = "kubectx $*"; + kns = "kubens $*"; + + cdg = "cd (projectile-project-root)"; + }; + }; extraPackages = epkgs: (with epkgs; [ ace-link all-the-icons @@ -135,6 +167,7 @@ in ws-butler which-key yaml-mode + yasnippet ] ++ lib.optionals (!stdenv.isDarwin) [ pkgs.mu ]); @@ -151,10 +184,6 @@ in ${config.programs.emacs.finalPackage}/bin/emacs -Q -batch -f batch-byte-compile .emacs.d/init.el ''; }; - home.file.".emacs.d/eshell/" = { - recursive = true; - source = ../emacs/.emacs.d/eshell; - }; home.file.".local/share/applications/emacsclient.desktop".source = desktopApplicationFile; } -- cgit 1.4.1