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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dot-config/vim/view/
247 changes: 247 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
# Dotfiles Migration Checklist — Linux to macOS

Tick the features you want to keep. Unticked items will **not** be ported.

---

## Bash — Shell Options & Behavior

- [x] Case-insensitive globbing (`nocaseglob`)
- [x] Append to history instead of overwriting (`histappend`)
- [x] Autocorrect typos in `cd` paths (`cdspell`)
- [x] `autocd` — type a directory name to `cd` into it
- [x] `globstar` — recursive globbing (`**/*.txt`)
- [x] `checkwinsize` — update terminal size after each command

## Bash — History

- [x] Unlimited history (`HISTSIZE=-1`)
- [x] Ignore duplicates and commands starting with space (`ignorespace:erasedups`)
- [x] Ignore common commands (`ls`, `cd`, `pwd`, `exit`, etc.)
- [x] Timestamps in history (`HISTTIMEFORMAT`)

## Bash — Prompt

- [x] Pure prompt theme (multiline, git branch, dirty/clean indicator, colored exit status)

## Bash — SSH

- [x] SSH hostname tab-completion from `~/.ssh/config`
- [x] Auto-start ssh-agent (NOTE: macOS has its own keychain agent — may not be needed)

## Bash — GPG

- [x] GPG-agent auto-start and TTY setup
- [x] GPG-agent as SSH agent (NOTE: macOS-specific paths needed)
- [x] GPG commit signing (git config)

## Bash — Inputrc (Readline)

- [x] Case-insensitive tab completion
- [x] Colored completion suggestions
- [x] Show-all-if-ambiguous (faster completion)
- [x] Up/Down arrow history search (search by prefix)
- [x] `Esc-s` to prefix command with `sudo`
- [x] `Esc-m` to open man page for command
- [x] Bracketed paste mode

## Bash — Aliases: Navigation

- [x] `..`, `...`, `....`, `.....` — quick parent directory navigation
- [x] `-` — go to previous directory
- [x] `dl` — cd to Downloads

## Bash — Aliases: Shortcuts

- [ ] `g` → `git`
- [ ] `h` → `history`
- [ ] `vi` → `vim`
- [x] `gs` → `git status -s`
- [x] `gl` → `git log (short)`
- [x] `k` → `kubectl`

## Bash — Aliases: File Operations

- [x] `rm` → `rm -i` (confirm before delete)
- [x] `cp` → `cp -i` (confirm before overwrite)
- [x] `mv` → `mv -i` (confirm before overwrite)
- [x] `untar` → `tar xvf`

## Bash — Aliases: Listing

- [x] `l` — long list with colors
- [x] `la` — long list including hidden files
- [x] `lsd` — list only directories
- [x] Colorized `grep`, `fgrep`, `egrep`

## Bash — Aliases: Network

- [x] `pubip` — show public IP via DNS lookup
- [ ] `localip` — show local IP address (NOTE: needs macOS adaptation)
- [ ] `sniff` — HTTP traffic sniffer via ngrep
- [ ] `httpdump` — HTTP traffic dump via tcpdump

## Bash — Aliases: Clipboard

- [x] `c` — trim newlines and copy to clipboard (NOTE: `wl-copy` → `pbcopy`)
- [x] `cwd` — copy working directory to clipboard
- [x] `pubkey` — copy public SSH key to clipboard
- [x] `prikey` — copy private SSH key to clipboard

## Bash — Aliases: System

- [x] `sudo` — enable aliases to be sudo'ed
- [ ] `week` — show current week number
- [ ] `timer` — simple stopwatch
- [x] `hosts` — edit /etc/hosts with vim
- [x] `afk` — lock screen (NOTE: `slock` → macOS lock command)
- [ ] `psc` — detailed process listing with cgroups
- [ ] `map` → `xargs -n1`

## Bash — Aliases: Misc

- [ ] `hd` — hex dump fallback
- [ ] `md5sum` / `sha1sum` — macOS fallbacks
- [ ] `urlencode` — URL-encode strings (NOTE: uses python2, needs update)

## Bash — Aliases: Package Manager (Linux-specific)

- [ ] `pac-search` — fzf-powered pacman search (NOTE: irrelevant on macOS, could adapt for brew)
- [ ] `pac-remove` — fzf-powered pacman remove (NOTE: irrelevant on macOS, could adapt for brew)

