···1212editor = vim
13131414# Store history in an xdg dir instead of ~
1515-hist_file = $XDG_DATA_HOME/bpythonhistory
1515+# Environment variables don't seem to work
1616+hist_file = ~/.local/share/bpythonhistory
161717181819[keyboard]
+2-4
.config/brew/Brewfile
···22# Homebrew-provided taps
33# ==============================================================================
44tap "homebrew/cask-fonts"
55-55+tap "homebrew/command-not-found"
6677# ==============================================================================
88# Third-party/custom taps
99# ==============================================================================
1010tap "rcmdnk/file"
1111tap "superatomic/bundle-extensions", "git@github.com:ian-h-chamberlain/homebrew-bundle-extensions"
1212-13121413# ==============================================================================
1514# Device-specific brewfiles
···1817# It would be nicer to use __dir__ here, but seems that this file is sometimes
1918# `evalged which leaves __dir__ as an empty string. So we just hardcode the path.
2019Dir.glob(File.join(Dir.home, ".config", "brew", "*.Brewfile")) do |brewfile|
2121- puts "Loading #{brewfile}..."
2020+ STDERR.puts "Loading #{brewfile}..."
2221 instance_eval File.read(brewfile)
2322end
2424-25232624# ==============================================================================
2725# Formulae/Casks
+90
.config/fish/completions/brew.fish
···11+set -l vendor_completions (brew --prefix)/share/fish/vendor_completions.d/brew.fish
22+if test -f $vendor_completions
33+ source $vendor_completions
44+end
55+66+# Overrides to make flag suggestions faster.
77+# TODO: maybe upstream this or something equivalent?
88+# It's a way better user experience and probably applies everywhere
99+for brew_suggest in (functions -a | string split ',' | string match '__fish_brew_suggest_*')
1010+ functions -c "$brew_suggest" "__orig$brew_suggest"
1111+ # Use `source` here to "inline" the $brew_suggest variable into the function definition
1212+ echo "function $brew_suggest
1313+ if commandline -t | string match -q -- '-*'
1414+ # If the cursor is in the middle of a flag, return immediately
1515+ return
1616+ else
1717+ # Otherwise, call the original function
1818+ __orig$brew_suggest \$argv
1919+ end
2020+ end" | source
2121+end
2222+2323+# For upstream could probably do something cleaner like this:
2424+# function __fish_brew_complete_arg -a cond -d "A shortcut for defining arguments completion for brew commands"
2525+# if contains -- -a $argv; or contains -- --arguments $argv
2626+# # There's no need to run -a completions if we're mid-flag
2727+# set cond "$cond; and commandline -pt | string match -vq -- -\*"
2828+# end
2929+# __orig_fish_brew_complete_arg $cond $argv[2..]
3030+# end
3131+3232+3333+# Custom completions for superatomic/bundle-extensions
3434+__fish_brew_complete_cmd add "Add one or more formulae and/or casks to a Brewfile"
3535+__fish_brew_complete_cmd drop "Drop one or more formulae and/or casks from a Brewfile"
3636+3737+__fish_brew_complete_arg add -s v -l verbose -d "Make some output more verbose"
3838+__fish_brew_complete_arg drop -s v -l verbose -d "Make some output more verbose"
3939+4040+# __fish_brew_complete_arg uses -f so we can't use it with -F
4141+function __fish_brew_complete_file_arg -a cond -d "A shortcut for defining file argument completion for brew commands"
4242+ set -e argv[1]
4343+ # NOTE: $cond can be just a name of a command (or several) or additionally any other condition
4444+ complete -r -F -c brew -n "__fish_brew_command $cond" $argv
4545+end
4646+4747+for cmd in add drop
4848+ __fish_brew_complete_arg $cmd -s g -l global -d "Read the Brewfile from ~/.Brewfile"
4949+ __fish_brew_complete_arg $cmd -l formula -l formulae -d "Treat all named arguments as formulae"
5050+ __fish_brew_complete_arg $cmd -l cask -l casks -d "Treat all named arguments as casks"
5151+ __fish_brew_complete_arg $cmd -s d -l debug -d "Display any debugging information"
5252+ __fish_brew_complete_arg $cmd -s q -l quiet -d "Make some output more quiet"
5353+ __fish_brew_complete_arg $cmd -s v -l verbose -d "Make some output more verbose"
5454+ __fish_brew_complete_arg $cmd -s h -l help -d "Show help message"
5555+5656+ __fish_brew_complete_file_arg $cmd -l file -d "Read the Brewfile from this location"
5757+end
5858+5959+__fish_brew_complete_arg add -l describe -d "Add a descriptive comment above each line"
6060+# Stolen from
6161+__fish_brew_complete_arg 'add; and not __fish_seen_argument -l cask -l casks' -a '(__fish_brew_suggest_formulae_all)'
6262+__fish_brew_complete_arg 'add; and not __fish_seen_argument -l formula -l formulae' -a '(__fish_brew_suggest_casks_all)'
6363+6464+function __fish_brew_suggest_bundle -d 'List formulae/casks present in the given Brewfile'
6565+ set bundle_args
6666+6767+ set current_args (commandline --current-process --tokenize --cut-at-cursor)
6868+ argparse --ignore-unknown file= -- $current_args
6969+ if set -q _flag_file
7070+ set -a bundle_args --file="$_flag_file"
7171+ end
7272+7373+ for flag in --global/-g --cask/--casks --formula/--formulae
7474+ set passthrough (string split '/' -- $flag)
7575+ if __fish_brew_opt >/dev/null $passthrough
7676+ set -a bundle_args $passthrough[1]
7777+ end
7878+ end
7979+8080+ if not __fish_brew_opt --formula --formulae --cask --casks >/dev/null
8181+ # The default `bundle list` only does formula but we want to do both
8282+ set -a bundle_args --cask --formula
8383+ end
8484+8585+ # TODO: If we know the file, it might be faster to actually just do a simple
8686+ # grep rather than invoking `brew bundle list`. These completions take a
8787+ brew bundle $bundle_args list 2>/dev/null
8888+end
8989+9090+__fish_brew_complete_arg drop -a '(__fish_brew_suggest_bundle)'
+7
.config/fish/conf.d/25-brew.fish
···1414 end
1515end
16161717+# For some reason using (brew --repository) here is _VERY_ slow so we just use
1818+# the environment that `brew shellenv` should have just given us in the step above
1919+set -l HB_CNF_HANDLER "$HOMEBREW_REPOSITORY/Library/Taps/homebrew/homebrew-command-not-found/handler.fish"
2020+if test -f $HB_CNF_HANDLER
2121+ source $HB_CNF_HANDLER
2222+end
2323+1724# This lets us use `brew bundle add --global` for cross-system packages
1825# and `brew bundle add` for system-specific packages.
1926set -gx HOMEBREW_BUNDLE_FILE_GLOBAL ~/.config/brew/Brewfile
+2-3
.config/fish/conf.d/50-config.fish
···8181 /usr/local/sbin \
8282 /opt/homebrew/bin
83838484-test -e {$HOME}/.iterm2_shell_integration.fish; and source {$HOME}/.iterm2_shell_integration.fish
8585-8684if status is-interactive; and test -f .nvmrc; and functions -q nvm
8785 nvm use --silent
8886end
···9088if string match -q "$TERM_PROGRAM" vscode
9189 and command -q code
9290 and test -z "$REMOTE_CONTAINERS"
9393- source (code --locate-shell-integration-path fish)
9191+ and test -f "$vscode_shell_integration"
9292+ source (code --locate-shell-integration-path fish)
9493end
95949695# Used to ensure Docker cache hits on dev VM
+1-1
.config/fish/functions/brew.fish
···22 # Force system python, for brew-file. This might break on linuxbrew ?
33 set -x PYENV_VERSION system
4455- if command -q rtx
55+ if string match --quiet '*rtx*' "$PATH"; and command -q rtx
66 rtx env python@system | sed s/-gx/-x/g | source
77 end
88
+4-12
.config/fish/functions/dsh.fish
···11function dsh
22- set -l dlib "tools/dlib.sh"
22+ set -l denv (gbase)/tools/denv
3344- if ! test -f "$dlib"
55- echo "'"(pwd)"/$dlib' does not exist!"
44+ if not test -f "$denv"
55+ echo "'$denv' does not exist!"
66 return 1
77 end
88···1111 return 1
1212 end
13131414- DOCKER_BUILDKIT=0 bash -c '
1515- set -o nounset
1616-1717- source tools/dlib.sh
1818- dlib_args="$(dlib_parse_args $@)"
1919- shift $?
2020-2121- dlib_workflow $dlib_args -- "/bin/bash --rcfile /etc/bashrc --rcfile ~/.bashrc"
2222- ' -- $argv
1414+ DOCKER_BUILDKIT=0 $denv "/bin/bash --rcfile /etc/bashrc --rcfile ~/.bashrc" -- $argv
2315end
+20-3
.config/fish/functions/fish_prompt.fish
···1515 set -g __fish_prompt_cwd (set_color cyan)
1616 end
17171818- set -g __fish_git_prompt_color bryellow --background normal --italics
1919-2018 set color_chars 0
21192220 set -g magenta (set_color magenta)
···5452 set remaining_char_count 0
5553 end
56545555+ set -g __fish_git_prompt_showdirtystate true
5656+ set -g __fish_git_prompt_showuntrackedfiles true
5757+ set -g __fish_git_prompt_showcolorhints true
5858+ set -g __fish_git_prompt_use_informative_chars true
5959+6060+ set -g __fish_git_prompt_describe_style contains
6161+ set -g __fish_git_prompt_showupstream auto
6262+6363+ set -l default_color bryellow -i -b normal
6464+ set -g __fish_git_prompt_color $default_color
6565+ set -g __fish_git_prompt_color_branch $default_color
6666+ set -g __fish_git_prompt_color_branch_detached brblack
6767+6868+ # Partial workaround for https://github.com/fish-shell/fish-shell/issues/10175
6969+ # This ends up with two separators sometimes but better than nothing I guess
7070+ set -g __fish_git_prompt_char_upstream_prefix (set_color $default_color)'|'(set_color green)
7171+ # Once fixed:
7272+ # set -g __fish_git_prompt_color_upstream green
7373+5774 set -g __fish_git_prompt_shorten_branch_len $remaining_char_count
58755976 set -l vcs_prompt (__fish_vcs_prompt)
···6279 end
63806481 set -l symbol '§'
6565- if test (id -u) -eq 0
8282+ if test (id -u) -eq 0
6683 set symbol '♯'
6784 end
6885
···1414cask "discord"
1515# VPN client for secure internet access and private browsing
1616cask "nordvpn"
1717+# Instant messaging application focusing on security
1818+cask "signal"
1719# Video game digital distribution service
1820cask "steam"
1921# Main codebase
···11+# ==============================================================================
22+# Taps
33+# ==============================================================================
44+tap "archgpt/tap"
55+tap "d12frosted/emacs-plus"
66+17# ==============================================================================
28# Formulae
39# ==============================================================================
···612brew "pinentry-mac"
713# Mac App Store command-line interface
814brew "mas"
1515+# TODO: this might also work on Linux but I need to check
1616+# GNU Emacs text editor
1717+brew "d12frosted/emacs-plus/emacs-plus@29"
9181019# ==============================================================================
1120# App store apps
···22312332# Application uninstaller
2433cask "appcleaner"
3434+# HTTP & GraphQL Client. FOSS Fork of Insomnia. 100%-Local, no user login, etc
3535+cask "archgpt/tap/insomnium"
2536# Tool to customize input devices and automate computer systems
2637cask "bettertouchtool"
2727-# Text editor
2828-cask "emacs"
2938# Web browser
3039cask "firefox"
3140# Screen color temperature controller
···4251cask "logitech-g-hub"
4352# Sound and audio controller
4453cask "proxy-audio-device"
4545-# Instant messaging application focusing on security
4646-cask "signal"
4754# Music streaming service
4855cask "spotify"
4949-# Video game digital distribution service
5050-cask "steam"
5156# Break time reminder app
5257cask "stretchly"
5358# Real time file synchronization software
···1313# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14141515if begin
1616- status --is-interactive; and not functions -q -- iterm2_status; and [ "$ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX""$TERM" != screen ]; and [ "$TERM" != dumb ]; and [ "$TERM" != linux ]
1616+ status --is-interactive
1717+ and not functions -q -- iterm2_status
1818+ and [ "$ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX""$TERM" != screen ]
1919+ and [ "$TERM" != dumb ]
2020+ and [ "$TERM" != linux ]
2121+ and string match -q "$TERM_PROGRAM" iTerm.app
1722 end
1823 function iterm2_status
1924 printf "\033]133;D;%s\007" $argv
+3
.gitconfig
···3434 dir-diff = ! COMPARE_FOLDERS=DIFF git difftool --dir-diff
3535 sswitch = !sh -c 'git stash && git switch \"$@\" && git stash pop' -
3636 ssw = sswitch
3737+ su = submodule update
3738[core]
3839 editor = vim
3940 quotePath = true
···7778 clean = git-lfs clean -- %f
7879 smudge = git-lfs smudge -- %f
7980 process = git-lfs filter-process
8181+[advice]
8282+ detachedHead = false
8083# NOTE: This has to come last to override other settings, e.g. user.email
8184[include]
8285 path = ~/.gitconfig.local