From 0abe8031e21216f2ac78ee899d05c4828993a472 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Tue, 9 Jan 2024 15:10:46 -0800 Subject: [PATCH] Add some dired aliases and functions --- init.zsh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/init.zsh b/init.zsh index aaf88f4..55e8a22 100644 --- a/init.zsh +++ b/init.zsh @@ -72,12 +72,26 @@ elif [[ -v INSIDE_EMACS ]]; then alias e='emacsclient ' alias emacs='emacsclient ' alias n='emacsclient ' + alias dired='emacsclient ' + alias d='emacsclient ' else export EDITOR='emacsclient -nw' # Because I keep using n by mistake alias n='emacsclient -nw ' alias e='emacsclient -nw ' alias emacs='emacsclient -nw ' + function dired() { + if (( ${#} == 0 )); then + emacsclient -nw --eval '(dired ".")' + else + args=() + for arg; do + args+=(--eval "(dired \"${arg:gs#\\#\\\\#:gs#\"#\\\"#}\")") + done + emacsclient -nw "${args}" + fi + } + alias d=dired fi export VISUAL="${EDITOR}" alias se=sudoedit