Skip to content

Instantly share code, notes, and snippets.

@elmoallistair
Last active October 16, 2020 04:34
Show Gist options
  • Save elmoallistair/40ed5566f2aa0c16faed5e3beb0737c9 to your computer and use it in GitHub Desktop.
Save elmoallistair/40ed5566f2aa0c16faed5e3beb0737c9 to your computer and use it in GitHub Desktop.
.zshrc file | Personal configuration
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
export ZSH="/home/elmoallistair/.oh-my-zsh"
ZSH_THEME="powerlevel10k/powerlevel10k"
POWERLEVEL9K_MODE="nerdfont-complete"
source $ZSH/oh-my-zsh.sh
source /home/elmoallistair/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
source /home/elmoallistair/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
lol() {
if [ -t 1 ]; then
"$@" | lolcat
else
"$@"
fi
}
COMMANDS=(
ls
cat
)
for COMMAND in "${COMMANDS[@]}"; do
alias "${COMMAND}=lol ${COMMAND}"
alias ".${COMMAND}=$(which ${COMMAND})"
done
function ListAllCommands {
COMMANDS=`echo -n $PATH | xargs -d : -I {} find {} -maxdepth 1 \
-executable -type f -printf '%P\n'`
ALIASES=`alias | cut -d '=' -f 1`
echo "$COMMANDS"$'\n'"$ALIASES" | sort -u
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment