Add Readme.md and CLAUDE.md, remove some cruft
This commit is contained in:
parent
6924181dcd
commit
1d13655c5e
5 changed files with 182 additions and 42 deletions
109
CLAUDE.md
Normal file
109
CLAUDE.md
Normal file
|
|
@ -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 <device> <process>` - Find process PID on device
|
||||||
|
- `devicekill <device> <process>` - Kill process on device
|
||||||
|
- `respring <device>` - Restart SpringBoard
|
||||||
|
- `devicereboot <device>` - 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.
|
||||||
72
Readme.md
Normal file
72
Readme.md
Normal file
|
|
@ -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
|
||||||
2
init.sh
2
init.sh
|
|
@ -26,7 +26,7 @@ link_config() {
|
||||||
cd "$CONFIG_PATH"
|
cd "$CONFIG_PATH"
|
||||||
|
|
||||||
for FILE in *; do
|
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"
|
link_config "${CONFIG_PATH}/$FILE"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
1
zshrc
1
zshrc
|
|
@ -217,7 +217,6 @@ alias mv='nocorrect mv' # don't correct spelling for 'mv'
|
||||||
alias u='cd ..'
|
alias u='cd ..'
|
||||||
alias uu='cd ../..'
|
alias uu='cd ../..'
|
||||||
alias uuu='cd ../../..'
|
alias uuu='cd ../../..'
|
||||||
alias uuuu='cd ../../../..'
|
|
||||||
alias myip='curl -4 icanhazip.com'
|
alias myip='curl -4 icanhazip.com'
|
||||||
|
|
||||||
alias be='bundle exec'
|
alias be='bundle exec'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue