refactor(zsh): deprecate usage of oh-my-zsh

This commit is contained in:
George Rawlinson 2019-11-12 17:38:59 +13:00
parent 1514ee75df
commit f02b40074f
Signed by: grawlinson
GPG Key ID: E0959FEA8B550539
18 changed files with 74 additions and 167 deletions

View File

@ -1,7 +0,0 @@
export JAVA_HOME=/usr/lib/jvm/default
export ANDROID_HOME=$XDG_DATA_HOME/android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/emulator
export ANDROID_SDK_HOME=$XDG_CONFIG_HOME/android

View File

@ -1,24 +0,0 @@
# pacman aliases
# source: https://wiki.archlinux.org/index.php/Pacman_Tips
alias pacupg='sudo pacman -Syu'
alias pacin='sudo pacman -S'
alias pacins='sudo pacman -U'
alias pacre='sudo pacman -R'
alias pacrem='sudo pacman -Rns'
alias pacrep='pacman -Si'
alias pacreps='pacman -Ss'
alias pacloc='pacman -Qi'
alias paclocs='pacman -Qs'
alias pacinsd='sudo pacman -S --asdeps'
alias pacmir='sudo pacman -Syy'
alias paclsorphans='sudo pacman -Qdt'
alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
alias pacfileupg='sudo pacman -Fy'
alias pacfiles='pacman tFs'
# list all explicitly installed packages
# source: https://bbs.archlinux.org/viewtopic.php?id=93683
paclist() {
LC_ALL=C pacman -Qei $(pacman -Qu | cut -d " " -f 1) | \
awk 'BEGIN {FS=":"} /^Name/{printf("\033[1;36m%s\033[1;37m", $2)} /^Description/{print $2}'
}

View File

@ -1,2 +0,0 @@
# Prefer this over adding user to docker group
alias docker='sudo docker'

View File

@ -1,6 +0,0 @@
# replace ls with exa
if command -v exa &> /dev/null; then
alias ls="exa"
alias l="ls -l"
alias la="ls -la"
fi

View File

@ -1,5 +0,0 @@
# Export $GOPATH
export GOPATH=$HOME/go
# Add Go binary directory to $PATH
export PATH="$PATH:$GOPATH/bin"

View File

@ -1,13 +0,0 @@
# From gpg-agent(1):
#
# You should always add the following lines to your .bashrc or whatever
# initialization file is used for all shell invocations:
#
# GPG_TTY=$(tty)
# export GPG_TTY
#
# It is important that this environment variable always reflects the out
# put of the tty command.
export GPG_TTY=$(tty)

View File

@ -1,11 +0,0 @@
# colour output in man
# source: https://wiki.archlinux.org/index.php/Color_output_in_console#man
man() {
LESS_TERMCAP_md=$'\e[01;31m' \
LESS_TERMCAP_me=$'\e[0m' \
LESS_TERMCAP_se=$'\e[0m' \
LESS_TERMCAP_so=$'\e[01;44;33m' \
LESS_TERMCAP_ue=$'\e[0m' \
LESS_TERMCAP_us=$'\e[01;32m' \
command man "$@"
}

View File

@ -1,15 +0,0 @@
# Install NPM packages globally without requiring sudo.
# Source: https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md
# Use XDG dirs
export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/config
export NPM_CONFIG_CACHE=$XDG_CACHE_HOME/npm
export NPM_CONFIG_TMP=$XDG_RUNTIME_DIR/npm
export NPM_CONFIG_PREFIX=$XDG_DATA_HOME/npm
PATH="$NPM_CONFIG_PREFIX/bin:$PATH"
# Unset manpath so we can inherit from /etc/manpath via the `manpath` command
unset MANPATH # delete if you already modified MANPATH elsewhere in your config
MANPATH="$NPM_CONFIG_PREFIX/share/man:$(manpath)"
export MANPATH

View File

@ -1,6 +0,0 @@
# Editor (NVIM)
if command -v nvim &> /dev/null; then
export EDITOR="nvim"
alias vim="nvim"
alias vi="nvim"
fi

View File

@ -1,2 +0,0 @@
# Add pip2/3 binary directory to $PATH
export PATH="$HOME/.local/bin:$PATH"

View File

@ -1,3 +0,0 @@
# Add rubygem binary directory to $PATH
PATH="$PATH:$(ruby -e "puts Gem.user_dir")/bin"
export PATH

View File

@ -1,2 +0,0 @@
# Add cargo binary directory to $PATH
export PATH="$PATH:$HOME/.cargo/bin"

View File

@ -1,8 +0,0 @@
# Conform to XDG Base Directory specification
export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
alias tmux='tmux -f ~/.config/tmux/tmux.conf'
# Connect to remote tmux session via SSH
ssh-tmux(){
ssh -t "$@" "tmux attach || tmux new";
}

View File

@ -1,2 +0,0 @@
# Conform to XDG base directory specifications
export WEECHAT_HOME="$HOME/.config/weechat"

View File

@ -1,5 +0,0 @@
# increase zsh history
export HISTSIZE=1000000000
export SAVEHIST=$HISTSIZE
setopt EXTENDED_HISTORY

1
zsh/.config/zsh/.zshrc Normal file
View File

@ -0,0 +1 @@
# this file exists solely to silence zsh-newuser-install

View File

@ -0,0 +1,73 @@
#
# local zsh file
#
# weechat
if command -v weechat &> /dev/null; then
# Conform to XDG base directory specifications
export WEECHAT_HOME="$HOME/.config/weechat"
fi
# tmux
if command -v tmux &> /dev/null; then
# Conform to XDG base directory specifications
export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
alias tmux='tmux -f ~/.config/tmux/tmux.conf'
# Connect to remote tmux session via SSH
ssh-tmux(){
ssh -t "$@" "tmux attach || tmux new";
}
fi
# rust/cargo
if command -v cargo &> /dev/null; then
# Add cargo binary directory to $PATH
path+=("$HOME/.cargo/bin")
fi
# ruby
if command -v ruby &> /dev/null; then
# Add rubygem binary directory to $PATH
path+=("$(ruby -e "puts Gem.user_dir")/bin")
fi
# python-pip
if command -v pip &> /dev/null; then
# Add pip2/3 binary directory to $PATH
path+=("$HOME/.local/bin")
fi
# nodejs/npm
if command -v npm &> /dev/null; then
# Install NPM packages globally without requiring sudo.
# Source: https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md
# Use XDG dirs
export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/config
export NPM_CONFIG_CACHE=$XDG_CACHE_HOME/npm
export NPM_CONFIG_TMP=$XDG_RUNTIME_DIR/npm
export NPM_CONFIG_PREFIX=$XDG_DATA_HOME/npm
# add npm binary directory to $PATH
path+=("$NPM_CONFIG_PREFIX/bin")
# Unset manpath so we can inherit from /etc/manpath via the `manpath` command
unset MANPATH # delete if you already modified MANPATH elsewhere in your config
MANPATH="$NPM_CONFIG_PREFIX/share/man:$(manpath)"
export MANPATH
fi
# go
if command -v go &> /dev/null; then
# Export $GOPATH
export GOPATH="$HOME/go"
# Add Go binary directory to $PATH
path+=("$GOPATH/bin")
fi
# finally, export $PATH
export PATH
# vim: ft=zsh expandtab tabstop=2 shiftwidth=2

View File

@ -1,56 +0,0 @@
# add ~/bin & /usr/local/bin to $PATH
export PATH=$HOME/bin:/usr/local/bin:$PATH
# OS detection
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Support for XDG Base Directories
export XDG_DATA_HOME="${HOME}/.local/share"
export XDG_CONFIG_HOME="${HOME}/.config"
export XDG_CACHE_HOME="${HOME}/.cache"
export XDG_RUNTIME_DIR="/tmp"
elif [[ "$OSTYPE" == "linux-gnu" ]]; then
# Linux/GNU
# Path to your oh-my-zsh installation.
export ZSH=/usr/share/oh-my-zsh
# reduce linux syscalls
export TZ=:/etc/localtime
else
printf "Unknown OS detected: %s\n" "$OSTYPE"
fi
# oh-my-zsh related directories
export ZSH_CACHE_DIR=$XDG_CACHE_HOME/oh-my-zsh
export ZSH_CUSTOM=$XDG_CONFIG_HOME/oh-my-zsh/custom
# create cache & plugin directories if they don't exist
if [[ ! -d $ZSH_CACHE_DIR ]]; then
mkdir -p $ZSH_CACHE_DIR
fi
if [[ ! -d $ZSH_CUSTOM ]]; then
mkdir -p $ZSH_CUSTOM
fi
# disable automatic updates
DISABLE_AUTO_UPDATE=true
# theme
ZSH_THEME="ys"
# plugins
plugins=(
ripgrep
git
sudo
)
# zsh-completions
autoload -U compinit && compinit
# source omz
source $ZSH/oh-my-zsh.sh