Skip to content

My personal dotfiles & new machine setup instructions

Notifications You must be signed in to change notification settings

hkennyv/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles

author(s): khuynh

Overview

Dotfile management using a bare git repository method (see here).

New Machine Setup

Install ssh-key

This section is mostly optional, you can always clone over https, but it's recommended to setup your ssh key.

  • create a new ssh-key
ssh-keygen -t rsa -b 4096
  • print ssh key and copy to the clipboard
cat ~/.ssh/id_rsa.pub

Setup shell and dotfiles

The following instructions works for any new UNIX-like machine. We will use zsh and configure it using oh-my-zsh. If you don't wish to use zsh and prefer to use an alternative shell, you can skip the first step below.

  • install oh-my-zsh (this is required before setting up the repository, your .zshrc will be overwritten later)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  • clone the dotfiles repository onto your machine
git clone --bare git@github.com:hkennyv/dotfiles.git $HOME/.cfg
  • define alias for config temporarily
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
  • checkout the actual content from the bare repository into your $HOME directory
config checkout
  • configure git to ignore untracked files
config config --local status.showUntrackedFiles no
  • check the dotfiles were cloned and checked out correctly. run the following command and your output should confirm you are on the main branch with no new commits
config status

your output should match something along these lines (ensure your current working directory is $HOME):

On branch main
nothing to commit (use -u to show untracked files)

After successfully setting up the shell, see the OS specific instructions to get started installing some applications.

Mac OS Setup

Install brew

Install brew using the following:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  • update brew formulae and brew
brew update

Install packages and applications

  • install brew bundle
brew tap Homebrew/bundle
  • install the .Brewfile. this will install all of the packages and cask applications listed in the file. i've included the packages and applications i use daily along with some qol packages (e.g. ripgrep to replace grep, fzf, etc...). I've included a seperate brewfile for some SDL dependencies that you can also install if you wish.

Use the following command to install the .Brewfile:

brew bundle --file $HOME/.khuynh/Brewfile

This will install the following packages (check the file in the repository for the most up to date list):

  • python3, pip3
  • node
  • yarn
  • fzf
  • rg

and the following applications:

  • iterm2 terminal emulator

  • rectangle wm

  • discord

  • slack

  • transmission torrent client

  • vim 8.0+

check the version of vim with vim --version and install with brew if version is less than 8.0.

Other useful programs

  • rustup
  • vscode insiders (to uninstall the stable version that is installed with the .Brewfile, delete Visual Studio Code.app)
  • XCode - you want to install both XCode and the Command Line Tools for XCode

Vim setup

curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  • open vim and run :PlugInstall to install all the plugins listed in your .vimrc

Ubuntu Setup

  • update apt
sudo apt update && sudo apt -y upgrade
  • install packages from .khuynh/packages.txt
cat ~/.khuynh/packages.txt | xargs sudo apt install -y

Windows Setup

Ninite install

Head over to https://ninite.com/ and select the following programs:

  • chrome
  • teamviewer
  • windirstat
  • winscp
  • vlc
  • qbittorrent
  • malwarebytes
  • steam

Run the ninite installer to have all the programs installed.

Install WSL

Follow the instructions here to install Windows Subsystem for Linux (WSL). I prefer Ubuntu 20.04 LTS.

From here, follow the instructions in Ubuntu Setup.

Install MSYS2

Follow instructions to install MSYS2 to get a proper unix(ish) shell environment set up.

Update MSYS2 path to include windows path

Open to C:\msys64\msys2_shell.cmd and edit the file to uncomment the line:

rem set MSYS2_PATH_TYPE=inherit

to

set MSYS2_PATH_TYPE=inherit

This will bring inherit your windows path into your MSYS2 PATH. You can verify this by using the following command in your MSYS2 shell (after you restart it):

echo $PATH

Toolchain setup

This section contains instructions for installing specific language toolchains.

Python

Mac OS and Linux

For UNIX-like environments, use pyenv to manage your python environments. Install the dependencies:

brew install openssl readline sqlite3 xz zlib

Or via apt:

sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git

Finally, install pyenv (mac os):

brew install pyenv

or via curl (mac os or linux):

curl https://pyenv.run | bash

Then follow the instructions from pyenv to install your version of choice.

Don't forget to add the shims to your .profile.local!

Windows

If you're using WSL, install using the instructions above. If not, you can use the installer directly from the Python website.

*ensure to check the box that adds python to your PATH

Node.js

Mac OS

On Mac OS, you can install nodejs & npm via brew:

brew install nodejs

Windows

Install node.js and npm via the node.js site installer.

Linux

You can install via the NodeSource binary distribution channel.

Rust

TODO

Usage

Configuration

Although this installation targets zsh, you can use it with any shell. Simply source the following files:

  • .aliases - contains all aliases
  • .profile - modifies $PATH, don't add user-specific paths in here, use .profile.local to do that
  • .profile.local - user-specific $PATH modifications

Application specific configuration include:

  • .vimrc - user vim configuration
  • .zshrc - zsh configuration

Commands

Inside of .aliases, we have:

alias config="$(which git) --git-dir=$HOME/.cfg/ --work-tree=$HOME"

It essentially aliases config to git. To add/modify/remove files from this git repo, you can use pretty much any regular git command except substite git for config. See the example of adding a .vimrc below:

config status
config add .vimrc
config commit -m 'add vimrc'

config add .bashrc
config commit -m 'add bashrc'
config push

About

My personal dotfiles & new machine setup instructions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published