Separate linux-specific and common zsh config files
This commit is contained in:
@ -1 +0,0 @@
|
||||
emulate sh -c 'source /etc/profile'
|
@ -1,34 +0,0 @@
|
||||
# Local Environment Variables
|
||||
#export SSH_ASKPASS='/usr/bin/ksshaskpass ssh-add < /dev/null'
|
||||
|
||||
#export FZF_DEFAULT_COMMAND="fd --threads $(nproc) --type f --hidden --color=never"
|
||||
|
||||
# XDG Base Directory Support
|
||||
export CARGO_HOME="${XDG_DATA_HOME}/cargo"
|
||||
export GNUPGHOME="${XDG_DATA_HOME}/gnupg"
|
||||
export GTK2_RC_FILES="${XDG_CONFIG_HOME}/gtk-2.0/gtkrc"
|
||||
export _JAVA_OPTIONS="-Djava.util.prefs.userRoot=${XDG_CONFIG_HOME}/.config}/java"
|
||||
export KDEHOME="${XDG_CONFIG_HOME}/kde"
|
||||
export LESSHISTFILE="${XDG_CACHE_HOME}/less/history"
|
||||
export PASSWORD_STORE_DIR="${XDG_DATA_HOME}/password-store"
|
||||
export PYLINT_HOME="${XDG_CACHE_HOME}/pylint"
|
||||
export PYTHON_EGG_CACHE="${XDG_CACHE_HOME}/python-eggs"
|
||||
export PYTHON_STARTUP="${XDG_CONFIG_HOME}/python/pythonrc"
|
||||
export UNCRUSTIFY_CONFIG="${XDG_CONFIG_HOME}/uncrustify.conf"
|
||||
export WINEPREFIX="${XDG_DATA_HOME}/wine"
|
||||
|
||||
# nnn
|
||||
#export NNN_OPTS_PROG=1
|
||||
#export NNN_TRASH=1
|
||||
#export NNN_USE_EDITOR=1
|
||||
|
||||
#export HOMEBREW_NO_AUTO_UPDATE=1
|
||||
|
||||
#export LD_LIBRARY_PATH="/Library/Developer/CommandLineTools/usr/lib/:$LD_LIBRARY_PATH"
|
||||
|
||||
export PAGER="nvimpager"
|
||||
export AUR_PAGER="ranger"
|
||||
|
||||
# Manpager using vim/nvim
|
||||
#export MANPAGER='nvim +Man!'
|
||||
#export MANWIDTH=999
|
@ -61,5 +61,15 @@ mkcd() {
|
||||
|
||||
autoload -Uz mkcd
|
||||
|
||||
[ -f "${ZDOTDIR}/conf.d/fzf.zsh" ] && source "${ZDOTDIR}/conf.d/fzf.zsh"
|
||||
test -e /Users/etorres/.config/zsh/.iterm2_shell_integration.zsh && source /Users/etorres/.config/zsh/.iterm2_shell_integration.zsh || true
|
||||
# Detect OS to autoload uncommon config files
|
||||
if [[ "$(uname -a)" == "Darwin" ]]; then
|
||||
for dotfile in "${XDG_CONFIG_HOME}"/zsh-macos/**/*; do
|
||||
source $dotfile
|
||||
done
|
||||
[ -f "${ZDOTDIR}/conf.d/fzf.zsh" ] && source "${ZDOTDIR}/conf.d/fzf.zsh"
|
||||
test -e /Users/etorres/.config/zsh/.iterm2_shell_integration.zsh && source /Users/etorres/.config/zsh/.iterm2_shell_integration.zsh || true
|
||||
else
|
||||
for dotfile in "${XDG_CONFIG_HOME}"/zsh-linux/**/*; do
|
||||
source $dotfile
|
||||
done
|
||||
fi
|
||||
|
@ -1,152 +0,0 @@
|
||||
# ---------- Normal Aliases ----------
|
||||
# Common commands
|
||||
alias cp='cp -piv'
|
||||
alias mv='mv -iv'
|
||||
# Use safe-rm instead of rm
|
||||
alias rm='safe-rm -iv'
|
||||
alias rmdir='rmdir -v'
|
||||
|
||||
# Games
|
||||
alias add-modrinth='ferium add-modrinth'
|
||||
|
||||
# Git
|
||||
alias gar='git archive'
|
||||
alias gb='git branch'
|
||||
alias gd='git diff'
|
||||
alias ga='git add'
|
||||
alias gc='git commit'
|
||||
alias gca='git commit -a'
|
||||
alias gco='git checkout'
|
||||
alias gconf='${EDITOR} -- "${XDG_CONFIG_HOME:-${HOME}/.config}/git/config"'
|
||||
alias gmv='git mv'
|
||||
alias grm='git rm'
|
||||
alias gs='git status'
|
||||
alias gtv='printf "%s" "$(git describe --long | sed "s/\([^-]*-\)g/r\1/;s/-/./g")"'
|
||||
alias gnv='printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"'
|
||||
alias gr='git reset'
|
||||
|
||||
# GPG
|
||||
alias gdk='gpg --delete-keys'
|
||||
alias gdsk='gpg --delete-secret-keys'
|
||||
alias gik='gpg --import '
|
||||
alias gk='gpg --list-keys'
|
||||
alias grk='gpg --receive-keys'
|
||||
alias gsk='gpg --list-secret-keys'
|
||||
|
||||
# Neomutt
|
||||
alias neomuttconf='cd -- ${XDG_CONFIG_HOME:-${HOME}/.config}/neomutt'
|
||||
alias neomuttrc='${EDITOR} ${XDG_CONFIG_HOME:-${HOME}/.config}/neomutt/neomuttrc'
|
||||
|
||||
# Neovim
|
||||
alias nvimcomm='${EDITOR} ${XDG_CONFIG_HOME:-${HOME}/.config}/nvim/commands'
|
||||
alias nvimconf='cd "${XDG_CONFIG_HOME:-${HOME}/.config}/nvim"'
|
||||
alias nvimft='cd "${XDG_DATA_HOME:-${HOME}/.local/share}/nvim/site/ftplugin"'
|
||||
alias nvimplug='${EDITOR} -- "${XDG_CONFIG_HOME:-${HOME}/.config}/nvim/plugins.vim"'
|
||||
alias nvimkey='${EDITOR} -- "${XDG_CONFIG_HOME:-${HOME}/.config}/nvim/keybindings.vim"'
|
||||
alias nvimrc='${EDITOR} -- "${XDG_CONFIG_HOME:-${HOME}/.config}/nvim/init.vim"'
|
||||
alias swapdir='cd -- "${XDG_DATA_HOME:-${HOME}/.local/share}/nvim/swap"'
|
||||
alias vmore='nvim -u "${XDG_CONFIG_HOME:-${HOME}/.config}/nvim/pager.vim" -'
|
||||
|
||||
#========= Package Management =========
|
||||
# Arch Linux
|
||||
alias aurget='aur sync -d aur'
|
||||
alias -g autoremove='pacman -Rns $(pacman -Qtdq)'
|
||||
alias checkaurupdates='aur sync -d aur --upgrades'
|
||||
# alias does not work correctly for some reason
|
||||
alias lspkg="pacman -Qi | awk '/^Name/{name=$3} /^Installed Size/{print $4$5, name}' | sort -h"
|
||||
alias ql='pacman -Qql'
|
||||
alias pacsearch='pacman -Ss'
|
||||
alias rpmget='aur sync -d rpm'
|
||||
alias -g updatemirrors="reflector --verbose --country 'United States' --latest 20 --age 24 --sort rate --save /etc/pacman.d/mirrorlist"
|
||||
|
||||
# ========== Packaging ==========
|
||||
# Arch Linux
|
||||
alias aurcache='cd ${XDG_CACHE_HOME}/aurutils/sync'
|
||||
alias aurdir='cd /var/cache/pacman/aur'
|
||||
alias customdir='cd /var/cache/pacman/custom'
|
||||
alias gpkginit='cp /usr/share/pacman/PKGBUILD-vcs.proto ./PKGBUILD'
|
||||
alias pkginit='cp /usr/share/pacman/PKGBUILD.proto ./PKGBUILD'
|
||||
alias pa='makepkg --force --clean --cleanbuild --syncdeps --rmdeps && addpkg aur'
|
||||
alias pc='makepkg --force --clean --cleanbuild --syncdeps --rmdeps && addpkg custom'
|
||||
alias pr='makepkg --force --clean --cleanbuild --syncdeps --rmdeps && addpkg rpm'
|
||||
|
||||
# Personal
|
||||
alias :q='exit'
|
||||
alias ct='cptemplate'
|
||||
alias less='less -i --'
|
||||
alias la='ls --almost-all --color --group-directories-first --human-readable -l'
|
||||
alias ls='ls --color --group-directories-first'
|
||||
alias ll='ls --classify --color --group-directories-first --human-readable -l'
|
||||
alias python='python3'
|
||||
alias spcli='speedtest-cli --secure'
|
||||
alias sshconfig='"${EDITOR}" -- ${HOME}/.ssh/config'
|
||||
alias tmux='tmux -f "${XDG_CONFIG_HOME:-${HOME}/.config}"/tmux/tmux.conf'
|
||||
alias tmuxrc='nvim -- "${XDG_CONFIG_HOME:-${HOME}/.config}"/tmux/tmux.conf'
|
||||
alias tuir='tuir --no-flash'
|
||||
alias wget='wget --hsts-file="${XDG_DATA_HOME}/wget-hsts"'
|
||||
|
||||
# Navigation
|
||||
alias dirconf='"${EDITOR}" -- "${XDG_CONFIG_HOME:-${HOME}/.config}/user-dirs.dirs"'
|
||||
alias dotfiles='cd "${HOME}/Dotfiles"'
|
||||
alias xch='cd -- ${XDG_CONFIG_HOME:-${HOME}/.config}'
|
||||
alias xcah='cd -- ${XDG_CACHE_HOME:-${HOME}/.cache}'
|
||||
alias xdh='cd -- ${XDG_DATA_HOME:-${HOME}/.local/share}'
|
||||
|
||||
# Programming
|
||||
# Use python-pytest-xdist plugin
|
||||
#alias pytest='pytest --numprocesses=$(nproc)'
|
||||
alias pyarchive='git archive -o rbackup-"$(python setup.py --version)".tar.gz --prefix=rbackup-"$(python setup.py --version)"/'
|
||||
|
||||
# ssh
|
||||
alias scpe='scp -i "${HOME}/.ssh/empress"'
|
||||
|
||||
# system
|
||||
alias bootloader='cd /boot/loader/entries'
|
||||
alias myip='curl ifconfig.me'
|
||||
alias restartfans='sudo systemctl restart fancontrol.service'
|
||||
|
||||
# zsh
|
||||
alias zdotdir='cd -- ${ZDOTDIR:-${HOME}/.zsh}'
|
||||
alias zshaliases='${EDITOR} -- ${ZDOTDIR:-${HOME}/.zsh}/conf.d/00-aliases.zsh'
|
||||
alias zbindings='${EDITOR} -- ${ZDOTDIR:-${HOME}/.zsh}/conf.d/keybindings.zsh'
|
||||
alias zconf='cd -- ${ZDOTDIR:-${HOME}/.zsh}/conf.d'
|
||||
alias zfuncs='cd -- ${ZDOTDIR:-${HOME}/.zsh}/conf.d/functions'
|
||||
alias zhist='${EDITOR} -- ${HISTFILE}'
|
||||
alias zmod='cd -- ${ZDOTDIR:-${HOME}/.zsh}/conf.d/modules'
|
||||
alias zpath='${EDITOR} -- ${ZDOTDIR:-${HOME}/.zsh}/conf.d/path.zsh'
|
||||
alias zprompt='${EDITOR} -- ${ZDOTDIR:-${HOME}/.zsh}/conf.d/prompt.zsh'
|
||||
alias zshrc='${EDITOR} -- ${ZDOTDIR:-${HOME}/.zsh}/.zshrc'
|
||||
alias zshrefresh='source -- ${ZDOTDIR:-${HOME}/.zsh}/.zshrc'
|
||||
alias zshenv='${EDITOR} -- ${ZDOTDIR:-${HOME}/.zsh}/.zshenv'
|
||||
|
||||
# ---------- Parameterized Aliases ----------
|
||||
lsbin() {
|
||||
if [[ -n $1 ]]; then
|
||||
pacman -Qql $1 | rg bin
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
rgenv () {
|
||||
if [[ -n $1 ]]; then
|
||||
env | rg --ignore-case $1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
stow-config () {
|
||||
local dotfile_dir="${HOME}/Dotfiles"
|
||||
|
||||
for conf in "${@}"; do
|
||||
if [[ -n ${conf} ]]; then
|
||||
mkdir --parents "${dotfile_dir}/${conf}/.config"
|
||||
mv "${XDG_CONFIG_HOME}/${conf}" "${dotfile_dir}/${conf}/.config"
|
||||
cd "${dotfile_dir}" && stow "${conf}"
|
||||
cd -
|
||||
else
|
||||
continue
|
||||
fi
|
||||
done
|
||||
}
|
1
zsh/.config/zsh/conf.d/README
Normal file
1
zsh/.config/zsh/conf.d/README
Normal file
@ -0,0 +1 @@
|
||||
This directory (zsh) contains files that are common between all OS installations
|
@ -1,10 +0,0 @@
|
||||
# Setup fzf
|
||||
# ---------
|
||||
|
||||
# Auto-completion
|
||||
# ---------------
|
||||
[[ $- == *i* ]] && source "/usr/share/fzf/completion.zsh"
|
||||
|
||||
# Key bindings
|
||||
# ------------
|
||||
source "/usr/share/fzf/key-bindings.zsh"
|
@ -1,4 +0,0 @@
|
||||
# PATH variable configuration
|
||||
path=("${HOME}/Scripts/Arch Linux Helpers" $path)
|
||||
|
||||
export PATH
|
@ -1,8 +0,0 @@
|
||||
# Notify on ssh login
|
||||
if [[ -n $SSH_CONNECTION ]]; then
|
||||
IP="$(echo $SSH_CONNECTION | cut -d " " -f 1)"
|
||||
HOSTNAME=$(hostname)
|
||||
NOW=$(date +"%e %b %Y, %a %r")
|
||||
EMAIL='erictorres4@pm.me'
|
||||
echo "Login from ${IP} on ${HOSTNAME} on ${NOW}" | neomutt -s 'SSH Login Notification' "${EMAIL}" 2>/dev/null
|
||||
fi
|
Reference in New Issue
Block a user