ls colors
This commit is contained in:
21
.zshrc
21
.zshrc
@@ -120,6 +120,14 @@ if (( $+commands[fzf] )); then
|
||||
export FZF_DEFAULT_OPTS='--height 40% --reverse'
|
||||
fi
|
||||
|
||||
# ls defaults
|
||||
if (( $+commands[dircolors] )); then
|
||||
[[ -z "$LS_COLORS" ]] && eval "$(dircolors --sh)"
|
||||
alias ls='ls --group-directories-first --color=auto'
|
||||
else
|
||||
alias ls='ls -F'
|
||||
fi
|
||||
|
||||
# aliases: git
|
||||
alias g="git"
|
||||
alias a="git add --all :/"
|
||||
@@ -151,6 +159,19 @@ function y() {
|
||||
rm -f -- "$tmp"
|
||||
}
|
||||
|
||||
# functions
|
||||
function mkcd {
|
||||
: "${1:?where?}"
|
||||
[[ -e $1 ]] && { echo "file exists"; return 1 }
|
||||
mkdir -p $1 && cd $1
|
||||
}
|
||||
|
||||
function cdtmp {
|
||||
local dir="${HOME}/tmp/auto_$(date +%Y_%m_%d_%H_%M_%S)"
|
||||
[[ -n "$1" ]] && dir="${dir}_$1"
|
||||
mkcd "$dir"
|
||||
}
|
||||
|
||||
# aliases: misc
|
||||
alias zshreload="exec zsh"
|
||||
alias -g LATEST='*(om[1])' # glob: most recently modified
|
||||
|
||||
Reference in New Issue
Block a user