PSalant726 / dotfiles

My environment configuration files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Required Software & Settings

Homebrew

Install with:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Font

Install the JetBrains Mono nerd font:

brew tap homebrew/cask-fonts
brew install font-jetbrains-mono-nerd-font

Optional: Install the Hack nerd font:

brew tap homebrew/cask-fonts
brew install font-hack-nerd-font

iTerm

  1. Get it from the official site, or install via Homebrew with:

    brew install --appdir="~/Applications" iterm2
  2. After cloning the bare cfg repo (details below), import the iTerm_profile.json file

    Preferences -> Profiles -> Other Actions... -> Import JSON Profiles...

Additional Tools

  1. Install the following with Homebrew:

    brew install bat eza fzf git git-delta go jq pyenv pyenv-virtualenv tree zsh
    $(brew --prefix)/opt/fzf/install
    
    # Use the homebrew zsh installation
    # Ensure $HOMEBREW_PREFIX is set
    sudo sh -c "echo $HOMEBREW_PREFIX/bin/zsh >> /etc/shells"
    chsh -s $HOMEBREW_PREFIX/bin/zsh
  2. Install Volta with:

    curl https://get.volta.sh | bash -s -- --skip-setup
    1. Install node, npm, and yarn with:

      volta install node npm yarn

    Optional: Install emoj via yarn with:

    yarn add emoj

oh-my-zsh

  1. Install with:

    sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  2. Install the powerlevel10k theme with:

    git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k

    Optional: Install the spaceship theme (currently configured, but unused by default) with:

    git clone --depth=1 https://github.com/denysdovhan/spaceship-prompt.git $ZSH_CUSTOM/themes/spaceship-prompt
    ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"
  3. Install the following plugins:

    git clone --depth=1 https://github.com/djui/alias-tips.git $ZSH_CUSTOM/plugins/alias-tips &&\
    git clone --depth=1 https://github.com/z-shell/F-Sy-H.git $ZSH_CUSTOM/plugins/F-Sy-H &&\
    git clone --depth=1 https://github.com/wfxr/forgit.git $ZSH_CUSTOM/plugins/forgit &&\
    git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

Firefox Developer Edition

  1. Download Firefox Developer Edition here.
  2. Log in with Firefox account
    1. This should sync bookmarks, extensions, etc.
  3. Open about:support
    1. Find the "Profile Folder" section
    2. Navigate to the profile location using iTerm
    3. Close Firefox
    4. Copy/Paste the user.js file from this repo into the profile directory
    5. Create a new directory in the profile directory, called chrome/
    6. Copy/Paste the userChrome.css file from this repo into the chrome/ directory
    7. Open Firefox

VS Code

Download it here. Sync extensions and preferences natively.

Optional

Install the gotest binary (to colorize go test output) by running the following outside of any Go modules:

go install github.com/rakyll/gotest@latest

Source .zshrc

After completing the below steps to configure the cfg repo, restart iTerm or run:

source ~/.zshrc

dotfiles Management with a Bare Git Repository

Prerequisite

Prior to installation, make sure to include the cfg alias in the local .bash_profile or .zshrc:

alias cfg="$HOMEBREW_PREFIX/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME"

Then, in the command line, run:

source ~/.zshrc
# or
source ~/.bash_profile

Installation

  1. Ensure that the source repo .gitignore's the folder where .cfg will be cloned:

    echo ".cfg" >> .gitignore
  2. Clone this repo into a "bare" repo in a hidden folder in the $HOME directory:

    git clone --bare git@github.com:PSalant726/dotfiles.git $HOME/.cfg

    Alternative: Clone via HTTPS

    git clone --bare https://github.com/PSalant726/dotfiles.git $HOME/.cfg
  3. Define the alias in the current shell scope (only required if not included in the local .zshrc or .bash_profile):

    alias cfg="$HOMEBREW_PREFIX/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME"
  4. Checkout the content from the bare repository in the $HOME directory:

    cfg checkout

    Note: The step above might fail with a message like:

    error: The following untracked working tree files would be overwritten by checkout:
        .zshrc # or .bash_profile
        .gitconfig
    Please move or remove them before you can switch branches.
    Aborting

    This is because the $HOME directory might already contain some stock configuration files that would be overwritten by this opteration. To resolve:

    1. Back up the files (if necessary), or remove them

    2. Re-run the checkout:

      cfg checkout
  5. Set the flag showUntrackedFiles to no for the local repository:

    This hides files that are not explicitly tracked. This is so that when running cfg status and other commands, files that are not of concern will not show up as untracked.

    cfg config --local status.showUntrackedFiles no

That's it! Type cfg commands to add and update dotfiles:

cfgs                                         # cfg status
...
cfga .zshrc                                  # cfg add
cfgcm -m "Add an awesome new alias"          # cfg commit
...
cfga .p10k.zsh
cfgcm -m "Make an awesome new bash prompt"
cfgps                                        # cfg push

About

My environment configuration files.


Languages

Language:Shell 90.2%Language:JavaScript 8.5%Language:CSS 1.3%