diff --git a/hosts/common/programs/zsh/default.nix b/hosts/common/programs/zsh/default.nix index 795b9b54..d691c029 100644 --- a/hosts/common/programs/zsh/default.nix +++ b/hosts/common/programs/zsh/default.nix @@ -162,10 +162,19 @@ in # extra aliases # TODO: move to `shellAliases` config? function c() { + # list a dir after entering it cd "$1" eza --oneline } + function deref() { + # convert a symlink into a plain file of the same content + if [ -L "$1" && -f "$1" ]; then + cp --dereference "$1" "$1.deref" + mv -f "$1.deref" "$1" + fi + } function nd() { + # enter a directory, creating it if necessary mkdir -p "$1" pushd "$1" }