Setting up a new computer


#Etc

These are my notes on the tasks or apps I frequently use and setup on a new or refreshed computer.

Desktop Backgrounds

Forest originally from uhdpaper.

Install fonts

Meslo LGS NF

For Mac, just unzip the fonts and double click each file to add it to Font Book.

Apps to Install

Install git

Type the following into terminal:

Bash
git --version

Python Things

Install uv

Install just

Go Things

Install pkgsite

Bash
go install golang.org/x/pkgsite/cmd/pkgsite@latest

Install godoc

Bash
go install golang.org/x/tools/cmd/godoc@latest
Run locally with godoc -http=:7000

Install gofumpt

Bash
go install mvdan.cc/gofumpt@latest

Update VS Code settings:

JSON
"go.useLanguageServer": true,
"gopls": {
    "formatting.gofumpt": true,
},

zsh Things

Starship prompt

instructions

Install it

Bash
curl -sS https://starship.rs/install.sh | sh

Add the following to the end of ~/.zshrc:

Bash
# ~/.zshrc

eval "$(starship init zsh)"

zsh auto-suggestions

https://github.com/zsh-users/zsh-autosuggestions

Bash
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions

echo "source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh" >> ~/.zshrc

zsh syntax highlighting

https://github.com/zsh-users/zsh-syntax-highlighting

Bash
# Clone this repository and source the script
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.zsh/zsh-syntax-highlighting

echo "source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ~/.zshrc

Set up global gitignore

Edit the .gitconfig file

Bash
nano ~/.gitconfig

Add the lines:

Text Only
[core]
        excludesfile = ~/.gitignore
Save the file and then create/open a .gitignore file
Bash
nano ~/.gitignore

Add anything that should be ignored for all projects. For example:

Text Only
.DS_Store
.env
venv
.venv
*.db
*.sqlite3
.pytest_cache
__pycache__

Set up "permanent" environment variables

(provided by OpenAI's ChatGPT)

macOS

Use nano to add export MY_VARIABLE=my_value to one of the following: - If you are using Bash shell, you can use ~/.bashrc - If you are using Zsh shell, you can use ~/.zshrc. Here’s how:

Load the new environment variables by running: - source ~/.zshrc - source ~/.bashrc

Install Air

Air is a useful tool for live reloading applications.

Installation:

Text Only
go install github.com/cosmtrek/air@latest

Make sure GOPATH is set in ~/.zshrc to be able to use the air command

Text Only
# Go Path Things
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
export PATH=$PATH:$(go env GOPATH)/bin

Archive

pyenv

https://github.com/pyenv/pyenv#automatic-installer

Bash
# pyenv automatic installer

curl https://pyenv.run | bash

# Set up pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.zshrc

# Set up global pyenv virtual env
pyenv install 3.11.2
pyenv virtualenv 3.11.2 3.11.2-global
pyenv global 3.11.2-global

Powerlevel10k

https://github.com/romkatv/powerlevel10k#manual

Bash
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.zsh/powerlevel10k

echo 'source ~/.zsh/powerlevel10k/powerlevel10k.zsh-theme' >> ~/.zshrc

# Configure it
p10k configure