Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ config/
tmux/scripts/status.sh # Modular status bar renderer
tmux/scripts/status.conf # Status gadget list (copied, per-machine)
tmux/scripts/bluetooth-menu.sh # Bluetooth popup menu
git/ # Git config, aliases, global gitignore, Delta
description
manifest
gitconfig # Linked to ~/.config/git/config
gitignore # Linked to ~/.config/git/ignore
identity # Copied to ~/.config/git/identity, per-machine
apply.sh
kde/ # KDE Plasma keyboard repeat settings
description
manifest
Expand Down Expand Up @@ -86,6 +93,15 @@ tests/ # Dockerfiles used by CI to test installs per distro
Config files are grouped into **sets** under `config/sets/<name>/`:

- **`basic`** — everything this repo has always deployed (Neovim, Fish, Tmux)
- **`git`** — aliases (`st`/`co`/`br`/`ci`/`last`/`unstage`/`amend`), sane
defaults (autoprune on fetch, `autoSetupRemote` on push, rerere, `diff3`
conflict markers), a global gitignore, and a per-machine identity file
(`~/.config/git/identity`, copied once so different machines can carry
different `user.name`/`user.email`). It also installs **Delta** and wires
it in as the diff/log pager — written to a separate, untracked
`~/.config/git/local` file rather than `git config --global`, since with
no `~/.gitconfig` yet that resolves to the tracked `~/.config/git/config`
symlink
- **`kde`** — sets the KDE Plasma keyboard repeat rate to 50/s with a 250ms
delay (via `kwriteconfig5`/`6` on `kcminputrc`)
- **`macos`** — the macOS system settings that differ from stock, applied via
Expand Down
58 changes: 58 additions & 0 deletions config/sets/git/apply.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
set -euo pipefail

# Installs Delta (a syntax-highlighting pager for git diff/show/log) and
# wires it in, mirroring config/sets/xfce/apply.sh's install_kitty. Skipped
# gracefully if this system's package manager doesn't have it (or isn't
# recognized) — the rest of the git set's aliases/config still apply either
# way, just with git's default (uncolored) pager.

# Deliberately not `git config --global`: when ~/.gitconfig doesn't exist,
# that resolves to ~/.config/git/config — the *symlink back into this repo*
# — and would silently rewrite the tracked gitconfig file instead of local,
# per-machine state. `--file` pins the write to a separate, untracked file
# that gitconfig includes; a missing include target is a silent no-op, so
# this is safe to skip entirely when delta isn't available.
GIT_LOCAL_CONFIG=~/.config/git/local

install_delta() {
command -v delta >/dev/null 2>&1 && return 0

if [ "$(uname)" == "Darwin" ]; then
command -v brew >/dev/null 2>&1 && brew install git-delta
elif [ "$(uname)" == "FreeBSD" ]; then
sudo pkg install -y git-delta
elif [ -f /etc/arch-release ]; then
sudo pacman -S --noconfirm git-delta
elif [ -f /etc/debian_version ]; then
export DEBIAN_FRONTEND=noninteractive
sudo apt update && sudo apt install -y git-delta
elif [ -f /etc/alpine-release ]; then
sudo apk add delta
elif [ -f /etc/redhat-release ]; then
sudo dnf install -y git-delta
elif [ -f /etc/gentoo-release ]; then
sudo emerge dev-util/git-delta
else
echo "Warning: don't know how to install delta on this system; install it manually." >&2
return 1
fi
}

if install_delta && command -v delta >/dev/null 2>&1; then
git config --file "$GIT_LOCAL_CONFIG" core.pager "delta"
git config --file "$GIT_LOCAL_CONFIG" interactive.diffFilter "delta --color-only"
git config --file "$GIT_LOCAL_CONFIG" delta.navigate true

# Line numbers, off by default. Also overrides delta's default
# file-style and line-numbers-{left,right}-style, both plain ANSI
# "blue" — poor contrast on a dark background (`delta --show-config`
# shows every other default style resolved to a specific RGB/256-color
# value; these two are the only ones left at a raw, unadjusted ANSI name).
git config --file "$GIT_LOCAL_CONFIG" delta.line-numbers true
git config --file "$GIT_LOCAL_CONFIG" delta.file-style "bold yellow ul"
git config --file "$GIT_LOCAL_CONFIG" delta.line-numbers-left-style "white"
git config --file "$GIT_LOCAL_CONFIG" delta.line-numbers-right-style "white"
else
echo "Warning: delta not available; leaving git's default pager in place." >&2
fi
5 changes: 5 additions & 0 deletions config/sets/git/description
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Git: aliases (st/co/br/ci/last/unstage/amend), sane defaults (autoprune on
fetch, autoSetupRemote on push, rerere, diff3 conflict markers), a global
gitignore, a per-machine identity file, plus Delta installed and wired in
as the diff/log pager with line numbers on and higher-contrast colors than
its low-contrast blue defaults
38 changes: 38 additions & 0 deletions config/sets/git/gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# ~/.config/git/identity holds per-machine user.name/user.email (deployed
# once, then left alone). ~/.config/git/local holds settings apply.sh writes
# imperatively (e.g. Delta wiring, only if it installed successfully) — it's
# not tracked by this repo, and missing either file here is a silent no-op.
[include]
path = ~/.config/git/identity
path = ~/.config/git/local

[core]
editor = nvim
excludesfile = ~/.config/git/ignore

[init]
defaultBranch = main

[color]
ui = auto

[fetch]
prune = true

[push]
autoSetupRemote = true

[merge]
conflictStyle = diff3

[rerere]
enabled = true

[alias]
st = status
co = checkout
br = branch
ci = commit
last = log -1 HEAD
unstage = reset HEAD --
amend = commit --amend --no-edit
11 changes: 11 additions & 0 deletions config/sets/git/gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# macOS
.DS_Store

# Windows
Thumbs.db
Desktop.ini

# Editor backup/swap files
*~
*.swp
*.swo
3 changes: 3 additions & 0 deletions config/sets/git/identity
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[user]
name = Rasmus Wejlgaard
email = pez@pez.sh
6 changes: 6 additions & 0 deletions config/sets/git/manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# See config/sets/basic/manifest for the full manifest format reference.

link gitconfig ~/.config/git/config
link gitignore ~/.config/git/ignore
copy identity ~/.config/git/identity
run apply.sh
Loading