Skip to content

Commit 5390f5a

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/main'
2 parents 6a52b2a + 666dda5 commit 5390f5a

File tree

11 files changed

+82
-96
lines changed

11 files changed

+82
-96
lines changed

.aliases

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ alias wget="curl -O"
5959
alias cleanup_dsstore="find . -name '*.DS_Store' -type f -ls -delete"
6060

6161
alias diskspace_report="df --si /"
62-
alias free_diskspace_report="diskspace_report"
6362

6463
# Shortcuts
6564
alias g="git"

.bash_profile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
# PATH setup via ~/.paths
44
setupPATH() {
5-
# Credit to https://github.com/davidaurelio/dotfiles/blob/main/.profile for the technique of resolving $variables
5+
# Credit to https://github.com/davidaurelio/dotfiles/blob/main/.profile this cute pattern.
66
while read -r P; do
77
P=`eval echo $P`
88
if [ -d "$P" ]; then
99
export PATH="$PATH:$P"
1010
fi
11-
# read these files but strip out comments and newlines.
12-
done < <(cat ~/.paths ~/.paths.local 2> /dev/null | grep -v "^#")
11+
#subread these files but strip out comments, extra whitespace, and empty lines
12+
done < <(tac ~/.paths ~/.paths.local 2> /dev/null | sed 's|#.*||' | sed 's/^[ \t]*//;s/[ \t]*$//' | sed '/^$/d')
1313
}
1414
setupPATH;
1515

@@ -40,6 +40,12 @@ export LESS_TERMCAP_so=$'\E[38;5;246m' # begin standout-mode - info box
4040
export LESS_TERMCAP_ue=$'\E[0m' # end underline
4141
export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline
4242

43+
44+
# Skip line-numbers and grid. https://github.com/sharkdp/bat/blob/e608b331425ca2ce8f8d0bd37e7f90901f91eb99/src/style.rs#L27-L61
45+
# In the future this can be `default,-numbers,-grid` but they haven't released in 18months so.....
46+
export BAT_STYLE="changes,header-filename,header-filesize,snip,rule"
47+
48+
4349
##
4450
## HISTORY settings...
4551
##

.exports

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ export LESS_TERMCAP_so=$(printf '\e[01;33m') # enter standout mode
2424
export LESS_TERMCAP_ue=$(printf '\e[0m') # leave underline mode
2525
export LESS_TERMCAP_us=$(printf '\e[04;36m') # enter underline mode – cyan
2626

27-
# I'll also make sure my `man grep` uses the right one
28-
export MANPATH="$HOME/.homebrew/opt/gnu-sed/libexec/gnubin:$HOME/homebrew/opt/gnu-sed/libexec/gnubin:$MANPATH";
29-
3027

3128
# fzf should be populated via `fd` which is the fastest file/dir finder. (respects gitignore, etc)
3229
# note.. `fd` seems faster than `ag`.. but if i wanted to use `ag` this is good: command ag --files-with-matches --filename-pattern ""
@@ -37,10 +34,6 @@ export FZF_DEFAULT_COMMAND='fd'
3734
export FZF_CTRL_T_COMMAND='fd'
3835
export FZF_CTRL_T_OPTS="--preview 'bat -n --color=always {} 2>/dev/null || tree -C {}'"
3936

40-
# Skip line-numbers and grid. https://github.com/sharkdp/bat/blob/e608b331425ca2ce8f8d0bd37e7f90901f91eb99/src/style.rs#L27-L61
41-
# In the future this can be `default,-numbers,-grid` but they haven't released in 18months so.....
42-
export BAT_STYLE="changes,header-filename,header-filesize,snip,rule"
43-
4437

4538
export CLOUDSDK_PYTHON=/usr/bin/python3
4639

.functions

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,7 @@ whichlink() {
2424
}
2525

2626

27-
# git commit browser. needs fzf. ctrl-m to view commit.
28-
log() {
29-
git log --graph --color=always \
30-
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" |
31-
fzf --ansi --no-sort --reverse --tiebreak=index --toggle-sort=\` \
32-
--bind "ctrl-m:execute:
33-
echo '{}' | grep -o '[a-f0-9]\{7\}' | head -1 |
34-
xargs -I % sh -c 'git show --color=always % | less -R'"
35-
}
36-
37-
#make two beeps
27+
# make two beeps.
3828
beep() {
3929
echo -e '\a'; sleep 0.1; echo -e '\a';
4030
}
@@ -152,10 +142,6 @@ webmify(){
152142
ffmpeg -i "$1" -vcodec libvpx -acodec libvorbis -isync -copyts -aq 80 -threads 3 -qmax 30 -y "$2" "$1.webm"
153143
}
154144

155-
# direct it all to /dev/null
156-
function nullify() {
157-
"$@" >/dev/null 2>&1
158-
}
159145

160146
# `shellswitch [bash |zsh]`
161147
# Must be in /etc/shells

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,12 @@ PAUL.readme.md
1010
node_modules
1111

1212
# why u be like that
13-
.DS_Store
13+
.DS_Store
14+
15+
16+
.aider.chat.history.md
17+
.aider.input.history
18+
.aider.tags.cache.v4
19+
20+
.gemini
21+
.roo

fish/aliases.fish

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ abbr bwre brew
3636
abbr brwe brew
3737

3838
abbr cat 'bat -P'
39-
set -x BAT_STYLE "header,header-filesize,header-filename,changes"
39+
# Skip line-numbers and grid. https://github.com/sharkdp/bat/blob/e608b331425ca2ce8f8d0bd37e7f90901f91eb99/src/style.rs#L27-L61
40+
# In the future this can be `default,-numbers,-grid` but they haven't released in 18months so.....
41+
set -x BAT_STYLE "changes,header-filename,header-filesize,snip,rule"
4042

4143
alias push="git push"
4244

@@ -118,7 +120,6 @@ alias sorteduniq-asc="sort | uniq -c | sort --ignore-leading-blanks --numeric-so
118120

119121

120122
alias diskspace_report="df --si /"
121-
alias free_diskspace_report="diskspace_report"
122123

123124

124125
alias hosts='sudo $EDITOR /etc/hosts' # yes I occasionally 127.0.0.1 twitter.com ;)
@@ -138,15 +139,6 @@ alias cleanup_dsstore="find . -name '*.DS_Store' -type f -ls -delete"
138139

139140
alias ungz="gunzip -k"
140141

141-
# File size
142-
alias fs="stat -f \"%z bytes\""
143-
144-
# emptytrash written as a function
145-
146-
# Update installed Ruby gems, Homebrew, npm, and their installed packages
147-
alias brew_update="brew -v update; brew upgrade --force-bottle --cleanup; brew cleanup; brew cask cleanup; brew prune; brew doctor; npm-check -g -u"
148-
alias update_brew_npm_gem='brew_update; npm install npm -g; npm update -g; sudo gem update --system; sudo gem update --no-document'
149-
150142

151143
function gemi
152144
# using https://github.com/simonw/llm-gemini and llm
@@ -156,9 +148,9 @@ function gemi
156148
# gemi "tell me a joke"
157149
if test -z "$argv[1]"
158150
# no markdown parsing here without some real fancy stuff. because you dont want to send to markdown renderer (glow) inbetween backticks, etc.
159-
llm chat --continue -m gemini-2.0-flash-exp
151+
llm chat --continue -m gemini-2.5-flash
160152
else
161-
llm prompt -m gemini-2.0-flash-exp "$argv" && echo "⬇️… and now rendered…⬇️" && llm logs -r | glow
153+
llm prompt -m gemini-2.5-flash "$argv" && echo "⬇️… and now rendered…⬇️" && llm logs -r | glow
162154
end
163155
end
164156

fish/chromium.fish

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ end
206206

207207

208208
# dt. rpp
209-
alias rppunit 'npm test -- --skip-ninja front_end/panels/timeline/ front_end/models/trace front_end/ui/legacy/components/perf_ui front_end/models/cpu_profile front_end/services/trace_bounds'
209+
alias rppunit 'npm test -- --skip-ninja front_end/panels/timeline/ front_end/models/trace front_end/ui/legacy/components/perf_ui front_end/models/cpu_profile front_end/services/trace_bounds front_end/models/ai_assistance/'
210210
alias rppunit-debug 'npm test -- front_end/panels/timeline/ front_end/models/trace front_end/ui/legacy/components/perf_ui --debug'
211211
alias rppinter 'npm run test -- test/e2e/performance/'
212212
alias rppe2e 'npm run test -- test/e2e/performance/'
@@ -225,15 +225,15 @@ function rbu --description "rebase-update with extra steps"
225225

226226
# _watch_suspend
227227

228-
git checkout origin/main && git cl archive -f --verbose && git rebase-update && git checkout -b main origin/main && \
228+
git checkout origin/main && git cl archive --force --verbose && git rebase-update && git checkout -b main origin/main && \
229229
git checkout main && depshooks && \
230230
git checkout "$current_branch_name"
231231

232232
# _watch_resume
233233
end
234234

235235
function rebasecontinue --description "continuing after resolving rebase conflicts mid-rebase-update"
236-
GIT_EDITOR=true git rebase --continue; git rebase-update -n && git checkout -b main origin/main && git checkout main && depshooks
236+
GIT_EDITOR=true git rebase --continue; git rebase-update --no-fetch && git checkout -b main origin/main && git checkout main && depshooks
237237
end
238238

239239

@@ -254,9 +254,7 @@ end
254254
alias upload 'git cl format --js && git status --porcelain=v2 && git cl upload'
255255

256256
abbr gcert 'gcert-local'
257+
# copy a diff-looking thing (like our karma diffs) to clipboard and this'll run em through delta. Could be improved for multiline strings but.. requires lotta lines.
258+
abbr deltapb 'printf "%s\n" "@@ -1,1 +1,1 @@" (pbpaste) | delta --max-line-length 1024 --minus-style "white #2b0000" --plus-style "white #001900"'
257259

258-
function clstatus --description "pick a branch that is on gerrit as a CL"
259-
set -l branch_name (git cl status --no-branch-color --date-order | awk '/ : / {print $0}' | fzf | awk '{print $1}')
260-
git checkout $branch_name
261-
end
262260

fish/config.fish

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
# I've noticed this file gets called multiple times.
1+
# I've noticed this file gets called multiple times. (not on mbp)
22
# todo, investigate later.
33
# status stack-trace
44

5-
# upfront add homebrew stuff to path
65

6+
# Debugging
77
# set fish_trace 1
8+
# fish_trace 1 outputs 3,500 lines when spawning a fresh shell.
9+
810
# /Users/paulirish/.homebrew/bin/fish --debug "*" # super noisy
9-
# see `fish --print-debug-categories`
10-
# /Users/paulirish/.homebrew/bin/fish --debug "abbrs ast-construction char-encoding complete config debug env-dispatch env-export env-locale error event exec exec-fork exec-job-exec exec-job-status fd-monitor history history-file iothread output-invalid path proc-internal-proc proc-job-run proc-pgroup proc-reap-external proc-reap-internal proc-termowner profile-history reader reader-render screen term-support topic-monitor uvar-file uvar-notifier warning warning-path"
11+
# see `fish --print-debug-categories`
12+
# fish --debug "$(fish --print-debug-categories | grep -v "ast-construction" | sed 's| .*||' | string join ',')"
13+
# ^ outputs 11,400 lines of spawning a fresh shell
14+
1115

1216
function fish_greeting
1317
end
1418

15-
# TODO: path and aliases are kinda slow to source. optimize later.
19+
# TODO: path and aliases are kinda slow to source. optimize later.
1620
function ssource --description "source most of my dotfiles, useful if making changes and iterating"
1721

1822
source ~/.config/fish/path.fish
@@ -23,19 +27,17 @@ function ssource --description "source most of my dotfiles, useful if making cha
2327
# pull in all shared `export …` aka `set -gx …`
2428
source ~/.exports
2529

26-
if test -e "../private/extras.fish";
27-
source ../private/extras.fish
30+
if test -e "$HOME/code/dotfiles/private/extras.fish";
31+
source $HOME/code/dotfiles/private/extras.fish
2832
end
2933

30-
# for things not checked into git..
34+
# for things not checked into git
3135
if test -e "$HOME/.extra.fish";
3236
source ~/.extra.fish
3337
end
3438
end
3539

3640

37-
fish_add_path $HOME/.homebrew/bin; fish_add_path $HOME/homebrew/bin; # so i can use utils in startup
38-
3941
ssource;
4042

4143
# I don't need a prompt symbol for you-got-things-in-yr-stash
@@ -95,8 +97,6 @@ set __fish_git_prompt_color_dirtystate 'red'
9597
set __fish_git_prompt_color_upstream_ahead ffb90f
9698
set __fish_git_prompt_color_upstream_behind blue
9799

98-
# Local prompt customization
99-
set -e fish_greeting
100100

101101

102102
set -g fish_pager_color_completion normal
@@ -105,13 +105,6 @@ set -g fish_pager_color_prefix cyan
105105
set -g fish_pager_color_progress cyan
106106

107107

108-
# ctrl-b invokes the fancy boi. but this doesnt really work right.
109-
bind \cb git-recent-with-fzf-and-diff
110-
if bind -M insert > /dev/null 2>&1
111-
bind -M insert \cb git-recent-with-fzf-and-diff
112-
end
113-
114-
115108

116109
string match -q "$TERM_PROGRAM" "vscode"
117110
and . (code --locate-shell-integration-path fish)

fish/functions.fish

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# thx to https://github.com/mduvall/config/
21

32
function subl --description 'Open Sublime Text'
43
if test -d "/Applications/Sublime Text.app"
@@ -87,21 +86,19 @@ end
8786

8887
function all_binaries_in_path --description \
8988
"list all binaries available in \$PATH (incl conflicts). pipe it to grep. top-most are what's used, in case of conflicts"
90-
# based on https://unix.stackexchange.com/a/120790/110766 but tweaked to work on mac. and then made it faster.
91-
find -L $PATH -maxdepth 1 -executable -type f 2>/dev/null
89+
# based on https://unix.stackexchange.com/a/120790/110766. and then made it faster. needs `brew install findutils`
90+
gfind -L $PATH -maxdepth 1 -executable -type f 2>/dev/null
91+
end
9292

93-
# list path
94-
# for val in $PATH; echo "$val"; end
93+
function all_binaries_in_path_grep --description "run all_binaries_in_path and grep with your argument"
94+
all_binaries_in_path | grep $argv
9595
end
9696

97-
function list_path --description "list all paths in PATH"
97+
function list_path --description "list all paths in PATH, top-most wins"
9898
for val in $PATH; echo "$val"; end
9999
end
100100

101-
function my_paths --description "list paths, in order"
102-
echo "# "
103-
printf '%s\n' (string split \n $PATH)
104-
end
101+
105102

106103
function stab --description "stabalize a video"
107104
set -l vid $argv[1]
@@ -199,25 +196,34 @@ function server -d 'Start a HTTP server in the current dir, optionally specifyin
199196
end
200197
end
201198

199+
# straight from the docs
200+
function last_history_item
201+
echo $history[1]
202+
end
203+
abbr -a !! --position anywhere --function last_history_item
204+
202205

203-
function conda -d 'lazy initialize conda'
204-
functions --erase conda
205-
eval /opt/miniconda3/bin/conda "shell.fish" "hook" | source
206-
# There's some opportunity to use `psub` but I don't really understand it.
207-
conda $argv
206+
# I crafted this lazy init pattern. It's lovely.
207+
# I first did it with functions but it's better with abbr to get completions etc immediately.
208+
function __lazy_init_conda -d 'lazy initialize conda'
209+
abbr --erase conda; functions --erase __lazy_init_conda
210+
eval $(which conda) "shell.fish" "hook" | source
211+
echo "conda"
208212
end
213+
abbr --add conda --function __lazy_init_conda
214+
215+
216+
function __lazy_init_cargo -d 'lazy initialize cargo'
217+
abbr --erase cargo; functions --erase __lazy_init_cargo
218+
sh "$HOME/.cargo/env"
219+
echo "cargo"
220+
end
221+
abbr --add cargo --function __lazy_init_cargo
209222

210223
# NVM doesnt support fish and its stupid to try to make it work there.
224+
# gcloud: Don't need "$HOME/google-cloud-sdk/path.fish.inc" lazyily done because it only adds to PATH which is already done.
211225

212226

213-
function google_cloud_sdk_lazy_init -d 'Lazy initializer for Google Cloud SDK'
214-
functions --erase gcloud gsutil bq
215-
source "$HOME/google-cloud-sdk/path.fish.inc"
216-
$argv
217-
end
218-
for cmd in gcloud gsutil bq
219-
eval "function $cmd; google_cloud_sdk_lazy_init $cmd \$argv; end"
220-
end
221227

222228

223229
function fns --description "Interactively search/preview fish shell functions and aliases"

fish/functions/fish_prompt.fish

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,6 @@ function fish_prompt
293293
set_color normal
294294
end
295295

296-
297-
298296
if test -n "$SSH_TTY"
299297
function fish_right_prompt;
300298
set_color $fish_color_host

0 commit comments

Comments
 (0)