Git Product home page Git Product logo

dotfiles's Introduction

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]:kingnobro/dotfiles.git
cd dotfiles
./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

dotfiles's People

Contributors

kingnobro avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.