Skip to content

Instantly share code, notes, and snippets.

@avatar-lavventura
Created January 9, 2026 16:33
Show Gist options
  • Select an option

  • Save avatar-lavventura/14d71d929e1caf5ec4d739941aacc57d to your computer and use it in GitHub Desktop.

Select an option

Save avatar-lavventura/14d71d929e1caf5ec4d739941aacc57d to your computer and use it in GitHub Desktop.
uname_out="$(uname -s)"
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 COLORTERM=truecolor
export DEFAULT_USER="$(whoami)"
export ZSH=$HOME"/.oh-my-zsh"
CASE_SENSITIVE="true" # Uncomment the following line to use case-sensitive completion.
DISABLE_AUTO_UPDATE="true"
DISABLE_AUTO_TITLE="true"
ZSH_CUSTOM_AUTOUPDATE_QUIET=true
FILTER_BRANCH_SQUELCH_WARNING=1
export LSCOLORS=ExGxBxDxCxEgEdxbxgxcxd
export LS_COLORS="$LS_COLORS:ow=1;34:tw=1;34:*.tar=1;31:*.tgz=1;31:*.arj=1;31:*.taz=1;31:*.lzh=1;31:*.lzma=1;31:*.tlz=1;31:*.txz=1;31:*.zip=1;31:*.z=1;31:*.Z=1;31:*.dz=1;31:*.gz=1;31:*.lz=1;31:*.xz=1;31:*.bz2=1;31:*.bz=1;31:*.tbz=1;31:*.tbz2=1;31:*.tz=1;31:*.deb=1;31:*.rpm=1;31:*.jar=1;31:*.war=1;31:*.ear=1;31:*.sar=1;31:*.rar=1;31:*.ace=1;31:*.zoo=1;31:*.cpio=1;31:*.7z=1;31:*.rz=1;31:*.json=00;35"
#
plugins=( # https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins
aliases
branch
brew
colored-man-pages
cp
debian
dirhistory
docker
docker-compose
fzf
gcloud
gh
gitfast
git-auto-fetch
git-extras
git-flow
gitignore
git-prompt
git-prompt
gnu-utils
gpg-agent
history
ipfs
ipfs
iterm2
macos
man
mongocli
pip
rsync
ruby
sudo
z
zsh-safe-rm
zsh-syntax-highlighting
)
source ~/personalize/git-flow-completion.zsh
GIT_AUTO_FETCH_INTERVAL=30 # in seconds 1200 default
if [ -z "$_zsh_custom_scripts_loaded" ]; then
_zsh_custom_scripts_loaded=1
fi
function git_prompt_info() {
local ref
if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
if [[ "$(__git_prompt_git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then
ref=$(__git_prompt_git symbolic-ref HEAD 2> /dev/null) || \
ref=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) || return 0
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
fi
}
function ls {
output=$(command ls -h --color=always -v --author --time-style=long-iso -C | wc -l)
if [ $output -gt 20 ]; then
command ls -h --color=always -v --author --time-style=long-iso -C "$@" | less -R
else
command ls -h --color=always -v --author --time-style=long-iso -C "$@" | less -R -F -X
fi
}
function precmd() {
printf "\033];$(whoami)@$(hostname):${PWD/#$HOME/~}\007";
echo -ne "\e]1;${PWD##*/}\a"
}
export COLUMNS # Remember columns for subprocesses
source $HOME/.oh-my-zsh/oh-my-zsh.sh
source ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/z/z.sh
setopt inc_append_history # append into history file
setopt extended_history # record timestamp of command in HISTFILE
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
setopt hist_ignore_dups # ignore duplicated commands history list
setopt hist_ignore_space # ignore commands that start with space
setopt hist_verify # show command with history expansion to user before running it
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_SAVE_NO_DUPS # do not save duplicated command
setopt HIST_REDUCE_BLANKS # delete empty lines from history file
setopt HIST_NO_STORE # do not add history and fc commands to the history
setopt INC_APPEND_HISTORY_TIME # append command to history file immediately after execution
setopt +o nomatch
setopt rmstarsilent
FILE=~/.p10k.zsh # to customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[ -f $FILE ] && source $FILE
FILE=~/.ssh_addresses
[ -f $FILE ] && source $FILE
FILE=~/.aliases
[ -f $FILE ] && source $FILE
FILE=~/.zpath
[ -f $FILE ] && source $FILE
FILE=~/venv/bin/activate
[ -f $FILE ] && source $FILE
source ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k/powerlevel10k.zsh-theme
fignore=(\~)
case "${uname_out}" in
Darwin*) # UNIX
export PATH=/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/3.0.0/bin:$PATH
export PATH=/usr/local/opt/coreutils/libexec/gnubin:$PATH
export PATH=~/.npm-packages/bin:$PATH
export PATH=/usr/local/opt/curl/bin:$PATH
export PATH=/usr/local/opt/imagemagick@6/bin:$PATH
export PATH=/usr/local/opt/make/libexec/gnubin:$PATH
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
;;
*)
esac
if [[ $TERM = dumb ]]; then
unset zle_bracketed_paste
fi
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
}
pastefinish() {
zle -N self-insert $OLD_SELF_INSERT
}
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish
source $ZSH/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # fix slowness of pastes
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
case "${uname_out}" in
Darwin*) # UNIX
DIR=$HOME/venv
[ ! -d $DIR ] && python3.8 -m venv $DIR
export LDFLAGS="-L/usr/local/opt/binutils/lib"
export CPPFLAGS="-I/usr/local/opt/binutils/include"
#
emacs_pn="macs --bg-daemon"
num=$(ps aux | grep -E $emacs_pn | grep -E " SNsl | SNs | Ss | S" | wc -l)
if [ $num -eq 0 ]; then
(&>/dev/null emacsclient -cqut ~/todo/todo/.todo-list.org &)
fi
;;
*) # LINUX
DIR=$HOME/venv
[ ! -d $DIR ] && python3 -m venv $DIR
FILE=~/venv/bin/eblocbroker
[ -f $FILE ] && eval "$(register-python-argcomplete $FILE)"
#
emacs_pn="[e]macs --daemon"
num=$(ps aux | grep -E $emacs_pn | grep -E " SNsl | SNs | Ss | S" | wc -l)
if [ $num -eq 0 ]; then
(&>/dev/null emacsclient -cqut &)
fi
;;
esac
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
zstyle ':completion:*' accept-exact '*(N)'
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh/cache
zstyle ':completion:*' hosts off
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment