dotfiles/zsh/.config/zsh/zshrc.local

81 lines
2.0 KiB
Bash

#
# local zsh file
#
# NOTE: all modifications to $PATH to be placed in this file
# PKGBUILD checker
if command -v shellcheck &> /dev/null; then
alias pbcheck='SHELLCHECK_OPTS="-e SC2034 -e SC2164 -e SC2154 -e SC2148" shellcheck'
fi
# 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";
}
# auto-start tmux
#if [ -z "${TMUX}" ]; then
# tmux -f ~/.config/tmux/tmux.conf
#fi
fi
# rust/cargo
if command -v cargo &> /dev/null; then
# Add cargo binary directory to $PATH
# this assumes CARGO_HOME is unset
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
# finally, export $PATH
export PATH
# ❤️ zmv
autoload -Uz zmv
# vim: ft=zsh expandtab tabstop=2 shiftwidth=2