Last active
February 6, 2023 04:14
-
-
Save ZacharyThompson/b4753fd44d54ecf8f26c3c88b22c7343 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export XDG_CONFIG_HOME="$HOME/.config" | |
export XDG_DATA_HOME="$HOME/.local/share" | |
export XDG_CACHE_HOME="$HOME/.cache" | |
export XDG_STATE_HOME="$HOME/.local/state" | |
export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle" | |
export NODE_REPL_HISTORY="$XDG_DATA_HOME/node_repl_history" | |
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc" | |
export NVM_DIR="$XDG_DATA_HOME/nvm" | |
export TLDR_CACHE_DIR="$XDG_CACHE_HOME/tldrc" | |
export WGETRC="$XDG_CONFIG_HOME/wgetrc" | |
export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc" | |
export GOPATH="$XDG_DATA_HOME/go" | |
export CARGO_HOME="$XDG_DATA_HOME/cargo" | |
export JULIA_DEPOT_PATH="$XDG_DATA_HOME/julia:$JULIA_DEPOT_PATH" | |
export RUSTUP_HOME="$XDG_DATA_HOME/rustup" | |
export PATH="$HOME/.local/bin:$PATH" | |
export PATH="$GOPATH/bin:$PATH" | |
export PATH="$CARGO_HOME/bin:$PATH" | |
export PATH="/usr/local/opt/llvm/bin:$PATH" | |
export KEYTIMEOUT=1 | |
export BROWSER="firefox.sh" | |
export HISTFILE="$HOME/.local/share/zsh/history" | |
HISTSIZE=1000 | |
SAVEHIST=1000 | |
setopt SHARE_HISTORY | |
# Basic auto/tab complete: | |
autoload -Uz compinit | |
zstyle ':completion:*' menu select | |
zmodload zsh/complist | |
compinit | |
_comp_options+=(globdots) # Include hidden files. | |
# Git branch right prompt | |
autoload -Uz vcs_info | |
precmd_vcs_info() { vcs_info } | |
precmd_functions+=( precmd_vcs_info ) | |
setopt prompt_subst | |
RPROMPT="%F{red}%(?..[%?] )%F{yellow}\$vcs_info_msg_0_" | |
zstyle ':vcs_info:git:*' formats '%b' | |
PROMPT='%F{fg}%~ $ ' | |
# Vi mode and keys | |
bindkey -v | |
export KEYTIMEOUT=1 | |
bindkey -M menuselect 'h' vi-backward-char | |
bindkey -M menuselect 'k' vi-up-line-or-history | |
bindkey -M menuselect 'l' vi-forward-char | |
bindkey -M menuselect 'j' vi-down-line-or-history | |
bindkey -v '^?' backward-delete-char | |
bindkey '^n' down-line-or-history | |
bindkey '^p' up-line-or-history | |
# Aliases | |
alias rm='rm -I' | |
alias update='' | |
#alias python3='python3.11' | |
alias pip='python3 -m pip' | |
alias glog='git log --oneline --graph --decorate -15' | |
alias grep='grep --color=auto' | |
alias mkdir='mkdir -p' | |
alias sudo='sudo ' # allows aliases to work with sudo | |
alias tree='tree -aC' | |
alias vi='ovi' | |
alias vim='nvim' | |
alias ytdl-a='yt-dlp --embed-metadata -i -4 -x -f bestaudio/best -o "%(title)s.%(ext)s"' | |
alias ytdl-ap='yt-dlp --embed-metadata -i -4 -x -f bestaudio/best -o "%(autonumber)s.%(title)s.%(ext)s"' | |
alias ytdl-p='yt-dlp --embed-metadata -i -4 -o "%(autonumber)s.%(title)s.%(ext)s"' | |
alias ytdl='yt-dlp --embed-metadata -i -4 -o "%(title)s.%(ext)s"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prefix=${XDG_DATA_HOME}/npm | |
cache=${XDG_CACHE_HOME}/npm | |
init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import atexit | |
import readline | |
history = os.path.join(os.environ['XDG_CACHE_HOME'], 'python_history') | |
try: | |
readline.read_history_file(history) | |
except OSError: | |
pass | |
def write_history(): | |
try: | |
readline.write_history_file(history) | |
except OSError: | |
pass | |
atexit.register(write_history) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hsts-file = /Users/zachary/.cache/wget-hsts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment