···128128brew "htop"
129129130130# Curses-based tool for viewing and analyzing log files
131131-brew "lnav"
131131+brew "lnav" args ["HEAD"]
132132133133# Ambitious Vim-fork focused on extensibility and agility
134134brew "neovim"
+9
.config/fish/conf.d/10-fisher.fish
···11+# Use a custom install dir for fisher, this does not need to be tracked
22+set -g fisher_path ~/.config/fish/fisher_install
33+44+set fish_function_path $fish_function_path[1] $fisher_path/functions $fish_function_path[2..-1]
55+set fish_complete_path $fish_complete_path[1] $fisher_path/completions $fish_complete_path[2..-1]
66+77+for file in $fisher_path/conf.d/*.fish
88+ builtin source $file 2> /dev/null
99+end
···22# modify it under the terms of the GNU General Public License
33# as published by the Free Software Foundation; either version 2
44# of the License, or (at your option) any later version.
55-#
55+#
66# This program is distributed in the hope that it will be useful,
77# but WITHOUT ANY WARRANTY; without even the implied warranty of
88# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
99# GNU General Public License for more details.
1010-#
1010+#
1111# You should have received a copy of the GNU General Public License
1212# along with this program; if not, write to the Free Software
1313# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-15
.config/fish/conf.d/nvm.fish
···11-function _nvm_uninstall -e nvm_uninstall
22- if test -s "$nvm_config/version"
33- read -l ver <$nvm_config/version
44- if set -l i (contains -i -- "$nvm_config/$ver/bin" $fish_user_paths)
55- set -e fish_user_paths[$i]
66- end
77- command rm -f $nvm_config/version
88- end
99-1010- for name in (set -n | command awk '/^nvm_/')
1111- set -e "$name"
1212- end
1313-1414- functions -e (functions -a | command awk '/^_nvm_/')
1515-end
···22set -U fish_user_paths ~/.cargo/bin
3344# Run nvm to update fish_user_paths for npm installs. Allow failure if running
55-# outside home directory (no .nvmrc found)
66-nvm || true
55+# outside home directory (no .nvmrc found), and run in background to avoid
66+# blocking the shell from starting
77+# nvm &>/dev/null & || true
7889if not set -q DOCKER_NAME; and test -f /etc/profile.d/docker_name.sh
910 set -gx DOCKER_NAME (sed -E 's/.*DOCKER_NAME=(.+)/\1/' /etc/profile.d/docker_name.sh)
-1
.config/fish/functions/bash_env.fish
···11-# Defined in /Users/ichamberlain/.config/fish/functions/bash_env.fish @ line 2
21function bash_env
32 set -x BASH_ENV ~/.bashrc.aliases
43 command bash -c "$argv"
-1
.config/fish/functions/beep.fish
···11-# Defined in /Users/ichamberlain/.config/fish/functions/beep.fish @ line 2
21function beep --description 'Shortcut to print the bell character'
32 echo -n \a $argv;
43end
-1
.config/fish/functions/dsh.fish
···11-# Defined in /Users/ichamberlain/.config/fish/functions/dsh.fish @ line 2
21function dsh
32 if test (uname) = "Darwin"
43 echo "dsh not supported on macOS!"
···11+function fish_normalize_saved_functions --description "Remove fish-generated paths in saved functions"
22+ set -l exclude_functions \
33+ "fish_normalize_saved_functions" \
44+ "fish_prompt" \
55+ "fisher"
66+77+ for fish_function in ~/.config/fish/functions/*.fish
88+ set -l func_name (basename $fish_function .fish)
99+ set -l rel_func_path '~/.config/fish/functions/'$func_name'.fish'
1010+1111+ if ! contains $func_name $exclude_functions
1212+ funcsave $func_name
1313+ end
1414+1515+ if test $func_name != "fish_normalize_saved_functions"
1616+ sed -e '/ Defined in .*\.fish/d' $fish_function >$fish_function.new
1717+ mv $fish_function.new $fish_function
1818+ end
1919+ end
2020+end
-1
.config/fish/functions/fish_prompt.fish
···11-# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.jInzkm/fish_prompt.fish @ line 2
21function fish_prompt --description 'Write out the prompt'
32 set -l last_status $status
43
+2-2
.config/fish/functions/fisher.fish
···11-set -g fisher_version 3.2.10
11+set -g fisher_version 3.2.11
2233function fisher -a cmd -d "fish package manager"
44 set -q XDG_CACHE_HOME; or set XDG_CACHE_HOME ~/.cache
···247247 for (n = split(ARGSTR, a, " "); i++ < n;) pkgs[getkey(a[i])] = a[i]
248248 }
249249 !NF { next } { k = getkey($1) }
250250- MODE == "-R" && !(k in pkgs) && $0 = $1
250250+ MODE == "-R" && !(k in pkgs) && ($0 = $1)
251251 MODE == "-W" && (/^#/ || k in pkgs || CMD != "rm") { print pkgs[k] (sub($1, "") ? $0 : "") }
252252 MODE == "-W" || CMD == "rm" { delete pkgs[k] }
253253 END {
-1
.config/fish/functions/func_name.fish
···11-# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.eXZO0F/func_name.fish @ line 2
21function func_name
32 echo (status current-command)
43end
···11-# Defined in /Users/ichamberlain/.config/fish/functions/generate_bazel_completions.fish @ line 2
21function generate_bazel_completions --description 'Print a list of completion strings for bazel'
32 command bazel help completion | sed -E 's/([A-Z_]+)=(.+)/set __\1 \2/g'
43end
-1
.config/fish/functions/generate_i95_targets.fish
···11-# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.0IaV7o/generate_i95_targets.fish @ line 2
21function generate_i95_targets
32 date
43 if ! count $argv >/dev/null
···11-# Defined in /Users/ichamberlain/.config/fish/functions/history.fish @ line 2
21function history --description alias\ history\ \'history\ --show-time=\"\%F\ \%T\ \"\'
32 builtin history --reverse --show-time="%F %T \$ " $argv;
43end
-1
.config/fish/functions/ls.fish
···11-# Defined in /Users/ichamberlain/.config/fish/functions/ls.fish @ line 2
21function ls --description 'List contents of directory, including hidden files in directory using long format'
32 if test (uname) = "Darwin"
43 set ls_args "-G"
-1
.config/fish/functions/mux.fish
···11-# Defined in /Users/ichamberlain/.config/fish/functions/mux.fish @ line 2
21function mux
32 tmux_attach $argv
43end
-232
.config/fish/functions/nvm.fish
···11-set -g nvm_version 1.0.2
22-33-function nvm -a cmd -d "Node.js version manager"
44- set -q XDG_CONFIG_HOME; or set XDG_CONFIG_HOME ~/.config
55- set -g nvm_config $XDG_CONFIG_HOME/nvm
66- set -g nvm_file .nvmrc
77- set -q nvm_mirror; or set -g nvm_mirror "https://nodejs.org/dist"
88-99- if test ! -d $nvm_config
1010- command mkdir -p $nvm_config
1111- end
1212-1313- switch "$cmd"
1414- case ls list
1515- set -e argv[1]
1616- _nvm_ls $argv
1717- case use
1818- set -e argv[1]
1919- _nvm_use $argv
2020- case ""
2121- if isatty
2222- if set -l root (_nvm_find_up (pwd) $nvm_file)
2323- read cmd <$root/$nvm_file
2424- end
2525- else
2626- read cmd
2727- end
2828- if not set -q cmd[1]
2929- echo "nvm: version or .nvmrc file missing" >&2
3030- _nvm_help >&2
3131- return 1
3232- end
3333-3434- _nvm_use $cmd
3535- case {,-}-v{ersion,}
3636- echo "nvm version $nvm_version"
3737- case {,-}-h{elp,}
3838- _nvm_help
3939- case complete
4040- _nvm_complete "$nvm_config/index"
4141- case \*
4242- echo "nvm: unknown flag or command \"$cmd\"" >&2
4343- _nvm_help >&2
4444- return 1
4545- end
4646-end
4747-4848-function _nvm_help
4949- echo "usage: nvm --help Show this help"
5050- echo " nvm --version Show the current version of nvm"
5151- echo " nvm ls [<regex>] List available versions matching <regex>"
5252- echo " nvm use <version> Download <version> and modify PATH to use it"
5353- echo " nvm Use version in .nvmrc (or stdin if not a tty)"
5454- echo "examples:"
5555- echo " nvm use 12"
5656- echo " nvm use lts"
5757- echo " nvm use latest"
5858- echo " nvm use dubnium"
5959- echo " nvm ls '^1|9\$'"
6060- echo " nvm ls 10"
6161- echo " nvm <file"
6262-end
6363-6464-function _nvm_complete -a index
6565- if test -s "$index"
6666- for alias in (command awk '
6767- $4 {
6868- for (i = split($4, alias, "|"); i; i--)
6969- if (!seen[alias[i]]++) print alias[i]
7070- }
7171- $2 != "-" && !seen[$2]++ { print $2 } { print $1 }
7272- ' <$index)
7373- complete -xc nvm -n "__fish_seen_subcommand_from use" -a $alias
7474- end
7575- end
7676-end
7777-7878-function _nvm_get_index
7979- set -l index "$nvm_config/index"
8080- set -q nvm_index_update_interval; or set -g nvm_index_update_interval 0
8181-8282- if test ! -e $index -o (math (command date +%s) - $nvm_index_update_interval) -gt 120
8383- command curl -sS $nvm_mirror/index.tab | command awk -v OFS=\t '
8484- NR > 1 && !/^v0\.[1-9]\./ {
8585- split($1 = substr($1, 2), v, ".")
8686- is_latest = NR == 2
8787- alias = ($10 = tolower($10)) == "-" ? "" : "lts|"$10
8888- is_lts = alias != ""
8989- print $1, (/^0/ ? "-" : v[1]), v[1]"."v[2],
9090- is_latest ? is_lts ? alias"|latest" : "latest" : is_lts ? alias : ""
9191- }
9292- ' >$index 2>/dev/null
9393-9494- if test ! -s "$index"
9595- echo "nvm: invalid mirror index -- is \"$nvm_mirror\" a valid host?" >&2
9696- return 1
9797- end
9898-9999- _nvm_complete $index
100100- set -g nvm_index_update_interval (command date +%s)
101101- end
102102-103103- echo $index
104104-end
105105-106106-function _nvm_ls -a query
107107- set -l index (_nvm_get_index); or return
108108- test -s "$nvm_config/version"; and read -l current <"$nvm_config/version"
109109- command awk -v current="$current" '
110110- $1 ~ /'"$query"'/ {
111111- gsub(/\|/, "/", $4)
112112- out[n++] = $1
113113- out[n++] = $4 ($1 == current ? ($4 ? "/" : "") "current" : "")
114114- pad = pad < length($1) ? length($1) : pad
115115- }
116116- END {
117117- for (i = n - 1; i > 0; i -= 2) {
118118- printf("%"pad"s %s\n", out[i - 1] , out[i] ? "("out[i]")": "")
119119- }
120120- }
121121- ' <$index 2>/dev/null
122122-end
123123-124124-function _nvm_resolve_version
125125- set -l index (_nvm_get_index); or return
126126- set -l ver (command awk -v ver="$argv[1]" '
127127- BEGIN {
128128- if (match(ver, /v[0-9]/)) gsub(/^[ \t]*v|[ \t]*$/, "", ver)
129129- if ((n = split(tolower(ver), a, "/")) > 3) exit
130130- for (ver = a[1]; n > 0; n--) {
131131- if (a[n] != "*" && a[n] != "latest" && (ver = a[n]) != "lts")
132132- break
133133- }
134134- }
135135- ver == $1"" || ver == $2"" || ver == $3"" || $4 && ver ~ $4 {
136136- print $1
137137- exit
138138- }
139139- ' <$index 2>/dev/null)
140140-141141- if not set -q ver[1]
142142- return 1
143143- end
144144-145145- echo $ver
146146-end
147147-148148-function _nvm_use
149149- set -l index (_nvm_get_index); or return
150150- set -l ver (_nvm_resolve_version $argv[1])
151151-152152- if not set -q ver[1]
153153- echo "nvm: invalid version number or alias: \"$argv[1]\"" >&2
154154- return 1
155155- end
156156-157157- if test ! -d "$nvm_config/$ver/bin"
158158- set -l os
159159- set -l arch
160160- set -l name "node-v$ver"
161161- set -l target "$nvm_config/$ver"
162162- switch (uname -s)
163163- case Linux
164164- set os linux
165165- switch (uname -m)
166166- case x86_64
167167- set arch x64
168168- case armv6 armv6l
169169- set arch armv6l
170170- case armv7 armv7l
171171- set arch armv7l
172172- case armv8 armv8l aarch64
173173- set arch arm64
174174- case \*
175175- set arch x86
176176- end
177177- set name "$name-linux-$arch.tar.gz"
178178- case Darwin
179179- set os darwin
180180- set arch x64
181181- case \*
182182- echo "nvm: OS not implemented -- request it on https://git.io/fish-nvm" >&2
183183- return 1
184184- end
185185-186186- set -l name "node-v$ver-$os-$arch"
187187- set -l url $nvm_mirror/v$ver/$name
188188-189189- echo "fetching $url" >&2
190190- command mkdir -p $target/$name
191191-192192- if not command curl -L --fail --progress-bar $url.tar.gz | command tar -xzf- -C $target/$name
193193- command rm -rf $target
194194- echo "nvm: fetch error -- are you offline?" >&2
195195- return 1
196196- end
197197-198198- command mv -f $target/$name/$name $nvm_config/$ver.
199199- command rm -rf $target
200200- command mv -f $nvm_config/$ver. $target
201201- end
202202-203203- if test -s "$nvm_config/version"
204204- read -l last <"$nvm_config/version"
205205- if set -l i (contains -i -- "$nvm_config/$last/bin" $fish_user_paths)
206206- set -e fish_user_paths[$i]
207207- end
208208- end
209209-210210- if set -l root (_nvm_find_up (pwd) $nvm_file)
211211- read -l line <$root/$nvm_file
212212- if test $ver != (_nvm_resolve_version $line)
213213- echo $argv[1] >$root/$nvm_file
214214- end
215215- end
216216-217217- echo $ver >$nvm_config/version
218218-219219- if not contains -- "$nvm_config/$ver/bin" $fish_user_paths
220220- set -U fish_user_paths "$nvm_config/$ver/bin" $fish_user_paths
221221- end
222222-end
223223-224224-function _nvm_find_up -a path file
225225- if test -e "$path/$file"
226226- echo $path
227227- else if test "$path" != /
228228- _nvm_find_up (command dirname $path) $file
229229- else
230230- return 1
231231- end
232232-end
-1
.config/fish/functions/py.fish
···11-# Defined in /Users/ichamberlain/.config/fish/functions/py.fish @ line 2
21function py --description 'alias py=bpython'
32 bpython $argv;
43end
-1
.config/fish/functions/rcheck.fish
···11-# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.MB1mBw/rcheck.fish @ line 2
21function rcheck --description 'Build and validate C++ unity targets with rmake and validate'
32 source ~/.config/fish/functions/remote_cmd.fish
43
-1
.config/fish/functions/refresh_branches.fish
···11-# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.r7lxdD/refresh_branches.fish @ line 2
21function refresh_branches
32 date
43 echo
-1
.config/fish/functions/remote_cmd.fish
···11-# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.Y3llUP/remote_cmd.fish @ line 2
21function remote_cmd
32 set -l escaped_args
43
-1
.config/fish/functions/rmake.fish
···11-# Defined in /Users/ichamberlain/.config/fish/functions/rmake.fish @ line 2
21function rmake
32 source ~/.config/fish/functions/remote_cmd.fish
43 remote_cmd rmake $argv
-1
.config/fish/functions/rpush.fish
···11-# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.3j2hva/rpush.fish @ line 2
21function rpush
32 source ~/.config/fish/functions/remote_cmd.fish
43 remote_cmd rpush $argv && greset
-1
.config/fish/functions/rrobot.fish
···11-# Defined in /Users/ichamberlain/.config/fish/functions/rrobot.fish @ line 2
21function rrobot
32 source ~/.config/fish/functions/remote_cmd.fish
43 remote_cmd rrobot $argv
-1
.config/fish/functions/sortfile.fish
···11-# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.ixqqIW/sortfile.fish @ line 2
21function sortfile
32 sort -o $argv[1] $argv[1]
43end
-1
.config/fish/functions/sudoedit.fish
···11-# Defined in /Users/ichamberlain/.config/fish/functions/sudoedit.fish @ line 2
21function sudoedit --description 'alias sudoedit=sudo sudo -e'
32 sudo sudo -e $argv;
43end
-1
.config/fish/functions/swap.fish
···11-# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.D9g25f/swap.fish @ line 1
21function swap
32 set -l tmpfile (mktemp)
43 mv "$argv[1]" $tmpfile
-4
.config/fish/functions/time.fish
···11-# Defined in /Users/ichamberlain/.config/fish/functions/time.fish @ line 2
22-function time --description 'alias time=time -p'
33- command time -p $argv;
44-end
-1
.config/fish/functions/tmux_attach.fish
···11-# Defined in /Users/ichamberlain/.config/fish/functions/tmux_attach.fish @ line 2
21function tmux_attach
32 if test (uname) = "Darwin"
43 vssh -t tmux_attach
+2-3
.config/fish/functions/vi.fish
···11-# Defined in /Users/ichamberlain/.config/fish/functions/vi.fish @ line 2
22-function vi --description 'alias vi vim'
33- vim $argv;
11+function vi --wraps=vim --description 'alias vi vim'
22+ vim $argv;
43end
+1-2
.config/fish/functions/vim.fish
···11-# Defined in /Users/ichamberlain/.config/fish/functions/vim.fish @ line 2
21function vim
33- command vim -p $argv
22+ command nvim -p $argv
43end
+10-6
.config/fish/functions/vscode_ext.fish
···11-# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.marwk0/vscode_ext.fish @ line 2
22-function vscode_ext
11+function vscode_ext --description 'Run VSCode with only specific extensions enabled'
3243 function print_help
54 set -l cmd (status current-command)
65 echo $cmd": Run VSCode with only specific extensions enabled"
76 echo
88- echo "USAGE: $cmd [options] <extension-id> [extension-id ...]"
77+ echo "USAGE: $cmd [options] <extension-id> [extension-id ...] [-- code-args ...]"
98 echo
109 echo "OPTIONS:"
1110 echo " -d, --dry-run Print the command that would be run, instead"
···1514 echo
1615 end
17161717+ set -l passthrough_args
1818+ if set -l arg_index (contains --index -- '--' $argv)
1919+ set passthrough_args $argv[(math $arg_index + 1)..-1]
2020+ set -e argv[$arg_index..-1]
2121+ end
2222+1823 set -l options \
1924 (fish_opt --short=h --long=help) \
2025 (fish_opt --short=d --long=dry-run)
···3338 echo $funcname": Expected at least 1 args, got 0"
3439 return 1
3540 end
3636-37413842 set -l extensions (code --list-extensions | grep -v $argv)
3943 set -l code_args "--new-window" --disable-extension={$extensions}
40444145 if test "$_flag_dry_run" != ""
4242- echo code $code_args
4646+ echo code $code_args $passthrough_args
4347 else
4444- code $code_args
4848+ code $code_args $passthrough_args
4549 end
4650end
-1
.config/fish/functions/vssh.fish
···11-# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.Uu7Qy6/vssh.fish @ line 2
21function vssh
32 set -x RHOST (basename (gbase))
43
+4
.config/git/gitconfig.local##class.personal
···11+[user]
22+ name = Ian Chamberlain
33+ email = ian.h.chamberlain@gmail.com
44+ login = ianchamberlain
+4
.config/git/gitconfig.local##class.work
···11+[user]
22+ name = Ian Chamberlain
33+ email = ichamberlain@128technology.com
44+ login = ichamberlain
···3333 install_vscode_exts
3434 fi
35353636+ # Install fishfile packages
3737+ fish -c fisher
3838+3639 echo "macOS setup is complete!"
3740}
3841
+3
.config/yadm/hooks/pre_commit
···3131 echo "It has been auto-updated, and should be committed."
3232 exit 1
3333fi
3434+3535+# TODO: convert other scripts to fish instead of bash (except bootstrap)
3636+fish -c fish_normalize_saved_functions