Skip to content

RmZeta2718/dotfiles_pub

Repository files navigation

My Public Dotfiles

This repository contains public dotfiles including various configuration files, shell utilies, plugins, etc (i.e. dotfiles). There is also a private repository containing private dotfiles like ssh info.

I'm using Dotbot to manage dotfiles. Tutorial on Dotbot by Anish (the author, also one of the lecturers of MIT-Missing-Semester).

There are many different approaches other than Dotbot, see https://dotfiles.github.io/

Note

  • zsh plugins are not placed in default folder ($ZSH/custom), but in ZSH_CUSTOM="$HOME/.zsh/custom". The default position is inside oh-my-zsh repo, causing repos (omz vs plugins) nesting with each other and hard to maintain in dotbot (clone order, dirty repo and other problems). If there is a better way, please let me know.
  • conda
    • conda init shoud be placed in ~/.shell_local_after. This is now automated by assuming conda init zsh append 15 lines to ~/.zshrc.
    • assuming conda envs are installed in ~/.conda, use conda_pull to rsync from remote.
  • vscode settings are not maintain by dotfiles, vscode has its own way to sync its settings.
  • tmux:
    • oh-my-tmux
    • using Fira Font as powerline font for tmux

Cheat Sheet

Sync all dotfiles to a new machine

First, generate new ssh key and add it to github (more instructions here). Then, clone and install dotfiles.

git clone [email protected]:RmZeta2718/dotfiles_pub.git
cd dotfiles_pub
./install

Modify dotfiles

Add a new dotfile ~/.foo :

mv ~/.foo ~/.dotfiles/foo
# Add a new link for `foo` in install.conf.yaml
~/.dotfiles/install
# commit changes to git

Add a git submodule (eg. plugins) ~/vim/foo :

cd ~/.dotfiles
mkdir -p vim  # make parent directory
# If submodule is already cloned to there, rm -rf it first
git submodule add ${git_link_to_foo} vim/foo  # add submodule, specify path explicitly
# Add a new link for `vim` in install.conf.yaml
# commit changes to git

Delete all dotfiles installed by this repo:

./uninstall

Upgrade all submodules:

git submodule update --recursive --remote
# commit changes
# on another machine, run dfu, that is:
git pull
./install  # the key is: git submodule sync --recursive

My Tricks

If a directory is managed by both public and private Dotbot repos(eg. ~/.ssh, ~/.config etc.), then you can't directly symlink the directory due to conflict. The solution is to link each file in these directories, explicitly or using wildcard(glob).

TODO

Extra initialization steps after ./install . They are not yet covered by Dotbot, still working on it to automate.

  • tldr
  • submodule init shoud be placed before file mapping

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published