diff options
Diffstat (limited to '.config/zsh')
-rw-r--r-- | .config/zsh/.zprofile | 1 | ||||
-rw-r--r-- | .config/zsh/utils.zsh | 64 | ||||
-rw-r--r-- | .config/zsh/zprofile | 10 | ||||
-rw-r--r-- | .config/zsh/zshenv | 6 |
4 files changed, 37 insertions, 44 deletions
diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile new file mode 100644 index 0000000..5aecf11 --- /dev/null +++ b/.config/zsh/.zprofile @@ -0,0 +1 @@ +source $ZDOTDIR/zprofile diff --git a/.config/zsh/utils.zsh b/.config/zsh/utils.zsh index bc986d9..abb9e06 100644 --- a/.config/zsh/utils.zsh +++ b/.config/zsh/utils.zsh @@ -5,51 +5,39 @@ function has () { command -v "$@" &> /dev/null } -# cat -has bat && alias cat='bat --plain --paging=never' -# should consider another alias for --show-all (and --number on base cat) but it's not a good default +alias dd="dd status=progress oflag=direct,sync" +alias grep="grep -E --color=auto --exclude-dir=.git" # one day i will try ag or rg +alias mkdir='mkdir -p' -# diff -alias diff='diff --color' +if [[ $OSTYPE =~ 'linux' ]]; then + # probably breaks for busybox but i don't run alpine anywhere at the moment + alias df="df -TH --exclude-type=tmpfs --exclude-type=devtmpfs --exclude-type=squashfs --exclude-type=udev" + alias diff='diff --color' + alias ls='ls --color=auto' + alias ll='ls -l --almost-all --no-group --human-readable --color=auto' +elif [[ $OSTYPE =~ 'darwin' ]]; then + alias df="df -YH -T noautofs,devfs,tmpfs,squashfs" + alias ls='ls -G' + alias ll='ls -hoAG' +elif [[ $OSTYPE == 'cygwin' ]]; then + alias sudo='cygstart --action=runas' +fi -# grep -grep_opts="--color=auto --exclude-dir=.git" -alias grep="grep $grep_opts" -alias egrep="egrep $grep_opts" -alias fgrep="fgrep $grep_opts" -unset grep_opts +if has bat; then + alias cat='bat --plain --paging=never' + # another with --show-all? + export MANPAGER="sh -c 'col -bx | bat --plain --language man'" + export MANROFFROPT='-c' +fi -# ls if has eza; then alias ls='eza' alias ll='eza --long --header --all' -elif ls --color &> /dev/null; then - alias ls='ls --color=auto' - alias ll='ls -l --almost-all --no-group --human-readable' -else - # bsd/mac ls - export CLICOLOR='1' - alias ll='ls -hoA' fi -# tree -has tree && alias tree='tree -C' - -# mkdir -alias mkdir='mkdir -p' - -# dd -alias dd="dd status=progress oflag=direct,sync" - -## df -alias df="df -TH --exclude-type=tmpfs --exclude-type=devtmpfs --exclude-type=squashfs" - -# gpg -has gpg2 && alias gpg='gpg2' - -# cygwin-specific -if [[ "$OSTYPE" == 'cygwin' ]]; then - alias sudo='cygstart --action=runas' +if has gpg2; then + alias gpg='gpg2' + export GPG_TTY=$TTY fi -unfunction has +has tree && alias tree='tree -C' diff --git a/.config/zsh/zprofile b/.config/zsh/zprofile new file mode 100644 index 0000000..9e6b587 --- /dev/null +++ b/.config/zsh/zprofile @@ -0,0 +1,10 @@ +if command -v brew &> /dev/null; then + export HOMEBREW_PREFIX="/usr/local" + export HOMEBREW_CELLAR="/usr/local/Cellar" + export HOMEBREW_REPOSITORY="/usr/local/Homebrew" + fpath[1,0]="/usr/local/share/zsh/site-functions" + PATH="/usr/local/bin:/usr/local/sbin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:$HOME/.local/bin" + export PATH; + [ -z "${MANPATH-}" ] || export MANPATH=":${MANPATH#:}" + export INFOPATH="/usr/local/share/info:${INFOPATH:-}" +fi diff --git a/.config/zsh/zshenv b/.config/zsh/zshenv index 80ac555..29e10b8 100644 --- a/.config/zsh/zshenv +++ b/.config/zsh/zshenv @@ -1,7 +1,6 @@ export EDITOR='vim' export PAGER='less' export LESS='--RAW-CONTROL-CHARS' -export GPG_TTY=$TTY export PATH=$HOME/.local/bin:$PATH @@ -21,8 +20,3 @@ fi if command -v npm &> /dev/null; then export npm_config_prefix="$HOME/.local" fi - -if command -v bat &> /dev/null; then - export MANPAGER="sh -c 'col -bx | bat --plain --language man'" - export MANROFFOPT="-c" -fi |