Void Linux workstation powered by niri, Fish and NeoVim. Contains scripts, browser extensions, custom XBPS packages, and typst plugins. git.anhgelus.world/anhgelus/dotfiles
void niri fish neovim nvim vim dotfiles linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(fish): clean files

-413
-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
-7
config/fish/completions/fisher.fish
··· 1 - complete --command fisher --exclusive --long help --description "Print help" 2 - complete --command fisher --exclusive --long version --description "Print version" 3 - complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins" 4 - complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins" 5 - complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins" 6 - complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex" 7 - complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)"
-8
config/fish/completions/fzf_configure_bindings.fish
··· 1 - complete fzf_configure_bindings --no-files 2 - complete fzf_configure_bindings --long help --short h --description "Print help" --condition "not __fish_seen_argument --help -h" 3 - complete fzf_configure_bindings --long directory --description "Change the key binding for Search Directory" --condition "not __fish_seen_argument --directory" 4 - complete fzf_configure_bindings --long git_log --description "Change the key binding for Search Git Log" --condition "not __fish_seen_argument --git_log" 5 - complete fzf_configure_bindings --long git_status --description "Change the key binding for Search Git Status" --condition "not __fish_seen_argument --git_status" 6 - complete fzf_configure_bindings --long history --description "Change the key binding for Search History" --condition "not __fish_seen_argument --history" 7 - complete fzf_configure_bindings --long processes --description "Change the key binding for Search Processes" --condition "not __fish_seen_argument --processes" 8 - complete fzf_configure_bindings --long variables --description "Change the key binding for Search Variables" --condition "not __fish_seen_argument --variables"
-177
config/fish/completions/packwiz.fish
··· 1 - # fish completion for packwiz -*- shell-script -*- 2 - 3 - function __packwiz_debug 4 - set -l file "$BASH_COMP_DEBUG_FILE" 5 - if test -n "$file" 6 - echo "$argv" >> $file 7 - end 8 - end 9 - 10 - function __packwiz_perform_completion 11 - __packwiz_debug "Starting __packwiz_perform_completion" 12 - 13 - # Extract all args except the last one 14 - set -l args (commandline -opc) 15 - # Extract the last arg and escape it in case it is a space 16 - set -l lastArg (string escape -- (commandline -ct)) 17 - 18 - __packwiz_debug "args: $args" 19 - __packwiz_debug "last arg: $lastArg" 20 - 21 - # Disable ActiveHelp which is not supported for fish shell 22 - set -l requestComp "PACKWIZ_ACTIVE_HELP=0 $args[1] __complete $args[2..-1] $lastArg" 23 - 24 - __packwiz_debug "Calling $requestComp" 25 - set -l results (eval $requestComp 2> /dev/null) 26 - 27 - # Some programs may output extra empty lines after the directive. 28 - # Let's ignore them or else it will break completion. 29 - # Ref: https://github.com/spf13/cobra/issues/1279 30 - for line in $results[-1..1] 31 - if test (string trim -- $line) = "" 32 - # Found an empty line, remove it 33 - set results $results[1..-2] 34 - else 35 - # Found non-empty line, we have our proper output 36 - break 37 - end 38 - end 39 - 40 - set -l comps $results[1..-2] 41 - set -l directiveLine $results[-1] 42 - 43 - # For Fish, when completing a flag with an = (e.g., <program> -n=<TAB>) 44 - # completions must be prefixed with the flag 45 - set -l flagPrefix (string match -r -- '-.*=' "$lastArg") 46 - 47 - __packwiz_debug "Comps: $comps" 48 - __packwiz_debug "DirectiveLine: $directiveLine" 49 - __packwiz_debug "flagPrefix: $flagPrefix" 50 - 51 - for comp in $comps 52 - printf "%s%s\n" "$flagPrefix" "$comp" 53 - end 54 - 55 - printf "%s\n" "$directiveLine" 56 - end 57 - 58 - # This function does two things: 59 - # - Obtain the completions and store them in the global __packwiz_comp_results 60 - # - Return false if file completion should be performed 61 - function __packwiz_prepare_completions 62 - __packwiz_debug "" 63 - __packwiz_debug "========= starting completion logic ==========" 64 - 65 - # Start fresh 66 - set --erase __packwiz_comp_results 67 - 68 - set -l results (__packwiz_perform_completion) 69 - __packwiz_debug "Completion results: $results" 70 - 71 - if test -z "$results" 72 - __packwiz_debug "No completion, probably due to a failure" 73 - # Might as well do file completion, in case it helps 74 - return 1 75 - end 76 - 77 - set -l directive (string sub --start 2 $results[-1]) 78 - set --global __packwiz_comp_results $results[1..-2] 79 - 80 - __packwiz_debug "Completions are: $__packwiz_comp_results" 81 - __packwiz_debug "Directive is: $directive" 82 - 83 - set -l shellCompDirectiveError 1 84 - set -l shellCompDirectiveNoSpace 2 85 - set -l shellCompDirectiveNoFileComp 4 86 - set -l shellCompDirectiveFilterFileExt 8 87 - set -l shellCompDirectiveFilterDirs 16 88 - 89 - if test -z "$directive" 90 - set directive 0 91 - end 92 - 93 - set -l compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2) 94 - if test $compErr -eq 1 95 - __packwiz_debug "Received error directive: aborting." 96 - # Might as well do file completion, in case it helps 97 - return 1 98 - end 99 - 100 - set -l filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2) 101 - set -l dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2) 102 - if test $filefilter -eq 1; or test $dirfilter -eq 1 103 - __packwiz_debug "File extension filtering or directory filtering not supported" 104 - # Do full file completion instead 105 - return 1 106 - end 107 - 108 - set -l nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2) 109 - set -l nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2) 110 - 111 - __packwiz_debug "nospace: $nospace, nofiles: $nofiles" 112 - 113 - # If we want to prevent a space, or if file completion is NOT disabled, 114 - # we need to count the number of valid completions. 115 - # To do so, we will filter on prefix as the completions we have received 116 - # may not already be filtered so as to allow fish to match on different 117 - # criteria than the prefix. 118 - if test $nospace -ne 0; or test $nofiles -eq 0 119 - set -l prefix (commandline -t | string escape --style=regex) 120 - __packwiz_debug "prefix: $prefix" 121 - 122 - set -l completions (string match -r -- "^$prefix.*" $__packwiz_comp_results) 123 - set --global __packwiz_comp_results $completions 124 - __packwiz_debug "Filtered completions are: $__packwiz_comp_results" 125 - 126 - # Important not to quote the variable for count to work 127 - set -l numComps (count $__packwiz_comp_results) 128 - __packwiz_debug "numComps: $numComps" 129 - 130 - if test $numComps -eq 1; and test $nospace -ne 0 131 - # We must first split on \t to get rid of the descriptions to be 132 - # able to check what the actual completion will be. 133 - # We don't need descriptions anyway since there is only a single 134 - # real completion which the shell will expand immediately. 135 - set -l split (string split --max 1 \t $__packwiz_comp_results[1]) 136 - 137 - # Fish won't add a space if the completion ends with any 138 - # of the following characters: @=/:., 139 - set -l lastChar (string sub -s -1 -- $split) 140 - if not string match -r -q "[@=/:.,]" -- "$lastChar" 141 - # In other cases, to support the "nospace" directive we trick the shell 142 - # by outputting an extra, longer completion. 143 - __packwiz_debug "Adding second completion to perform nospace directive" 144 - set --global __packwiz_comp_results $split[1] $split[1]. 145 - __packwiz_debug "Completions are now: $__packwiz_comp_results" 146 - end 147 - end 148 - 149 - if test $numComps -eq 0; and test $nofiles -eq 0 150 - # To be consistent with bash and zsh, we only trigger file 151 - # completion when there are no other completions 152 - __packwiz_debug "Requesting file completion" 153 - return 1 154 - end 155 - end 156 - 157 - return 0 158 - end 159 - 160 - # Since Fish completions are only loaded once the user triggers them, we trigger them ourselves 161 - # so we can properly delete any completions provided by another script. 162 - # Only do this if the program can be found, or else fish may print some errors; besides, 163 - # the existing completions will only be loaded if the program can be found. 164 - if type -q "packwiz" 165 - # The space after the program name is essential to trigger completion for the program 166 - # and not completion of the program name itself. 167 - # Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish. 168 - complete --do-complete "packwiz " > /dev/null 2>&1 169 - end 170 - 171 - # Remove any pre-existing completions for the program since we will be handling all of them. 172 - complete -c packwiz -e 173 - 174 - # The call to __packwiz_prepare_completions will setup __packwiz_comp_results 175 - # which provides the program's completion choices. 176 - complete -c packwiz -n '__packwiz_prepare_completions' -f -a '$__packwiz_comp_results' 177 -
-35
config/fish/fish_variables
··· 1 - # This file contains fish universal variable definitions. 2 - # VERSION: 3.0 3 - SETUVAR __fish_initialized:3800 4 - SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish 5 - SETUVAR _fisher_patrickf1_2F_fzf_2E_fish_files:\x7e/\x2econfig/fish/functions/_fzf_configure_bindings_help\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_extract_var_info\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_preview_changed_file\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_preview_file\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_report_diff_type\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_report_file_type\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_directory\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_git_log\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_git_status\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_history\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_processes\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_variables\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_wrapper\x2efish\x1e\x7e/\x2econfig/fish/functions/fzf_configure_bindings\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/fzf\x2efish\x1e\x7e/\x2econfig/fish/completions/fzf_configure_bindings\x2efish 6 - SETUVAR _fisher_plugins:jorgebucaran/fisher\x1epatrickf1/fzf\x2efish 7 - SETUVAR _fisher_upgraded_to_4_4:\x1d 8 - SETUVAR fish_color_autosuggestion:brblack 9 - SETUVAR fish_color_cancel:\x2dr 10 - SETUVAR fish_color_command:normal 11 - SETUVAR fish_color_comment:red 12 - SETUVAR fish_color_cwd:green 13 - SETUVAR fish_color_cwd_root:red 14 - SETUVAR fish_color_end:green 15 - SETUVAR fish_color_error:brred 16 - SETUVAR fish_color_escape:brcyan 17 - SETUVAR fish_color_history_current:\x2d\x2dbold 18 - SETUVAR fish_color_host:normal 19 - SETUVAR fish_color_host_remote:yellow 20 - SETUVAR fish_color_normal:normal 21 - SETUVAR fish_color_operator:brcyan 22 - SETUVAR fish_color_param:cyan 23 - SETUVAR fish_color_quote:yellow 24 - SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold 25 - SETUVAR fish_color_search_match:white\x1e\x2d\x2dbackground\x3dbrblack 26 - SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack 27 - SETUVAR fish_color_status:red 28 - SETUVAR fish_color_user:brgreen 29 - SETUVAR fish_color_valid_path:\x2d\x2dunderline 30 - SETUVAR fish_key_bindings:fish_default_key_bindings 31 - SETUVAR fish_pager_color_completion:normal 32 - SETUVAR fish_pager_color_description:yellow\x1e\x2di 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_selected_background:\x2dr