## Bash — Functions: File/Directory

- [x] `mkd` — create directory and cd into it
- [x] `tmpd` — create temp directory and cd into it
- [x] `targz` — create .tar.gz with best available compressor
- [x] `fs` — show file/directory sizes sorted
- [ ] `gz` — compare original vs gzipped size
- [x] `tre` — enhanced tree with colors, ignoring .git
- [ ] `v` — open vim (current dir if no args)
- [ ] `o` — open file/dir (NOTE: `xdg-open` → `open` on macOS)

## Bash — Functions: Git

- [x] `gdiff` — colored git diff for non-repo files
- [x] `repo` — open current repo in browser (NOTE: `xdg-open` → `open`)

## Bash — Functions: Network/Web

- [x] `digga` — enhanced DNS lookup
- [x] `getcertnames` — extract SSL certificate names from a domain
- [x] `isup` — check if a URL is online (NOTE: `notify-send` → `osascript`)
- [ ] `dataurl` — create base64 data URL from a file
- [ ] `gitio` — create git.io short URL (NOTE: git.io is discontinued)

## Bash — Functions: Unicode

- [ ] `escape` — UTF-8 encode a string
- [ ] `unidecode` — decode unicode escape sequences
- [ ] `codepoint` — get unicode code point of a character

## Bash — Functions: Calculator

- [x] `calc` — command-line calculator using bc

## Bash — Functions: Go Development

- [ ] `gostatic` — build Go static binary
- [ ] `gogo` — navigate to Go project in GOPATH
- [ ] `golistdeps` — list Go project dependencies

## Bash — Functions: D-Bus (Linux-specific)

- [ ] `dbs` — D-Bus session info (NOTE: does not exist on macOS)

## Bash — Functions: Pet Snippets

- [ ] `prev` — add previous command to pet snippet manager
- [ ] `pet-select` — search pet snippets (NOTE: requires `pet` tool)

## Bash — Functions: Docker

- [ ] `dcleanup` — remove stopped containers, dangling images
- [ ] `del_stopped` — remove a specific stopped container
- [ ] `relies_on` — ensure dependency containers are running
- [ ] Container wrappers (audacity, chrome, firefox, etc.) (NOTE: most are Linux/X11-specific)

## Bash — Autocompletion

- [x] Git completion
- [x] kubectl completion
- [x] fzf key-bindings and completion
- [ ] lxc completion
- [ ] flux completion

## Bash — Exports/Environment

- [x] `EDITOR=vim`
- [x] Colored man pages (LESS_TERMCAP variables)
- [x] `MANPAGER`, `LESS`, `LESSOPEN` config
- [x] `TODOTXT_DEFAULT_ACTION=ls`

## Bash — PATH

- [ ] Go paths (`GOPATH`, `GOBIN`)
- [ ] `~/.local/bin`
- [ ] Krew (kubectl plugin manager)

---

## Git

- [x] All aliases (l, s, d, di, p, pr, c, ca, go, graph, tags, branches, remotes, amend, credit, reb, fb, ft, fc, fm, dm, contributors, lg, mdiff, unreleased, up, undo, top, alias, squash, ignored, patchit)
- [x] Whitespace fix on apply
- [x] GPG commit signing
- [x] diff-so-fancy as pager (NOTE: needs `brew install diff-so-fancy`)
- [x] Custom excludesfile and attributesfile
- [x] Whitespace error detection
- [x] Auto-correct mistyped commands (`help.autocorrect = 1`)
- [x] SSH push instead of HTTPS for GitHub
- [x] Default branch = main
- [x] Color scheme (branch, diff, status)

---

## Vim

- [x] Core settings (autoindent, smart tabs, search highlighting, etc.)
- [x] Space as leader key
- [x] `jk` to escape insert mode
- [x] `;` mapped to `:` (skip shift for commands)
- [x] `j`/`k` navigate visual lines
- [x] `F2` paste toggle
- [x] `w!!` — sudo save
- [x] Tab key for bracket matching
- [x] Quick vimrc edit/reload (`<leader>ev`, `<leader>sv`)
- [x] Persistent undo across sessions
- [x] Backup and swap file configuration
- [x] Cursor line highlighting

---

## macOS-specific (NEW — from today's setup)

