Skip to content

Instantly share code, notes, and snippets.

@danmindru
Last active November 18, 2024 14:43
Show Gist options
  • Select an option

  • Save danmindru/ff36fc8f2ba3575cc2b2bcd74dac262a to your computer and use it in GitHub Desktop.

Select an option

Save danmindru/ff36fc8f2ba3575cc2b2bcd74dac262a to your computer and use it in GitHub Desktop.
# Configure pyenv
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
# Configure nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# Default node version
nvm use v18
# Copilot cli
#eval "$(github-copilot-cli alias -- "$0")"
# 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
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Increase max node memory
export NODE_OPTIONS=--max_old_space_size=4096
# Added by Anaconda3 installer
export PATH="/home/dk83720/anaconda3/bin:$PATH"
# Use different npm global dir https://stackoverflow.com/a/40905762/3263450
export PATH=~/.npm-global/bin:$PATH
# Path to a Windows browser
export BROWSER=/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe
# Enable buildpack autocomplete
. $(pack completion --shell zsh)
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
# The emulator theme (HyperTerm)
ZSH_THEME="powerlevel10k/powerlevel10k"
# or: "ys" or "bullet-train"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(history history-substring-search python pip)
source $ZSH/oh-my-zsh.sh
# Load rupa/z
source $ZSH_CUSTOM/z.sh
# Lazygit
function gap() {
git add .
git commit -a -m "$1"
git push
}
# Aliases & useful shortcuts
alias reload='source ~/.zshrc'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias cat='bat'
function tt() {
if [ ! $1 ]; then
tree -L 1
elif
tree -L $1
echo '-----------------------------------'
}
function markdown() {
if [ $1 ]; then
mdv $1 -t 597.208 -T 953.3567
elif
echo 'Please provide the path of the markdown file to view.'
}
# Presentations
function finish() {
# Run in the dir you want to finish
dirName=${PWD##*/}
cd ../
fullPath=${PWD}
mv $fullPath'/'$dirName $fullPath'/.'$dirName
echo '✅ '$fg[yellow]$dirName$reset_color' marked as done'
}
function unfinish_all() {
# Run in the parent folder where you have a bunch of finished dirs (cuz you used finish(), see above)
ls -A | grep -v -P 'png' | grep -P '^\.+' | while read -r line; do
mv "$line" "`echo "$line" | sed 's/^\.//g'`";
done
}
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# pnpm
export PNPM_HOME="/Users/danmindru/Library/pnpm"
export PATH="$PNPM_HOME:$PATH"
# pnpm end
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/danmindru/Downloads/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/danmindru/Downloads/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/danmindru/Downloads/google-cloud-sdk/completion.zsh.inc' ]; then . '/Users/danmindru/Downloads/google-cloud-sdk/completion.zsh.inc'; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment