Skip to content

Commit d27a39a

Browse files
committed
a few updates
1 parent 31d8716 commit d27a39a

9 files changed

Lines changed: 43 additions & 38 deletions

File tree

.exports

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export LESSSECURE=1
3131
# note.. `fd` seems faster than `ag`.. but if i wanted to use `ag` this is good: command ag --files-with-matches --filename-pattern ""
3232
# fd > 8.1 got slower. https://github.com/sharkdp/fd/issues/1131
3333
# so.. here's the install for the last fast one: CARGO_NET_GIT_FETCH_WITH_CLI=true cargo install --vers 8.1.1 fd-find
34-
# To do a fzf including hidden/ignord files.. 'fd --unrestricted'
34+
# To do a fzf including hidden/ignord files.. 'fd --unrestricted' or shorter: 'fd -u'
3535
export FZF_DEFAULT_COMMAND='fd'
3636
export FZF_CTRL_T_COMMAND='fd'
3737
export FZF_CTRL_T_OPTS="--preview 'bat -n --color=always {} 2>/dev/null || tree -C {}'"

.gitconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
excludesfile = ~/.gitignore
6868
attributesfile = ~/.gitattributes
6969
precomposeUnicode = true
70-
# https://github.com/dandavison/delta
71-
pager = delta
70+
# https://github.com/dandavison/delta. full path for agents running in subshells.
71+
pager = /opt/homebrew/bin/delta
7272

7373
[delta]
7474
max-line-length = 1400

.ssh.config.example

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
# copy to ~/.ssh/config
22

3-
Host github.com
4-
ControlMaster auto
5-
ControlPersist 120
6-
73
Host *
8-
# Always use SSH2.
9-
Protocol 2
10-
11-
# Use a shared channel for all sessions to the same host,
12-
# instead of always opening a new one. This leads to much
13-
# quicker connection times.
14-
ControlMaster auto
15-
ControlPath ~/.ssh/control/%r@%h:%p
16-
ControlPersist 1800
4+
# Use a shared channel for all sessions to the same host,
5+
# instead of always opening a new one. This leads to much
6+
# quicker connection times.
7+
ControlMaster auto
8+
ControlPath ~/.ssh/control/%C
9+
ControlPersist 1800
1710

18-
# also this stuff
19-
Compression yes
20-
TCPKeepAlive yes
21-
ServerAliveInterval 20
22-
ServerAliveCountMax 10
11+
# Personal preference but with 'no', the OS won't kill the socket during a temporary outage
12+
TCPKeepAlive no
13+
# Also this stuff
14+
Compression yes
15+
ServerAliveInterval 30
16+
ServerAliveCountMax 6

brew.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ PACKAGES=(
2020
the_silver_searcher ripgrep fzf fd bat eza glow jq jdupes datamash pandoc pdfgrep cloc
2121

2222
# Dev Runtimes & Build Tools
23-
deno pnpm rbenv bazel gradle cmake ninja mkcert
23+
node deno pnpm rbenv bazel gradle cmake ninja mkcert
2424

2525
# Watchers & Linters
2626
watchexec entr shellcheck

docs/bash tricks.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@ bash tricks
22

33
# dont allow commiting to main branch
44

5+
run this:
6+
57
```sh
8+
cat << 'EOF' > .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit
69
#!/bin/sh
710
811
branch="$(git rev-parse --abbrev-ref HEAD)"
912
1013
if [ "$branch" = "main" ]; then
11-
echo "Hello from .git/hooks/pre-commit"
12-
echo "You can't commit directly to main branch."
14+
echo "You can't commit directly to main. Make a feature branch. [Sincerely, your .git/hooks/pre-commit]"
1315
exit 1
1416
fi
17+
EOF
1518
```
1619

17-
save that to `.git/hooks/pre-commit`
18-
1920

2021
# use one of two binaries:
2122
Create alias if it doesn't already exist:

fish/aliases.fish

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,14 @@ alias mine="git checkout mine"
123123

124124

125125

126-
# ag defaults. go as wide as terminal (minus some space for line numbers)
127-
# i used to like `--follow --hidden` but dont anymore. -follow ends up with lots of fstat errors on broken symlinks. and --hidden is something that should be turned on explicitly.
128-
# OKAY RIPGREP is way faster than AG. i gotta drop ag like its hot.
129-
# also ripgrep doesnt buffer output so you can pipe it somewhere and it'll go as it happens. wow yah SO much better.
130-
# alias ag='command ag -W (math $COLUMNS - 14)'
126+
# Ripgrep > ag (silver_seacher). By far. definitely faster and also doesnt buffer output so you can pipe it somewhere and it'll go as it happens
127+
# -uu is the combo of `--no-ignore` and `--hidden` which is what i often want to look through gitignored stuff and other hidden things.
128+
abbr rgu 'rg -uu'
131129

132130
# fd is fast but their multicore stuff is dumb and slow and bad. https://github.com/sharkdp/fd/issues/1203
133131
# alias fd='command fd -j1 --exclude node_modules'
134132
abbr fdfind 'fd'
133+
# fd's -u is equivalent to rg's -uu.
135134
abbr fzfall 'fd --unrestricted | fzf'
136135

137136
# By default watchexec thinks the project origin is higher up. So dumb.

fish/config.fish

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,6 @@ and . (code --locate-shell-integration-path fish)
111111

112112

113113
# begin gd completion
114-
gd --completion-fish | source
114+
# gd --completion-fish | source
115115
# end gd completion
116+

fish/functions.fish

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ function solve_all_conflicts --description 'try to solve all current git conflic
2727
echo "Conflicted files: $before ==> $after"
2828
end
2929

30+
31+
# git-recent with experimental worktree support
32+
function recent
33+
set -l o (~/code/git-recent/git-recent $argv)
34+
if test -d "$o"
35+
cd $o
36+
else if test -n "$o"
37+
echo $o
38+
end
39+
end
40+
41+
3042
function killprocess --description 'Kill process that user selects in fzf (from ps aux output)'
3143
set -l pid (ps aux | fzf -m --header-lines=1 | awk '{print $2}')
3244

setup-a-new-machine.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
read -n 1
66

77

8+
# ssh multiplexing control sockets
9+
mkdir ~/.ssh/control
10+
11+
812
##############################################################################################################
913
### backup old machine's key items
1014

@@ -147,9 +151,6 @@ export PATH=$HOME/homebrew/bin:$HOME/homebrew/sbin:$PATH
147151
### install of common things
148152
###
149153

150-
# github.com/jamiew/git-friendly
151-
# the `push` command which copies the github compare URL to my clipboard is heaven
152-
bash < <( curl https://raw.github.com/jamiew/git-friendly/master/install.sh)
153154

154155
# autocompletion for git branch names https://git-scm.com/book/en/v1/Git-Basics-Tips-and-Tricks
155156
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
@@ -164,9 +165,6 @@ npm install -g git-recent
164165
# trash as the safe `rm` alternative
165166
npm install --global trash-cli
166167

167-
# more readable git diffs
168-
npm install --global diff-so-fancy
169-
170168
# my preferred statik webserver
171169
npm install -g statikk
172170

0 commit comments

Comments
 (0)