Setup your Mac

Mac initial Seup

  1. Install Homebrew /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Setup Terminal
    1. Install Nord terminal app https://github.com/arcticicestudio/nord-terminal-app
    2. Change default terminal theme to Nord
    3. Install oh-my-zsh sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" https://ohmyz.sh
  3. Install power10k
  4. Configure power10k p10k configure
  5. Install Git brew install git
  6. Install GH brew install gh
  7. Install Github Copilot CLI gh extension install github/gh-copilot
  8. Install tig brew install tig
  9. Install z brew install z
  10. Install eza brew install eza eza was earlier called exa
    1. Alias ls to eza --colour=always --long --tree --level=1
    2. Alias le to eza --colour=always --long --tree --level=2

      Add these to .zshrc

  11. Install tmux brew install tmux

Dotfiles

It is possible that you have multpile machines and you want to have same configuration on all of them. This is where dotfiles come in. Dotfiles are configuration files that are hidden and start with a dot. These files (if there are no saved passwords) can be stored in a git repository and can be cloned on any machine.

Creating Dotfiles Repository

This is a simple way to create a dotfiles repository. There are other ways to do this. This is just one way to do it. I am assuming the you have dot files for zsh and tmux. If you have other dotfiles, you can create a folder for that as well.

  1. Install stow brew install stow
  2. Create a git repository on github called dotfiles
  3. Clone the repository to your local machine git clone <repo-url>
  4. Change directory to dotfiles cd ~/dotfiles
  5. For Shell
    1. Create a folder called shell mkdir shell
    2. Change directory to shell cd shell
    3. Move the zshrc file to shell folder mv ~/.zshrc .
    4. Move p10k.zsh to shell folder mv ~/.p10k.zsh .
    5. Move to dotfiles folder cd ..
    6. Create a symlink for zshrc stow shell
  6. For Tmux
    1. Create a folder called tmux mkdir tmux
    2. Change directory to tmux cd tmux
    3. Move the tmux.conf file to tmux folder mv ~/.tmux.conf .
    4. Move to dotfiles folder cd ..
    5. Create a symlink for tmux stow tmux
  7. Add and commit the changes git add . && git commit -m "Basic dotfiles setup"
  8. Push the changes to a remote repository git push

Reusing the Dotfiles repository on a new machine

  1. Install stow brew install stow
  2. Clone the dotfiles repository git clone <repo-url>
  3. Change directory to dotfiles cd ~/dotfiles
  4. Create a symlink for zsh stow shell
  5. Create a symlink for tmux stow tmux

Questions

  1. what is / -> This is a root of file system. Any path starting with / is absolute path. Everything else is relative path wrt pwd
  2. What is /home -> One of the folders in the root
  3. What is ~ -> This is a home directory of the user. This is an absolute path
  4. What is . -> This is a current directory
  5. What is .. -> This is a parent directory of pwd.
  6. What is ./ -> . refered to pwd