···11+# This is a standard python config file
22+# Valid values can be True, False, integer numbers, strings
33+# By default bpython will look for $XDG_CONFIG_HOME/bpython/config
44+# ($XDG_CONFIG_HOME defaults to ~/.config) or you can specify a file with the
55+# --config option on the command line
66+#
77+# see http://docs.bpython-interpreter.org/configuration.html
88+# for all configurable options
99+1010+# General section tag
1111+[general]
1212+1313+# Display the autocomplete list as you type (default: True).
1414+# When this is off, you can hit tab to see the suggestions.
1515+# auto_display_list = True
1616+1717+# Syntax highlighting as you type (default: True).
1818+# syntax = True
1919+2020+# Display the arg spec (list of arguments) for callables,
2121+# when possible (default: True).
2222+# arg_spec = True
2323+2424+# History file (default: ~/.pythonhist):
2525+# hist_file = ~/.pythonhist
2626+2727+# Number of lines to store in history (set to 0 to disable) (default: 100):
2828+# hist_length = 100
2929+3030+# Soft tab size (default: 4, see pep-8):
3131+# tab_length = 4
3232+3333+# Color schemes should be put in $XDG_CONFIG_HOME/bpython/ e.g. to use the theme
3434+# $XDG_CONFIG_HOME/bpython/foo.theme set color_scheme = foo. Leave blank or set
3535+# to "default" to use the default theme
3636+# color_scheme = default
3737+3838+# Allow two blank lines before automatic dedent
3939+dedent_after = 2
4040+4141+# External editor to use for editing the current line, block, or full history
4242+# Default is to try $EDITOR and $VISUAL, then vi - but if you uncomment
4343+# the line below that will take precedence
4444+editor = vim
4545+4646+# Whether to append .py to the filename while saving session to a file.
4747+# (default: False)
4848+# save_append_py = False
4949+5050+# The name of a helper executable that should perform pastebin upload on
5151+# bpython's behalf. If unset, bpython uploads pastes to bpaste.net. (default: )
5252+# pastebin_helper = gist.py
5353+5454+# How long an undo must be expected to take before prompting for how
5555+# many lines should be undone. Set to -1 to never prompt, or 0 to
5656+# always prompt.
5757+# single_undo_time = 1.0
5858+5959+# Enable autoreload feature by default (default: False).
6060+# default_autoreload = False
6161+6262+[keyboard]
6363+6464+# All key bindings are shown commented out with their default binding
6565+6666+# pastebin = F8
6767+# last_output = F9
6868+# reimport = F6
6969+# help = F1
7070+# toggle_file_watch = F5
7171+# save = C-s
7272+# undo = C-r
7373+# up_one_line = C-p
7474+# down_one_line = C-n
7575+# cut_to_buffer = C-k
7676+# search = C-o
7777+# yank_from_buffer = C-y
7878+# backspace = C-h
7979+clear_word = C-M-h
8080+# clear_line = C-u
8181+# clear_screen = C-l
8282+# show_source = F2
8383+# exit = C-d
8484+# external_editor = F7
8585+# edit_config = F3
8686+# reverse_incremental_search = M-r
8787+# incremental_search = M-s
8888+8989+[curtsies]
9090+9191+# Allow the the completion and docstring box above the current line
9292+# (default: False)
9393+# list_above = False
9494+9595+# Enables two fish (the shell) style features:
9696+# Previous line key will search for the current line (like reverse incremental
9797+# search) and right arrow will complete the current line with the first match
9898+# from history. (default: True)
9999+right_arrow_completion = True
···11+source (dirname (status --current-filename))/../bazel_vars.fish
22+33+function __tokenize_list
44+ string replace -r "\n" " " -- $argv | string split --no-empty " "
55+end
66+77+function __bazel_needs_command
88+ set cmd (commandline -opc)
99+ if test (count $cmd) -eq 1
1010+ return 0
1111+ end
1212+1313+ for arg in $cmd[2..-1]
1414+ if contains -- $arg $__bazel_command_list
1515+ return 1
1616+ end
1717+ end
1818+1919+ return 0
2020+end
2121+2222+function __bazel_using_command
2323+ set cmd (commandline -opc)
2424+ if test (count $cmd) -gt 1
2525+ if contains -- $argv[1] $cmd
2626+ return 0
2727+ end
2828+ end
2929+ return 1
3030+end
3131+3232+function __bazel_workspace
3333+ set path (pwd)
3434+ while ! test -f $path/WORKSPACE
3535+ if test path = "/"
3636+ return 1
3737+ end
3838+ set path (string split --max 1 --right / $path)[1]
3939+ end
4040+ return 0
4141+end
4242+4343+function __bazel_output
4444+ command bazel $argv 2>/dev/null
4545+end
4646+4747+function __bazel_query
4848+ __bazel_output query --keep_going --order_output=no $argv
4949+end
5050+5151+function __bazel_targets
5252+ if ! __bazel_workspace
5353+ return 0
5454+ end
5555+5656+ set line (commandline --current-process)
5757+ set last_char (string sub --start -1 -- $line)
5858+ set target (string split --no-empty ' ' -- $line)[-1]
5959+6060+ if test $last_char = " "; or string match --quiet --regex '^\-' -- $target
6161+ return 0
6262+ end
6363+6464+ if string match --invert --quiet '//*' -- $target
6565+ # Only deal with absolute targets
6666+ echo '//'
6767+ else
6868+ set dot_target (string match --regex '(.*[\/])[.]{0,3}$' -- $target)
6969+ and echo $dot_target[2]"..."
7070+7171+ set target_types $argv[1] "rule"
7272+7373+ if string match --quiet '*:*' -- $target
7474+ # OK, now find the targets in this package
7575+ set package (string split ':' -- $target)[1]
7676+ set all_targets "$package:all"
7777+7878+ echo $all_targets
7979+ __bazel_query "kind('$target_types', $all_targets)"
8080+ else
8181+ set cur_package (string match --regex '(.*)\/[^\/]*' -- $target)[2]
8282+ __bazel_query "kind('$target_types', $cur_package/...:all)"
8383+ end
8484+ end
8585+end
8686+8787+function __bazel_complete
8888+ complete --no-files --command bazel $argv
8989+end
9090+9191+function __bazel_complete_files
9292+ complete --command bazel $argv
9393+end
9494+9595+function __bazel_complete_options
9696+ set condition $argv[1]
9797+ set options_list (__tokenize_list $argv[2])
9898+9999+ # Enumerate all the startup options as "long options"
100100+ for option in $options_list
101101+ set stripped_opt (string replace -r '^--' '' -- $option)
102102+103103+ set completion_params --no-files
104104+105105+ if string match --quiet -r '=$' -- $stripped_opt
106106+ set -a completion_params --require-parameter
107107+ else if string match --quiet '=path' -- $stripped_opt
108108+ set completion_params --require-parameter
109109+ else if string match --quiet '=label' -- $stripped_opt
110110+ # TODO use __bazel_targets
111111+ set completion_params --require-parameter
112112+ else if string match --quiet '*={*}' -- $stripped_opt
113113+ set -a completion_params --require-parameter
114114+ set enum_values \
115115+ (string replace -r '.*=\{(.*)\}$' '$1' -- $stripped_opt | string split ',' --)
116116+ set -a completion_params --arguments="$enum_values"
117117+ end
118118+119119+ set stripped_opt (string replace -r '=.*' '' -- $stripped_opt)
120120+121121+ complete --command bazel -n "$condition" -l $stripped_opt $completion_params
122122+ end
123123+end
124124+125125+# ==============================================================================
126126+# BEGIN COMPLETIONS
127127+# ==============================================================================
128128+129129+set __bazel_command_list (__tokenize_list $__BAZEL_COMMAND_LIST)
130130+set __bazel_info_keys (__tokenize_list $__BAZEL_INFO_KEYS)
131131+132132+# Generate startup options when no command is specified yet
133133+__bazel_complete_options '__bazel_needs_command' $__BAZEL_STARTUP_OPTIONS
134134+135135+# Help completions
136136+# TODO: Instead of special-casing, this split/enum logic should happen for all commands
137137+set -l help_completions (
138138+ string split ',' -- (
139139+ string match -r '\{(.*)\}' -- $__BAZEL_COMMAND_HELP_ARGUMENT
140140+ )[2]
141141+)
142142+143143+__bazel_complete -n '__bazel_using_command help' -a "$__bazel_command_list $help_completions"
144144+145145+# Per-subcommand completions
146146+for subcommand in $__bazel_command_list
147147+ # Make the subcommand itself a completion
148148+ __bazel_complete -n '__bazel_needs_command' -a $subcommand
149149+150150+ set -l normalized_name (string upper -- $subcommand | string replace '-' '_' --)
151151+152152+ # Add the _FLAGS for each subcommand
153153+ set -l flags "__BAZEL_COMMAND_"$normalized_name"_FLAGS"
154154+ __bazel_complete_options "__bazel_using_command $subcommand" $$flags
155155+156156+ # Use `bazel query` to complete _ARGUMENTS for each subcommand
157157+ set -l argument "__BAZEL_COMMAND_"$normalized_name"_ARGUMENT"
158158+ set -q $argument; and switch $$argument
159159+ case 'info-key'
160160+ __bazel_complete -n "__bazel_using_command $subcommand" -a "$__bazel_info_keys"
161161+ case 'label'
162162+ __bazel_complete -n "__bazel_using_command $subcommand" -a '(__bazel_targets ".*")'
163163+ case 'label-test'
164164+ __bazel_complete -n "__bazel_using_command $subcommand" -a '(__bazel_targets "test")'
165165+ case 'label-bin'
166166+ __bazel_complete -n "__bazel_using_command $subcommand" -a '(__bazel_targets "binary|test")'
167167+ case 'path'
168168+ __bazel_complete_files -n "__bazel_using_command $subcommand"
169169+ case '*'
170170+ # Don't allow file completion by default
171171+ __bazel_complete -n "__bazel_using_command $subcommand"
172172+ end
173173+end
174174+175175+# Add descriptions for subcommands
176176+# TODO: it would be preferable to generate these descriptions from `bazel help` output
177177+__bazel_complete -n '__bazel_needs_command' -a analyze-profile -d 'Analyzes build profile data.'
178178+__bazel_complete -n '__bazel_needs_command' -a build -d 'Builds the specified targets.'
179179+__bazel_complete -n '__bazel_needs_command' -a coverage -d 'Runs tests and collects coverage'
180180+__bazel_complete -n '__bazel_needs_command' -a canonicalize-flags -d 'Canonicalizes a list of bazel options.'
181181+__bazel_complete -n '__bazel_needs_command' -a clean -d 'Removes output files and optionally stops the server.'
182182+__bazel_complete -n '__bazel_needs_command' -a dump -d 'Dumps the internal state of the bazel server process.'
183183+__bazel_complete -n '__bazel_needs_command' -a fetch -d 'Fetches external repositories that are prerequisites to the targets.'
184184+__bazel_complete -n '__bazel_needs_command' -a help -d 'Prints help for commands, or the index.'
185185+__bazel_complete -n '__bazel_needs_command' -a info -d 'Displays runtime info about the bazel server.'
186186+__bazel_complete -n '__bazel_needs_command' -a mobile-install -d 'Installs targets to mobile devices.'
187187+__bazel_complete -n '__bazel_needs_command' -a query -d 'Executes a dependency graph query.'
188188+__bazel_complete -n '__bazel_needs_command' -a run -d 'Runs the specified target.'
189189+__bazel_complete -n '__bazel_needs_command' -a shutdown -d 'Stops the bazel server.'
190190+__bazel_complete -n '__bazel_needs_command' -a test -d 'Builds and runs the specified test targets.'
191191+__bazel_complete -n '__bazel_needs_command' -a version -d 'Prints version information for bazel.'
+6
.config/fish/completions/nvm.fish
···11+complete -xc nvm -n __fish_use_subcommand -a ls -d "List available versions matching <regex>"
22+complete -xc nvm -n __fish_use_subcommand -a use -d "Download <version> and modify PATH to use it"
33+complete -xc nvm -n __fish_use_subcommand -a --help -d "Show usage help"
44+complete -xc nvm -n __fish_use_subcommand -a --version -d "Show the current version of nvm"
55+66+nvm complete
···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
+5
.config/fish/functions/bash_env.fish
···11+# Defined in /Users/ichamberlain/.config/fish/functions/bash_env.fish @ line 2
22+function bash_env
33+ set -x BASH_ENV ~/.bashrc.aliases
44+ command bash -c "$argv"
55+end
+4
.config/fish/functions/beep.fish
···11+# Defined in /Users/ichamberlain/.config/fish/functions/beep.fish @ line 2
22+function beep --description 'Shortcut to print the bell character'
33+ echo -n \a $argv;
44+end
+28
.config/fish/functions/dsh.fish
···11+# Defined in /Users/ichamberlain/.config/fish/functions/dsh.fish @ line 2
22+function dsh
33+ if test (uname) = "Darwin"
44+ echo "dsh not supported on macOS!"
55+ return 1
66+ end
77+88+ pushd ~/Documents/workspace
99+1010+ set -l dlib "tools/dlib.sh"
1111+1212+ if ! test -f "$dlib"
1313+ echo "'"(pwd)"/$dlib' does not exist!"
1414+ return 1
1515+ end
1616+1717+ bash -c '
1818+ set -o nounset
1919+2020+ source tools/dlib.sh
2121+ dlib_args="$(dlib_parse_args $@)"
2222+ shift $?
2323+2424+ dlib_workflow $dlib_args -- "$@"
2525+ ' -- $argv
2626+2727+ popd
2828+end
+4
.config/fish/functions/f.fish
···11+# Defined in /Users/ichamberlain/.config/fish/functions/f.fish @ line 2
22+function f --description 'alias f fuck'
33+ fuck $argv;
44+end
+4
.config/fish/functions/func_name.fish
···11+# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.eXZO0F/func_name.fish @ line 2
22+function func_name
33+ echo (status current-command)
44+end
···11+# Defined in /Users/ichamberlain/.config/fish/functions/generate_bazel_completions.fish @ line 2
22+function generate_bazel_completions --description 'Print a list of completion strings for bazel'
33+ command bazel help completion | sed -E 's/([A-Z_]+)=(.+)/set __\1 \2/g'
44+end
+12
.config/fish/functions/generate_i95_targets.fish
···11+# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.0IaV7o/generate_i95_targets.fish @ line 2
22+function generate_i95_targets
33+ date
44+ if ! count $argv >/dev/null
55+ echo "Error: no I95 repository specified"
66+ return 1
77+ end
88+ set -l dir $argv[1]
99+ cd $dir/build
1010+ make help | sed 's/\.\.\. //' > i95_cmake_targets.txt
1111+ echo "Completed generating i95 targets!"
1212+end
+4
.config/fish/functions/history.fish
···11+# Defined in /Users/ichamberlain/.config/fish/functions/history.fish @ line 2
22+function history --description alias\ history\ \'history\ --show-time=\"\%F\ \%T\ \"\'
33+ builtin history --reverse --show-time="%F %T \$ " $argv;
44+end
+4
.config/fish/functions/mux.fish
···11+# Defined in /Users/ichamberlain/.config/fish/functions/mux.fish @ line 2
22+function mux
33+ tmux_attach $argv
44+end
+232
.config/fish/functions/nvm.fish
···11+set -g nvm_version 1.0.1
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
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 --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
+63
.config/fish/functions/rcheck.fish
···11+# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.MB1mBw/rcheck.fish @ line 2
22+function rcheck --description 'Build and validate C++ unity targets with rmake and validate'
33+ source ~/.config/fish/functions/remote_cmd.fish
44+55+ function print_help
66+ set -l cmd (status current-command)
77+ echo $cmd": Build and validate C++ unity targets with rmake and validate"
88+ echo
99+ echo "USAGE: $cmd [options] <target> [target ...]"
1010+ echo
1111+ echo "OPTIONS:"
1212+ echo
1313+ echo " -d | --dry-run Only print the command that would be run,"
1414+ echo " instead of running it"
1515+ echo
1616+ echo " -b <arg> | --build-arg=<arg> Argument to pass to the build command. May be"
1717+ echo " specified multiple times, once per argument"
1818+ echo
1919+ echo " -t <arg> | --test-arg=<arg> Argument to pass to the validate command. May be"
2020+ echo " specified multiple times, once per argument"
2121+ echo
2222+ echo " -h, --help Show this help"
2323+ echo
2424+ end
2525+2626+ set -l options \
2727+ (fish_opt --short=d --long=dry-run) \
2828+ (fish_opt --short=b --long=build-arg --required-val --multiple-vals) \
2929+ (fish_opt --short=t --long=test-arg --required-val --multiple-vals) \
3030+ (fish_opt --short=h --long=help) \
3131+3232+ set -l cmd (status current-command)
3333+ argparse --name=$cmd $options -- $argv; or return $status
3434+3535+ if test "$_flag_help" != ""
3636+ print_help >&2
3737+ return
3838+ end
3939+4040+ if test (count $argv) -lt 1
4141+ echo $cmd": Expected at least 1 args, got 0" >&2
4242+ return 1
4343+ end
4444+4545+ set -l build_targets
4646+ set -l test_targets
4747+ # Remaining unparsed arguments are build/test targets
4848+ for target in $argv
4949+ set -a build_targets $target"_unity"
5050+ set -a test_targets $target
5151+ end
5252+5353+ set build_command \
5454+ rmake $_flag_build_arg $build_targets \
5555+ '&&' \
5656+ tools/dvalidate -c -run $test_targets $_flag_test_arg
5757+5858+ if test "$_flag_dry_run" != ""
5959+ echo "Would have run command: '$build_command'"
6060+ else
6161+ remote_cmd $build_command
6262+ end
6363+end
+59
.config/fish/functions/refresh_branches.fish
···11+# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.r7lxdD/refresh_branches.fish @ line 2
22+function refresh_branches
33+ date
44+ echo
55+ echo "=========================================================================="
66+77+ echo "Pruning old docker images, containers, etc."
88+ if type -q docker
99+ docker system prune --all --force --filter "until=72h"
1010+ end
1111+ echo
1212+1313+ set -l branches \
1414+ "develop" \
1515+ "release/4.5" \
1616+ "release/4.4" \
1717+ "release/4.3" \
1818+ "release/4.2" \
1919+ "feature/rbac"
2020+2121+ if test (uname) != "Darwin"
2222+ set dlib (/usr/local/bin/gbase)"/tools/dlib.sh"
2323+ end
2424+2525+ git stash push -m "temporary stash to update branches" | grep --quiet "No local changes to save"
2626+ set stashed_git_changes $status
2727+2828+ function cleanup --inherit-variable stashed_git_changes
2929+ if test $stashed_git_changes = 1
3030+ git stash pop
3131+ end
3232+3333+ echo "=========================================================================="
3434+ echo
3535+ end
3636+3737+ trap cleanup EXIT
3838+3939+ for branch in $branches
4040+ echo "Refreshing upstream branch '$branch'"
4141+4242+ git checkout $branch
4343+ if ! git pull --prune --ff-only origin $branch
4444+ echo "Failed to pull '$branch'"
4545+ git checkout -
4646+ echo
4747+ continue
4848+ end
4949+5050+ if set -q dlib
5151+ echo "Pulling docker images with dlib '$dlib'"
5252+ bash -c "source $dlib && dlib_pull_release"
5353+ end
5454+5555+ # Restore the previous branch
5656+ git checkout -
5757+ echo
5858+ end
5959+end
+15
.config/fish/functions/remote_cmd.fish
···11+# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.Y3llUP/remote_cmd.fish @ line 2
22+function remote_cmd
33+ set -l escaped_args
44+55+ for arg in $argv[2..-1]
66+ switch $arg
77+ case '&&' '||' ';'
88+ set -a escaped_args $arg
99+ case '*'
1010+ set -a escaped_args (string escape --no-quoted -- $arg)
1111+ end
1212+ end
1313+1414+ command $argv[1] $escaped_args
1515+end
+5
.config/fish/functions/rmake.fish
···11+# Defined in /Users/ichamberlain/.config/fish/functions/rmake.fish @ line 2
22+function rmake
33+ source ~/.config/fish/functions/remote_cmd.fish
44+ remote_cmd rmake $argv
55+end
+5
.config/fish/functions/rpush.fish
···11+# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.3j2hva/rpush.fish @ line 2
22+function rpush
33+ source ~/.config/fish/functions/remote_cmd.fish
44+ remote_cmd rpush $argv && greset
55+end
+5
.config/fish/functions/rrobot.fish
···11+# Defined in /Users/ichamberlain/.config/fish/functions/rrobot.fish @ line 2
22+function rrobot
33+ source ~/.config/fish/functions/remote_cmd.fish
44+ remote_cmd rrobot $argv
55+end
+4
.config/fish/functions/sortfile.fish
···11+# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.ixqqIW/sortfile.fish @ line 2
22+function sortfile
33+ sort -o $argv[1] $argv[1]
44+end
+4
.config/fish/functions/sudoedit.fish
···11+# Defined in /Users/ichamberlain/.config/fish/functions/sudoedit.fish @ line 2
22+function sudoedit --description 'alias sudoedit=sudo sudo -e'
33+ sudo sudo -e $argv;
44+end
+7
.config/fish/functions/swap.fish
···11+# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.D9g25f/swap.fish @ line 1
22+function swap
33+ set -l tmpfile (mktemp)
44+ mv "$argv[1]" $tmpfile
55+ mv "$argv[2]" "$argv[1]"
66+ mv $tmpfile "$argv[2]"
77+end
+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
+14
.config/fish/functions/tmux_attach.fish
···11+# Defined in /Users/ichamberlain/.config/fish/functions/tmux_attach.fish @ line 2
22+function tmux_attach
33+ if test (uname) = "Darwin"
44+ vssh -t tmux_attach
55+ else
66+ if tmux ls
77+ if test $TERM_PROGRAM = "iTerm.app"
88+ command tmux -CC attach $argv
99+ else
1010+ command tmux attach $argv
1111+ end
1212+ end
1313+ end
1414+end
+4
.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;
44+end
+4
.config/fish/functions/vim.fish
···11+# Defined in /Users/ichamberlain/.config/fish/functions/vim.fish @ line 2
22+function vim
33+ command vim -p $argv
44+end
+4
.config/fish/functions/vs.fish
···11+# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.AWuPwF/vs.fish @ line 1
22+function vs
33+44+end
+46
.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
33+44+ function print_help
55+ set -l cmd (status current-command)
66+ echo $cmd": Run VSCode with only specific extensions enabled"
77+ echo
88+ echo "USAGE: $cmd [options] <extension-id> [extension-id ...]"
99+ echo
1010+ echo "OPTIONS:"
1111+ echo " -d, --dry-run Print the command that would be run, instead"
1212+ echo " of actually running it"
1313+ echo
1414+ echo " -h, --help Show this help"
1515+ echo
1616+ end
1717+1818+ set -l options \
1919+ (fish_opt --short=h --long=help) \
2020+ (fish_opt --short=d --long=dry-run)
2121+2222+ set -l funcname (status current-command)
2323+2424+ argparse --name=$funcname $options -- $argv
2525+ or return $status
2626+2727+ if test "$_flag_help" != ""
2828+ print_help >&2
2929+ return
3030+ end
3131+3232+ if test (count $argv) -lt 1
3333+ echo $funcname": Expected at least 1 args, got 0"
3434+ return 1
3535+ end
3636+3737+3838+ set -l extensions (code --list-extensions | grep -v $argv)
3939+ set -l code_args "--new-window" --disable-extension={$extensions}
4040+4141+ if test "$_flag_dry_run" != ""
4242+ echo code $code_args
4343+ else
4444+ code $code_args
4545+ end
4646+end
+21
.config/fish/functions/vssh.fish
···11+# Defined in /var/folders/4w/bjgmcfds1nv33zqkhf2q2_340000gp/T//fish.Uu7Qy6/vssh.fish @ line 2
22+function vssh
33+ set -x RHOST (basename (gbase))
44+55+ set -l host
66+77+ if ping -c 1 -W 1 $RHOST >/dev/null 2>&1
88+ set host $RHOST
99+ else
1010+ set host dev
1111+ end
1212+1313+ if ! count $argv >/dev/null
1414+ set -l working_dir (pwd)
1515+ set -l cmd "test -d $working_dir && cd $working_dir; exec \$SHELL -li"
1616+1717+ command ssh -t $host "$cmd"
1818+ else
1919+ command ssh $host $argv
2020+ end
2121+end
+54
.config/fish/i95_cmake_targets.fish
···11+set rg_opts \
22+ --only-matching \
33+ --no-column \
44+ --no-line-number \
55+ --color never \
66+ --no-filename
77+88+function __complete_cmd
99+ complete --no-files --command $argv
1010+end
1111+1212+function __list_targets
1313+ set -l search_regex $argv[1]
1414+1515+ set -l build_dir (gbase)"/build"
1616+1717+ vssh "if test -d $build_dir; cd $build_dir && cat i95_cmake_targets.txt; end" | egrep "$search_regex"
1818+1919+ # Ripgrep for dumb heuristic:
2020+ # rg $rg_opts --glob 'CMakeLists.txt' --replace '$target' -- $search_regex'.*$' (gbase) \
2121+ # | string trim -- \
2222+ # | string replace '${PROJECT_NAME}' '128T' -- \
2323+ # | egrep -v '\$|#.*' # exclude things with unexpanded variables or commented out
2424+end
2525+2626+function __complete_build_opts
2727+ set cmd $argv[1]
2828+2929+ set build_script (gbase)/tools/env_scripts/build
3030+ if ! test -x $build_script
3131+ return
3232+ end
3333+3434+ set build_opts (
3535+ $build_script -h \
3636+ | rg $rg_opts --replace '$1' -- '-(\S+)\s+[-].*$' - \
3737+ | grep -v '\[|\]' \
3838+ | string replace '/' "\n" -- \
3939+ | string trim --
4040+ )
4141+4242+ for build_opt in $build_opts
4343+ if string match --quiet "*=*" -- $build_opt
4444+ set split_opt (string split "=" $build_opt)
4545+ __complete_cmd $cmd --old-option $split_opt[1] -x
4646+ else if string match "(no)*" -- $build_opt
4747+ set positive_opt (string replace "(no)" "" -- $build_opt)
4848+ __complete_cmd $cmd --old-option $positive_opt
4949+ __complete_cmd $cmd --old-option "no$positive_opt"
5050+ else
5151+ __complete_cmd $cmd --old-option $build_opt
5252+ end
5353+ end
5454+end
+92
.config/fish/iterm2_shell_integration.fish
···11+# This program is free software; you can redistribute it and/or
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+#
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+#
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.
1414+1515+if begin; status --is-interactive; and not functions -q -- iterm2_status; and [ "$ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX""$TERM" != screen ]; and [ "$TERM" != dumb ]; and [ "$TERM" != linux ]; end
1616+ function iterm2_status
1717+ printf "\033]133;D;%s\007" $argv
1818+ end
1919+2020+ # Mark start of prompt
2121+ function iterm2_prompt_mark
2222+ printf "\033]133;A\007"
2323+ end
2424+2525+ # Mark end of prompt
2626+ function iterm2_prompt_end
2727+ printf "\033]133;B\007"
2828+ end
2929+3030+ # Tell terminal to create a mark at this location
3131+ function iterm2_preexec --on-event fish_preexec
3232+ # For other shells we would output status here but we can't do that in fish.
3333+ printf "\033]133;C;\007"
3434+ end
3535+3636+ # Usage: iterm2_set_user_var key value
3737+ # These variables show up in badges (and later in other places). For example
3838+ # iterm2_set_user_var currentDirectory "$PWD"
3939+ # Gives a variable accessible in a badge by \(user.currentDirectory)
4040+ # Calls to this go in iterm2_print_user_vars.
4141+ function iterm2_set_user_var
4242+ printf "\033]1337;SetUserVar=%s=%s\007" "$argv[1]" (printf "%s" "$argv[2]" | base64 | tr -d "\n")
4343+ end
4444+4545+ function iterm2_write_remotehost_currentdir_uservars
4646+ printf "\033]1337;RemoteHost=%s@%s\007\033]1337;CurrentDir=%s\007" $USER $iterm2_hostname $PWD
4747+4848+ # Users can define a function called iterm2_print_user_vars.
4949+ # It should call iterm2_set_user_var and produce no other output.
5050+ if functions -q -- iterm2_print_user_vars
5151+ iterm2_print_user_vars
5252+ end
5353+5454+ end
5555+5656+ functions -c fish_prompt iterm2_fish_prompt
5757+5858+ functions -c fish_mode_prompt iterm2_fish_mode_prompt
5959+ function fish_mode_prompt --description 'Write out the mode prompt; do not replace this. Instead, change fish_mode_prompt before sourcing .iterm2_shell_integration.fish, or modify iterm2_fish_mode_prompt instead.'
6060+ set -l last_status $status
6161+6262+ iterm2_status $last_status
6363+ iterm2_write_remotehost_currentdir_uservars
6464+ if not functions iterm2_fish_prompt | grep iterm2_prompt_mark > /dev/null
6565+ iterm2_prompt_mark
6666+ end
6767+ sh -c "exit $last_status"
6868+6969+ iterm2_fish_mode_prompt
7070+ end
7171+7272+ function fish_prompt --description 'Write out the prompt; do not replace this. Instead, change fish_prompt before sourcing .iterm2_shell_integration.fish, or modify iterm2_fish_prompt instead.'
7373+ # Remove the trailing newline from the original prompt. This is done
7474+ # using the string builtin from fish, but to make sure any escape codes
7575+ # are correctly interpreted, use %b for printf.
7676+ printf "%b" (string join "\n" (iterm2_fish_prompt))
7777+7878+ iterm2_prompt_end
7979+ end
8080+8181+ # If hostname -f is slow for you, set iterm2_hostname before sourcing this script
8282+ if not set -q -g iterm2_hostname
8383+ set -g iterm2_hostname (hostname -f 2>/dev/null)
8484+ # some flavors of BSD (i.e. NetBSD and OpenBSD) don't have the -f option
8585+ if test $status -ne 0
8686+ set -g iterm2_hostname (hostname)
8787+ end
8888+ end
8989+9090+ iterm2_write_remotehost_currentdir_uservars
9191+ printf "\033]1337;ShellIntegrationVersion=10;shell=fish\007"
9292+end
+13
.config/gdb/init.py
···11+#!/usr/bin/env python2
22+33+from __future__ import print_function
44+55+import re
66+77+# Replace working dir /i95code with ~/Documents/workspace
88+# This make things like cmd+click work properly
99+pwd_str = gdb.execute("pwd", from_tty=False, to_string=True).strip()
1010+1111+new_pwd = re.sub(r"^.+/i95code/(.+)\.$", r"~/Documents/workspace/\1", pwd_str)
1212+print("cwd: '{}'".format(new_pwd))
1313+gdb.execute("cd {}".format(new_pwd))
+7
.gdbinit
···11+# For macos:
22+# add-auto-load-safe-path ~/.pyenv
33+# set startup-with-shell off
44+55+source ~/.config/gdb/init.py
66+set substitute-path /i95code ~/Documents/workspace
77+directory ~/Documents/workspace