Skip to content

Instantly share code, notes, and snippets.

@TheWebDevel
Created April 20, 2019 03:48
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheWebDevel/3f4ec501dfbdb2fa80899825a80d996d to your computer and use it in GitHub Desktop.
Save TheWebDevel/3f4ec501dfbdb2fa80899825a80d996d to your computer and use it in GitHub Desktop.
My zshrc
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
# Load Nerd Fonts with Powerlevel9k theme for Zsh
POWERLEVEL9K_MODE='nerdfont-complete'
source ~/powerlevel9k/powerlevel9k.zsh-theme
# Customise the Powerlevel9k prompts
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ssh dir vcs newline status)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
# Load Zsh tools for syntax highlighting and autosuggestions
HOMEBREW_FOLDER="/usr/local/share"
source "$HOMEBREW_FOLDER/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
source "$HOMEBREW_FOLDER/zsh-autosuggestions/zsh-autosuggestions.zsh"
export PATH=/usr/local/bin:$PATH
# Lazy git
gitpush() {
echo -e "\e[0;32m YOUR GIT STATUS: \e[0m"
git status -s -u -v
echo -n "\e[0;32m Press ENTER to continue: \e[0m"
read var_name
echo -e "\e[0;32m ADDING ALL... \e[0m"
git add . -v
echo -e "\e[0;32m COMMITING... \e[0m"
git commit -a -s -v -m "$*"
echo -e "\e[0;32m PUSHING... \e[0m"
git push -v
}
alias lg=gitpush
# Lazy youtube-dl
youtubedownload() {
youtube-dl \
-f '(bestvideo[ext=mp4]/bestvideo)+(bestaudio[ext=m4a]/bestaudio)/best' \
--max-filesize 500m \
--console-title \
-o "~/Downloads/%(title)s.%(ext)s" \
$*
}
youtubedownloadlist() {
youtube-dl \
-f '(bestvideo[ext=mp4]/bestvideo)+(bestaudio[ext=m4a]/bestaudio)/best' \
--max-filesize 500m \
--console-title \
-o "~/Downloads/%(playlist_title)s/%(playlist_index)s - %(title)s.%(ext)s" \
$*
}
alias yd=youtubedownload
alias ydl=youtubedownloadlist
# Makes going back easier
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
# Easily access folders
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
alias p="cd ~/Projects"
# Good to know what we week are in
alias week='date +%V'
# Find and delete .DS_Store Files
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"
# Empty Trash and Other Caches
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl; sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent'"
# To Open VS Code Text easily
alias s='code .'
alias c='code .'
# To Edit System Hosts File
alias edithost='cd && cd ../../etc && s hosts'
# Update everything at once
alias brewup='brew update && brew upgrade && brew cu -a -f --cleanup -y && brew cleanup; brew doctor'
@varaskkar
Copy link

Good help, I used the youtube-dl function and the lazy git function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment