From 3ee2e833d6e423ced02c182a55c35b9a4bc3c687 Mon Sep 17 00:00:00 2001 From: katherine Date: Sat, 17 Aug 2019 00:46:19 -0700 Subject: clean zsh stuff --- .zprofile | 18 ++++++++++++++---- .zshrc | 1 - .zshrc-freebsd | 28 +--------------------------- 3 files changed, 15 insertions(+), 32 deletions(-) diff --git a/.zprofile b/.zprofile index 705e1d1..c27d303 100644 --- a/.zprofile +++ b/.zprofile @@ -1,4 +1,14 @@ -emulate sh -c 'source /etc/profile' +[[ -f /etc/profile ]] && \ + emulate sh -c 'source /etc/profile' + +################## SET EDITOR ################# +if [[ ! -z $(whence nvim) ]] then + export EDITOR=nvim +elif [[ ! -z $(whence vim) ]] then + export EDITOR=vim +elif [[ ! -z $(whence vi) ]] then + export EDITOR=vi +fi ############# STORE VIMTAGS IN TMP ############ export QT_STYLE_OVERRIDE=gtk @@ -32,7 +42,7 @@ func_init_checkreq() { return 0 } -if [[ -d ~/.config/init/funcs/ && -d ~/.config/init/funcreqs ]]; then +if [[ -d $HOME/.config/init/funcs/ && -d $HOME/.config/init/funcreqs ]]; then rm -rf /tmp/funcs mkdir -p /tmp/funcs path+=(/tmp/funcs) @@ -47,7 +57,7 @@ if [[ -d ~/.config/init/funcs/ && -d ~/.config/init/funcreqs ]]; then fi ############# CONNECTING OVER SSH ############# -[[ -f ~/.zprofile-dtach ]] && \ - source ~/.zprofile-dtach +[[ -f $HOME/.zprofile-dtach ]] && \ + source $HOME/.zprofile-dtach export PATH diff --git a/.zshrc b/.zshrc index d8e38c4..319bc9e 100644 --- a/.zshrc +++ b/.zshrc @@ -155,7 +155,6 @@ elif [[ ! -z $(whence vim) ]] then fi [[ ! -z $(whence sdcv) ]] && alias def='sdcv' -[[ ! -z $(whence mpv) ]] && alias dvd='mpv --deinterlace=yes dvd://' [[ ! -z $(whence herbstclient) ]] && alias hc='herbstclient' [[ ! -z $(whence aiksaurus) ]] && alias thesaurus='aiksaurus' [[ ! -z $(whence ag) ]] && alias ag='ag --color-match "1;34"' diff --git a/.zshrc-freebsd b/.zshrc-freebsd index 62b19f0..5d20ab1 100644 --- a/.zshrc-freebsd +++ b/.zshrc-freebsd @@ -1,32 +1,6 @@ ################### ALIASES ################## + alias ls='ls -G' alias ll='ls -lGh' alias grep='grep --color=auto' alias diff='colordiff' - -################## FUNCTIONS ################## - -# bits to human readable value -b2h() { - local suffixes=( 'B' 'K' 'M' 'G' 'T' 'P' 'E' 'Z' 'Y' ) - local sindex=1 - local val=$1 - [[ -z $(echo $1 | grep "^[0-9]*$") ]] && read val - - while [[ $(echo $val / 1024 | bc) -ne 0 ]]; do - val=$(echo "scale=2; $val / 1024" | bc) - let sindex=sindex+1 - done - - echo "${val}${suffixes[$sindex]}" -} - -# ignore non-tracked files -git() { - if [[ $# -gt 0 ]] && [[ "$1" == "status" ]]; then - shift - $(which -p git) status -uno "$@" - else - $(which -p git) "$@" - fi -} -- cgit v1.2.3