Adapt zsh config for macOS

This commit is contained in:
Eric Torres 2022-09-20 22:50:01 -07:00
parent eb98ee4112
commit 0f1f598c76
7 changed files with 16 additions and 23 deletions

View File

@ -55,7 +55,7 @@ autoload -Uz cf
# Make a directory, then change into it # Make a directory, then change into it
mkcd() { mkcd() {
[[ ! -d "${1}" ]] && mkdir --parents -- "${1}" [[ ! -d "${1}" ]] && gmkdir --parents -- "${1}"
cd "${1}" || exit cd "${1}" || exit
} }

View File

@ -1,10 +1,10 @@
# ---------- Normal Aliases ---------- # ---------- Normal Aliases ----------
# Common commands # Common commands
alias cp='cp -piv' alias cp='gcp -piv'
alias mv='mv -iv' alias mv='gmv -iv'
# Use safe-rm instead of rm # Use safe-rm instead of rm
alias rm='safe-rm -iv' alias rm='safe-rm -iv'
alias rmdir='rmdir -v' alias rmdir='grmdir -v'
# Games # Games
alias add-modrinth='ferium add-modrinth' alias add-modrinth='ferium add-modrinth'
@ -73,10 +73,10 @@ alias pr='makepkg --force --clean --cleanbuild --syncdeps --rmdeps && addpkg rpm
# Personal # Personal
alias :q='exit' alias :q='exit'
alias ct='cptemplate' alias ct='cptemplate'
alias less='less -i --' #alias less='less -i --'
alias la='ls --almost-all --color --group-directories-first --human-readable -l' alias la='gls --almost-all --color --group-directories-first --human-readable -l'
alias ls='ls --color --group-directories-first' alias ls='gls --color --group-directories-first'
alias ll='ls --classify --color --group-directories-first --human-readable -l' alias ll='gls --classify --color --group-directories-first --human-readable -l'
alias python='python3' alias python='python3'
alias spcli='speedtest-cli --secure' alias spcli='speedtest-cli --secure'
alias sshconfig='"${EDITOR}" -- ${HOME}/.ssh/config' alias sshconfig='"${EDITOR}" -- ${HOME}/.ssh/config'
@ -150,3 +150,8 @@ stow-config () {
fi fi
done done
} }
getwifipassword() {
security find-generic-password -ga "$1" | rg "password
}

View File

@ -1,4 +1,2 @@
# bindkey -M viins '^r' history-incremental-search-backward # bindkey -M viins '^r' history-incremental-search-backward
# bindkey -M vicmd '^r' history-incremental-search-backward # bindkey -M vicmd '^r' history-incremental-search-backward
# vim: syntax=zsh

View File

@ -3,8 +3,8 @@
# Auto-completion # Auto-completion
# --------------- # ---------------
[[ $- == *i* ]] && source "/usr/share/fzf/completion.zsh" [[ $- == *i* ]] && source "/usr/local/Cellar/fzf/0.33.0/shell/completion.zsh"
# Key bindings # Key bindings
# ------------ # ------------
source "/usr/share/fzf/key-bindings.zsh" source "/usr/local/Cellar/fzf/0.33.0/shell/key-bindings.zsh"

View File

@ -10,5 +10,3 @@ setopt correctall
# prevent accidental overwriting of a file # prevent accidental overwriting of a file
setopt noclobber setopt noclobber
# vim: syntax=zsh

View File

@ -1,4 +1,4 @@
# PATH variable configuration # PATH variable configuration
path=("${HOME}/Scripts/Arch Linux Helpers" $path) path=("${HOME}/Scripts/macOS Helpers" "${HOME}/.local/bin" $path)
export PATH export PATH

View File

@ -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