From bf6809b4fd60f1e04ef6e65264aa10e124620d61 Mon Sep 17 00:00:00 2001 From: Bauke Date: Tue, 24 Jan 2023 19:34:46 +0100 Subject: [PATCH] Move usage documentation from wiki to BAUKE_DIR. --- .bauke/Usage.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .bauke/Usage.md diff --git a/.bauke/Usage.md b/.bauke/Usage.md new file mode 100644 index 0000000..ce61f86 --- /dev/null +++ b/.bauke/Usage.md @@ -0,0 +1,49 @@ +# Dotfiles + +## Setup & Usage + +Create a directory that'll act as the bare git directory, then initialize it using `$HOME` as the working tree. + +``` +mkdir $HOME/.dotfiles +git init --bare $HOME/.dotfiles +``` + +To manage it, use `GIT_DIR` and `GIT_WORK_TREE`. Preferably as an alias. + +``` +alias dotfiles="GIT_DIR=$HOME/.dotfiles GIT_WORK_TREE=$HOME" +``` + +From there, prefix `dotfiles` to any commands that recognize these variables. + +``` +# Git +dotfiles git add .zshrc +dotfiles git status +# VS Codium +dotfiles codium +# ... +``` + +Hide untracked files from `dotfiles git status`, otherwise everything in `$HOME` will show up. + +``` +dotfiles git config --local status.showUntrackedFiles no +``` + +For VS Codium, create `$HOME/.vscode/settings.json`. + +``` +{ + "git.untrackedChanges": "hidden" +} +``` + +## Subtleties + +### Can't add files from git repositories + +For example, since `.oh-my-zsh` is a git repository, files inside `.oh-my-zsh/custom` can't be added. But since they're just scripts like any other, place them directly inside `$HOME` (or anywhere else) and `source ` them in `.zshrc` manually. + +Another solution is to set `$ZSH_CUSTOM` to something outside the `$ZSH` directory.