···3232function __bazel_workspace
3333 set path (pwd)
3434 while ! test -f $path/WORKSPACE
3535- if test path = "/"
3535+ if test path = /
3636 return 1
3737 end
3838 set path (string split --max 1 --right / $path)[1]
···63636464 if string match --invert --quiet '//*' -- $target
6565 # Only deal with absolute targets
6666- echo '//'
6666+ echo //
6767 else
6868 set dot_target (string match --regex '(.*[\/])[.]{0,3}$' -- $target)
6969 and echo $dot_target[2]"..."
70707171- set target_types $argv[1] "rule"
7171+ set target_types $argv[1] rule
72727373 if string match --quiet '*:*' -- $target
7474 # OK, now find the targets in this package
···152152if ! set -q $__BAZEL_STARTUP_OPTIONS
153153 set __STRIPPED_BAZEL_STARTUP_OPTIONS (__tokenize_options $__BAZEL_STARTUP_OPTIONS)
154154end
155155-__bazel_complete_options '__bazel_needs_command' __STRIPPED_BAZEL_STARTUP_OPTIONS
155155+__bazel_complete_options __bazel_needs_command __STRIPPED_BAZEL_STARTUP_OPTIONS
156156157157# Help completions
158158# TODO: Instead of special-casing, this split/enum logic should happen for all commands
···167167# Per-subcommand completions
168168for subcommand in $__bazel_command_list
169169 # Make the subcommand itself a completion
170170- __bazel_complete -n '__bazel_needs_command' -a $subcommand
170170+ __bazel_complete -n __bazel_needs_command -a $subcommand
171171172172 set normalized_name (string upper -- $subcommand | string replace '-' '_' --)
173173···183183 # Use `bazel query` to complete _ARGUMENTS for each subcommand
184184 set -l argument "__BAZEL_COMMAND_"$normalized_name"_ARGUMENT"
185185 set -q $argument; and switch $$argument
186186- case 'info-key'
186186+ case info-key
187187 __bazel_complete -n "__bazel_using_command $subcommand" -a "$__bazel_info_keys"
188188- case 'label'
188188+ case label
189189 __bazel_complete -n "__bazel_using_command $subcommand" -a '(__bazel_targets ".*")'
190190- case 'label-test'
190190+ case label-test
191191 __bazel_complete -n "__bazel_using_command $subcommand" -a '(__bazel_targets "test")'
192192- case 'label-bin'
192192+ case label-bin
193193 __bazel_complete -n "__bazel_using_command $subcommand" -a '(__bazel_targets "binary|test")'
194194- case 'path'
194194+ case path
195195 __bazel_complete_files -n "__bazel_using_command $subcommand"
196196 case '*'
197197 # Don't allow file completion by default
···201201202202# Add descriptions for subcommands
203203# TODO: it would be preferable to generate these descriptions from `bazel help` output
204204-__bazel_complete -n '__bazel_needs_command' -a analyze-profile -d 'Analyzes build profile data.'
205205-__bazel_complete -n '__bazel_needs_command' -a build -d 'Builds the specified targets.'
206206-__bazel_complete -n '__bazel_needs_command' -a coverage -d 'Runs tests and collects coverage'
207207-__bazel_complete -n '__bazel_needs_command' -a canonicalize-flags -d 'Canonicalizes a list of bazel options.'
208208-__bazel_complete -n '__bazel_needs_command' -a clean -d 'Removes output files and optionally stops the server.'
209209-__bazel_complete -n '__bazel_needs_command' -a dump -d 'Dumps the internal state of the bazel server process.'
210210-__bazel_complete -n '__bazel_needs_command' -a fetch -d 'Fetches external repositories that are prerequisites to the targets.'
211211-__bazel_complete -n '__bazel_needs_command' -a help -d 'Prints help for commands, or the index.'
212212-__bazel_complete -n '__bazel_needs_command' -a info -d 'Displays runtime info about the bazel server.'
213213-__bazel_complete -n '__bazel_needs_command' -a mobile-install -d 'Installs targets to mobile devices.'
214214-__bazel_complete -n '__bazel_needs_command' -a query -d 'Executes a dependency graph query.'
215215-__bazel_complete -n '__bazel_needs_command' -a run -d 'Runs the specified target.'
216216-__bazel_complete -n '__bazel_needs_command' -a shutdown -d 'Stops the bazel server.'
217217-__bazel_complete -n '__bazel_needs_command' -a test -d 'Builds and runs the specified test targets.'
218218-__bazel_complete -n '__bazel_needs_command' -a version -d 'Prints version information for bazel.'
204204+__bazel_complete -n __bazel_needs_command -a analyze-profile -d 'Analyzes build profile data.'
205205+__bazel_complete -n __bazel_needs_command -a build -d 'Builds the specified targets.'
206206+__bazel_complete -n __bazel_needs_command -a coverage -d 'Runs tests and collects coverage'
207207+__bazel_complete -n __bazel_needs_command -a canonicalize-flags -d 'Canonicalizes a list of bazel options.'
208208+__bazel_complete -n __bazel_needs_command -a clean -d 'Removes output files and optionally stops the server.'
209209+__bazel_complete -n __bazel_needs_command -a dump -d 'Dumps the internal state of the bazel server process.'
210210+__bazel_complete -n __bazel_needs_command -a fetch -d 'Fetches external repositories that are prerequisites to the targets.'
211211+__bazel_complete -n __bazel_needs_command -a help -d 'Prints help for commands, or the index.'
212212+__bazel_complete -n __bazel_needs_command -a info -d 'Displays runtime info about the bazel server.'
213213+__bazel_complete -n __bazel_needs_command -a mobile-install -d 'Installs targets to mobile devices.'
214214+__bazel_complete -n __bazel_needs_command -a query -d 'Executes a dependency graph query.'
215215+__bazel_complete -n __bazel_needs_command -a run -d 'Runs the specified target.'
216216+__bazel_complete -n __bazel_needs_command -a shutdown -d 'Stops the bazel server.'
217217+__bazel_complete -n __bazel_needs_command -a test -d 'Builds and runs the specified test targets.'
218218+__bazel_complete -n __bazel_needs_command -a version -d 'Prints version information for bazel.'
+5-1
.config/fish/completions/cargo.fish
···11-source /usr/local/share/fish/completions/cargo.fish
11+if test -f /usr/local/share/fish/completions/cargo.fish
22+ source /usr/local/share/fish/completions/cargo.fish
33+else if test -f /usr/share/fish/completions/cargo.fish
44+ source /usr/share/fish/completions/cargo.fish
55+end
2637# https://github.com/fish-shell/fish-shell/issues/8429
48function __list_cargo_examples
-1
.config/fish/completions/dsh.fish
···21212222complete -c dsh --short-option=- \
2323 --description "Forward remaining args to shell in container"
2424-
···4455function __fish_vscode_ext_complete_wrap_code
66 set -l cmd (commandline -opc)
77- contains -- '--' $cmd
77+ contains -- -- $cmd
88end
991010complete -c vscode_ext --wraps code
···1717complete -c vscode_ext -n '! __fish_vscode_ext_complete_wrap_code' \
1818 -l help -s d -d "Show help text"
1919complete -c vscode_ext -n '! __fish_vscode_ext_complete_wrap_code' \
2020- -s '-' -d "Pass through remaining args to code"
2020+ -s - -d "Pass through remaining args to code"
21212222-complete -c vscode_ext -n '__fish_vscode_ext_complete_wrap_code' --wraps=code
2222+complete -c vscode_ext -n __fish_vscode_ext_complete_wrap_code --wraps=code
+17-17
.config/fish/completions/yadm.fish
···2727end
28282929# yadm's specific autocomplete
3030-complete -x -c yadm -n '__fish_yadm_needs_command' -a 'clone' -d 'Clone an existing repository'
3030+complete -x -c yadm -n __fish_yadm_needs_command -a clone -d 'Clone an existing repository'
3131complete -F -c yadm -n '__fish_yadm_using_command clone' -s w -d 'work-tree to use (default: $HOME)'
3232complete -f -c yadm -n '__fish_yadm_using_command clone' -s b -d 'branch to clone'
3333complete -x -c yadm -n '__fish_yadm_using_command clone' -s f -d 'force to overwrite'
3434complete -x -c yadm -n '__fish_yadm_using_command clone' -l bootstrap -d 'force bootstrap to run'
3535complete -x -c yadm -n '__fish_yadm_using_command clone' -l no-bootstrap -d 'prevent bootstrap from beingrun'
36363737-complete -x -c yadm -n '__fish_yadm_needs_command' -a 'alt' -d 'Create links for alternates'
3838-complete -x -c yadm -n '__fish_yadm_needs_command' -a 'bootstrap' -d 'Execute $HOME/.config/yadm/bootstrap'
3939-complete -x -c yadm -n '__fish_yadm_needs_command' -a 'perms' -d 'Fix perms for private files'
4040-complete -x -c yadm -n '__fish_yadm_needs_command' -a 'enter' -d 'Run sub-shell with GIT variables set'
4141-complete -c yadm -n '__fish_yadm_needs_command' -a 'git-crypt' -d 'Run git-crypt commands for the yadm repo'
4242-complete -x -c yadm -n '__fish_yadm_needs_command' -a 'help' -d 'Print a summary of yadm commands'
4343-complete -x -c yadm -n '__fish_yadm_needs_command' -a 'upgrade' -d 'Upgrade to version 2 of yadm directory structure'
4444-complete -x -c yadm -n '__fish_yadm_needs_command' -a 'version' -d 'Print the version of yadm'
3737+complete -x -c yadm -n __fish_yadm_needs_command -a alt -d 'Create links for alternates'
3838+complete -x -c yadm -n __fish_yadm_needs_command -a bootstrap -d 'Execute $HOME/.config/yadm/bootstrap'
3939+complete -x -c yadm -n __fish_yadm_needs_command -a perms -d 'Fix perms for private files'
4040+complete -x -c yadm -n __fish_yadm_needs_command -a enter -d 'Run sub-shell with GIT variables set'
4141+complete -c yadm -n __fish_yadm_needs_command -a git-crypt -d 'Run git-crypt commands for the yadm repo'
4242+complete -x -c yadm -n __fish_yadm_needs_command -a help -d 'Print a summary of yadm commands'
4343+complete -x -c yadm -n __fish_yadm_needs_command -a upgrade -d 'Upgrade to version 2 of yadm directory structure'
4444+complete -x -c yadm -n __fish_yadm_needs_command -a version -d 'Print the version of yadm'
45454646-complete -x -c yadm -n '__fish_yadm_needs_command' -a 'init' -d 'Initialize an empty repository'
4646+complete -x -c yadm -n __fish_yadm_needs_command -a init -d 'Initialize an empty repository'
4747complete -x -c yadm -n '__fish_yadm_using_command init' -s f -d 'force to overwrite'
4848complete -F -c yadm -n '__fish_yadm_using_command init' -s w -d 'set work-tree (default: $HOME)'
49495050-complete -x -c yadm -n '__fish_yadm_needs_command' -a 'list' -d 'List tracked files at current directory'
5050+complete -x -c yadm -n __fish_yadm_needs_command -a list -d 'List tracked files at current directory'
5151complete -x -c yadm -n '__fish_yadm_using_command list' -s a -d 'list all managed files instead'
52525353-complete -x -c yadm -n '__fish_yadm_needs_command' -a 'encrypt' -d 'Encrypt files'
5454-complete -x -c yadm -n '__fish_yadm_needs_command' -a 'decrypt' -d 'Decrypt files'
5353+complete -x -c yadm -n __fish_yadm_needs_command -a encrypt -d 'Encrypt files'
5454+complete -x -c yadm -n __fish_yadm_needs_command -a decrypt -d 'Decrypt files'
5555complete -x -c yadm -n '__fish_yadm_using_command decrypt' -s l -d 'list the files stored without extracting'
56565757-complete -x -c yadm -n '__fish_yadm_needs_command' -a 'introspect' -d 'Report internal yadm data'
5858-complete -x -c yadm -n '__fish_yadm_using_command introspect' -a (printf -- '%s\n' 'commands configs repo switches') -d 'category'
5757+complete -x -c yadm -n __fish_yadm_needs_command -a introspect -d 'Report internal yadm data'
5858+complete -x -c yadm -n '__fish_yadm_using_command introspect' -a (printf -- '%s\n' 'commands configs repo switches') -d category
59596060-complete -x -c yadm -n '__fish_yadm_needs_command' -a 'gitconfig' -d 'Pass options to the git config command'
6161-complete -x -c yadm -n '__fish_yadm_needs_command' -a 'config' -d 'Configure a setting'
6060+complete -x -c yadm -n __fish_yadm_needs_command -a gitconfig -d 'Pass options to the git config command'
6161+complete -x -c yadm -n __fish_yadm_needs_command -a config -d 'Configure a setting'
6262for name in (yadm introspect configs)
6363 complete -x -c yadm -n '__fish_yadm_using_command config' -a "$name" -d 'yadm config'
6464end
+1-1
.config/fish/conf.d/10-curl.fish
···11# Use latest curl version from brew for updated SSL support
22-set -Ux fish_user_paths "/usr/local/opt/curl/bin" $fish_user_paths
22+set -Ux fish_user_paths /usr/local/opt/curl/bin $fish_user_paths
+2
.config/fish/conf.d/50-config.fish
···55set -gx DEVKITPRO /opt/devkitpro
66set -gx DEVKITARM $DEVKITPRO/devkitARM
7788+set -gx CARGO_UNSTABLE_SPARSE_REGISTRY true
99+810if not set -gq GPG_TTY
911 # Set a proper TTY for gpg commands to work
1012 set -gx GPG_TTY (tty)
···11function __fish_bind_bang
22 switch (commandline --current-token)[-1]
33- case "!"
44- # Without the `--`, the functionality can break when completing
55- # flags used in the history (since, in certain edge cases
66- # `commandline` will assume that *it* should try to interpret
77- # the flag)
88- commandline --current-token -- $history[1]
99- commandline --function repaint
1010- case "*"
1111- commandline --insert !
33+ case "!"
44+ # Without the `--`, the functionality can break when completing
55+ # flags used in the history (since, in certain edge cases
66+ # `commandline` will assume that *it* should try to interpret
77+ # the flag)
88+ commandline --current-token -- $history[1]
99+ commandline --function repaint
1010+ case "*"
1111+ commandline --insert !
1212 end
1313end
+40-40
.config/fish/functions/__fish_bind_dollar.fish
···11function __fish_bind_dollar
22 switch (commandline --current-token)[-1]
33- # This case lets us still type a literal `!$` if we need to (by
44- # typing `!\$`). Probably overkill.
55- case "*!\\"
66- # Without the `--`, the functionality can break when completing
77- # flags used in the history (since, in certain edge cases
88- # `commandline` will assume that *it* should try to interpret
99- # the flag)
1010- commandline --current-token -- (echo -ns (commandline --current-token)[-1] | head -c '-1')
1111- commandline --insert '$'
1212- case "!"
1313- commandline --current-token ""
1414- commandline --function history-token-search-backward
33+ # This case lets us still type a literal `!$` if we need to (by
44+ # typing `!\$`). Probably overkill.
55+ case "*!\\"
66+ # Without the `--`, the functionality can break when completing
77+ # flags used in the history (since, in certain edge cases
88+ # `commandline` will assume that *it* should try to interpret
99+ # the flag)
1010+ commandline --current-token -- (echo -ns (commandline --current-token)[-1] | head -c '-1')
1111+ commandline --insert '$'
1212+ case "!"
1313+ commandline --current-token ""
1414+ commandline --function history-token-search-backward
151516161717- # Main difference from referenced version is this `*!` case
1818- # =========================================================
1919- #
2020- # If the `!$` is preceded by any text, search backward for tokens
2121- # that contain that text as a substring. E.g., if we'd previously
2222- # run
2323- #
2424- # git checkout -b a_feature_branch
2525- # git checkout master
2626- #
2727- # then the `fea!$` in the following would be replaced with
2828- # `a_feature_branch`
2929- #
3030- # git branch -d fea!$
3131- #
3232- # and our command line would look like
3333- #
3434- # git branch -d a_feature_branch
3535- #
3636- case "*!"
3737- # Without the `--`, the functionality can break when completing
3838- # flags used in the history (since, in certain edge cases
3939- # `commandline` will assume that *it* should try to interpret
4040- # the flag)
4141- commandline --current-token -- (echo -ns (commandline --current-token)[-1] | head -c '-1')
4242- commandline --function history-token-search-backward
4343- case "*"
4444- commandline --insert '$'
1717+ # Main difference from referenced version is this `*!` case
1818+ # =========================================================
1919+ #
2020+ # If the `!$` is preceded by any text, search backward for tokens
2121+ # that contain that text as a substring. E.g., if we'd previously
2222+ # run
2323+ #
2424+ # git checkout -b a_feature_branch
2525+ # git checkout master
2626+ #
2727+ # then the `fea!$` in the following would be replaced with
2828+ # `a_feature_branch`
2929+ #
3030+ # git branch -d fea!$
3131+ #
3232+ # and our command line would look like
3333+ #
3434+ # git branch -d a_feature_branch
3535+ #
3636+ case "*!"
3737+ # Without the `--`, the functionality can break when completing
3838+ # flags used in the history (since, in certain edge cases
3939+ # `commandline` will assume that *it* should try to interpret
4040+ # the flag)
4141+ commandline --current-token -- (echo -ns (commandline --current-token)[-1] | head -c '-1')
4242+ commandline --function history-token-search-backward
4343+ case "*"
4444+ commandline --insert '$'
4545 end
4646end
···11+function fish_check_saved_functions --description 'check syntax of saved files'
22+ set -l exclude_functions \
33+ fish_check_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+ continue
1313+ end
1414+1515+ funcsave $func_name &>/dev/null
1616+ sed -e '/ Defined in .*\.fish/d' $fish_function >$fish_function.new
1717+ mv $fish_function.new $fish_function
1818+ end
1919+2020+ set -l retcode 0
2121+2222+ for fish_file in ~/.config/fish/**/*.fish
2323+ if contains $fish_file $exclude_functions
2424+ continue
2525+ end
2626+2727+ if ! fish --no-execute $fish_file
2828+ set -l retcode (math 1 + $retcode)
2929+ end
3030+ end
3131+3232+ fish_indent --check ~/.config/fish/**/*.fish
3333+ set -l failed_files $status
3434+ if test $failed_files -ne 0
3535+ set retcode (math $retcode + $failed_files)
3636+ fish_indent --write ~/.config/fish/**/*.fish
3737+ end
3838+3939+ return $retcode
4040+end
···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
+2-2
.config/fish/functions/fisher.fish
···150150 end
151151152152 contains -- $plugin $_fisher_plugins || set -Ua _fisher_plugins $plugin
153153- contains -- $plugin $install_plugins && set -l event "install" || set -l event "update"
153153+ contains -- $plugin $install_plugins && set -l event install || set -l event update
154154 echo -es "installing \x1b[1m$plugin\x1b[22m" \n" "$$plugin_files_var
155155156156 for file in (string match --entire --regex -- "[functions/|conf\.d/].*fish\$" $$plugin_files_var)
···172172 test $total[1] = 0 || echo "installed $total[1]") (
173173 test $total[2] = 0 || echo "updated $total[2]") (
174174 test $total[3] = 0 || echo "removed $total[3]")
175175- ) "plugin/s"
175175+ ) plugin/s
176176 case \*
177177 echo "fisher: unknown flag or command: \"$cmd\" (see `fisher -h`)" >&2 && return 1
178178 end
···11function generate_bazel_completions --description 'Print a list of completion strings for bazel'
22- command bazel help completion | sed -E 's/([A-Z_]+)=(.+)/set __\1 \2/g'
22+ command bazel help completion | sed -E 's/([A-Z_]+)=(.+)/set __\1 \2/g'
33end
···11function history --description alias\ history\ \'history\ --show-time=\"\%F\ \%T\ \"\'
22- builtin history --reverse --show-time="%F %T \$ " $argv;
22+ builtin history --reverse --show-time="%F %T \$ " $argv
33end
+3-3
.config/fish/functions/ls.fish
···11function ls --description 'List contents of directory, including hidden files in directory using long format'
22- if test (uname) = "Darwin"
33- set ls_args "-G"
22+ if test (uname) = Darwin
33+ set ls_args -G
44 else
55 set ls_args "--color=auto"
66 end
77- command ls -Flah $ls_args $argv
77+ command ls -Flah $ls_args $argv
88end
···11function rdsh
22- set -l tmux_cmd "tmux"
22+ set -l tmux_cmd tmux
3344- if test $TERM_PROGRAM = "iTerm.app";
55- set -a tmux_cmd "-CC"
44+ if test $TERM_PROGRAM = "iTerm.app"
55+ set -a tmux_cmd -CC
66 end
7788- set -a tmux_cmd "new" "'dsh $argv'"
88+ set -a tmux_cmd new "'dsh $argv'"
991010 rpush && vssh -t $tmux_cmd
1111end
+3-3
.config/fish/functions/refresh_branches.fish
···5566 echo "Pruning old docker images, containers, etc."
77 if type -q docker
88- docker system prune --all --force --filter "until=72h"
88+ docker system prune --all --force --filter "until=72h" --filter "label!=auto-delete=false"
99 end
1010 echo
11111212 set -l branches \
1313- "develop" \
1313+ develop \
1414 "release/5.3" \
1515 "release/5.2" \
1616 "release/5.1" \
1717 "release/5.0" \
1818 "release/4.5"
19192020- if test (uname) != "Darwin"
2020+ if test (uname) != Darwin
2121 set dlib (/usr/local/bin/gbase)"/tools/dlib.sh"
2222 end
2323
+2-2
.config/fish/functions/rpush.fish
···11function rpush
22- source ~/.config/fish/functions/remote_cmd.fish
33- remote_cmd rpush $argv
22+ source ~/.config/fish/functions/remote_cmd.fish
33+ remote_cmd rpush $argv
4455 set rpush_status $status
66 if test $rpush_status -ne 0
···1010 # instance of scp as part of its file transfer protocol, and for some reason
1111 # it uses the shell instead of just the scp binary. So in these cases we
1212 # also just run the command verbatim.
1313- if contains -- '-f' $argv; or contains -- '-t' $argv;
1313+ if contains -- -f $argv; or contains -- -t $argv
1414 set should_exec 1
1515 end
1616
···11function tmux_attach
22- if test (uname) = "Darwin"
22+ if test (uname) = Darwin
33 vssh tmux_attach
44 else
55 if tmux ls
+1-1
.config/fish/functions/vi.fish
···11function vi --wraps=vim --description 'alias vi vim'
22- vim $argv;
22+ vim $argv
33end
+1-1
.config/fish/functions/vscode_ext.fish
···41414242 set -l enabled_extensions (string join '|' $argv)
4343 set -l extensions (code --list-extensions | egrep -v "$enabled_extensions" -)
4444- set -l code_args "--new-window" --disable-extension={$extensions}
4444+ set -l code_args --new-window --disable-extension={$extensions}
45454646 if test "$_flag_dry_run" != ""
4747 echo code $code_args $passthrough_args
+3-3
.config/fish/functions/vssh.fish
···30303131 set -l ssh_args
3232 if test "$_flag_T" != ""
3333- set -a ssh_args "-T"
3333+ set -a ssh_args -T
3434 else
3535- set -a ssh_args "-t"
3535+ set -a ssh_args -t
3636 end
37373838 if ! count $argv >/dev/null
···4646 set working_dir (pwd)
4747 set ssh_cmd "test -d $working_dir && cd $working_dir; $cmd"
48484949- command ssh $ssh_args "dev" "$ssh_cmd"
4949+ command ssh $ssh_args dev "$ssh_cmd"
5050end
···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.
14141515-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
1515+if begin
1616+ status --is-interactive; and not functions -q -- iterm2_status; and [ "$ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX""$TERM" != screen ]; and [ "$TERM" != dumb ]; and [ "$TERM" != linux ]
1717+ end
1818+ function iterm2_status
1919+ printf "\033]133;D;%s\007" $argv
2020+ end
19212020- # Mark start of prompt
2121- function iterm2_prompt_mark
2222- printf "\033]133;A\007"
2323- end
2222+ # Mark start of prompt
2323+ function iterm2_prompt_mark
2424+ printf "\033]133;A\007"
2525+ end
24262525- # Mark end of prompt
2626- function iterm2_prompt_end
2727- printf "\033]133;B\007"
2828- end
2727+ # Mark end of prompt
2828+ function iterm2_prompt_end
2929+ printf "\033]133;B\007"
3030+ end
29313030- # 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
3232+ # Tell terminal to create a mark at this location
3333+ function iterm2_preexec --on-event fish_preexec
3434+ # For other shells we would output status here but we can't do that in fish.
3535+ printf "\033]133;C;\007"
3636+ end
35373636- # 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
3838+ # Usage: iterm2_set_user_var key value
3939+ # These variables show up in badges (and later in other places). For example
4040+ # iterm2_set_user_var currentDirectory "$PWD"
4141+ # Gives a variable accessible in a badge by \(user.currentDirectory)
4242+ # Calls to this go in iterm2_print_user_vars.
4343+ function iterm2_set_user_var
4444+ printf "\033]1337;SetUserVar=%s=%s\007" "$argv[1]" (printf "%s" "$argv[2]" | base64 | tr -d "\n")
4545+ end
44464545- function iterm2_write_remotehost_currentdir_uservars
4646- printf "\033]1337;RemoteHost=%s@%s\007\033]1337;CurrentDir=%s\007" $USER $iterm2_hostname $PWD
4747+ function iterm2_write_remotehost_currentdir_uservars
4848+ printf "\033]1337;RemoteHost=%s@%s\007\033]1337;CurrentDir=%s\007" $USER $iterm2_hostname $PWD
47494848- # 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
5050+ # Users can define a function called iterm2_print_user_vars.
5151+ # It should call iterm2_set_user_var and produce no other output.
5252+ if functions -q -- iterm2_print_user_vars
5353+ iterm2_print_user_vars
5454+ end
53555454- end
5656+ end
55575656- if functions -q -- iterm2_fish_prompt
5757- # Gracefully handle running source ~/.config/fish/config.fish
5858- functions -e iterm2_fish_prompt
5959- end
5858+ if functions -q -- iterm2_fish_prompt
5959+ # Gracefully handle running source ~/.config/fish/config.fish
6060+ functions -e iterm2_fish_prompt
6161+ end
60626161- functions -c fish_prompt iterm2_fish_prompt
6363+ functions -c fish_prompt iterm2_fish_prompt
62646363- functions -c fish_mode_prompt iterm2_fish_mode_prompt
6464- 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.'
6565- set -l last_status $status
6565+ functions -c fish_mode_prompt iterm2_fish_mode_prompt
6666+ 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.'
6767+ set -l last_status $status
66686767- iterm2_status $last_status
6868- iterm2_write_remotehost_currentdir_uservars
6969- if not functions iterm2_fish_prompt | grep iterm2_prompt_mark > /dev/null
7070- iterm2_prompt_mark
7171- end
7272- sh -c "exit $last_status"
6969+ iterm2_status $last_status
7070+ iterm2_write_remotehost_currentdir_uservars
7171+ if not functions iterm2_fish_prompt | grep iterm2_prompt_mark >/dev/null
7272+ iterm2_prompt_mark
7373+ end
7474+ sh -c "exit $last_status"
73757474- iterm2_fish_mode_prompt
7575- end
7676+ iterm2_fish_mode_prompt
7777+ end
76787777- 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.'
7878- # Remove the trailing newline from the original prompt. This is done
7979- # using the string builtin from fish, but to make sure any escape codes
8080- # are correctly interpreted, use %b for printf.
8181- printf "%b" (string join "\n" (iterm2_fish_prompt))
7979+ 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.'
8080+ # Remove the trailing newline from the original prompt. This is done
8181+ # using the string builtin from fish, but to make sure any escape codes
8282+ # are correctly interpreted, use %b for printf.
8383+ printf "%b" (string join "\n" (iterm2_fish_prompt))
82848383- iterm2_prompt_end
8484- end
8585+ iterm2_prompt_end
8686+ end
85878686- # If hostname -f is slow for you, set iterm2_hostname before sourcing this script
8787- if not set -q -g iterm2_hostname
8888- set -g iterm2_hostname (hostname -f 2>/dev/null)
8989- # some flavors of BSD (i.e. NetBSD and OpenBSD) don't have the -f option
9090- if test $status -ne 0
9191- set -g iterm2_hostname (hostname)
8888+ # If hostname -f is slow for you, set iterm2_hostname before sourcing this script
8989+ if not set -q -g iterm2_hostname
9090+ set -g iterm2_hostname (hostname -f 2>/dev/null)
9191+ # some flavors of BSD (i.e. NetBSD and OpenBSD) don't have the -f option
9292+ if test $status -ne 0
9393+ set -g iterm2_hostname (hostname)
9494+ end
9295 end
9393- end
94969595- iterm2_write_remotehost_currentdir_uservars
9696- printf "\033]1337;ShellIntegrationVersion=10;shell=fish\007"
9797+ iterm2_write_remotehost_currentdir_uservars
9898+ printf "\033]1337;ShellIntegrationVersion=10;shell=fish\007"
9799end
+14-5
.config/yadm/hooks/pre_commit
···1515# shellcheck source=../utils.sh
1616source utils.sh
17171818+# skip checks for merge commits:
1919+if is_merging; then
2020+ exit 0
2121+fi
2222+1823if command -v shellcheck >/dev/null; then
1924 SHELLCHECK_SOURCES=(
2025 bootstrap
···2732 fi
2833fi
29343030-if command -v code >/dev/null; then
3535+if git rev-parse -q --verify MERGE_HEAD command -v code >/dev/null; then
3136 if ! check_vscode_exts &>/dev/null; then
3237 # Update vscode extension list to be current with installed extensions
3338 list_vscode_exts >"$VSCODE_EXTENSIONS"
···4045 ~/.config/fish/
4146 ~/.config/thefuck/
4247)
4343-untracked_fish_files=$(
4848+untracked_files=$(
4449 yadm ls-files --full-name --exclude-standard --others -- "${CHECK_UNTRACKED_DIRS[@]}"
4550)
4646-if [[ $untracked_fish_files ]]; then
4747- exit_with_error "Untracked files found in repository:" "$untracked_fish_files"
5151+if [[ $untracked_files ]]; then
5252+ exit_with_error "Untracked files found in repository:" "$untracked_files"
4853fi
49545050-fish -c fish_normalize_saved_functions
5555+fish -c fish_check_saved_functions
5656+failed_files=$?
5757+if [[ $failed_files -ne 0 ]] ; then
5858+ exit_with_error "$failed_files files failed fish lint/format checks!"
5959+fi
51605261# TODO: convert other scripts to fish instead of bash (except bootstrap)
+4
.config/yadm/utils.sh
···8282 fi
8383 fi
8484}
8585+8686+function is_merging() {
8787+ git rev-parse -q --verify MERGE_HEAD
8888+}