From 1d13655c5ed5ac0db5cbfc2cb99ae81eb2c68961 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Fri, 6 Jun 2025 09:05:43 -0700 Subject: [PATCH] Add Readme.md and CLAUDE.md, remove some cruft --- CLAUDE.md | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++ Readme.md | 72 +++++++++++++++++++++++++++++++++ init.sh | 2 +- tm_properties | 40 ------------------ zshrc | 1 - 5 files changed, 182 insertions(+), 42 deletions(-) create mode 100644 CLAUDE.md create mode 100644 Readme.md delete mode 100644 tm_properties diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..ed1f5f6 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,109 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Repository Overview + +This is a personal dotfiles configuration repository containing shell configurations, editor settings, git configuration, and development tools setup for macOS and Unix systems. + +## Setup and Installation + +The main setup script is `init.sh`. Run it to symlink configuration files to their proper locations: + +```bash +./init.sh +``` + +This script: +- Creates symlinks from files in this repo to `~/.filename` +- Backs up existing dotfiles to `~/original-dot-files/` +- Excludes certain files (init.sh, Gemfile, Gemfile.lock, zsh/, Brewfile) + +## Package Management + +Install development tools and applications using Homebrew: + +```bash +brew bundle install +``` + +The `Brewfile` contains essential development tools like: +- CLI tools: gh, jq, ripgrep, terraform, awscli +- Development environments: rbenv, direnv +- Utilities: diff-so-fancy, parallel, llm + +## Shell Configuration + +The zsh configuration is modular and located in: +- Main config: `zshrc` +- Functions: `zsh/functions/` +- Completions: `zsh/completions/` +- Device control utilities: `zsh/devicectl.sh` + +Key features: +- Custom prompt with git integration (`prompt sjs`) +- Extensive git aliases (a, c, co, d, s, etc.) +- Smart directory navigation with auto-cd +- History management with 2M line buffer +- Ruby/rbenv and Python/pyenv integration +- iOS device control functions via `devicectl.sh` + +Notable aliases: +- `cc` = `claude --dangerously-skip-permissions` (Claude Code) +- `be` = `bundle exec` +- `doc` = `docker-compose` + +## Editor Configurations + +### Emacs (`emacs` file) +- Comprehensive Emacs configuration with language-specific modes +- Custom key bindings optimized for macOS +- Support for Ruby, JavaScript, Python, C, Haskell, Lisp +- TextMate-style project navigation +- Custom themes and visual settings + +### Vim (`vimrc` file) +- Dark theme with syntax highlighting +- 4-space indentation with smart tabbing +- Folding support with marker-based folds +- Language-specific auto-commands for C, Python, PHP, etc. +- Custom key mappings for buffer navigation + +## Git Configuration + +The `gitconfig` contains: +- Signed commits with SSH keys +- Enhanced diff output with `diff-so-fancy` +- Automatic rebase and fast-forward-only pulls +- Advanced merge and diff algorithms +- Pre-commit hook that runs `git diff --check` + +## iOS Development Tools + +The `zsh/devicectl.sh` provides functions for iOS device management: +- `devicepid ` - Find process PID on device +- `devicekill ` - Kill process on device +- `respring ` - Restart SpringBoard +- `devicereboot ` - Reboot device + +## File Structure + +Key configuration mappings: +- `zshrc` → `~/.zshrc` +- `vimrc` → `~/.vimrc` +- `emacs` → `~/.emacs` +- `gitconfig` → `~/.gitconfig` +- `gitignore` → `~/.gitignore` (global) +- `irbrc` → `~/.irbrc` +- `gemrc` → `~/.gemrc` +- `ackrc` → `~/.ackrc` + +## Development Workflow + +When making changes: +1. Edit files directly in this repository +2. Test changes by sourcing or reloading configs +3. Commit changes with descriptive messages +4. The pre-commit hook will check for whitespace issues + +The configuration supports both macOS and Linux environments with platform-specific adaptations throughout the shell and editor configs. \ No newline at end of file diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..d25e8d5 --- /dev/null +++ b/Readme.md @@ -0,0 +1,72 @@ +# sjs's config (dotfiles) + +These are my personal *nix config files, hand-crafted since around 2004 when I started by pilfering everything I could find on mailing lists and blogs. They work great on both Linux and macOS, with more server-ish stuff on the Linux side and desktop-ish stuff on the macOS side. + +After zsh (big time zsh hipster) this is the first thing I set up in my shell environment on a new machine, along with [~/bin](https://github.com/samsonjs/bin). + +## what've we got here? + +- **zsh**: custom prompt with git integration, extensive aliases, lots of nitpicky tweaks like subword navigation excluding / for easy subpath traversal +- **$EDITOR**: vim and emacs configs, though the emacs one is fairly dated +- **git**: enhanced diffing, signed commits, pre-commit hooks +- **ruby**: rbenv integration, IRB customizations +- **screen**: yep I'm old, no tmux here +- **iOS simulator stuff**: [device control utilities](https://gist.github.com/insidegui/b570ec998b9e2aeb730f4e142f0593d1) via `devicectl.sh` (from Gui Rambo) + +## setup + +All files in this repo are symlinked to `~/.filename`. Any existing files are backed up to `~/original-dot-files/` before linking so you won't lose anything, though it is up to you to merge the changes if you care. + +```zsh +# symlink all the files in this directory +# (excluding init.sh, Brewfile, and zsh directory) +./init.sh +``` + +There's also a Brewfile with stuff that I usually want for general shell usability, along with ruby and iOS dev. I don't recommend using this without customizing it. + +```zsh +brew bundle install +``` + +## git aliases + +These short aliases make git really easy to use in your shell: + +**Making changes:** +- `a` - `git add` +- `c` - `git commit` +- `chp` - `git cherry-pick` +- `co` - `git checkout` +- `b` - `git branch` +- `m` - `git merge` +- `f` - `git fetch` +- `t` - `git tag` + +**Viewing changes:** +- `d` - `git diff` (working tree changes) +- `dc` - `git diff --cached` (staged changes) +- `ds` - `git diff --stat` (summary) +- `s` - `git status -sb` (short status) + +**Commit log:** +- `gl` - Fancy graph log with colors and relative dates +- `glo` - `git log --oneline --decorate` +- `gls` - `git log --stat` + +**Stashing:** +- `st` - `git stash` +- `stl` - `git stash list` +- `stp` - `git stash pop` + +**Custom scripts:** +See [~/bin](https://github.com/samsonjs/bin) for these ones. +- `rmb` - `git remove-merged-branches` (custom command) +- `gup` - `git update` (custom command) + +## other aliases + +- `be` - Bundle exec +- `doc` - docker-compose +- `u/uu/uuu` - Navigate up 1-3 directories +- `myip` - Get your public IP using icanhazip diff --git a/init.sh b/init.sh index d78eadc..c8fdb3b 100755 --- a/init.sh +++ b/init.sh @@ -26,7 +26,7 @@ link_config() { cd "$CONFIG_PATH" for FILE in *; do - if [ "$FILE" != "init.sh" ] && [ "$FILE" != "Gemfile" ] && [ "$FILE" != "Gemfile.lock" ] && [ "$FILE" != "zsh" ] && [ "$FILE" != "Brewfile" ]; then + if [ "$FILE" != "init.sh" ] && [ "$FILE" != "zsh" ] && [ "$FILE" != "Brewfile" ]; then link_config "${CONFIG_PATH}/$FILE" fi done diff --git a/tm_properties b/tm_properties deleted file mode 100644 index b1c890f..0000000 --- a/tm_properties +++ /dev/null @@ -1,40 +0,0 @@ -fontName = "Menlo" -fontSize = 12 -tabSize = 4 -softTabs = true -wrapColumn = "Use Window Frame" -spellChecking = false -showInvisibles = false -windowTitle = "$TM_DISPLAYNAME — ${TM_DIRECTORY/.*\///} — $windowTitleSCM" -exclude = "{$exclude,*.zip}" -include = "{$include,.gitignore,.tm_properties}" - -[ Makefile ] -softTabs = false -tabSize = 8 - -[ text ] -softWrap = false -wrapColumn = 80 -softTabs = true -tabSize = 4 -spellChecking = false - -[ text.html.markdown ] -softWrap = true -wrapColumn = "Use Window Frame" -softTabs = true -tabSize = 4 - -[ text.plain ] -softWrap = true -wrapColumn = "Use Window Frame" -softTabs = true -tabSize = 4 - -[ source ] -softWrap = false -wrapColumn = "Use Window Frame" -softTabs = true -tabSize = 4 -spellChecking = false diff --git a/zshrc b/zshrc index e7b178a..af23bb6 100755 --- a/zshrc +++ b/zshrc @@ -217,7 +217,6 @@ alias mv='nocorrect mv' # don't correct spelling for 'mv' alias u='cd ..' alias uu='cd ../..' alias uuu='cd ../../..' -alias uuuu='cd ../../../..' alias myip='curl -4 icanhazip.com' alias be='bundle exec'