this repo has no description

add fish config

tjh 1ff28ae2 a80dc5af

+338
+186
.config/fish/completions/bun.fish
··· 1 + # This is terribly complicated 2 + # It's because: 3 + # 1. bun run has to have dynamic completions 4 + # 2. there are global options 5 + # 3. bun {install add remove} gets special options 6 + # 4. I don't know how to write fish completions well 7 + # Contributions very welcome!! 8 + 9 + function __fish__get_bun_bins 10 + string split ' ' (bun getcompletes b) 11 + end 12 + 13 + function __fish__get_bun_scripts 14 + set -lx SHELL bash 15 + set -lx MAX_DESCRIPTION_LEN 40 16 + string trim (string split '\n' (string split '\t' (bun getcompletes z))) 17 + end 18 + 19 + function __fish__get_bun_packages 20 + if test (commandline -ct) != "" 21 + set -lx SHELL fish 22 + string split ' ' (bun getcompletes a (commandline -ct)) 23 + end 24 + end 25 + 26 + function __history_completions 27 + set -l tokens (commandline --current-process --tokenize) 28 + history --prefix (commandline) | string replace -r \^$tokens[1]\\s\* "" | string replace -r \^$tokens[2]\\s\* "" | string split ' ' 29 + end 30 + 31 + function __fish__get_bun_bun_js_files 32 + string split ' ' (bun getcompletes j) 33 + end 34 + 35 + set -l bun_install_boolean_flags yarn production optional development no-save dry-run force no-cache silent verbose global 36 + set -l bun_install_boolean_flags_descriptions "Write a yarn.lock file (yarn v1)" "Don't install devDependencies" "Add dependency to optionalDependencies" "Add dependency to devDependencies" "Don't update package.json or save a lockfile" "Don't install anything" "Always request the latest versions from the registry & reinstall all dependencies" "Ignore manifest cache entirely" "Don't output anything" "Excessively verbose logging" "Use global folder" 37 + 38 + set -l bun_builtin_cmds_without_run dev create help bun upgrade discord install remove add init pm x 39 + set -l bun_builtin_cmds_accepting_flags create help bun upgrade discord run init link unlink pm x 40 + 41 + function __bun_complete_bins_scripts --inherit-variable bun_builtin_cmds_without_run -d "Emit bun completions for bins and scripts" 42 + # Do nothing if we already have a builtin subcommand, 43 + # or any subcommand other than "run". 44 + if __fish_seen_subcommand_from $bun_builtin_cmds_without_run 45 + or not __fish_use_subcommand && not __fish_seen_subcommand_from run 46 + return 47 + end 48 + # Do we already have a bin or script subcommand? 49 + set -l bins (__fish__get_bun_bins) 50 + if __fish_seen_subcommand_from $bins 51 + return 52 + end 53 + # Scripts have descriptions appended with a tab separator. 54 + # Strip off descriptions for the purposes of subcommand testing. 55 + set -l scripts (__fish__get_bun_scripts) 56 + if __fish_seen_subcommand_from (string split \t -f 1 -- $scripts) 57 + return 58 + end 59 + # Emit scripts. 60 + for script in $scripts 61 + echo $script 62 + end 63 + # Emit binaries and JS files (but only if we're doing `bun run`). 64 + if __fish_seen_subcommand_from run 65 + for bin in $bins 66 + echo "$bin"\t"package bin" 67 + end 68 + for file in (__fish__get_bun_bun_js_files) 69 + echo "$file"\t"Bun.js" 70 + end 71 + end 72 + end 73 + 74 + 75 + # Clear existing completions 76 + complete -e -c bun 77 + 78 + # Dynamically emit scripts and binaries 79 + complete -c bun -f -a "(__bun_complete_bins_scripts)" 80 + 81 + # Complete flags if we have no subcommand or a flag-friendly one. 82 + set -l flag_applies "__fish_use_subcommand; or __fish_seen_subcommand_from $bun_builtin_cmds_accepting_flags" 83 + complete -c bun \ 84 + -n $flag_applies --no-files -s 'u' -l 'origin' -r -d 'Server URL. Rewrites import paths' 85 + complete -c bun \ 86 + -n $flag_applies --no-files -s 'p' -l 'port' -r -d 'Port number to start server from' 87 + complete -c bun \ 88 + -n $flag_applies --no-files -s 'd' -l 'define' -r -d 'Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:\"development\"' 89 + complete -c bun \ 90 + -n $flag_applies --no-files -s 'e' -l 'external' -r -d 'Exclude module from transpilation (can use * wildcards). ex: -e react' 91 + complete -c bun \ 92 + -n $flag_applies --no-files -l 'use' -r -d 'Use a framework (ex: next)' 93 + complete -c bun \ 94 + -n $flag_applies --no-files -l 'hot' -r -d 'Enable hot reloading in Bun\'s JavaScript runtime' 95 + 96 + # Complete dev and create as first subcommand. 97 + complete -c bun \ 98 + -n "__fish_use_subcommand" -a 'dev' -d 'Start dev server' 99 + complete -c bun \ 100 + -n "__fish_use_subcommand" -a 'create' -f -d 'Create a new project from a template' 101 + 102 + # Complete "next" and "react" if we've seen "create". 103 + complete -c bun \ 104 + -n "__fish_seen_subcommand_from create" -a 'next' -d 'new Next.js project' 105 + 106 + complete -c bun \ 107 + -n "__fish_seen_subcommand_from create" -a 'react' -d 'new React project' 108 + 109 + # Complete "upgrade" as first subcommand. 110 + complete -c bun \ 111 + -n "__fish_use_subcommand" -a 'upgrade' -d 'Upgrade bun to the latest version' -x 112 + # Complete "-h/--help" unconditionally. 113 + complete -c bun \ 114 + -s "h" -l "help" -d 'See all commands and flags' -x 115 + 116 + # Complete "-v/--version" if we have no subcommand. 117 + complete -c bun \ 118 + -n "not __fish_use_subcommand" -l "version" -s "v" -d 'Bun\'s version' -x 119 + 120 + # Complete additional subcommands. 121 + complete -c bun \ 122 + -n "__fish_use_subcommand" -a 'discord' -d 'Open bun\'s Discord server' -x 123 + 124 + 125 + complete -c bun \ 126 + -n "__fish_use_subcommand" -a 'bun' -d 'Generate a new bundle' 127 + 128 + 129 + complete -c bun \ 130 + -n "__fish_seen_subcommand_from bun" -F -d 'Bundle this' 131 + 132 + complete -c bun \ 133 + -n "__fish_seen_subcommand_from create; and __fish_seen_subcommand_from react next" -F -d "Create in directory" 134 + 135 + 136 + complete -c bun \ 137 + -n "__fish_use_subcommand" -a 'init' -F -d 'Start an empty Bun project' 138 + 139 + complete -c bun \ 140 + -n "__fish_use_subcommand" -a 'install' -f -d 'Install packages from package.json' 141 + 142 + complete -c bun \ 143 + -n "__fish_use_subcommand" -a 'add' -F -d 'Add a package to package.json' 144 + 145 + complete -c bun \ 146 + -n "__fish_use_subcommand" -a 'remove' -F -d 'Remove a package from package.json' 147 + 148 + 149 + for i in (seq (count $bun_install_boolean_flags)) 150 + complete -c bun \ 151 + -n "__fish_seen_subcommand_from install add remove" -l "$bun_install_boolean_flags[$i]" -d "$bun_install_boolean_flags_descriptions[$i]" 152 + end 153 + 154 + complete -c bun \ 155 + -n "__fish_seen_subcommand_from install add remove" -l 'cwd' -d 'Change working directory' 156 + 157 + complete -c bun \ 158 + -n "__fish_seen_subcommand_from install add remove" -l 'cache-dir' -d 'Choose a cache directory (default: $HOME/.bun/install/cache)' 159 + 160 + complete -c bun \ 161 + -n "__fish_seen_subcommand_from add" -d 'Popular' -a '(__fish__get_bun_packages)' 162 + 163 + complete -c bun \ 164 + -n "__fish_seen_subcommand_from add" -d 'History' -a '(__history_completions)' 165 + 166 + complete -c bun \ 167 + -n "__fish_seen_subcommand_from pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) cache;" -a 'bin ls cache hash hash-print hash-string' -f 168 + 169 + complete -c bun \ 170 + -n "__fish_seen_subcommand_from pm; and __fish_seen_subcommand_from cache; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts);" -a 'rm' -f 171 + 172 + # Add built-in subcommands with descriptions. 173 + complete -c bun -n "__fish_use_subcommand" -a "create" -f -d "Create a new project from a template" 174 + complete -c bun -n "__fish_use_subcommand" -a "build bun" --require-parameter -F -d "Transpile and bundle one or more files" 175 + complete -c bun -n "__fish_use_subcommand" -a "upgrade" -d "Upgrade Bun" 176 + complete -c bun -n "__fish_use_subcommand" -a "run" -d "Run a script or package binary" 177 + complete -c bun -n "__fish_use_subcommand" -a "install" -d "Install dependencies from package.json" -f 178 + complete -c bun -n "__fish_use_subcommand" -a "remove" -d "Remove a dependency from package.json" -f 179 + complete -c bun -n "__fish_use_subcommand" -a "add" -d "Add a dependency to package.json" -f 180 + complete -c bun -n "__fish_use_subcommand" -a "init" -d "Initialize a Bun project in this directory" -f 181 + complete -c bun -n "__fish_use_subcommand" -a "link" -d "Register or link a local npm package" -f 182 + complete -c bun -n "__fish_use_subcommand" -a "unlink" -d "Unregister a local npm package" -f 183 + complete -c bun -n "__fish_use_subcommand" -a "pm" -d "Additional package management utilities" -f 184 + complete -c bun -n "__fish_use_subcommand" -a "x" -d "Execute a package binary, installing if needed" -f 185 + complete -c bun -n "__fish_use_subcommand" -a "outdated" -d "Display the latest versions of outdated dependencies" -f 186 + complete -c bun -n "__fish_use_subcommand" -a "publish" -d "Publish your package from local to npm" -f
+17
.config/fish/config.fish
··· 1 + if status is-interactive 2 + # Commands to run in interactive sessions can go here 3 + set -g fish_greeting 4 + set -gx SSH_AUTH_SOCK $(gpgconf --list-dirs agent-ssh-socket) 5 + set -gx EDITOR /usr/bin/helix 6 + end 7 + 8 + set --export PATH /usr/local/bin /usr/bin 9 + # bun 10 + set --export BUN_INSTALL "$HOME/.bun" 11 + set --export PATH $BUN_INSTALL/bin $PATH 12 + # flyctl 13 + set --export FLYCTL_INSTALL "$HOME/.fly" 14 + set --export PATH $FLYCTL_INSTALL/bin $PATH 15 + # cargo 16 + set --export CARGO_INSTALL "$HOME/.cargo" 17 + set --export PATH $CARGO_INSTALL/bin $PATH
+42
.config/fish/fish_variables
··· 1 + # This file contains fish universal variable definitions. 2 + # VERSION: 3.0 3 + SETUVAR __fish_initialized:3800 4 + SETUVAR fish_color_autosuggestion:585858 5 + SETUVAR fish_color_cancel:\x2d\x2dreverse 6 + SETUVAR fish_color_command:a1b56c 7 + SETUVAR fish_color_comment:f7ca88 8 + SETUVAR fish_color_cwd:green 9 + SETUVAR fish_color_cwd_root:red 10 + SETUVAR fish_color_end:ba8baf 11 + SETUVAR fish_color_error:ab4642 12 + SETUVAR fish_color_escape:86c1b9 13 + SETUVAR fish_color_history_current:\x2d\x2dbold 14 + SETUVAR fish_color_host:normal 15 + SETUVAR fish_color_host_remote:yellow 16 + SETUVAR fish_color_keyword:a1b56c 17 + SETUVAR fish_color_match:7cafc2 18 + SETUVAR fish_color_normal:normal 19 + SETUVAR fish_color_operator:7cafc2 20 + SETUVAR fish_color_option:d8d8d8 21 + SETUVAR fish_color_param:d8d8d8 22 + SETUVAR fish_color_quote:f7ca88 23 + SETUVAR fish_color_redirection:d8d8d8 24 + SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack 25 + SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack 26 + SETUVAR fish_color_status:red 27 + SETUVAR fish_color_user:brgreen 28 + SETUVAR fish_color_valid_path:\x2d\x2dunderline 29 + SETUVAR fish_key_bindings:fish_default_key_bindings 30 + SETUVAR fish_pager_color_background:\x1d 31 + SETUVAR fish_pager_color_completion:normal 32 + SETUVAR fish_pager_color_description:B3A06D 33 + SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline 34 + SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan 35 + SETUVAR fish_pager_color_secondary_background:\x1d 36 + SETUVAR fish_pager_color_secondary_completion:\x1d 37 + SETUVAR fish_pager_color_secondary_description:\x1d 38 + SETUVAR fish_pager_color_secondary_prefix:\x1d 39 + SETUVAR fish_pager_color_selected_background:\x2d\x2dbackground\x3dbrblack 40 + SETUVAR fish_pager_color_selected_completion:\x1d 41 + SETUVAR fish_pager_color_selected_description:\x1d 42 + SETUVAR fish_pager_color_selected_prefix:\x1d
+15
.config/fish/functions/__fish_list_current_token.fish
··· 1 + function __fish_list_current_token --description 'List contents of token under the cursor if it is a directory, otherwise list the contents of the current directory' 2 + set -l val "$(commandline -t | string replace -r '^~' "$HOME")" 3 + set -l cmd 4 + if test -d $val 5 + set cmd ls -lGh $val 6 + else 7 + set -l dir (dirname -- $val) 8 + if test $dir != . -a -d $dir 9 + set cmd ls -lGh $dir 10 + else 11 + set cmd ls -lGh 12 + end 13 + end 14 + __fish_echo $cmd 15 + end
+31
.config/fish/functions/fish_prompt.fish
··· 1 + function fish_prompt --description 'Write out the prompt' 2 + set -l last_pipestatus $pipestatus 3 + set -lx __fish_last_status $status # Export for __fish_print_pipestatus. 4 + set -l normal (set_color normal) 5 + set -q fish_color_status 6 + or set -g fish_color_status red 7 + 8 + # Color the prompt differently when we're root 9 + set -l color_cwd $fish_color_cwd 10 + set -l suffix '>' 11 + if functions -q fish_is_root_user; and fish_is_root_user 12 + if set -q fish_color_cwd_root 13 + set color_cwd $fish_color_cwd_root 14 + end 15 + set suffix '#' 16 + end 17 + 18 + # Write pipestatus 19 + # If the status was carried over (if no command is issued or if `set` leaves the status untouched), don't bold it. 20 + set -l bold_flag --bold 21 + set -q __fish_prompt_status_generation; or set -g __fish_prompt_status_generation $status_generation 22 + if test $__fish_prompt_status_generation = $status_generation 23 + set bold_flag 24 + end 25 + set __fish_prompt_status_generation $status_generation 26 + set -l status_color (set_color $fish_color_status) 27 + set -l statusb_color (set_color $bold_flag $fish_color_status) 28 + set -l prompt_status (__fish_print_pipestatus "[" "]" "|" "$status_color" "$statusb_color" $last_pipestatus) 29 + 30 + echo -n -s (prompt_login)' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal " "$prompt_status $suffix " " 31 + end
+3
.config/fish/functions/lf.fish
··· 1 + function lf 2 + ls -lGh $argv 3 + end
+9
.config/fish/functions/win10.fish
··· 1 + function win10 2 + switch (incus list -f csv,noheader -c s win10) 3 + case RUNNING 4 + echo "win10 already running" 5 + case STOPPED 6 + incus start win10 7 + end 8 + $HOME/.scripts/looking-glass 9 + end
+35
.scripts/looking-glass
··· 1 + #!/usr/bin/env bash 2 + 3 + VM=${1:-win10} 4 + GROUP=wheel 5 + 6 + # Relevant paths 7 + INCUS=/var/run/incus 8 + VMDIR=${INCUS}/${VM} 9 + SPICE=${INCUS}/${VM}/qemu.spice 10 + 11 + # First check if we have access to the shared memory device. 12 + # 13 + # Use udev rules to set permissions. 14 + # IVSHMEM=/dev/shm/looking-glass 15 + IVSHMEM=/dev/kvmfr0 16 + if ! [[ -r ${IVSHMEM} && -w ${IVSHMEM} ]]; then 17 + ls -l ${IVSHMEM} 18 + echo "need rw access to shared memory device ${IVSHMEM}" 19 + exit 1 20 + fi 21 + 22 + # Iff necessary, grant read-execute on the incus run directory to 23 + # the group in ${GROUP}. 24 + if ! [[ -x ${INCUS} && -r ${INCUS} ]]; then 25 + sudo chown :${GROUP} ${INCUS} && sudo chmod g=rx ${INCUS} 26 + fi 27 + 28 + # Iff necessary, grant read-execute on the vm directory, and 29 + # read-write on the spice socket, to the group in ${GROUP}. 30 + if ! [[ -x ${VMDIR} && -r ${VMDIR} && -r ${SPICE} && -w ${SPICE} ]]; then 31 + sudo chown :${GROUP} ${VMDIR} && sudo chmod g=rx ${VMDIR} 32 + sudo chown :${GROUP} ${SPICE} && sudo chmod g=rw ${SPICE} 33 + fi 34 + 35 + looking-glass-client -f ${IVSHMEM} -c ${SPICE} -p 0 win:size=2880x1620