Skip to content
Open
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
68 changes: 68 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# dotfiles-guid: 4e079e8c-dadd-47fc-9582-0914483981ea
# =============================================================================
# .editorconfig — cross-editor formatting baseline
# =============================================================================
# Supported by VS Code (EditorConfig extension), Vim, Neovim, Emacs, Sublime,
# WebStorm, and many others. Reference: https://editorconfig.org
# =============================================================================

# root = true

# ---- Defaults for all files ------------------------------------------------
# [*]
# charset = utf-8
# end_of_line = lf
# indent_style = space
# indent_size = 2
# trim_trailing_whitespace = true
# insert_final_newline = true

# ---- JavaScript / TypeScript -----------------------------------------------
# [*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}]
# indent_style = space
# indent_size = 2

# ---- JSON ------------------------------------------------------------------
# [*.{json,jsonc,json5}]
# indent_style = space
# indent_size = 2

# ---- YAML ------------------------------------------------------------------
# [*.{yml,yaml}]
# indent_style = space
# indent_size = 2

# ---- HTML / CSS / SCSS -----------------------------------------------------
# [*.{html,css,scss,sass,less}]
# indent_style = space
# indent_size = 2

# ---- Markdown --------------------------------------------------------------
# [*.{md,mdx}]
# trim_trailing_whitespace = false # trailing spaces are meaningful in Markdown
# indent_size = 2

# ---- Python (PEP 8 uses 4 spaces) ------------------------------------------
# [*.py]
# indent_size = 4

# ---- Go (uses tabs) --------------------------------------------------------
# [*.go]
# indent_style = tab

# ---- Rust ------------------------------------------------------------------
# [*.rs]
# indent_size = 4

# ---- Shell scripts ---------------------------------------------------------
# [*.{sh,bash,zsh}]
# indent_size = 2

# ---- Makefiles (require tabs) ----------------------------------------------
# [Makefile]
# indent_style = tab

# ---- Package lock files (auto-generated; don't reformat) ------------------
# [{package-lock.json,yarn.lock,pnpm-lock.yaml}]
# indent_size = unset
# insert_final_newline = unset
206 changes: 206 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
# dotfiles-guid: 4e079e8c-dadd-47fc-9582-0914483981ea
# =============================================================================
# ~/.gitconfig — global Git configuration
# =============================================================================
# This file is managed by dotfiles. Machine-specific overrides go in
# ~/.gitconfig.local (included at the bottom of this file).
#
# Run `git config --list --show-origin` to see the current resolved config.
# =============================================================================

[user]
# Set your name and email here — or override in ~/.gitconfig.local
# name = Your Name
# email = you@example.com

# GPG signing (uncomment after setting up a key)
# signingkey = <your-key-id>

[core]
# Sensible cross-platform line ending handling
# autocrlf = input # convert CRLF → LF on commit; leave LF alone
# safecrlf = warn
# whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol

# Faster status/diff on large repos
# fsmonitor = true
# untrackedCache = true

# Pager — plain less by default; delta below is much nicer
# pager = less -FRX

# Editor for commit messages
# editor = code --wait

# Global gitignore (path below is set by install.sh)
# excludesfile = ~/.gitignore_global

# Avoid "dubious ownership" warnings when repo owner ≠ current user
# trustctime = false

[init]
# defaultBranch = main

[pull]
# rebase = false # merge by default; change to `true` or `ff-only` if preferred

[push]
# default = current # push current branch to same-name remote branch
# autoSetupRemote = true # automatically set upstream on first push

[fetch]
# prune = true # remove remote-tracking branches that no longer exist

[merge]
# tool = vscode
# conflictstyle = zdiff3 # shows the common ancestor in conflict markers

# [mergetool "vscode"]
# cmd = code --wait $MERGED

[diff]
# tool = vscode
# algorithm = histogram # better diff for moved code
# colorMoved = default

# [difftool "vscode"]
# cmd = code --wait --diff $LOCAL $REMOTE

[rebase]
# autosquash = true # automatically apply fixup!/squash! prefixes
# autostash = true # stash/pop dirty working tree around rebase
# updateRefs = true # update intermediate refs when rebasing a stack

[branch]
# sort = -committerdate # show most recently committed branches first

[tag]
# sort = -version:refname # sort tags by version descending

[status]
# showUntrackedFiles = all # show individual files in untracked dirs

[log]
# date = relative

[color]
# ui = auto
# branch = auto
# diff = auto
# status = auto

# [color "branch"]
# current = yellow bold
# local = green bold
# remote = cyan bold

# [color "diff"]
# meta = yellow bold
# frag = magenta bold
# old = red bold
# new = green bold
# whitespace = red reverse

# [color "status"]
# added = green bold
# changed = yellow bold
# untracked = red bold

[credential]
# helper = osxkeychain # macOS; change to `manager` on Windows, `store` on Linux

# =============================================================================
# ALIASES — git shortcuts
# =============================================================================

[alias]
# Basics
s = status -sb
a = add
aa = add --all
c = commit
cm = commit -m
ca = commit --amend
can = commit --amend --no-edit

# Branches
co = checkout
sw = switch
swc = switch -c # create and switch
b = branch
ba = branch -a
bd = branch -d

# Stash
st = stash
stp = stash pop
stl = stash list

# Diff / log
d = diff
ds = diff --staged
dc = diff --cached
lg = log --oneline --graph --decorate --all
lgg = log --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset'
last = log -1 HEAD --stat

# Remote
p = push
pf = push --force-with-lease
pu = pull
f = fetch --all --prune

# Convenience
unstage = restore --staged
discard = restore
aliases = config --get-regexp alias
ignored = ls-files --others --ignored --exclude-standard
root = rev-parse --show-toplevel

# Find the commit that introduced a string
find = log -S
# List contributors by commit count
contributors = shortlog -sn --no-merges

# Undo last commit (keep changes staged)
uncommit = reset --soft HEAD~1

# Create a throwaway "wip" commit
wip = "!git add -A && git commit -m 'WIP'"
unwip = "!git log -n 1 | grep -q -c WIP && git reset HEAD~1"


# =============================================================================
# DELTA — a better diff pager (https://github.com/dandavison/delta)
# =============================================================================
# Install: brew install git-delta
# Uncomment the block below to enable it.
#
# [core]
# pager = delta
#
# [interactive]
# diffFilter = delta --color-only
#
# [delta]
# navigate = true # n/N to move between diff sections
# side-by-side = true
# line-numbers = true
# syntax-theme = Dracula
#
# [merge]
# conflictstyle = zdiff3


# =============================================================================
# GITHUB CLI / gh — https://cli.github.com
# =============================================================================
# [url "git@github.com:"]
# insteadOf = https://github.com/ # use SSH for GitHub repos


# =============================================================================
# LOCAL OVERRIDES — user.name, user.email, work configs, etc.
# =============================================================================
[include]
path = ~/.gitconfig.local
Loading