Skip to content

Instantly share code, notes, and snippets.

@MatsAnd
Last active June 8, 2022 19:05
Show Gist options
  • Save MatsAnd/1c5db19dbc612e52b2367856fa07003a to your computer and use it in GitHub Desktop.
Save MatsAnd/1c5db19dbc612e52b2367856fa07003a to your computer and use it in GitHub Desktop.

Setup new Mac

Install homebrew

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

Switch shell to zsh

chsh -s /bin/zsh

Install oh my zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Install kitty

https://sw.kovidgoyal.net/kitty/

brew install kitty --cask

Install zsh-syntax-highlighting

zsh-syntax-highlighting

brew install zsh-syntax-highlighting

Setup zsh history config

echo 'export HISTSIZE=50000' >> $HOME/.zshrc     			# How many lines of history to keep in memory
echo 'export HISTFILE=~/.zsh_history' >> $HOME/.zshrc    	# Where to save history to disk
echo 'export SAVEHIST=50000' >> $HOME/.zshrc			# Number of history entries to save to disk
echo '#export HISTDUP=erase' >> $HOME/.zshrc				# Erase duplicates in the history file
echo 'setopt appendhistory' >> $HOME/.zshrc					# Append history to the history file (no overwriting)
echo 'setopt sharehistory' >> $HOME/.zshrc					# Share history across terminals
echo 'setopt incappendhistory' >> $HOME/.zshrc				# Immediately append to the history file, not just when a term is killed

Install Fica Code

Fira Code

Install theme - snazzy

curl -o ~/.config/kitty/snazzy.conf https://raw.githubusercontent.com/connorholyday/kitty-snazzy/master/snazzy.conf

Configure kitty

mv ~/.config/kitty/kitty.conf ~/.config/kitty/kitty.bak
curl -o ~/.config/kitty/kitty.conf https://gist.githubusercontent.com/MatsAnd/8eda328d597c9719d626dd00fa0bfef4/raw/fd8f5499b8c0152812298d88476b1ace6b171cbe/kitty.conf

Install antigen (zsh plugin manager)

$ curl -L git.io/antigen > ~/.zsh/antigen/antigen.zsh

Setup zsh packages

Add the following to the bottom of ~/.zshrc

# Load antigen
source ~/.zsh/antigen/antigen.zsh

antigen use oh-my-zsh

antigen bundle command-not-found  # suggests package name with relevant command
antigen bundle docker
antigen bundle git-flow-avh
antigen bundle history            # aliases: h for history, hsi for grepping history
antigen bundle pip

# Additional completion definitions for Zsh.
antigen bundle zsh-users/zsh-completions src
antigen bundle sdurrheimer/docker-compose-zsh-completion
antigen bundle $HOME/.zsh/completions --no-local-clone

antigen bundle lukechilds/zsh-nvm
antigen theme robbyrussell

# I´m done!
antigen apply

Setup nvm

Install zsh-nvm

nvm upgrade
nvm install node
nvm install rc
nvm install --lts
nvm use --lts

Setup Git

git config --global user.name "Mats Andreassen"
git config --global user.email "[email protected]"
git config --global github.user matsand
git config --global color.ui true
ssh-keygen -t rsa -b 4096 -C "[email protected]"
eval "$(ssh-agent -s)"

Edit ~/.ssh/config

Host *
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_rsa
$ ssh-add -K ~/.ssh/id_rsa

Copy key:

$ pbcopy < ~/.ssh/id_rsa.pub

Paste key into GitHub´s settings: https://github.com/settings/keys

gpg

  1. brew install gpg
  2. Generate gpg keys and upload to github, as described in this guide
  3. git config --global commit.gpgsign true
  4. Install https://gpgtools.org/
  5. Add gpg passphrase to keyring on first commit

Setup npm

$ npm set init.author.email "[email protected]"
$ npm set init.author.url "https://github.com/matsand"
$ npm set init.author.name "Mats Andreassen"
$ npm set init.license "MIT"
$ npm set save-prefix ""

Install azure cli

$ brew install azure-cli
$ az login

Install npm packages

$ npm i -g vercel release azure-functions-core-tools create-react-app standard yarn eslint
$ vercel login

Add now/vercel alias:

$ echo "alias now=vercel" >> ~/.zshrc

Install docker

$ brew install docker --cask

Install mongodb

$ brew tap mongodb/brew
$ brew install [email protected]
$ brew install mongodb-compass-community --cask
$ brew services start [email protected]

Install .NET Core

https://dotnet.microsoft.com/download

brew install dotnet --cask

Install PowerShell

$ brew install powershell --cask
$ pwsh

Install go

https://golang.org/

Install pyenv

$ brew install pyenv

Install python

$ pyenv install 3.8.2
$ pyenv install 2.7.18
$ pyenv global 3.8.2
$ echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.zshrc

Install open jdk

$ brew install openjdk
$ sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

Install kotlin

$ brew install kotlin

Download IntelliJ

https://www.jetbrains.com/idea/

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