Skip to content

Commit 8c12bd2

Browse files
authored
Merge pull request #16 from jacobo-doist/dotfiles-changes-from-work-machine
Bring in changes from work machine dotfiles
2 parents e47b95e + 90c2ba4 commit 8c12bd2

File tree

8 files changed

+103
-5
lines changed

8 files changed

+103
-5
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#{{ if .is_macos }}
2+
[".bash.d/200_tool_iterm2_shell_integration.sh"]
3+
type = "file"
4+
url = "https://raw.githubusercontent.com/gnachman/iTerm2/master/Resources/shell_integration/iterm2_shell_integration.bash"
5+
refreshPeriod = "730h"
6+
#{{ end -}}

home/dot_bash_profile

Lines changed: 0 additions & 4 deletions
This file was deleted.

home/dot_bash_profile.tmpl

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
# bash_profile vs bashrc:
3+
# - bash_profile: sourced for LOGIN shells (SSH, Terminal.app on macOS, console login)
4+
# - bashrc: sourced for INTERACTIVE NON-LOGIN shells (running `bash` from existing shell)
5+
# This file sources bashrc so all settings work regardless of shell type
6+
7+
{{ if .is_macos -}}
8+
# ------------------------------------------------------------------------------
9+
# Locale Configuration
10+
# ------------------------------------------------------------------------------
11+
# My macOS is configured with AppleLocale=en_ES (English language, Spain region)
12+
# because I live in Spain but prefer English. Problem is, there's no en_ES Unix
13+
# locale on macOS. The terminal tries to derive locale settings from this, fails,
14+
# and ends up setting LC_CTYPE=UTF-8, which is invalid (locales need the full
15+
# format like en_IE.UTF-8, not just UTF-8). This causes bash to complain:
16+
#
17+
# bash: warning: setlocale: LC_COLLATE: cannot change locale (): No such file
18+
#
19+
# The fix: explicitly set a valid locale. I use en_IE.UTF-8 (English/Ireland)
20+
# because it gives me:
21+
# - British English spelling (colour, metre, etc.)
22+
# - Metric system
23+
# - Euro currency symbol
24+
# - 24-hour time format
25+
# - dd/MM/yyyy date format
26+
#
27+
# Useful commands:
28+
# defaults read -g AppleLocale # Check macOS locale setting
29+
# locale -a | grep en_ # List available English locales
30+
# locale # Verify current settings
31+
# ------------------------------------------------------------------------------
32+
export LANG=en_IE.UTF-8
33+
export LC_ALL=en_IE.UTF-8
34+
35+
{{ end -}}
36+
# shellcheck source=/dev/null
37+
[[ -s $HOME/.bashrc ]] && source "$HOME/.bashrc"
38+

home/dot_config/git/config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
aliases = !git config --get-regexp '^alias\\.' | sed 's/alias\\.\\([^ ]\\+\\) /alias \\1=/' | showaliases -
112112

113113
mrpush = push -omerge_request.create -o merge_request.draft
114+
whereami = !(g=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) && [ "$g" != HEAD ] && echo "$g") || git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD 2>/dev/null
114115

115116
[hub]
116117
protocol = https
@@ -150,3 +151,6 @@
150151
expandtab = true
151152
refreshonfocus = true
152153
resizebrowsercolumns = true
154+
155+
[submodule]
156+
recurse = true

home/dot_config/tmux/tmux.conf.tmpl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,21 @@ set -g default-terminal "screen-256color"
108108
# Enable truecolor where available
109109
set-option -ga terminal-overrides ",xterm-256color:Tc"
110110
111+
# Allow modified key sequences (like Shift+Enter) to pass through to
112+
# applications instead of being swallowed by tmux. Without this, tmux treats
113+
# Shift+Enter the same as Enter, breaking apps that rely on the distinction
114+
# (e.g. Claude Code uses Shift+Enter for newline vs Enter for submit).
115+
set -s extended-keys always
116+
117+
# Use the CSI u encoding for extended keys (e.g. ESC[13;2u for Shift+Enter)
118+
# instead of the default xterm modifyOtherKeys format (ESC[27;2;13~), which
119+
# apps like Claude Code don't recognise.
120+
set -s extended-keys-format csi-u
121+
122+
# Tell tmux that the outer terminal supports extended keys, so tmux knows it
123+
# can forward CSI u-encoded sequences from the terminal.
124+
set -as terminal-features 'xterm*:extkeys'
125+
111126
# }}}
112127
# Key Bindings {{ "{{{" }}
113128
# ===============

home/dot_vimrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ if has('win32') || has('win64')
243243
set guifont=Lucida\ Console:h12
244244
elseif has('gui_macvim')
245245
set macligatures
246-
set guifont=FiraCodeNFM-Reg:h16
246+
set guifont=FantasqueSansMNFM-Regular:h18
247247
elseif has('unix')
248248
set guifont=Monaco\ 10
249249
endif

home/exact_private_dot_bash.d/private_010_functions_ai.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,21 @@ function is_cursor_agent() {
66
# @tags: canbescript
77
function is_ai_agent() {
88
is_cursor_agent
9+
}
10+
11+
# @tags: command
12+
# DEPENDS-ON: assert_has_command
13+
function claude-spend()
14+
{
15+
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
16+
echo "Usage: claude-spend [DAYS]"
17+
echo "Show a sparkline of daily Claude AI spend."
18+
echo ""
19+
echo " DAYS Number of days to show (default: 5)"
20+
return 0
21+
fi
22+
assert_has_command ccusage || return 1
23+
assert_has_command spark || return 1
24+
local days=${1:-5}
25+
spark $(ccusage daily --since "$(date -v-"${days}"d +%Y%m%d)" --jq '[.daily[].totalCost][]' --no-color)
926
}

home/exact_private_dot_bash.d/private_045_brew.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,26 @@ fi
6767
#INFOPATH="$($BREW_PATH --prefix)/share/info:$INFOPATH"
6868
#export MANPATH INFOPATH
6969

70+
# Wrapper: redirect `brew update <pkg>` to `brew upgrade <pkg>` {{{
71+
# brew update only updates brew itself and doesn't take formula names.
72+
# If positional args are given, the user almost certainly meant `brew upgrade`.
73+
brew() {
74+
if [[ "$1" == "update" && $# -gt 1 ]]; then
75+
local has_positional=false
76+
for arg in "${@:2}"; do
77+
if [[ "$arg" != -* ]]; then
78+
has_positional=true
79+
break
80+
fi
81+
done
82+
if $has_positional; then
83+
echo "brew update doesn't take formula names. Running 'brew upgrade ${*:2}' instead." >&2
84+
command brew upgrade "${@:2}"
85+
return
86+
fi
87+
fi
88+
command brew "$@"
89+
}
90+
# }}}
91+
7092
unset BREW_PATH

0 commit comments

Comments
 (0)