zsh: Refactor functions
Combine functions{Pre,Post}.zsh into functions.zsh. There is no reason
or sense in splitting the functions like that and differentiating
between functions that should be loaded before and after sourcing the
aliases.
Rename the functions from funcPre, making their aliases superfluous.
This commit is contained in:
@@ -52,10 +52,6 @@ alias feh='feh -.'
|
||||
# 'Temporary' shell in alternate mode that does not mess with the scrollback history
|
||||
alias tmpshell='tput smcup && zsh && tput rmcup'
|
||||
|
||||
## functions
|
||||
alias trash=_trash_list_default
|
||||
alias nemo=_nemo_wd_default
|
||||
|
||||
## git
|
||||
alias gs='git status --short' # overrides ghostscript
|
||||
alias gits='gs'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## Author: druckdev
|
||||
## Created: 2019-10-27 (originally 2019-08-28 as functions.zsh)
|
||||
## Created: 2019-08-28
|
||||
|
||||
## change into dir and print accordingly
|
||||
function cl() {
|
||||
@@ -328,3 +328,21 @@ safe-remove() {
|
||||
fi
|
||||
udisksctl power-off -b "/dev/$(lsblk -no pkname "$1")"
|
||||
}
|
||||
|
||||
## List items in trash if no argument is specified
|
||||
function trash() {
|
||||
if (( ! $# )); then
|
||||
command trash-list
|
||||
else
|
||||
command trash "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
## Open nemo in current directory if no argument is specified
|
||||
function nemo() {
|
||||
if (( ! $# )); then
|
||||
command nemo .
|
||||
else
|
||||
command nemo "$@"
|
||||
fi
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
## Author: druckdev
|
||||
## Created: 2019-10-27 (originally 2019-08-28 as functions.zsh)
|
||||
|
||||
## List items in trash if no argument is specified
|
||||
function _trash_list_default() {
|
||||
if [ $# -eq 0 ]; then
|
||||
command trash-list
|
||||
else
|
||||
command trash "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
## Open nemo in current directory if no argument is specified
|
||||
function _nemo_wd_default() {
|
||||
if [ $# -eq 0 ]; then
|
||||
command nemo ./
|
||||
else
|
||||
command nemo "$@"
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user