- [x] AeroSpace tiling window manager config
- [x] SketchyBar status bar config
- [x] JankyBorders window borders config
- [x] Ghostty terminal config
- [x] App launcher (choose-gui) scripts
- [x] Bitwarden integration script
- [x] GitHub integration script
- [x] Modifier switch script
- [x] Wallpaper

---

## Install Script (NEW)

The install script should handle:
- [x] Homebrew installation
- [x] Brew packages: aerospace, sketchybar, borders, ghostty, choose-gui, maccy, diff-so-fancy, vim, git, bash (newer version), fzf, tree, jq
- [x] Brew cask apps: maccy
- [x] JetBrainsMono Nerd Font installation
- [x] GNU Stow installation and linking
- [x] Bash as default shell (Homebrew bash, not macOS default)
- [x] Create vim backup/undo/swap directories
- [x] Start services (sketchybar, aerospace)
3 changes: 3 additions & 0 deletions dot-bash_profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
# macOS opens login shells by default. Source .bashrc for all config.
[[ -r ~/.bashrc ]] && source ~/.bashrc
51 changes: 17 additions & 34 deletions dot-bashrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
#!/bin/bash
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# macOS adaptation of Linux dotfiles

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

# reset text properties
# see https://wiki.archlinux.org/index.php/Bash/Prompt_customization#Escapes_between_command_input_and_output
#trap 'tput sgr0' DEBUG

# Case-insensitive globbing (used in pathname expansion)
shopt -s nocaseglob

Expand Down Expand Up @@ -38,32 +33,21 @@ shopt -s checkwinsize
grep -v "[?*]" | cut -d " " -f2 | \
tr ' ' '\n')" scp sftp ssh

# start the agent automatically and make sure that only one ssh-agent process runs at a time
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
ssh-agent -t 1h > "$XDG_RUNTIME_DIR/ssh-agent.env"
fi
if [[ ! -f "$SSH_AUTH_SOCK" ]]; then
source "$XDG_RUNTIME_DIR/ssh-agent.env" >/dev/null
# ssh-agent: use macOS Keychain via ssh-add
# On macOS, ssh-agent is managed by launchd. Just ensure keys are added.
if [[ -z "$SSH_AUTH_SOCK" ]]; then
# Fallback: if SSH_AUTH_SOCK is somehow not set by launchd
export SSH_AUTH_SOCK="$HOME/.gnupg/S.gpg-agent.ssh"
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [[ -f /usr/share/bash-completion/bash_completion ]]; then
# shellcheck source=/dev/null
. /usr/share/bash-completion/bash_completion
elif [[ -f /etc/bash_completion ]]; then
# shellcheck source=/dev/null
. /etc/bash_completion
fi
fi

if [[ -d /etc/bash_completion.d ]]; then
for file in /etc/bash_completion.d/* ; do
# shellcheck source=/dev/null
source "$file"
done
# enable programmable completion features
# Use Homebrew's bash-completion if available
if [[ -r "/opt/homebrew/etc/profile.d/bash_completion.sh" ]]; then
# shellcheck source=/dev/null
. "/opt/homebrew/etc/profile.d/bash_completion.sh"
elif [[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]]; then
# shellcheck source=/dev/null
. "/usr/local/etc/profile.d/bash_completion.sh"
fi

# use a tty for gpg
Expand All @@ -76,10 +60,10 @@ if ! pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1; then
gpg-connect-agent updatestartuptty /bye >/dev/null
fi

# Set SSH to use gpg-agent
# Set SSH to use gpg-agent (macOS path)
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
export SSH_AUTH_SOCK="$HOME/.gnupg/S.gpg-agent.ssh"
fi

# add alias for ssh to update the tty
Expand All @@ -89,8 +73,7 @@ alias ssh="gpg-connect-agent updatestartuptty /bye >/dev/null; ssh"
source ~/.config/bash/pure.sh

# Load the shell dotfiles
#for file in ~/.{aliases,functions,dockerfunc,path,exports}; do
for file in ~/.config/bash/{aliases,autocompletion,functions,exports}; do
for file in ~/.config/bash/{path,aliases,autocompletion,functions,exports}; do
if [[ -r "$file" ]] && [[ -f "$file" ]]; then
# shellcheck source=/dev/null
source "$file"
Expand Down
Loading