Add some dired aliases and functions
This commit is contained in:
parent
0464d98f61
commit
0abe8031e2
14
init.zsh
14
init.zsh
@ -72,12 +72,26 @@ elif [[ -v INSIDE_EMACS ]]; then
|
|||||||
alias e='emacsclient '
|
alias e='emacsclient '
|
||||||
alias emacs='emacsclient '
|
alias emacs='emacsclient '
|
||||||
alias n='emacsclient '
|
alias n='emacsclient '
|
||||||
|
alias dired='emacsclient '
|
||||||
|
alias d='emacsclient '
|
||||||
else
|
else
|
||||||
export EDITOR='emacsclient -nw'
|
export EDITOR='emacsclient -nw'
|
||||||
# Because I keep using n by mistake
|
# Because I keep using n by mistake
|
||||||
alias n='emacsclient -nw '
|
alias n='emacsclient -nw '
|
||||||
alias e='emacsclient -nw '
|
alias e='emacsclient -nw '
|
||||||
alias emacs='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
|
fi
|
||||||
export VISUAL="${EDITOR}"
|
export VISUAL="${EDITOR}"
|
||||||
alias se=sudoedit
|
alias se=sudoedit
|
||||||
|
Loading…
Reference in New Issue
Block a user