Skip to content

Instantly share code, notes, and snippets.

@superguigui
Last active March 31, 2020 08:43
Show Gist options
  • Save superguigui/a67003077f8c3632ea97b4b14ce712a7 to your computer and use it in GitHub Desktop.
Save superguigui/a67003077f8c3632ea97b4b14ce712a7 to your computer and use it in GitHub Desktop.
Install new Computer
My Dotfiles
See README.md for instructions
alias mkdir="mkdir -p"
alias ..="cd .."
alias ...="cd ../.."
alias l="ls -lG"
alias lsa="ls -AGFoh"
alias c="clear"
alias o="open ."
alias g="git"
alias ns="npm i -S"
alias nd="npm i -D"
alias ng="npm i -g"
alias ni="npm i"
alias copyssh="pbcopy < ~/.ssh/id_rsa.pub"
# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com && ipconfig getifaddr en1"
# Flush Directory Service cache
alias flushdns="dscacheutil -flushcache && killall -HUP mDNSResponder"
# Recursively delete `.DS_Store` files
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"
# Empty the Trash on all mounted volumes and the main HDD
# Also, clear Apple’s System Logs to improve shell startup speed
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
# Show/hide hidden files in Finder
alias show-hidden-file="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hide-hidden-file="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
# Hide/show all desktop icons (useful when presenting)
alias showdeskicons="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
alias hidedeskicons="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
# Batch convert all wav in current folder to MP3
alias batchWavToMP3="for i in *.wav; do lame -b 320 -h "${i}" "${i%.wav}.mp3"; done"
alias springboard="/Users/hellohikimori/local/springboard/springboard"
alias sb="/Users/hellohikimori/local/springboard/springboard"
# Pure prompt
autoload -U promptinit; promptinit
prompt pure
# Some Aliases
source "$HOME/.aliases"
# NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# Add Visual Studio Code (code)
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
# RUPA Z
. /usr/local/etc/profile.d/z.sh
# ZSH-SYNTAX-HIGHLIGHTING
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# ZSH-AUTOSUGGESTIONS
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh

Install

Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Git

Install git from brew and remove eventual git previous installs https://gist.github.com/brandonsimpson/54d9e085c9fde5e6ad3a#file-reinstall_git_brew-md

ZSH

brew install zsh

NVM

Don't try to install it with homebrew!

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash

YARN

Without node to be sure to use NVM's node

brew install yarn --without-node

Pure prompt

npm install --global pure-prompt

And add this to your .zshrc

# Pure prompt
autoload -U promptinit; promptinit
prompt pure

Homebrew Cask

brew tap caskroom/cask

Apps

Install these apps via cask for easy and quick installation (make sure to update them afterwards).

brew cask install google-chrome
brew cask install hyper
brew cask install visual-studio-code
brew cask install filezilla
brew cask install firefox
brew cask install dropbox
brew cask install spectacle
brew cask install spotify
brew cask install slack
brew cask install docker
brew cask install blender
brew cask install fontprep

VsCode CLI

Install VSCode CLI for terminal, add the following 2 lines to your .zshrc

# Add Visual Studio Code (code)
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"

Vscode Plugins

From command line

code --install-extension arcticicestudio.nord-visual-studio-code 
code --install-extension slevesque.shader
code --install-extension sysoev.language-stylus
code --install-extension PKief.material-icon-theme
code --install-extension whatwedo.twig

Hyper and ZSH

Set ZSH as default shell for Hyper, change (or create) the shell line from ~/.hyper.js to

shell: '/bin/zsh',

ZSH Plugins

brew install z
brew install zsh-syntax-highlighting
brew install zsh-autosuggestions

Add the following to your .zshrc to complete plugins installation

# RUPA Z 
. /usr/local/etc/profile.d/z.sh
# ZSH-SYNTAX-HIGHLIGHTING
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# ZSH-AUTOSUGGESTIONS
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh

HPM

Install hpm (hyper package manager)

npm install -g hpm-cli

Hyper plugins

And then install some cool hyper plugins (you will probably need to restart hyper multiple times)

hpm install nord-hyper
hpm install hypercwd
hpm install hyperterm-tabs-enhanced
hpm install hyperterm-cursor
hpm install hyperlinks

Composer (php)

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer

FFMPEG

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