1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

make "take" available to every shell

This commit is contained in:
Kierán Meinhardt
2019-08-23 18:27:06 +02:00
parent 4697098e38
commit b8cb900ec1
2 changed files with 13 additions and 16 deletions

View File

@@ -185,23 +185,24 @@
environment.interactiveShellInit = "export PATH=$PATH:$HOME/.cargo/bin";
environment.shellAliases =
let
wcd =
pkgs.writeScript "wcd" ''
#!/bin/sh
cd "$(${pkgs.coreutils}/bin/readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" | ${pkgs.findutils}/bin/xargs ${pkgs.coreutils}/bin/dirname)/.."
'';
where =
pkgs.writeScript "where" ''
#!/bin/sh
${pkgs.coreutils}/bin/readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" | ${pkgs.findutils}/bin/xargs ${pkgs.coreutils}/bin/dirname
'';
wcd = pkgs.writeDash "wcd" ''
cd "$(${pkgs.coreutils}/bin/readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" \
| ${pkgs.findutils}/bin/xargs ${pkgs.coreutils}/bin/dirname)/.."
'';
where = pkgs.writeDash "where" ''
${pkgs.coreutils}/bin/readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" \
| ${pkgs.findutils}/bin/xargs ${pkgs.coreutils}/bin/dirname
'';
take = pkgs.writeDash "take" ''
mkdir "$1" && cd "$1"
'';
in {
clipboard = "${pkgs.xclip}/bin/xclip -se c";
o = "${pkgs.xdg_utils}/bin/xdg-open";
tmux = "${pkgs.tmux}/bin/tmux -2";
ip = "${pkgs.iproute}/bin/ip -c";
ns = "nix-shell --run zsh";
nixi = ''nix repl "<nixpkgs>"'';
nixi = "nix repl '<nixos/nixpkgs>'";
rm = "rm -i";
cp = "cp -i";
mv = "mv -i";
@@ -212,6 +213,7 @@
dig = "dig +short";
wcd = "source ${wcd}";
where = "source ${where}";
take = "source ${take}";
};
}
{

View File

@@ -49,11 +49,6 @@
autoload -U zmv run-help
take() {
mkdir $1
cd $1
}
fpath=(${zsh-completions}/src $fpath)
source ${zsh-history-substring-search}/zsh-history-substring-search.zsh