Add README with setup and usage instructions

This commit is contained in:
1jamesthompson1
2026-03-23 09:21:27 +13:00
parent 99e2784a77
commit 823e5407e0

100
README.md Normal file
View File

@@ -0,0 +1,100 @@
# Dotfiles
My personal dotfiles for quick setup on new machines. Change once, update everywhere.
## What's Included
| File | Description |
|------|-------------|
| `.bashrc` | Bash configuration with custom prompt, aliases, lazy-loaded conda/nvm, auto-start tmux |
| `.tmux.conf` | tmux config with vi keybindings and TPM plugins |
| `.vimrc` | Vim configuration with clipboard support, syntax highlighting, and sensible defaults |
| `setup.sh` | Bootstrap script for new Debian-like machines |
## Quick Install on a New Machine
```bash
curl -fsSL https://gitea.sjhl.nz/james/dotfiles/raw/branch/main/setup.sh | bash
```
Or manually:
```bash
git clone --bare https://gitea.sjhl.nz/james/dotfiles ~/.dotfiles
# Define the dotfiles alias
dotfiles() {
/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$@"
}
# Checkout files (will prompt if conflicts exist)
dotfiles checkout
# Hide untracked files from status
dotfiles config --local status.showUntrackedFiles no
```
## Managing Your Dotfiles
After installation, the `dotfiles` command is available in your shell:
```bash
# View status
dotfiles status
# Add changes
dotfiles add .bashrc
dotfiles commit -m "Update prompt"
dotfiles push
```
The alias is already defined in `.bashrc`, so it's available in new terminals.
## tmux Usage
tmux starts automatically when you open a new terminal (configured in `.bashrc`).
**Basic Commands:**
| Command | Action |
|---------|--------|
| `tmux` | Start new session |
| `tmux ls` | List sessions |
| `tmux attach -t 0` | Attach to session 0 |
| `Ctrl+b d` | Detach from session |
| `Ctrl+b c` | Create new window |
| `Ctrl+b %` | Split vertically |
| `Ctrl+b "` | Split horizontally |
| `Ctrl+b [` | Copy/vi mode |
| `q` | Exit copy mode |
**Install TPM plugins:**
After first tmux start, press `Ctrl+b I` to install plugins (tpm, tmux-sensible, tmux-yank).
## Vim Usage
| Command | Action |
|---------|--------|
| `vi` or `vim` | Open editor |
| `:w` | Save |
| `:q` | Quit |
| `:q!` | Force quit |
| `/pattern` | Search |
| `n` | Next search match |
| `yy` | Yank (copy) line |
| `p` | Paste |
| `u` | Undo |
| `Ctrl+r` | Redo |
Clipboard is integrated - yanking/pasting works with system clipboard.
## Uninstall
To remove dotfiles from a machine:
```bash
dotfiles checkout HEAD
dotfiles clean -fd
rm -rf ~/.dotfiles ~/.dotfiles-backup
```
Your original files will be restored from the backup created during checkout.