feat(shell): clean up fisher plugins

This commit is contained in:
2026-01-09 01:15:02 +02:00
parent 892216a8fc
commit 6bb804ec7f
110 changed files with 174 additions and 3453 deletions

1
.gitignore vendored
View File

@@ -57,3 +57,4 @@ local/share/fonts/*
lock
node_modules
ssh/local.d/*
config/fish/fish_variables*

View File

@@ -1,71 +0,0 @@
# @halostatue/fish-macos/completions/app.fish:v7.0.1
complete --command app --erase
complete --command app --arguments bundleid \
--exclusive --condition __fish_use_subcommand \
--description 'Show bundle IDs for macOS apps'
complete --command app --arguments find \
--exclusive --condition __fish_use_subcommand \
--description 'Find macOS apps by pattern'
complete --command app --arguments frontmost \
--exclusive --condition __fish_use_subcommand \
--description 'Shows the front-most application'
complete --command app --arguments icon \
--exclusive --condition __fish_use_subcommand \
--description 'Extracts a MacOS app icon as a png file'
complete --command app --arguments quit \
--exclusive --condition __fish_use_subcommand \
--description 'Quit macOS apps by pattern'
for subcommand in bundleid find
complete --command app --condition '__fish_seen_subcommand_from '$subcommand \
--short-option x --long-option exact --description 'Exact matches only'
complete --command app --condition '__fish_seen_subcommand_from '$subcommand \
--short-option a --long-option all --description 'Show all matches'
complete --command app --condition '__fish_seen_subcommand_from '$subcommand \
--short-option q --long-option quiet --description 'Quiet (show no output)'
complete --command app --condition '__fish_seen_subcommand_from '$subcommand \
--short-option h --long-option help --description 'Help for app '$subcommand
end
complete --command app --condition '__fish_seen_subcommand_from 'bundleid \
--short-option s --long-option short --description 'Show only the bundle ID'
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
--short-option b --long-option bundle-id --description 'Shows the app bundle ID'
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
--short-option p --long-option path --description 'Shows the app path'
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
--short-option n --long-option name --description 'Shows the app name'
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
--short-option P --long-option pid --description 'Shows the PID of the app'
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
--short-option a --long-option all --description 'Shows all details'
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
--short-option h --long-option help --description 'Help for app 'frontmost
complete --command app --condition '__fish_seen_subcommand_from 'icon \
--short-option x --long-option exact --description 'Exact matches only'
complete --command app --condition '__fish_seen_subcommand_from 'icon \
--short-option o --long-option output --description 'Extracts to this file or directory' \
--force-files
complete --command app --condition '__fish_seen_subcommand_from 'icon \
--short-option w --long-option width --description 'Uses this pixel width' \
--no-files
complete --command app --condition '__fish_seen_subcommand_from 'icon \
--short-option h --long-option help --description 'Help for app 'icon
complete --command app --condition '__fish_seen_subcommand_from 'quit \
--short-option x --long-option exact --description 'Exact matches only'
complete --command app --condition '__fish_seen_subcommand_from 'quit \
--short-option r --long-option restart --description 'Restart after quit'
complete --command app --condition '__fish_seen_subcommand_from 'quit \
--short-option h --long-option help --description 'Help for app 'quit

View File

@@ -1,70 +0,0 @@
# @halostatue/fish-macos/completions/finder.fish:v7.0.1
complete --command finder --erase
complete --command finder --arguments track \
--exclusive --condition __fish_use_subcommand \
--description 'Enables Finder PWD tracking'
complete --command finder --arguments untrack \
--exclusive --condition __fish_use_subcommand \
--description 'Disables Finder PWD tracking'
complete --command finder --arguments pwd \
--exclusive --condition __fish_use_subcommand \
--description 'Prints the path of the Finder window'
complete --command finder --arguments cd \
--exclusive --condition __fish_use_subcommand \
--description 'Changes to the path of the Finder window'
complete --command finder --arguments pushd \
--exclusive --condition __fish_use_subcommand \
--description 'Pushes to the path of the Finder window'
complete --command finder --arguments update \
--exclusive --condition __fish_use_subcommand \
--description 'Updates the Finder to PWD'
complete --command finder --arguments list \
--exclusive --condition __fish_use_subcommand \
--description 'Sets Finder to list view with PWD'
complete --command finder --arguments icon \
--exclusive --condition __fish_use_subcommand \
--description 'Sets Finder to icon view with PWD'
complete --command finder --arguments column \
--exclusive --condition __fish_use_subcommand \
--description 'Sets Finder to column view with PWD'
complete --command finder --arguments hidden \
--exclusive --condition __fish_use_subcommand \
--description 'Shows or hides `hidden` files'
complete --command finder --arguments desktop-icons \
--exclusive --condition __fish_use_subcommand \
--description 'Shows or hides desktop icons'
complete --command finder --arguments clean \
--exclusive --condition __fish_use_subcommand \
--description 'Cleans .DS_Store files'
complete --command finder --arguments quarantine \
--exclusive --condition __fish_use_subcommand \
--description 'Works with file quarantine data'
complete --command finder --arguments selected \
--exclusive --condition __fish_use_subcommand \
--description 'Print Finder selected files'
for subcommand in cd clean column desktop-icons hidden icon list pushd pwd quarantine selected track untrack update
complete --command finder --condition '__fish_seen_subcommand_from '$subcommand \
--short-option h --long-option help --description 'Help for finder '$subcommand
end
for subcommand in hidden desktop-icons
complete --command finder --condition '__fish_seen_subcommand_from '$subcommand \
--arguments off --description 'Turns '$subcommand' off'
complete --command finder --condition '__fish_seen_subcommand_from '$subcommand \
--arguments on --description 'Turns '$subcommand' on'
complete --command finder --condition '__fish_seen_subcommand_from '$subcommand \
--arguments toggle --description 'Toggles '$subcommand
complete --command finder --condition '__fish_seen_subcommand_from '$subcommand \
--arguments status --description 'Shows the status of '$subcommand
end
complete --command finder --condition '__fish_seen_subcommand_from 'quarantine \
--arguments show --description 'Shows quarantine events'
complete --command finder --condition '__fish_seen_subcommand_from 'quarantine \
--arguments clear --description 'Clears all quarantine events'
complete --command finder --condition '__fish_seen_subcommand_from 'quarantine \
--arguments clean --description 'Removes 'quarantine' attributes from files' \
--require-parameter --force-files

View File

@@ -1,8 +0,0 @@
complete fzf_configure_bindings --no-files
complete fzf_configure_bindings --long help --short h --description "Print help" --condition "not __fish_seen_argument --help -h"
complete fzf_configure_bindings --long directory --description "Change the key binding for Search Directory" --condition "not __fish_seen_argument --directory"
complete fzf_configure_bindings --long git_log --description "Change the key binding for Search Git Log" --condition "not __fish_seen_argument --git_log"
complete fzf_configure_bindings --long git_status --description "Change the key binding for Search Git Status" --condition "not __fish_seen_argument --git_status"
complete fzf_configure_bindings --long history --description "Change the key binding for Search History" --condition "not __fish_seen_argument --history"
complete fzf_configure_bindings --long processes --description "Change the key binding for Search Processes" --condition "not __fish_seen_argument --processes"
complete fzf_configure_bindings --long variables --description "Change the key binding for Search Variables" --condition "not __fish_seen_argument --variables"

View File

@@ -1,117 +0,0 @@
# @halostatue/fish-macos/completions/mac.fish:v7.0.1
complete --command mac --erase
complete --command mac --arguments airdrop \
--exclusive --condition __fish_use_subcommand \
--description 'Changes AirDrop settings'
complete --command mac --arguments airport \
--exclusive --condition __fish_use_subcommand \
--description 'Work with AirPort (WiFi) settings'
complete --command mac --arguments brightness \
--exclusive --condition __fish_use_subcommand \
--description 'Adjust the screen brightness level'
complete --command mac --arguments flushdns \
--exclusive --condition __fish_use_subcommand \
--description 'Flushes DNS'
complete --command mac --arguments font-smoothing \
--exclusive --condition __fish_use_subcommand \
--description 'Manages font smoothing settings'
complete --command mac --arguments lsclean \
--exclusive --condition __fish_use_subcommand \
--description 'Cleans LaunchServices to remove duplicate Open with... entries'
complete --command mac --arguments mail \
--exclusive --condition __fish_use_subcommand \
--description 'Manage various operations of Mail.app'
complete --command mac --arguments proxy-icon \
--exclusive --condition __fish_use_subcommand \
--description 'Manage proxy icon appearance delay'
complete --command mac --arguments transparency \
--exclusive --condition __fish_use_subcommand \
--description 'Manage UI transparency'
complete --command mac --arguments vol \
--exclusive --condition __fish_use_subcommand \
--description 'Changes Mac volume; accepts 0100 volume percentage'
for subcommand in airdrop airport brightness flushdns font-smoothing lsclean mail proxy-icon transparency version vol
complete --command mac --condition '__fish_seen_subcommand_from '$subcommand \
--short-option h --long-option help --description 'Help for mac '$subcommand
end
complete --command mac --condition '__fish_seen_subcommand_from brightness' \
--arguments up --description 'Increases screen brightness'
complete --command mac --condition '__fish_seen_subcommand_from brightness' \
--arguments down --description 'Decreases screen brightness'
for subcommand in airdrop proxy-icon transparency
complete --command mac --condition '__fish_seen_subcommand_from '$subcommand \
--arguments on --description 'Enables '$subcommand
complete --command mac --condition '__fish_seen_subcommand_from '$subcommand \
--arguments off --description 'Disables '$subcommand
complete --command mac --condition '__fish_seen_subcommand_from '$subcommand \
--arguments toggle --description 'Toggles '$subcommand
complete --command mac --condition '__fish_seen_subcommand_from '$subcommand \
--arguments status --description 'Shows the status of '$subcommand
end
complete --command mac --condition '__fish_seen_subcommand_from 'airport \
--arguments scan --description 'Shows available networks'
complete --command mac --condition '__fish_seen_subcommand_from 'airport \
--arguments ssid --description 'Shows the SSID'
complete --command mac --condition '__fish_seen_subcommand_from 'airport \
--arguments password --description 'Gets the current WiFi network password'
complete --command mac --condition '__fish_seen_subcommand_from 'font-smoothing \
--arguments on --description 'Enables font smoothing; app IDs can be provided to limit control'
complete --command mac --condition '__fish_seen_subcommand_from 'font-smoothing \
--arguments off --description 'Disables font smoothing; app IDs can be provided to limit control'
complete --command mac --condition '__fish_seen_subcommand_from 'mail \
--arguments vacuum --description 'Vacuums the Mail.app envelope index'
complete --command mac --condition '__fish_seen_subcommand_from 'mail \
--arguments attachments --description 'Sets Mail.app attachment handling' \
--require-parameter --no-files
complete --command mac --condition '__fish_seen_subcommand_from 'attachments \
--arguments inline \
--description 'Sets Mail.app attachment handling so that they are inline to the message'
complete --command mac --condition '__fish_seen_subcommand_from 'attachments \
--arguments icon \
--description 'Sets Mail.app attachment handling so that they are icons on the message'
complete --command mac --condition '__fish_seen_subcommand_from 'version \
--short-option s --long-option simple --description 'Simple mac version name'
complete --command mac --condition '__fish_seen_subcommand_from 'version \
--short-option l --long-option lowercase --description 'Lowercase mac version name'
complete --command mac --condition '__fish_seen_subcommand_from 'version \
--short-option f --long-option version --description 'Full version number'
complete --command mac --condition '__fish_seen_subcommand_from 'version \
--short-option c --long-option comparable --description 'Simplified comparable version value'
complete --command mac --condition '__fish_seen_subcommand_from 'version \
--short-option h --long-option help --description 'Help for mac 'version
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments mute --description 'Mutes volume'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments unmute --description 'Unmutes volume'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments show --description 'Shows the current volume'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 10 --description 'Sets the volume to 10%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 20 --description 'Sets the volume to 20%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 30 --description 'Sets the volume to 30%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 40 --description 'Sets the volume to 40%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 50 --description 'Sets the volume to 50%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 60 --description 'Sets the volume to 60%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 70 --description 'Sets the volume to 70%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 80 --description 'Sets the volume to 80%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 90 --description 'Sets the volume to 90%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 100 --description 'Sets the volume to 100%'

View File

@@ -1,8 +0,0 @@
# @halostatue/fish-macos/completions/manp.fish:v7.0.1
complete --command manp --erase
complete --command manp --wraps man
complete --command manp --exclusive --condition __fish_no_arguments \
--short-option h --long-option help --description 'Show help for manp'
complete --command manp --exclusive --condition __fish_no_arguments \
--long-option clear-cache --description 'Clear the man page PDF cache'

View File

@@ -2,21 +2,21 @@
# Place in ~/.config/fish/completions/phpenv.fish
# Complete main commands
complete -c phpenv -f -n __fish_use_subcommand -a install -d "Install a PHP version"
complete -c phpenv -f -n __fish_use_subcommand -a uninstall -d "Uninstall a PHP version"
complete -c phpenv -f -n __fish_use_subcommand -a use -d "Use PHP version for current shell"
complete -c phpenv -f -n __fish_use_subcommand -a local -d "Set PHP version for current project"
complete -c phpenv -f -n __fish_use_subcommand -a global -d "Set global PHP version"
complete -c phpenv -f -n __fish_use_subcommand -a list -d "List installed PHP versions"
complete -c phpenv -f -n __fish_use_subcommand -a ls -d "List installed PHP versions"
complete -c phpenv -f -n __fish_use_subcommand -a current -d "Show current PHP version"
complete -c phpenv -f -n __fish_use_subcommand -a which -d "Show path to PHP binary"
complete -c phpenv -f -n __fish_use_subcommand -a versions -d "Show all available versions"
complete -c phpenv -f -n __fish_use_subcommand -a doctor -d "Check phpenv installation"
complete -c phpenv -f -n __fish_use_subcommand -a config -d "Manage configuration"
complete -c phpenv -f -n __fish_use_subcommand -a extensions -d "Manage PHP extensions"
complete -c phpenv -f -n __fish_use_subcommand -a ext -d "Manage PHP extensions"
complete -c phpenv -f -n __fish_use_subcommand -a help -d "Show help"
complete -c phpenv -f -n "__fish_use_subcommand" -a "install" -d "Install a PHP version"
complete -c phpenv -f -n "__fish_use_subcommand" -a "uninstall" -d "Uninstall a PHP version"
complete -c phpenv -f -n "__fish_use_subcommand" -a "use" -d "Use PHP version for current shell"
complete -c phpenv -f -n "__fish_use_subcommand" -a "local" -d "Set PHP version for current project"
complete -c phpenv -f -n "__fish_use_subcommand" -a "global" -d "Set global PHP version"
complete -c phpenv -f -n "__fish_use_subcommand" -a "list" -d "List installed PHP versions"
complete -c phpenv -f -n "__fish_use_subcommand" -a "ls" -d "List installed PHP versions"
complete -c phpenv -f -n "__fish_use_subcommand" -a "current" -d "Show current PHP version"
complete -c phpenv -f -n "__fish_use_subcommand" -a "which" -d "Show path to PHP binary"
complete -c phpenv -f -n "__fish_use_subcommand" -a "versions" -d "Show all available versions"
complete -c phpenv -f -n "__fish_use_subcommand" -a "doctor" -d "Check phpenv installation"
complete -c phpenv -f -n "__fish_use_subcommand" -a "config" -d "Manage configuration"
complete -c phpenv -f -n "__fish_use_subcommand" -a "extensions" -d "Manage PHP extensions"
complete -c phpenv -f -n "__fish_use_subcommand" -a "ext" -d "Manage PHP extensions"
complete -c phpenv -f -n "__fish_use_subcommand" -a "help" -d "Show help"
# Helper functions for completions
function __phpenv_complete_installed_versions
@@ -26,13 +26,13 @@ end
function __phpenv_complete_available_versions
# Try to get dynamic versions first
if command -q curl -a command -q jq; and functions -q __phpenv_parse_version_field
echo latest
echo nightly
echo "latest"
echo "nightly"
echo "5.x"
echo "7.x"
echo "8.x"
__phpenv_parse_version_field latest "8.4"
__phpenv_parse_version_field nightly "8.5"
__phpenv_parse_version_field "latest" "8.4"
__phpenv_parse_version_field "nightly" "8.5"
__phpenv_parse_version_field "5.x" "5.6"
__phpenv_parse_version_field "7.x" "7.4"
__phpenv_parse_version_field "8.x" "8.4"
@@ -64,18 +64,18 @@ complete -c phpenv -f -n "__fish_seen_subcommand_from uninstall use local global
-a "(__phpenv_complete_installed_versions)" -d "Installed PHP version"
# Add system option for use command
complete -c phpenv -f -n "__fish_seen_subcommand_from use" -a system -d "Use system PHP"
complete -c phpenv -f -n "__fish_seen_subcommand_from use" -a "system" -d "Use system PHP"
# Complete binaries for which command
complete -c phpenv -f -n "__fish_seen_subcommand_from which" -a "(__phpenv_complete_binaries)" -d "PHP binary"
# Complete config subcommands
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set list" \
-a get -d "Get configuration value"
-a "get" -d "Get configuration value"
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set list" \
-a set -d "Set configuration value"
-a "set" -d "Set configuration value"
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set list" \
-a list -d "List all configuration"
-a "list" -d "List all configuration"
# Complete config keys
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from get set" \
@@ -91,27 +91,27 @@ complete -c phpenv -f \
complete -c phpenv -f \
-n "__fish_seen_subcommand_from extensions ext" \
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
-a install -d "Install PHP extension"
-a "install" -d "Install PHP extension"
complete -c phpenv -f \
-n "__fish_seen_subcommand_from extensions ext" \
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
-a uninstall -d "Uninstall PHP extension"
-a "uninstall" -d "Uninstall PHP extension"
complete -c phpenv -f \
-n "__fish_seen_subcommand_from extensions ext" \
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
-a remove -d "Remove PHP extension"
-a "remove" -d "Remove PHP extension"
complete -c phpenv -f \
-n "__fish_seen_subcommand_from extensions ext" \
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
-a list -d "List installed extensions"
-a "list" -d "List installed extensions"
complete -c phpenv -f \
-n "__fish_seen_subcommand_from extensions ext" \
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
-a ls -d "List installed extensions"
-a "ls" -d "List installed extensions"
complete -c phpenv -f \
-n "__fish_seen_subcommand_from extensions ext" \
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
-a available -d "Show available extensions"
-a "available" -d "Show available extensions"
# Complete extension names
complete -c phpenv -f \

View File

@@ -1,4 +0,0 @@
# @halostatue/fish-macos/completions/ql.fish:v7.0.1
complete --erase --command ql
complete --command ql --wraps qlmanage

View File

@@ -1,24 +0,0 @@
# Everforest color scheme for fish shell
# Generated from template - do not edit manually
# Set fish colors
set -U fish_color_normal #d3c6aa
set -U fish_color_command #7fbbb3
set -U fish_color_keyword #d699b6
set -U fish_color_quote #dbbc7f
set -U fish_color_redirection #83c092
set -U fish_color_end #e69875
set -U fish_color_error #e67e80
set -U fish_color_param #d3c6aa
set -U fish_color_comment #7a8478
set -U fish_color_selection --background=#323c41
set -U fish_color_search_match --background=#323c41
set -U fish_color_operator #a7c080
set -U fish_color_escape #d699b6
set -U fish_color_autosuggestion #859289
# Set fish pager colors
set -U fish_pager_color_progress #9da9a0
set -U fish_pager_color_prefix #7fbbb3
set -U fish_pager_color_completion #d3c6aa
set -U fish_pager_color_description #859289

View File

@@ -1,24 +0,0 @@
# Everforest color scheme for fish shell
# Generated from template - do not edit manually
# Set fish colors
set -U fish_color_normal #d3c6aa
set -U fish_color_command #7fbbb3
set -U fish_color_keyword #d699b6
set -U fish_color_quote #dbbc7f
set -U fish_color_redirection #83c092
set -U fish_color_end #e69875
set -U fish_color_error #e67e80
set -U fish_color_param #d3c6aa
set -U fish_color_comment #7a8478
set -U fish_color_selection --background=#374247
set -U fish_color_search_match --background=#374247
set -U fish_color_operator #a7c080
set -U fish_color_escape #d699b6
set -U fish_color_autosuggestion #859289
# Set fish pager colors
set -U fish_pager_color_progress #9da9a0
set -U fish_pager_color_prefix #7fbbb3
set -U fish_pager_color_completion #d3c6aa
set -U fish_pager_color_description #859289

View File

@@ -1,24 +0,0 @@
# Everforest color scheme for fish shell
# Generated from template - do not edit manually
# Set fish colors
set -U fish_color_normal #d3c6aa
set -U fish_color_command #7fbbb3
set -U fish_color_keyword #d699b6
set -U fish_color_quote #dbbc7f
set -U fish_color_redirection #83c092
set -U fish_color_end #e69875
set -U fish_color_error #e67e80
set -U fish_color_param #d3c6aa
set -U fish_color_comment #7a8478
set -U fish_color_selection --background=#3a464c
set -U fish_color_search_match --background=#3a464c
set -U fish_color_operator #a7c080
set -U fish_color_escape #d699b6
set -U fish_color_autosuggestion #859289
# Set fish pager colors
set -U fish_pager_color_progress #9da9a0
set -U fish_pager_color_prefix #7fbbb3
set -U fish_pager_color_completion #d3c6aa
set -U fish_pager_color_description #859289

View File

@@ -1,24 +0,0 @@
# Everforest color scheme for fish shell
# Generated from template - do not edit manually
# Set fish colors
set -U fish_color_normal #5c6a72
set -U fish_color_command #7fbbb3
set -U fish_color_keyword #d699b6
set -U fish_color_quote #dbbc7f
set -U fish_color_redirection #83c092
set -U fish_color_end #e69875
set -U fish_color_error #e67e80
set -U fish_color_param #5c6a72
set -U fish_color_comment #a6b0a0
set -U fish_color_selection --background=#f4f0d9
set -U fish_color_search_match --background=#f4f0d9
set -U fish_color_operator #a7c080
set -U fish_color_escape #d699b6
set -U fish_color_autosuggestion #b3c0b0
# Set fish pager colors
set -U fish_pager_color_progress #c0cdb8
set -U fish_pager_color_prefix #7fbbb3
set -U fish_pager_color_completion #5c6a72
set -U fish_pager_color_description #b3c0b0

View File

@@ -1,24 +0,0 @@
# Everforest color scheme for fish shell
# Generated from template - do not edit manually
# Set fish colors
set -U fish_color_normal #5c6a72
set -U fish_color_command #7fbbb3
set -U fish_color_keyword #d699b6
set -U fish_color_quote #dbbc7f
set -U fish_color_redirection #83c092
set -U fish_color_end #e69875
set -U fish_color_error #e67e80
set -U fish_color_param #5c6a72
set -U fish_color_comment #a6b0a0
set -U fish_color_selection --background=#ede6cf
set -U fish_color_search_match --background=#ede6cf
set -U fish_color_operator #a7c080
set -U fish_color_escape #d699b6
set -U fish_color_autosuggestion #b3c0b0
# Set fish pager colors
set -U fish_pager_color_progress #c0cdb8
set -U fish_pager_color_prefix #7fbbb3
set -U fish_pager_color_completion #5c6a72
set -U fish_pager_color_description #b3c0b0

View File

@@ -1,24 +0,0 @@
# Everforest color scheme for fish shell
# Generated from template - do not edit manually
# Set fish colors
set -U fish_color_normal #5c6a72
set -U fish_color_command #7fbbb3
set -U fish_color_keyword #d699b6
set -U fish_color_quote #dbbc7f
set -U fish_color_redirection #83c092
set -U fish_color_end #e69875
set -U fish_color_error #e67e80
set -U fish_color_param #5c6a72
set -U fish_color_comment #a6b0a0
set -U fish_color_selection --background=#e9e1cc
set -U fish_color_search_match --background=#e9e1cc
set -U fish_color_operator #a7c080
set -U fish_color_escape #d699b6
set -U fish_color_autosuggestion #b3c0b0
# Set fish pager colors
set -U fish_pager_color_progress #c0cdb8
set -U fish_pager_color_prefix #7fbbb3
set -U fish_pager_color_completion #5c6a72
set -U fish_pager_color_description #b3c0b0

View File

@@ -1,7 +0,0 @@
if test -z "$SSH_ENV"
set -xg SSH_ENV $HOME/.ssh/environment
end
if not __ssh_agent_is_started
__ssh_agent_start
end

View File

@@ -1,27 +0,0 @@
# fzf.fish is only meant to be used in interactive mode. If not in interactive mode and not in CI, skip the config to speed up shell startup
if not status is-interactive && test "$CI" != true
exit
end
# Because of scoping rules, to capture the shell variables exactly as they are, we must read
# them before even executing _fzf_search_variables. We use psub to store the
# variables' info in temporary files and pass in the filenames as arguments.
# This variable is global so that it can be referenced by fzf_configure_bindings and in tests
set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) (set --names | psub)'
# Install the default bindings, which are mnemonic and minimally conflict with fish's preset bindings
fzf_configure_bindings
# Doesn't erase autoloaded _fzf_* functions because they are not easily accessible once key bindings are erased
function _fzf_uninstall --on-event fzf_uninstall
_fzf_uninstall_bindings
set --erase _fzf_search_vars_command
functions --erase _fzf_uninstall _fzf_migration_message _fzf_uninstall_bindings fzf_configure_bindings
complete --erase fzf_configure_bindings
set_color cyan
echo "fzf.fish uninstalled."
echo "You may need to manually remove fzf_configure_bindings from your config.fish if you were using custom key bindings."
set_color normal
end

View File

@@ -1,62 +0,0 @@
# @halostatue/fish-brew/conf.d/halostatue_fish_brew.fish:v3.2.1
# Find Homebrew via a known prefix. If the `__homebrew_prefix` universal
# variable is set, that will be set as the first test prefix.
if not command --query brew
set --local prefixes $HOME/.brew $HOME/.linuxbrew /opt/homebrew /usr/local
set --query --universal __homebrew_prefix
and set --prepend prefixes $__homebrew_prefix
for prefix in $prefixes
test -x $prefix/bin/brew
or continue
set --prepend PATH $prefix/bin
break
end
end
if command --query brew
set --query --universal __brew_prefix
and set --erase --universal __brew_prefix
set --local __brew_prefix (brew --prefix)
if ! contains -- {$__brew_prefix}/bin $fish_user_paths
fish_add_path --append --move --path \
{$__brew_prefix}/bin \
/usr/local/bin \
/usr/bin \
/bin \
{$__brew_prefix}/sbin \
/usr/local/sbin \
/usr/sbin \
/sbin
end
if test -s $HOME/.config/brew/config.fish
if status is-interactive
set --local deprecated 0
if set --query $__halostatue_fish_brew_config_deprecated
set deprecated $__halostatue_fish_brew_config_deprecated
end
if test $deprecated -le 0
echo >&2 "Sourcing ~/.config/brew/config.fish is deprecated."
echo >&2 "See https://docs.brew.sh/Manpage#environment for a better alternative."
set --universal $__halostatue_fish_brew_config_deprecated 10
else
set --universal $__halostatue_fish_brew_config_deprecated (math $deprecated - 1)
end
end
source $HOME/.config/brew/config.fish
end
end
function _halostatue_fish_brew_uninstall -e halostatue_fish_brew_uninstall
set --universal --erase __brew_prefix __halostatue_fish_brew_config_deprecated
functions --erase has_cask has_keg (status function)
end

View File

@@ -1,14 +0,0 @@
# @halostatue/fish-macos/conf.d/halostatue_fish_macos.fish:v7.0.1
function _halostatue_fish_macos_uninstall -e halostatue_fish_macos_uninstall
set --function functions app finder has_app mac manp note ql remind
for cmd in $functions
complete --erase --command $cmd
end
set --append functions (status function) \
(functions --all | string match --entire --regex '^__macos_app_|^__macos_finder_|^__macos_mac_')
functions --erase $functions
end

View File

@@ -16,7 +16,7 @@ if not set -q PHPENV_AUTO_SWITCH
end
if not set -q PHPENV_DEFAULT_EXTENSIONS
set -g PHPENV_DEFAULT_EXTENSIONS opcache
set -g PHPENV_DEFAULT_EXTENSIONS "opcache"
end
# Initialize PATH on shell startup if global version is set (less aggressive)

View File

@@ -1,25 +0,0 @@
status is-interactive || exit
function _puffer_fish_key_bindings --on-variable fish_key_bindings
set -l modes
if test "$fish_key_bindings" = fish_default_key_bindings
set modes default insert
else
set modes insert default
end
bind --mode $modes[1] . _puffer_fish_expand_dots
bind --mode $modes[1] ! _puffer_fish_expand_bang
bind --mode $modes[1] '$' _puffer_fish_expand_lastarg
bind --mode $modes[2] --erase . ! '$'
end
_puffer_fish_key_bindings
set -l uninstall_event puffer_fish_key_bindings_uninstall
function _$uninstall_event --on-event $uninstall_event
bind -e .
bind -e !
bind -e '$'
end

View File

@@ -1,52 +0,0 @@
# Sponge version
set --global sponge_version 1.1.0
# Allow to repeat previous command by default
if not set --query --universal sponge_delay
set --universal sponge_delay 2
end
# Purge entries both after `sponge_delay` entries and on exit by default
if not set --query --universal sponge_purge_only_on_exit
set --universal sponge_purge_only_on_exit false
end
# Add default filters
if not set --query --universal sponge_filters
set --universal sponge_filters sponge_filter_failed sponge_filter_matched
end
# Don't filter out commands that already have been in the history by default
if not set --query --universal sponge_allow_previously_successful
set --universal sponge_allow_previously_successful true
end
# Consider `0` the only successful exit code by default
if not set --query --universal sponge_successful_exit_codes
set --universal sponge_successful_exit_codes 0
end
# No active regex patterns by default
if not set --query --universal sponge_regex_patterns
set --universal sponge_regex_patterns
end
# Attach event handlers
functions --query \
_sponge_on_prompt \
_sponge_on_preexec \
_sponge_on_postexec \
_sponge_on_exit
# Initialize empty state for the first run
function _sponge_install --on-event sponge_install
set --global _sponge_current_command ''
set --global _sponge_current_command_exit_code 0
set --global _sponge_current_command_previously_in_history false
end
# Clean up variables
function _sponge_uninstall --on-event sponge_uninstall
_sponge_clear_state
set --erase sponge_version
end

View File

@@ -1,12 +1,4 @@
jorgebucaran/fisher
ilancosman/tide@v6
jethrokuan/z
halostatue/fish-macos@v7
danhper/fish-ssh-agent
halostatue/fish-brew@v3
edc/bass
meaningful-ooo/sponge
nickeb96/puffer-fish
jgusta/paths
patrickf1/fzf.fish
ivuorinen/phpenv.fish

View File

@@ -1,53 +0,0 @@
# @halostatue/fish-macos/functions/__macos_app_bundleid.fish:v7.0.1
function __macos_app_bundleid
argparse --name 'app bundleid' x/exact a/all h/help q/quiet s/short -- $argv
or return 1
if set --query _flag_help
echo 'Usage: app bundleid [options] pattern...
Shows the bundle identifier for each of the applications found for the
pattern (see `app find` for how applications are found).
Options:
-x, --exact Perform exact matches only
-a, --all Show all matches
-q, --quiet Suppress error output
-s, --short Prints out the bundle IDs only
-h, --help Show this help
Examples:
> app bundleid 1password
/Applications/1Password for Safari.app: com.1password.safari
/Applications/1Password.app: com.1password.1password
> app bundleid -x 1password
/Applications/1Password.app: com.1password.1password'
return 0
end
if test (count $argv) -eq 0
echo >&2 'app bundleid: Not enough arguments.'
__macos_app_bundleid --help >&2
return 1
end
set --function apps (__macos_app_find $_flag_exact $_flag_all $argv)
or return 1
for app in $apps
set --local bundle_id (mdls -name kMDItemCFBundleIdentifier -r $app)
if test -z $bundle_id
set --query _flag_quiet
or echo >&2 'Error getting bundle ID for "'$app'"'
else
if set --query _flag_short
echo $bundle_id
else
echo $app: $bundle_id
end
end
end
end

View File

@@ -1,85 +0,0 @@
# @halostatue/fish-macos/functions/__macos_app_find.fish:v7.0.1
function __macos_app_find
argparse --name 'app find' x/exact a/all q/quiet h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: app find [options] pattern...
Shows installed apps by the provided pattern or patterns. Searches for
apps in /Applications, /Applications/Setapp, /Applications/Utilities,
~/Applications, /Appliciations/Xcode.app/Contents/Applications,
/Developer/Applications, and /System/Applications.
Options:
-x, --exact Perform exact matches only
-a, --all Show all matches
-q, --quiet Do not print matches
-h, --help Show this help
Examples:
> app find --all 1password
/Applications/1Password for Safari.app
/Applications/1Password.app
> app find --exact 1password
/Applications/1Password.app'
return 0
end
if test (count $argv) -eq 0
echo >&2 'app find: Not enough arguments.'
__macos_app_find --help >&2
return 1
end
set --function a Applications
set --function paths \
/$a \
~/$a \
/$a/Setapp \
/$a/Utilities \
/$a/Xcode.app/Contents/$a \
/Developer/Applications \
/System/Applications
set --function found 0
for pattern in $argv
set pattern (string replace '\.app/?$' '' $pattern)
set --local apps {$paths}/*.app {$paths}/*.localized/*.app
for candidate in $apps
set --local found_item 0
if set --query _flag_exact
if string match --ignore-case --entire --quiet /$pattern.app $candidate
set found_item 1
end
else if string match --ignore-case --entire --quiet $pattern $candidate
set found_item 1
end
if test $found_item -eq 1
set --query _flag_quiet
or echo $candidate
set found (math $found + $found_item)
set --query _flag_quiet
and return 0
set --query _flag_all
or return 0
end
end
end
test $found -gt 0
and return 0
set --query _flag_quiet
or echo >&2 'No applications found.'
return 1
end

View File

@@ -1,110 +0,0 @@
# @halostatue/fish-macos/functions/__macos_app_frontmost.fish:v7.0.1
function __macos_app_frontmost::info
set --function value (lsappinfo info -only $argv[2] $argv[1] | string split =)[2]
or return 1
string replace --all '"' '' $value
return 0
end
function __macos_app_frontmost
argparse --name 'app frontmost' \
h/help b/bundle-id p/path n/name P/pid a/all \
-- $argv
or return 1
if set --query _flag_help
echo 'Usage: app frontmost [options]
Retrieves details about the front-most application.
Options:
-b, --bundle-id Shows the app bundle ID
-p, --path Shows the app path
-n, --name Shows the app name
-P, --pid Shows the PID of the app
-a, --all Shows all details
-h, --help Show this help
Example:
> app frontmost
iTerm2'
return 0
end
set --function front (lsappinfo front)
or return 1
set --function items 0
if set --query _flag_all
set items 4
else
set --query _flag_bundle_id _flag_path _flag_name _flag_pid
set --local missing $status
switch $missing
case 0
set _flag_all 1
set items 4
case 4
set _flag_name 1
set items 1
case '*'
set items (math 4 - $missing)
end
end
if set --query _flag_name || set --query _flag_all
set --function name (__macos_app_frontmost::info $front name)
or return 1
end
if set --query _flag_bundle_id || set --query _flag_all
set --function bundle_id (__macos_app_frontmost::info $front bundleID)
or return 1
end
if set --query _flag_path || set --query _flag_all
set --function bundle_path (__macos_app_frontmost::info $front bundlepath)
or return 1
end
if set --query _flag_pid || set --query _flag_all
set --function pid (__macos_app_frontmost::info $front pid)
or return 1
end
if set --query _flag_all
printf "%s: %s %s (%s)\n" $name $bundle_id $bundle_path $pid
else
if set --query _flag_name
printf "%s" $name
test $items -gt 1 && printf ": "
set items (math $items - 1)
end
if set --query _flag_bundle_id
printf "%s" $bundle_id
test $items -gt 1 && printf " "
set items (math $items - 1)
end
if set --query _flag_path
printf "%s" $bundle_path
test $items -gt 1 && printf " "
set items (math $items - 1)
end
if set --query _flag_pid
if test $items -gt 1
printf "(%s)" $pid
else
printf "%s" $pid
end
end
printf "\n"
end
end

View File

@@ -1,93 +0,0 @@
# @halostatue/fish-macos/functions/__macos_app_icon.fish:v7.0.1
function __macos_app_icon
argparse --name 'app quit' x/exact h/help 'o/output=' 'w/width=' -- $argv
or return 1
if set --query _flag_help
echo 'Usage: app icon [options] pattern...
Extracts macOS app icons as PNG (see `app find` for how applications
are found).
Options:
-x, --exact Perform exact matches only
-oOUTPUT Output to the file or directory specified
--output OUTPUT Output to the file or directory specified
-wWIDTH Outputs to a maximum of WIDTH pixels
--width WIDTH Outputs to a maximum of WIDTH pixels
-h, --help Show this help'
return 0
end
if test (count $argv) -eq 0
echo >&2 'app icon: Not enough arguments.'
__macos_app_icon --help >&2
return 1
end
if set --query _flag_exact
set --function apps (__macos_app_find --exact $argv)
or return 1
else
set --function apps (__macos_app_find --all $argv)
or return 1
end
set --function app_count (count $apps)
set --function output_path $PWD
if not test -z $_flag_output
if test -e $_flag_output
if test -f $_flag_output
if test $app_count -gt 1
echo >&2 'app icon: More than one application found, but only one output file specified.'
return 1
end
set output_path (dirname $_flag_output)
set output_file (basename $_flag_output)
else if test -d $_flag_output
set output_path $_flag_output
else
echo >&2 'app icon: Output to a non-file or directory specified.'
return 1
end
else
set output_path $_flag_output
mkdir -p $output_path
end
end
for app in $apps
set --local icon $app/Contents/Resources/(
defaults read $app/Contents/Info CFBundleIconFile |
string replace --regex '\.icns$' ''
).icns
set --local name (basename $app .app)_icon.png
set --local tmp $TMPDIR/$name
set --local max_width (sips -g pixelWidth $icon | tail -1 | awk '{ print $2; }')
set --local outfile
set --local width
if test -z $output_file
set outfile $output_path/$name
else
set outfile $output_path/$output_file
end
if test -z $_flag_width
set width $max_width
else if test $_flag_width -gt $max_width
set width $max_width
else
set width $_flag_width
end
sips -s format png --resampleHeightWidthMax $width $icon --out $outfile >/dev/null 2>&1
echo Wrote $app icon to $outfile.
end
end

View File

@@ -1,42 +0,0 @@
# @halostatue/fish-macos/functions/__macos_app_quit.fish:v7.0.1
function __macos_app_quit
argparse --name 'app quit' x/exact r/restart h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: app quit [options] pattern...
Quits apps identified by the provided pattern or patterns (see
`app find` for how applications are found).
Options:
-x, --exact Quits only applications with exact matches
-r, --restart Restarts the application that was quit
-h, --help Show this help'
return 0
end
if test (count $argv) -eq 0
echo >&2 'app bundleid: Not enough arguments.'
__macos_app_quit --help >&2
return 1
end
if set --query _flag_exact
set --function apps (__macos_app_find --exact $argv)
or return 1
else
set --function apps (__macos_app_find --all $argv)
or return 1
end
for app in $apps
printf 'quit app "%s"' $app | osascript >/dev/null
if set --query _flag_restart
sleep 2
open -a $app
end
end
end

View File

@@ -1,18 +0,0 @@
# @halostatue/fish-macos/functions/__macos_finder_cd.fish:v7.0.1
function __macos_finder_cd
argparse --name 'finder cd' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: finder cd [options] [window#]
Changes the current path to the path of the Finder window.
Options:
-h, --help Show this help'
return 0
end
cd (__macos_finder_pwd::get $argv[1])
end

View File

@@ -1,30 +0,0 @@
# @halostatue/fish-macos/functions/__macos_finder_clean.fish:v7.0.1
function __macos_finder_clean
argparse --name 'finder clean' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: finder clean [options] [path...]
Removes .DS_Store files from the paths provided, or the current path if
one is not provided.
Options:
-h, --help Show this help'
return 0
end
if set --query argv[1]
set --function paths $argv
else
set --function paths .
end
for path in $paths
test -d $path
or continue
find $path -type f -name '*.DS_Store' -ls -delete
end
end

View File

@@ -1,18 +0,0 @@
# @halostatue/fish-macos/functions/__macos_finder_column.fish:v7.0.1
function __macos_finder_column
argparse --name 'finder column' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: finder column [options] [window#]
Updates the Finder window to PWD using column view.
Options:
-h, --help Show this help'
return 0
end
__macos_finder_pwd::update --column $argv
end

View File

@@ -1,44 +0,0 @@
# @halostatue/fish-macos/functions/__macos_finder_desktop_icons.fish:v7.0.1
function __macos_finder_desktop_icons
argparse --name 'finder desktop-icons' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: finder desktop-icons [options] STATE
Shows or hides the desktop icons. If not specified, shows the current state.
States:
off Hides the desktop icons
on Shows the desktop icons
[status] Shows desktop icon visibility
toggle Toggles desktop icon visibility
Options:
-h, --help Show this help'
return 0
end
set --function action (string lower -- $argv[1])
set --function key CreateDesktop
switch $action
case off
__macos_finder_defaults::set $key false
case on
__macos_finder_defaults::set $key true
case toggle
if test (__macos_mac_defaults_query com.apple.Finder $key 1) -eq 1
__macos_finder_defaults::set $key false
else
__macos_finder_defaults::set $key true
end
case status ''
if test (__macos_mac_defaults_query com.apple.Finder $key 1) -eq 1
echo 'Desktop icons are hidden.'
else
echo 'Desktop icons are visible.'
end
end
end

View File

@@ -1,45 +0,0 @@
# @halostatue/fish-macos/functions/__macos_finder_hidden.fish:v7.0.1
function __macos_finder_hidden
argparse --name 'finder hidden' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: finder hidden [options] STATE
Shows or hides files that are normally hidden from the Finder. If not
specified, shows the current state.
States:
off Hides files that are normally hidden from the Finder
on Shows files that are normally hidden from the Finder
[status] Shows the status of the hidden files setting
toggle Toggles the hidden files setting
Options:
-h, --help Show this help'
return 0
end
set --function action (string lower -- $argv[1])
set --function key AppleShowAllFiles
switch $action
case off
__macos_finder_defaults::set $key false
case on
__macos_finder_defaults::set $key true
case toggle
if test (__macos_mac_defaults_query com.apple.Finder $key 0) -eq 1
__macos_finder_defaults::set $key false
else
__macos_finder_defaults::set $key true
end
case status ''
if test (__macos_mac_defaults_query com.apple.Finder $key 0) -eq 1
echo 'Hidden files are visible in finder.'
else
echo 'Hidden files are hidden in finder.'
end
end
end

View File

@@ -1,18 +0,0 @@
# @halostatue/fish-macos/functions/__macos_finder_icon.fish:v7.0.1
function __macos_finder_icon
argparse --name 'finder icon' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: finder icon [options] [window#]
Updates the Finder window to PWD using icon view.
Options:
-h, --help Show this help'
return 0
end
__macos_finder_pwd::update --icon $argv
end

View File

@@ -1,18 +0,0 @@
# @halostatue/fish-macos/functions/__macos_finder_list.fish:v7.0.1
function __macos_finder_list
argparse --name 'finder list' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: finder list [options] [window#]
Updates the Finder window to PWD using list view.
Options:
-h, --help Show this help'
return 0
end
__macos_finder_pwd::update --list $argv
end

View File

@@ -1,18 +0,0 @@
# @halostatue/fish-macos/functions/__macos_finder_pushd.fish:v7.0.1
function __macos_finder_pushd
argparse --name 'finder pushd' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: finder pushd [options] [window#]
Changes the current path to the path of the Finder window with pushd.
Options:
-h, --help Show this help'
return 0
end
pushd (__macos_finder_pwd::get $argv[1])
end

View File

@@ -1,18 +0,0 @@
# @halostatue/fish-macos/functions/__macos_finder_pwd.fish:v7.0.1
function __macos_finder_pwd
argparse --name 'finder pwd' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: finder pwd [options] [window#]
Prints the path of the Finder window.
Options:
-h, --help Show this help'
return 0
end
__macos_finder_pwd::get $argv[1]
end

View File

@@ -1,60 +0,0 @@
# @halostatue/fish-macos/functions/__macos_finder_quarantine.fish:v7.0.1
function __macos_finder_quarantine::run
set --query argv[1]
or return 1
set --function databases ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV*
set --function cmd sqlite3 -separator ' | '
for db in $databases
$cmd $db $argv
end
end
function __macos_finder_quarantine
argparse --name 'finder quarantine' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: finder [options] [SUBCOMMAND] [FILE...]
Manage quarantine events.
Subcommands:
[show] Shows quarantine events by agent and URL.
clean FILE... Removes quarantine attributes from the specified file(s).
At least one file is required.
clear Clears all quarantine events.
Options:
-h, --help Show this help'
return 0
end
set --function verb (string lower -- $argv[1])
set --erase argv[1]
switch $verb
case show ''
__macos_finder_quarantine::run "
SELECT LSQuarantineAgentName, LSQuarantineDataURLString
FROM LSQuarantineEvent
WHERE LSQuarantineDataURLString != ''
ORDER BY LSQuarantineAgentName, LSQuarantineDataURLString;"
case clear
__macos_finder_quarantine::run 'DELETE FROM LSQuarantineEvent;'
case clean
if not set --query argv[1]
echo >&2 'finder quarantine clean requires at least one file parameter'
return 1
end
for attr in com.apple.{metadata:{kMDItemDownloadedDate,kMDItemWhereFroms},quarantine}
xattr -r -d $attr $argv
end
case '*'
echo >&2 "finder quarantine: unknown command '"$verb"'. Use 'show', 'clear', or 'clean'."
return 1
end
end

View File

@@ -1,28 +0,0 @@
# @halostatue/fish-macos/functions/__macos_finder_selected.fish:v7.0.1
function __macos_finder_selected
argparse --name 'finder selected' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: finder selected [options] [window#]
Print the selected files on the command-line.
Options:
-h, --help Show this help'
return 0
end
echo '
tell application "Finder" to set theSelection to selection
set output to ""
set itemCount to count theSelection
repeat with itemIndex from 1 to itemCount
if itemIndex is less than itemCount then set theDelimiter to "\n"
if itemIndex is itemCount then set theDelimiter to ""
set currentItem to (item itemIndex of theSelection as alias)
set currentItem to POSIX path of currentItem
set output to output & currentItem & theDelimiter
end repeat' | osascript
end

View File

@@ -1,26 +0,0 @@
# @halostatue/fish-macos/functions/__macos_finder_track.fish:v7.0.1
function __macos_finder_track
argparse --name 'finder track' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: finder track [options]
Makes the first Finder window track with the shell PWD. This should be used
in a single shell instance only, and updates only when the PWD value is
updated.
Options:
-h, --help Show this help'
return 0
end
if not functions --query __macos_finder_tracking
function __macos_finder_tracking --on-variable PWD
__macos_finder_pwd::update
end
end
__macos_finder_pwd::update
end

View File

@@ -1,18 +0,0 @@
# @halostatue/fish-macos/functions/__macos_finder_untrack.fish:v7.0.1
function __macos_finder_untrack
argparse --name 'finder untrack' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: finder untrack [options]
Unlinks the shell PWD from the first Finder window.
Options:
-h, --help Show this help'
return 0
end
functions --erase __macos_finder_tracking
end

View File

@@ -1,18 +0,0 @@
# @halostatue/fish-macos/functions/__macos_finder_update.fish:v7.0.1
function __macos_finder_update
argparse --name 'finder update' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: finder update [options] [window#]
Updates the Finder window to PWD.
Options:
-h, --help Show this help'
return 0
end
__macos_finder_pwd::update $argv
end

View File

@@ -1,45 +0,0 @@
# @halostatue/fish-macos/functions/__macos_mac_airdrop.fish:v7.0.1
function __macos_mac_airdrop
argparse --name 'mac airdrop' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: mac airdrop STATE
Turns AirDrop on or off. Requires administrative permissions and
executes with sudo.
States:
off Disables AirDrop.
on Enables AirDrop.
[status] Shows the status of AirDrop.
toggle Toggles the status of AirDrop.
Options:
-h, --help Show this help'
return 0
end
set --function subcommand (string lower -- $argv[1])
set --erase argv[1]
switch $subcommand
case on
sudo ifconfig awdl0 up
case off
sudo ifconfig awdl0 down
case status ''
ifconfig awdl0 | awk '/status:/ { print $2; }'
case toggle
if test (__macos_mac_airdrop status) == active
__macos_mac_airdrop off
else
__macos_mac_airdrop on
end
case '*'
echo >&2 'mac airdrop: unknown state.'
__macos_mac_airdrop --help >&2
return 1
end
end

View File

@@ -1,75 +0,0 @@
# @halostatue/fish-macos/functions/__macos_mac_airport.fish:v7.0.1
function __macos_mac_airport::ssid
__macos_mac_airport::run -I | string replace --filter --regex '\s+SSID: (\S+)' '$1'
end
function __macos_mac_airport::run
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport \
$argv
end
function __macos_mac_airport
argparse --name 'mac airport' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: mac airport STATE
mac airport SUBCOMMAND [SSID]
Performs various WiFi (AirPort) operations. If no state or subcommand is
provided, the scan subcommand will be run by default. Otherwise a state (off,
on, toggle) or a subcommand must be provided.
States:
off Disables the WiFi adapter.
on Enables the WiFi adapter.
toggle Toggles the status of the WiFi adapter.
Subcommands:
password [SSID] Shows the password of the current or specified SSID.
scan Scans for WiFi networks..
ssid Shows the current WiFi network SSID.
status Shows the status of the WiFi adapter.
Options:
-h, --help Show this help'
return 0
end
set --function cmd (string lower -- $argv[1])
set --erase argv[1]
switch $cmd
case scan ''
printf "Scanning...\r"
__macos_mac_airport::run -s
case network ssid
__macos_mac_airport::ssid
case off
networksetup -setairportpower en0 off
case on
networksetup -setairportpower en0 on
case status
networksetup -getairportpower en0 | string replace --regex '^[^:]+: ' '' | string lower
case toggle
if test (__macos_mac_airport status) == on
__macos_mac_airport off
else
__macos_mac_airport on
end
case password
set --local ssid
if set --query argv[1]
set ssid $argv[1]
else
set ssid (__macos_mac_airport::ssid)
end
security find-generic-password -D "AirPort network password" -l $ssid -gw
case '*'
echo >&2 'mac airport: Unknown command.'
__macos_mac_airport --help >&2
return 1
end
end

View File

@@ -1,38 +0,0 @@
# @halostatue/fish-macos/functions/__macos_mac_brightness.fish:v7.0.1
function __macos_mac_brightness
argparse --name 'mac brightness' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: mac brightness [options] DIRECTION
Adjust the screen brightness level.
Direction:
up Increases the screen brightness level.
down Decreases the screen brightness level.
Options:
-h, --help Show this help'
return 0
end
set --function direction (string lower -- $argv[1])
set --erase argv[1]
switch $direction
case down
echo 'tell application "System Events"
key code 145
end tell' | osascript >/dev/null
case up ''
echo 'tell application "System Events"
key code 144
end tell' | osascript >/dev/null
case '*'
echo >&2 'mac brightness: Unknown direction'
__macos_mac_brightness --help >&2
return 1
end
end

View File

@@ -1,9 +0,0 @@
# @halostatue/fish-macos/functions/__macos_mac_defaults_query.fish:v7.0.1
function __macos_mac_defaults_query
if set --function value (defaults read $argv[1] $argv[2] 2>/dev/null)
echo $value
else
echo $argv[3]
end
end

View File

@@ -1,19 +0,0 @@
# @halostatue/fish-macos/functions/__macos_mac_flushdns.fish:v7.0.1
function __macos_mac_flushdns
argparse --name 'mac flushdns' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: mac flushdns [options]
Flushes the DNS cache. Requires sudo.
Options:
-h, --help Show this help'
return 0
end
sudo dscacheutil -flushcache
and sudo killall -HUP mDNSResponder
end

View File

@@ -1,62 +0,0 @@
# @halostatue/fish-macos/functions/__macos_mac_font_smoothing.fish:v7.0.1
function __macos_mac_font_smoothing
argparse --name 'mac font-smoothing' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: mac font-smoothing [options] off|on [APP...]
Enables or disables font smoothing. If no apps are provided, sets the
global font smoothing preference. If apps are provided, font smoothing
will be set for each app. See `app bundleid` for how apps are resolved.
States:
off Turns off font smoothing
on Turns on font smoothing
Options:
-h, --help Show this help'
return 0
end
set --function state (string lower -- $argv[1])
set --erase argv[1]
switch $state
case on
if test (count $argv) -eq 0
defaults delete -g CGFontRenderingFontSmoothingDisabled
else
for app in (__macos_app_bundleid --exact --short --all $argv)
defaults delete $app CGFontRenderingFontSmoothingDisabled
if test $app = com.microsoft.VSCode
defaults delete $app.helper CGFontRenderingFontSmoothingDisabled
defaults delete $app.helper.EH CGFontRenderingFontSmoothingDisabled
defaults delete $app.helper.NP CGFontRenderingFontSmoothingDisabled
end
end
end
case off
if test (count $argv) -eq 0
defaults write -g CGFontRenderingFontSmoothingDisabled -bool false
else
for app in (__macos_app_bundleid --exact --short --all $argv)
defaults write $app CGFontRenderingFontSmoothingDisabled -bool false
if test $app = com.microsoft.VSCode
defaults write $app.helper CGFontRenderingFontSmoothingDisabled -bool false
defaults write $app.helper.EH CGFontRenderingFontSmoothingDisabled -bool false
defaults write $app.helper.NP CGFontRenderingFontSmoothingDisabled -bool false
end
end
end
case '*'
echo >&2 'mac font-smoothing: Unknown state.'
__macos_mac_font_smoothing --help >&2
return 1
end
end

View File

@@ -1,20 +0,0 @@
# @halostatue/fish-macos/functions/__macos_mac_lsclean.fish:v7.0.1
function __macos_mac_lsclean
argparse --name 'mac lsclean' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: mac lsclean [options]
Cleans the LaunchServices registration list.
Options:
-h, --help Show this help'
return 0
end
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister \
-kill -r -domain local -domain system -domain user
and killall Finder
end

View File

@@ -1,68 +0,0 @@
# @halostatue/fish-macos/functions/__macos_mac_mail.fish:v7.0.1
# Speed up Mail.app by vacuuming the Envelope Index
# - Code from: http://web.archive.org/web/20071008123746/http://www.hawkwings.net/2007/03/03/scripts-to-automate-the-mailapp-envelope-speed-trick/
# - Originally by "pmbuko" with modifications by Romulo
# - Updated by Brett Terpstra 2012
# - Updated by Mathias Törnblom 2015 to support V3 in El Capitan and still keep backwards compatibility
# - Updated by Andrei Miclaus 2017 to support V4 in Sierra
# - Updated by Austin Ziegler 2022 to not actually care what the OS version is (and translated to fish). The only
# restriction is that you must have opened Mail.app at least once on any OS upgrade so that if any version changes
# have happened, Mail.app has taken care of that for you.
function __macos_mac_mail
argparse --name 'mac mail' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: mac mail [options] SUBCOMMAND [arg]
Performs operations on Mail.app configuration and database.
Before running vacuum after any OS upgrade, Mail.app must have been opened
at least once so that the database and index formats have been updated.
Subcommands:
vacuum Vacuums the envelope index to improve performance.
attachments inline Sets Mail.app attachment handling to inline.
attachments icon Sets Mail.app attachment handling to icon.
Options:
-h, --help Show this help'
return 0
end
set --function subcommand (string lower -- $argv[1])
set --erase argv[1]
switch $subcommand
case vacuum
set --function mail_version (
path filter --type dir ~/Library/Mail/* |
path basename |
string match --all --entire --regex V\\d
)
set --function mail_path ~/Library/Mail/$mail_version/MailData/Envelope\ Index
osascript -e 'tell application "Mail" to quit'
set --function before (ls -lnah $mail_path | awk '{ print $5; }')
/usr/bin/sqlite3 $mail_path vacuum
set --function after (ls -lnah $mail_path | awk '{ print $5; }')
printf "Mail index before: %s\nMail index after: %s\n" $before $after
osascript -e 'tell application "Mail" to activate'
case attachments
switch (string lower -- $argv[1])
case inline
defaults delete com.apple.mail DisableInlineAttachmentViewing
case icon
defaults write com.apple.mail DisableInlineAttachmentViewing -bool true
end
case '*'
echo >&2 'mac mail: Unknown command.'
__macos_mac_mail --help >&2
return 1
end
end

View File

@@ -1,66 +0,0 @@
# @halostatue/fish-macos/functions/__macos_mac_proxy_icon.fish:v7.0.1
function __macos_mac_proxy_icon
argparse --name 'mac proxy-icon' h/help q/query -- $argv
or return 1
if set --query _flag_help
echo 'Usage: mac proxy-icon [options] STATE
Enables or disables the visibility of the proxy icon without delay. macOS
versions older than Monterey always show the proxy icon.
States:
FLOAT Sets the display of the proxy icon to FLOAT fractional seconds.
off Sets the display of the proxy icon to default.
on Sets the display of the proxy icon to 0 seconds.
[status] Shows the duration of the proxy icon display.
toggle Toggles the display of the proxy icon.
Options:
-q, --query When getting status, suppresses output.
-h, --help Show this help'
return 0
end
set --function state (string lower -- $argv[1])
set --erase argv[1]
switch $state
case status ''
set --function value (__macos_mac_defaults_query -g NSToolbarTitleViewRolloverDelay 0.5)
if set --query _flag_query
test $value -eq 0
else if test $value -eq 0
printf "immediate (0 seconds)\n"
else
printf "%0.2f seconds\n" $value
end
case toggle
if __macos_mac_proxy_icon --query status
__macos_mac_proxy_icon off
else
__macos_mac_proxy_icon on
end
case on
defaults write -g NSToolbarTitleViewRolloverDelay -float 0
and killall Finder
case off
defaults delete -g NSToolbarTitleViewRolloverDelay
and killall Finder
case '*'
if string match --regex '^\\d+$|^\\d*\.\\d+$' $state
defaults write -g NSToolbarTitleViewRolloverDelay -float $state
and killall Finder
else
echo >&2 'mac proxy-icon: Unknown state.'
__macos_mac_proxy_icon --help >&2
return 1
end
end
end

View File

@@ -1,22 +0,0 @@
# @halostatue/fish-macos/functions/__macos_mac_serialnumber.fish:v7.0.1
function __macos_mac_serialnumber
argparse --name 'mac serialnumber' h/help c/copy -- $argv
or return 1
if set --query _flag_help
echo 'Usage: mac serialnumber [options]
Gets the serial number for the current macOS device.
Options:
-c, --copy Copy to the clipboard
-h, --help Show this help'
return 0
end
set --function serial (ioreg -l | string replace --filter --regex --all '^.*"IOPlatformSerialNumber"\s+=\s+"([^"]+)"' '$1')
set --query _flag_copy && echo $serial | pbcopy
echo $serial
end

View File

@@ -1,42 +0,0 @@
# @halostatue/fish-macos/functions/__macos_mac_touchid.fish:v7.0.1
function __macos_mac_touchid
argparse --name 'mac touchid' h/help q/quiet -- $argv
or return 1
if set --query _flag_help
echo 'Usage: mac touchid SUBSYSTEM [STATE]
Enables or disables Touch ID support. Requires administrative permissions
and executes with sudo.
Subsystems:
sudo Manages Touch ID support for sudo
States:
off Disables Touch ID.
on Enables Touch ID.
[status] Shows the status of Touch ID.
toggle Toggles the status of Touch ID.
Options:
-h, --help Show this help'
return 0
end
set --function subsystem (string lower -- $argv[1])
set --erase argv[1]
if set --query _flag_quiet
set --append argv --quiet
end
switch $subsystem
case sudo
__macos_mac_touchid_sudo $argv
case '*'
echo >&2 'mac touchid: unknown subsystem.'
__macos_mac_touchid --help >&2
return 1
end
end

View File

@@ -1,194 +0,0 @@
# @halostatue/fish-macos/functions/__macos_mac_touchid_sudo.fish:v7.0.1
# Massively simplified. This version _only_ works if /etc/pam.d/sudo includes `auth
# include sudo_local` and requires manual removal of `pam_reattach` and `pam_tid` from
# `/etc/pam.d/sudo` _manually_ if present.
function __macos_mac_touchid_sudo::check_supported
if string match -rq '^\s*auth\s+include\s+sudo_local$' </etc/pam.d/sudo
return 0
end
echo "Unsupported sudo configuration, cannot find 'auth include sudo_local'. \
If your macOS installation supports 'include', add this at the top:" |
fmt -s >&2
printf >&2 "\n auth include sudo_local\n\n"
printf >&2 "Once this has been added, try again.\n"
return 1
end
function __macos_mac_touchid_sudo::check_old_install
set --function found
string match -rq '^\s*auth\s+sufficient\s+pam_tid\.so' </etc/pam.d/sudo
and set --append found pam_tid
string match -rq '^\s*auth\s+optional\s+.+pam_reattach\.so' </etc/pam.d/sudo
and set --append found pam_reattach
if set --query found[1]
set found (string join ' and ' $found)
printf >&2 "Sudo support for "$found" present in /etc/pam.d/sudo.\n\n"
echo "This is unsupported by 'mac touchid sudo' and must be manually \
removed before continuing." | fmt -s >&2
return 0
end
return 1
end
function __macos_mac_touchid_sudo::print_status
set --query _flag_quiet
or printf "%-15s: %s\n" $argv
end
function __macos_mac_touchid_sudo::remove_one
path is --type file --perm read /etc/pam.d/sudo_local
and grep -q $argv[1] /etc/pam.d/sudo_local
and sudo sed -i '' -e "/$argv[1]/d" /etc/pam.d/sudo_local
end
function __macos_mac_touchid_sudo::remove
osascript -e 'tell application "System Preferences" to quit'
for ext in pam_tid pam_reattach
__macos_mac_touchid_sudo::remove_one {$ext} /etc/pam.d/sudo_local
and __macos_mac_touchid_sudo::print_status $ext disabled
end
if ! test -s /etc/pam.d/sudo_local
# If /etc/pam.d/sudo_local is empty, remove it.
sudo rm -f /etc/pam.d/sudo_local
end
end
function __macos_mac_touchid_sudo::add
set --function targets
test -f /etc/pam.d/sudo_local
or sudo touch /etc/pam.d/sudo_local
if set --query argv[1]
set --function reattach $argv[1]
if string match -rq '^\s*auth\s+optional\s+'$argv[1] </etc/pam.d/sudo_local
if string match -rq '^\s*auth\s+sufficient\s+pam_tid\.so' </etc/pam.d/sudo_local
__macos_mac_touchid_sudo::print_status pam_reattach enabled
__macos_mac_touchid_sudo::print_status pam_tid enabled
return 0
end
end
set --append targets pam_reattach pam_tid
else if string match -rq '^\s*auth\s+sufficient\s+pam_tid\.so' </etc/pam.d/sudo_local
__macos_mac_touchid_sudo::print_status pam_tid enabled
else
set --append targets pam_tid
end
osascript -e 'tell application "System Preferences" to quit'
for target in $targets
if grep -q $target /etc/pam.d/sudo_local
__macos_mac_touchid_sudo::remove_one $target /etc/pam.d/sudo_local
end
end
if set --query reattach
printf "%-10s %-14s %s\n" \
auth optional $reattach \
auth sufficient pam_tid.so |
sudo tee -a /etc/pam.d/sudo_local >/dev/null
and begin
__macos_mac_touchid_sudo::print_status pam_reattach enabled
__macos_mac_touchid_sudo::print_status pam_tid enabled
end
else
printf "%-10s %-14s %s\n" auth sufficient pam_tid.so |
sudo tee -a /etc/pam.d/sudo_local >/dev/null
and __macos_mac_touchid_sudo::print_status pam_tid enabled
end
end
function __macos_mac_touchid_sudo
argparse --name 'mac touchid sudo' h/help q/quiet -- $argv
or return 1
if set --query _flag_help
echo 'Usage: mac touchid sudo [STATE]
Enables or disables Touch ID support for sudo. Requires administrative
permissions to edit /etc/pam.d/sudo_local and executes with sudo.
If pam_reattach is installed, this will be managed as well. Note that if
pam_reattach is installed using sudo, it is imperative that Touch ID
support be disabled first or you may be in a situation where you cannot
use sudo. Note that MacPorts-installed pam_reattach will never be used.
States:
off Disables Touch ID.
on Enables Touch ID.
[status] Shows the status of Touch ID.
toggle Toggles the status of Touch ID.
Options:
-h, --help Show this help'
return 0
end
__macos_mac_touchid_sudo::check_supported
or return
__macos_mac_touchid_sudo::check_old_install
and return
set --function subcommand (string lower -- $argv[1])
set --erase argv[1]
switch $subcommand
case on
set --local reattach /opt/local /opt/homebrew /usr/local /usr
set reattach (path filter --type file $reattach/lib/pam/pam_reattach.so)
if set --query reattach[1]
set reattach (string replace --all --regex / \\/ $reattach[1])
end
__macos_mac_touchid_sudo::add $reattach
case off
__macos_mac_touchid_sudo::remove
case status ''
set --local pam_tid disabled
set --local pam_reattach disabled
grep -q pam_tid.so /etc/pam.d/sudo_local
and set pam_tid enabled
grep -q pam_reattach.so /etc/pam.d/sudo_local
and set pam_reattach enabled
if set --query _flag_quiet
test $pam_tid = enabled
else
__macos_mac_touchid_sudo::print_status pam_tid $pam_tid
__macos_mac_touchid_sudo::print_status pam_reattach $pam_reattach
end
case toggle
if __macos_mac_touchid_sudo status --quiet
__macos_mac_touchid_sudo off
else
__macos_mac_touchid_sudo on
end
case '*'
echo >&2 'mac touchid: unknown state.'
__macos_mac_touchid_sudo --help >&2
return 1
end
end

View File

@@ -1,60 +0,0 @@
# @halostatue/fish-macos/functions/__macos_mac_transparency.fish:v7.0.1
function __macos_mac_transparency
argparse --name 'mac transparency' h/help q/query -- $argv
or return 1
if set --query _flag_help
echo 'Usage: mac transparency [options] STATE
Enables or disables interface transparency by setting the universal
access "reduce transparency" setting.
States:
off Disables interface transparency
on Enables interface transparency
[status] Shows the status of interface transparency
toggle Toggles interface transparency
Options:
-q, --query When getting status, suppresses output.
-h, --help Show this help'
return 0
end
set function state (string lower -- $argv[1])
set --erase argv[1]
switch $state
case status ''
set function value (__macos_mac_defaults_query com.apple.universalaccess reduceTransparency 0)
if set --query _flag_query
test $value -eq 0
else
if test $value -eq 0
echo on
else
echo off
end
end
case on
defaults delete com.apple.universalaccess reduceTransparency
case off
defaults write com.apple.universalaccess reduceTransparency -bool true
case toggle
if __macos_mac_transparency status --query
__macos_mac_transparency off
else
__macos_mac_transparency on
end
case '*'
echo >&2 'mac transparency: unknown state'
__macos_mac_transparency --help >&2
return 1
end
end

View File

@@ -1,86 +0,0 @@
# @halostatue/fish-macos/functions/__macos_mac_version.fish:v7.0.1
function __macos_mac_version
argparse \
--exclusive s,v \
--exclusive l,v \
--exclusive s,c \
--exclusive l,c \
--exclusive v,c \
h/help s/simple l/lowercase v/version c/comparable -- $argv
if set --query _flag_help
echo 'Usage: mac version [options]
Shows the current mac version.
Options:
-s, --simple Removes spaces from the version displayed
-l, --lowercase Converts the version to all lowercase
-c, --comparable Outputs the comparable version value
-v, --version Outputs the macOS version (same as sw_vers -productVersion)'
return 0
end
set --function os_version (sw_vers -productVersion)
if set --query _flag_version
echo $os_version
return $status
end
set os_version (__macos_version_to_comparable $os_version)
or return 1
if set --query _flag_comparable
echo $os_version
return 0
end
switch $os_version
case 1005000
set os_version Leopard
case 1006000
set os_version Snow Leopard
case 1007000
set os_version Lion
case 1008000
set os_version Mountain Lion
case 1009000
set os_version Mavericks
case 1010000
set os_version Yosemite
case 1011000
set os_version El Capitan
case 1012000
set os_version Sierra
case 1013000
set os_version High Sierra
case 1014000
set os_version Mojave
case 1015000
set os_version Catalina
case 1100000
set os_version Big Sur
case 1200000
set os_version Monterey
case 1300000
set os_version Ventura
case 1400000
set os_version Sonoma
case 1500000
set os_version Sequoia
case '*'
return 1
end
if set --query _flag_simple
set os_version (string replace --all ' ' '' "$os_version")
end
if set --query _flag_lowercase
set os_version (string lower -- "$os_version")
end
echo $os_version
end

View File

@@ -1,45 +0,0 @@
# @halostatue/fish-macos/functions/__macos_mac_vol.fish:v7.0.1
function __macos_mac_vol
argparse --name 'mac vol' h/help -- $argv
or return 1
if set --query _flag_help
echo 'Usage: mac vol [options] LEVEL
Control the volume level.
Levels:
mute Mutes the volume level.
unmute Unmutes the volume level.
0 .. 100 Sets the volume level at LEVEL %.
[show] Shows the current volume level.
Options:
-h, --help Show this help'
return 0
end
set --function action (string lower -- $argv[1])
set --erase argv[1]
switch $action
case mute
osascript -e 'set volume output muted true'
case unmute
osascript -e 'set volume output muted false'
case (seq 0 100)
osascript -e "set volume output volume "$action
case show ''
if test (osascript -e 'output muted of (get volume settings)') = true
echo muted
else
osascript -e "output volume of (get volume settings)"
end
case '*'
echo >&2 'mac vol: Unknown level'
__macos_mac_vol --help >&2
return 1
end
end

View File

@@ -1,25 +0,0 @@
function __ssh_agent_is_started -d "check if ssh agent is already started"
if test -n "$SSH_CONNECTION"
# This is an SSH session
ssh-add -l >/dev/null 2>&1
if test $status -eq 0 -o $status -eq 1
# An SSH agent was forwarded
return 0
end
end
if begin
test -f "$SSH_ENV"; and test -z "$SSH_AGENT_PID"
end
source $SSH_ENV >/dev/null
end
if test -z "$SSH_AGENT_PID"
return 1
end
ssh-add -l >/dev/null 2>&1
if test $status -eq 2
return 1
end
end

View File

@@ -1,5 +0,0 @@
function __ssh_agent_start -d "start a new ssh agent"
ssh-agent -c | sed 's/^echo/#echo/' >$SSH_ENV
chmod 600 $SSH_ENV
source $SSH_ENV >/dev/null
end

View File

@@ -169,6 +169,6 @@ function __z -d "Jump to a recent directory."
echo "Not sure how to open file manager"; and return 1
end
else
pushd "$target"
cd "$target"
end
end

View File

@@ -1,43 +0,0 @@
function _fzf_configure_bindings_help --description "Prints the help message for fzf_configure_bindings."
echo "\
USAGE:
fzf_configure_bindings [--COMMAND=[KEY_SEQUENCE]...]
DESCRIPTION
fzf_configure_bindings installs key bindings for fzf.fish's commands and erases any bindings it
previously installed. It installs bindings for both default and insert modes. fzf.fish executes
it without options on fish startup to install the out-of-the-box key bindings.
By default, commands are bound to a mnemonic key sequence, shown below. Each command's binding
can be configured using a namesake corresponding option:
COMMAND | DEFAULT KEY SEQUENCE | CORRESPONDING OPTION
Search Directory | Ctrl+Alt+F (F for file) | --directory
Search Git Log | Ctrl+Alt+L (L for log) | --git_log
Search Git Status | Ctrl+Alt+S (S for status) | --git_status
Search History | Ctrl+R (R for reverse) | --history
Search Processes | Ctrl+Alt+P (P for process) | --processes
Search Variables | Ctrl+V (V for variable) | --variables
Override a command's binding by specifying its corresponding option with the desired key
sequence. Disable a command's binding by specifying its corresponding option with no value.
Because fzf_configure_bindings erases bindings it previously installed, it can be cleanly
executed multiple times. Once the desired fzf_configure_bindings command has been found, add it
to your config.fish in order to persist the customized bindings.
In terms of validation, fzf_configure_bindings fails if passed unknown options. It expects an
equals sign between an option's name and value. However, it does not validate key sequences.
Pass -h or --help to print this help message and exit.
EXAMPLES
Default bindings but bind Search Directory to Ctrl+F and Search Variables to Ctrl+Alt+V
\$ fzf_configure_bindings --directory=\cf --variables=\e\cv
Default bindings but disable Search History
\$ fzf_configure_bindings --history=
An agglomeration of different options
\$ fzf_configure_bindings --git_status=\cg --history=\ch --variables= --processes=
SEE Also
To learn more about fish key bindings, see bind(1) and fish_key_reader(1).
"
end

View File

@@ -1,13 +0,0 @@
# helper function for _fzf_search_variables
function _fzf_extract_var_info --argument-names variable_name set_show_output --description "Extract and reformat lines pertaining to \$variable_name from \$set_show_output."
# Extract only the lines about the variable, all of which begin with either
# $variable_name: ...or... $variable_name[
string match --regex "^\\\$$variable_name(?::|\[).*" <$set_show_output |
# Strip the variable name prefix, including ": " for scope info lines
string replace --regex "^\\\$$variable_name(?:: )?" '' |
# Distill the lines of values, replacing...
# [1]: |value|
# ...with...
# [1] value
string replace --regex ": \|(.*)\|" ' $1'
end

View File

@@ -1,49 +0,0 @@
# helper for _fzf_search_git_status
# arg should be a line from git status --short, e.g.
# MM functions/_fzf_preview_changed_file.fish
# D README.md
# R LICENSE -> "New License"
function _fzf_preview_changed_file --argument-names path_status --description "Show the git diff of the given file."
# remove quotes because they'll be interpreted literally by git diff
# no need to requote when referencing $path because fish does not perform word splitting
# https://fishshell.com/docs/current/fish_for_bash_users.html
set -f path (string unescape (string sub --start 4 $path_status))
# first letter of short format shows index, second letter shows working tree
# https://git-scm.com/docs/git-status/2.35.0#_short_format
set -f index_status (string sub --length 1 $path_status)
set -f working_tree_status (string sub --start 2 --length 1 $path_status)
set -f diff_opts --color=always
if test $index_status = '?'
_fzf_report_diff_type Untracked
_fzf_preview_file $path
else if contains {$index_status}$working_tree_status DD AU UD UA DU AA UU
# Unmerged statuses taken directly from git status help's short format table
# Unmerged statuses are mutually exclusive with other statuses, so if we see
# these, then safe to assume the path is unmerged
_fzf_report_diff_type Unmerged
git diff $diff_opts -- $path
else
if test $index_status != ' '
_fzf_report_diff_type Staged
# renames are only detected in the index, never working tree, so only need to test for it here
# https://stackoverflow.com/questions/73954214
if test $index_status = R
# diff the post-rename path with the original path, otherwise the diff will show the entire file as being added
set -f orig_and_new_path (string split --max 1 -- ' -> ' $path)
git diff --staged $diff_opts -- $orig_and_new_path[1] $orig_and_new_path[2]
# path currently has the form of "original -> current", so we need to correct it before it's used below
set path $orig_and_new_path[2]
else
git diff --staged $diff_opts -- $path
end
end
if test $working_tree_status != ' '
_fzf_report_diff_type Unstaged
git diff $diff_opts -- $path
end
end
end

View File

@@ -1,43 +0,0 @@
# helper function for _fzf_search_directory and _fzf_search_git_status
function _fzf_preview_file --description "Print a preview for the given file based on its file type."
# because there's no way to guarantee that _fzf_search_directory passes the path to _fzf_preview_file
# as one argument, we collect all the arguments into one single variable and treat that as the path
set -f file_path $argv
if test -L "$file_path" # symlink
# notify user and recurse on the target of the symlink, which can be any of these file types
set -l target_path (realpath "$file_path")
set_color yellow
echo "'$file_path' is a symlink to '$target_path'."
set_color normal
_fzf_preview_file "$target_path"
else if test -f "$file_path" # regular file
if set --query fzf_preview_file_cmd
# need to escape quotes to make sure eval receives file_path as a single arg
eval "$fzf_preview_file_cmd '$file_path'"
else
bat --style=numbers --color=always "$file_path"
end
else if test -d "$file_path" # directory
if set --query fzf_preview_dir_cmd
# see above
eval "$fzf_preview_dir_cmd '$file_path'"
else
# -A list hidden files as well, except for . and ..
# -F helps classify files by appending symbols after the file name
command ls -A -F "$file_path"
end
else if test -c "$file_path"
_fzf_report_file_type "$file_path" "character device file"
else if test -b "$file_path"
_fzf_report_file_type "$file_path" "block device file"
else if test -S "$file_path"
_fzf_report_file_type "$file_path" socket
else if test -p "$file_path"
_fzf_report_file_type "$file_path" "named pipe"
else
echo "$file_path doesn't exist." >&2
end
end

View File

@@ -1,18 +0,0 @@
# helper for _fzf_preview_changed_file
# prints out something like
# ╭────────╮
# │ Staged │
# ╰────────╯
function _fzf_report_diff_type --argument-names diff_type --description "Print a distinct colored header meant to preface a git patch."
# number of "-" to draw is the length of the string to box + 2 for padding
set -f repeat_count (math 2 + (string length $diff_type))
set -f line (string repeat --count $repeat_count)
set -f top_border$line
set -f btm_border$line
set_color yellow
echo $top_border
echo "$diff_type"
echo $btm_border
set_color normal
end

View File

@@ -1,6 +0,0 @@
# helper function for _fzf_preview_file
function _fzf_report_file_type --argument-names file_path file_type --description "Explain the file type for a file."
set_color red
echo "Cannot preview '$file_path': it is a $file_type."
set_color normal
end

View File

@@ -1,32 +0,0 @@
function _fzf_search_directory --description "Search the current directory. Replace the current token with the selected file paths."
# Directly use fd binary to avoid output buffering delay caused by a fd alias, if any.
# Debian-based distros install fd as fdfind and the fd package is something else, so
# check for fdfind first. Fall back to "fd" for a clear error message.
set -f fd_cmd (command -v fdfind || command -v fd || echo "fd")
set -f --append fd_cmd --color=always $fzf_fd_opts
set -f fzf_arguments --multi --ansi $fzf_directory_opts
set -f token (commandline --current-token)
# expand any variables or leading tilde (~) in the token
set -f expanded_token (eval echo -- $token)
# unescape token because it's already quoted so backslashes will mess up the path
set -f unescaped_exp_token (string unescape -- $expanded_token)
# If the current token is a directory and has a trailing slash,
# then use it as fd's base directory.
if string match --quiet -- "*/" $unescaped_exp_token && test -d "$unescaped_exp_token"
set --append fd_cmd --base-directory=$unescaped_exp_token
# use the directory name as fzf's prompt to indicate the search is limited to that directory
set --prepend fzf_arguments --prompt="Directory $unescaped_exp_token> " --preview="_fzf_preview_file $expanded_token{}"
set -f file_paths_selected $unescaped_exp_token($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments)
else
set --prepend fzf_arguments --prompt="Directory> " --query="$unescaped_exp_token" --preview='_fzf_preview_file {}'
set -f file_paths_selected ($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments)
end
if test $status -eq 0
commandline --current-token --replace -- (string escape -- $file_paths_selected | string join ' ')
end
commandline --function repaint
end

View File

@@ -1,36 +0,0 @@
function _fzf_search_git_log --description "Search the output of git log and preview commits. Replace the current token with the selected commit hash."
if not git rev-parse --git-dir >/dev/null 2>&1
echo '_fzf_search_git_log: Not in a git repository.' >&2
else
if not set --query fzf_git_log_format
# %h gives you the abbreviated commit hash, which is useful for saving screen space, but we will have to expand it later below
set -f fzf_git_log_format '%C(bold blue)%h%C(reset) - %C(cyan)%ad%C(reset) %C(yellow)%d%C(reset) %C(normal)%s%C(reset) %C(dim normal)[%an]%C(reset)'
end
set -f preview_cmd 'git show --color=always --stat --patch {1}'
if set --query fzf_diff_highlighter
set preview_cmd "$preview_cmd | $fzf_diff_highlighter"
end
set -f selected_log_lines (
git log --no-show-signature --color=always --format=format:$fzf_git_log_format --date=short | \
_fzf_wrapper --ansi \
--multi \
--scheme=history \
--prompt="Git Log> " \
--preview=$preview_cmd \
--query=(commandline --current-token) \
$fzf_git_log_opts
)
if test $status -eq 0
for line in $selected_log_lines
set -f abbreviated_commit_hash (string split --field 1 " " $line)
set -f full_commit_hash (git rev-parse $abbreviated_commit_hash)
set -f --append commit_hashes $full_commit_hash
end
commandline --current-token --replace (string join ' ' $commit_hashes)
end
end
commandline --function repaint
end

View File

@@ -1,41 +0,0 @@
function _fzf_search_git_status --description "Search the output of git status. Replace the current token with the selected file paths."
if not git rev-parse --git-dir >/dev/null 2>&1
echo '_fzf_search_git_status: Not in a git repository.' >&2
else
set -f preview_cmd '_fzf_preview_changed_file {}'
if set --query fzf_diff_highlighter
set preview_cmd "$preview_cmd | $fzf_diff_highlighter"
end
set -f selected_paths (
# Pass configuration color.status=always to force status to use colors even though output is sent to a pipe
git -c color.status=always status --short |
_fzf_wrapper --ansi \
--multi \
--prompt="Git Status> " \
--query=(commandline --current-token) \
--preview=$preview_cmd \
--nth="2.." \
$fzf_git_status_opts
)
if test $status -eq 0
# git status --short automatically escapes the paths of most files for us so not going to bother trying to handle
# the few edges cases of weird file names that should be extremely rare (e.g. "this;needs;escaping")
set -f cleaned_paths
for path in $selected_paths
if test (string sub --length 1 $path) = R
# path has been renamed and looks like "R LICENSE -> LICENSE.md"
# extract the path to use from after the arrow
set --append cleaned_paths (string split -- "-> " $path)[-1]
else
set --append cleaned_paths (string sub --start=4 $path)
end
end
commandline --current-token --replace -- (string join ' ' $cleaned_paths)
end
end
commandline --function repaint
end

View File

@@ -1,39 +0,0 @@
function _fzf_search_history --description "Search command history. Replace the command line with the selected command."
# history merge incorporates history changes from other fish sessions
# it errors out if called in private mode
if test -z "$fish_private_mode"
builtin history merge
end
if not set --query fzf_history_time_format
# Reference https://devhints.io/strftime to understand strftime format symbols
set -f fzf_history_time_format "%m-%d %H:%M:%S"
end
# Delinate time from command in history entries using the vertical box drawing char (U+2502).
# Then, to get raw command from history entries, delete everything up to it. The ? on regex is
# necessary to make regex non-greedy so it won't match into commands containing the char.
set -f time_prefix_regex '^.*? │ '
# Delinate commands throughout pipeline using null rather than newlines because commands can be multi-line
set -f commands_selected (
builtin history --null --show-time="$fzf_history_time_format" |
_fzf_wrapper --read0 \
--print0 \
--multi \
--scheme=history \
--prompt="History> " \
--query=(commandline) \
--preview="string replace --regex '$time_prefix_regex' '' -- {} | fish_indent --ansi" \
--preview-window="bottom:3:wrap" \
$fzf_history_opts |
string split0 |
# remove timestamps from commands selected
string replace --regex $time_prefix_regex ''
)
if test $status -eq 0
commandline --replace -- $commands_selected
end
commandline --function repaint
end

View File

@@ -1,32 +0,0 @@
function _fzf_search_processes --description "Search all running processes. Replace the current token with the pid of the selected process."
# Directly use ps command because it is often aliased to a different command entirely
# or with options that dirty the search results and preview output
set -f ps_cmd (command -v ps || echo "ps")
# use all caps to be consistent with ps default format
# snake_case because ps doesn't seem to allow spaces in the field names
set -f ps_preview_fmt (string join ',' 'pid' 'ppid=PARENT' 'user' '%cpu' 'rss=RSS_IN_KB' 'start=START_TIME' 'command')
set -f processes_selected (
$ps_cmd -A -opid,command | \
_fzf_wrapper --multi \
--prompt="Processes> " \
--query (commandline --current-token) \
--ansi \
# first line outputted by ps is a header, so we need to mark it as so
--header-lines=1 \
# ps uses exit code 1 if the process was not found, in which case show an message explaining so
--preview="$ps_cmd -o '$ps_preview_fmt' -p {1} || echo 'Cannot preview {1} because it exited.'" \
--preview-window="bottom:4:wrap" \
$fzf_processes_opts
)
if test $status -eq 0
for process in $processes_selected
set -f --append pids_selected (string split --no-empty --field=1 -- " " $process)
end
# string join to replace the newlines outputted by string split with spaces
commandline --current-token --replace -- (string join ' ' $pids_selected)
end
commandline --function repaint
end

View File

@@ -1,47 +0,0 @@
# This function expects the following two arguments:
# argument 1 = output of (set --show | psub), i.e. a file with the scope info and values of all variables
# argument 2 = output of (set --names | psub), i.e. a file with all variable names
function _fzf_search_variables --argument-names set_show_output set_names_output --description "Search and preview shell variables. Replace the current token with the selected variable."
if test -z "$set_names_output"
printf '%s\n' '_fzf_search_variables requires 2 arguments.' >&2
commandline --function repaint
return 22 # 22 means invalid argument in POSIX
end
# Exclude the history variable from being piped into fzf because
# 1. it's not included in $set_names_output
# 2. it tends to be a very large value => increases computation time
# 3._fzf_search_history is a much better way to examine history anyway
set -f all_variable_names (string match --invert history <$set_names_output)
set -f current_token (commandline --current-token)
# Use the current token to pre-populate fzf's query. If the current token begins
# with a $, remove it from the query so that it will better match the variable names
set -f cleaned_curr_token (string replace -- '$' '' $current_token)
set -f variable_names_selected (
printf '%s\n' $all_variable_names |
_fzf_wrapper --preview "_fzf_extract_var_info {} $set_show_output" \
--prompt="Variables> " \
--preview-window="wrap" \
--multi \
--query=$cleaned_curr_token \
$fzf_variables_opts
)
if test $status -eq 0
# If the current token begins with a $, do not overwrite the $ when
# replacing the current token with the selected variable.
# Uses brace expansion to prepend $ to each variable name.
commandline --current-token --replace (
if string match --quiet -- '$*' $current_token
string join " " \${$variable_names_selected}
else
string join " " $variable_names_selected
end
)
end
commandline --function repaint
end

View File

@@ -1,21 +0,0 @@
function _fzf_wrapper --description "Prepares some environment variables before executing fzf."
# Make sure fzf uses fish to execute preview commands, some of which
# are autoloaded fish functions so don't exist in other shells.
# Use --function so that it doesn't clobber SHELL outside this function.
set -f --export SHELL (command --search fish)
# If neither FZF_DEFAULT_OPTS nor FZF_DEFAULT_OPTS_FILE are set, then set some sane defaults.
# See https://github.com/junegunn/fzf#environment-variables
set --query FZF_DEFAULT_OPTS FZF_DEFAULT_OPTS_FILE
if test $status -eq 2
# cycle allows jumping between the first and last results, making scrolling faster
# layout=reverse lists results top to bottom, mimicking the familiar layouts of git log, history, and env
# border shows where the fzf window begins and ends
# height=90% leaves space to see the current command and some scrollback, maintaining context of work
# preview-window=wrap wraps long lines in the preview window, making reading easier
# marker=* makes the multi-select marker more distinguishable from the pointer (since both default to >)
set --export FZF_DEFAULT_OPTS '--cycle --layout=reverse --border --height=90% --preview-window=wrap --marker="*"'
end
fzf $argv
end

View File

@@ -1,8 +0,0 @@
function _puffer_fish_expand_bang
switch (commandline -t)
case '!'
commandline -t $history[1]
case '*'
commandline -i '!'
end
end

View File

@@ -1,9 +0,0 @@
function _puffer_fish_expand_dots -d 'expand ... to ../.. etc'
set -l cmd (commandline --cut-at-cursor)
set -l split (string split -- ' ' $cmd)
if string match --quiet --regex -- '^(\.\./)*\.\.$' $split[-1]
commandline --insert '/..'
else
commandline --insert '.'
end
end

View File

@@ -1,9 +0,0 @@
function _puffer_fish_expand_lastarg
switch (commandline -t)
case '!'
commandline -t ""
commandline -f history-token-search-backward
case '*'
commandline -i '$'
end
end

View File

@@ -1,5 +0,0 @@
function _sponge_clear_state
set --erase --global _sponge_current_command
set --erase --global _sponge_current_command_exit_code
set --erase --global _sponge_current_command_previously_in_history
end

View File

@@ -1,3 +0,0 @@
function _sponge_on_exit --on-event fish_exit
sponge_delay=0 _sponge_remove_from_history
end

View File

@@ -1,24 +0,0 @@
function _sponge_on_postexec --on-event fish_postexec
set --global _sponge_current_command_exit_code $status
# Remove command from the queue if it's been added previously
if set --local index (contains --index -- $_sponge_current_command $_sponge_queue)
set --erase _sponge_queue[$index]
end
# Ignore empty commands
if test -n $_sponge_current_command
set --local command ''
# Run filters
for filter in $sponge_filters
if $filter \
$_sponge_current_command \
$_sponge_current_command_exit_code \
$_sponge_current_command_previously_in_history
set command $_sponge_current_command
break
end
end
set --prepend --global _sponge_queue $command
end
end

View File

@@ -1,16 +0,0 @@
function _sponge_on_preexec --on-event fish_preexec \
--argument-names command
_sponge_clear_state
set --global _sponge_current_command $command
builtin history search --case-sensitive --exact --max=1 --null $command \
| read --local --null found_entries
# If a command is in the history and in the queue, ignore it, like if it wasnt in the history
if test (count $found_entries) -ne 0; and not contains $command $_sponge_queue
set --global _sponge_current_command_previously_in_history true
else
set --global _sponge_current_command_previously_in_history false
end
end

View File

@@ -1,5 +0,0 @@
function _sponge_on_prompt --on-event fish_prompt
if test $sponge_purge_only_on_exit = false
_sponge_remove_from_history
end
end

View File

@@ -1,9 +0,0 @@
function _sponge_remove_from_history
while test (count $_sponge_queue) -gt $sponge_delay
builtin history delete --case-sensitive --exact -- $_sponge_queue[-1]
set --erase _sponge_queue[-1]
end
builtin history save
end

View File

@@ -10,9 +10,8 @@ function _tide_detect_os
printf %s\n  FFFFFF 00CCFF # https://answers.microsoft.com/en-us/windows/forum/all/what-is-the-official-windows-8-blue-rgb-or-hex/fd57144b-f69b-42d8-8c21-6ca911646e44
case linux
if test (uname -o) = Android
echo ﲎ # This character is evil and messes up code display, so it's put on its own line
# https://developer.android.com/distribute/marketing-tools/brand-guidelines
printf %s\n 3DDC84 3C3F41 # fg is from above link, bg is from Android Studio default dark theme
printf %s\n 3DDC84 3C3F41 # fg is from above link, bg is from Android Studio default dark theme
else
_tide_detect_os_linux_cases /etc/os-release ID ||
_tide_detect_os_linux_cases /etc/os-release ID_LIKE ||

View File

@@ -0,0 +1,6 @@
function _tide_item_bun
if path is $_tide_parent_dirs/bun.lockb
bun --version | string match -qr "(?<v>.*)"
_tide_print_item bun $tide_bun_icon' ' $v
end
end

View File

@@ -50,7 +50,7 @@ function _tide_item_git
(0|(?<dirty>.*))\n(0|(?<untracked>.*))(\n(0|(?<behind>.*))\t(0|(?<ahead>.*)))?' \
"$(git $_set_dir_opt stash list 2>/dev/null | count
string match -r ^UU $stat | count
string match -r ^[ADMR]. $stat | count
string match -r ^[ADMR] $stat | count
string match -r ^.[ADMR] $stat | count
string match -r '^\?\?' $stat | count
git rev-list --count --left-right @{upstream}...HEAD 2>/dev/null)"

View File

@@ -1,7 +1,10 @@
function _tide_parent_dirs --on-variable PWD
set -g _tide_parent_dirs (string escape (
for dir in (string split / -- $PWD)
set -la parts $dir
string join / -- $parts
end))
set -g _tide_parent_dirs (
string escape (
for dir in (string split / -- $PWD)
set -fa parts $dir
string join / -- $parts
end
)
)
end

View File

@@ -1,7 +1,7 @@
function _tide_remove_unusable_items
# Remove tool-specific items for tools the machine doesn't have installed
set -l removed_items
for item in aws crystal direnv distrobox docker elixir gcloud git go java kubectl nix_shell node php pulumi python ruby rustc terraform toolbox zig
for item in aws bun crystal direnv distrobox docker elixir gcloud git go java kubectl nix_shell node php pulumi python ruby rustc terraform toolbox zig
contains $item $tide_left_prompt_items $tide_right_prompt_items || continue
set -l cli_names $item

View File

@@ -11,14 +11,14 @@ function _tide_sub_bug-report
set --long | string match -r "^_?tide.*" | # Get only tide variables
string match -r --invert "^_tide_prompt_var.*" # Remove _tide_prompt_var
else
set -l fish_version ($fish_path --version | string match -r "fish, version (\d\.\d\.\d)")[2]
_tide_check_version Fish fish-shell/fish-shell "(\d\.\d\.\d)" $fish_version || return
$fish_path --version | string match -qr "fish, version (?<fish_version>.*)"
_tide_check_version Fish fish-shell/fish-shell "(?<v>[\d.]+)" $fish_version || return
set -l tide_version (tide --version | string match -r "tide, version (\d\.\d\.\d)")[2]
_tide_check_version Tide IlanCosman/tide "v(\d\.\d\.\d)" $tide_version || return
tide --version | string match -qr "tide, version (?<tide_version>.*)"
_tide_check_version Tide IlanCosman/tide "v(?<v>[\d.]+)" $tide_version || return
if command --query git
test (git --version | string match -r "git version ([\d\.]*)" | string replace --all . '')[2] -gt 2220
test (path sort (git --version) "git version 2.22.0")[1] = "git version 2.22.0"
_tide_check_condition \
"Your git version is too old." \
"Tide requires at least version 2.22." \
@@ -32,11 +32,12 @@ function _tide_sub_bug-report
"Please uninstall it before submitting a bug report." || return
if not set -q _flag_check
set -l fish_startup_time ($fish_path -ic "time $fish_path -c exit" 2>|
string match -r "Executed in(.*)fish" | string trim)[2]
$fish_path -ic "time $fish_path -c exit" 2>|
string match -rg "Executed in(.*)fish" |
string trim | read -l fish_startup_time
read --local --prompt-str "What operating system are you using? (e.g Ubuntu 20.04): " os
read --local --prompt-str "What terminal emulator are you using? (e.g Kitty): " terminal_emulator
read -l --prompt-str "What operating system are you using? (e.g Ubuntu 20.04): " os
read -l --prompt-str "What terminal emulator are you using? (e.g Kitty): " terminal_emulator
printf '%b\n' "\nPlease copy the following information into the issue:\n" \
"fish version: $fish_version" \
@@ -50,15 +51,14 @@ function _tide_sub_bug-report
end
end
function _tide_check_version -a program_name repo_name regex_to_get_version current_version
curl --silent https://github.com/$repo_name/releases/latest |
string match -r ".*$repo_name/releases/tag/$regex_to_get_version.*" |
read --local --line __ latestVersion
function _tide_check_version -a program_name repo_name regex_to_get_v installed_version
curl -sL https://github.com/$repo_name/releases/latest |
string match -qr "https://github.com/$repo_name/releases/tag/$regex_to_get_v"
string match --quiet -r "^$latestVersion" "$current_version"
string match -qr "^$v" "$installed_version" # Allow git versions, e.g 3.3.1-701-gceade1629
_tide_check_condition \
"Your $program_name version is out of date." \
"The latest is $latestVersion. You have $current_version." \
"The latest is $v. You have $installed_version." \
"Please update before submitting a bug report."
end

View File

@@ -1,46 +0,0 @@
# @halostatue/fish-macos/functions/app.fish:v7.0.1
function app --description 'Operate on macOS applications'
argparse --stop-nonopt h/help -- $argv
if set --query _flag_help
echo 'Usage: app [options] subcommand [arguments...]
Operates on macOS apps by name.
Subcommands:
bundleid Shows the bundleID for installed matching apps
find Shows installed matching apps
frontmost Shows the frontmost application
icon Saves the icon for matching apps to disk
quit Quits and optionally restarts matching apps
Options:
-h, --help Show this help'
return 0
end
set --function cmd $argv[1]
set --erase argv[1]
switch (string lower -- $cmd)
case bundleid
__macos_app_bundleid $argv
case find
__macos_app_find $argv
case frontmost
__macos_app_frontmost $argv
case icon
__macos_app_icon $argv
case quit
__macos_app_quit $argv
case ''
echo >&2 'app: No command provided.'
app --help >&2
return 1
case '*'
echo >&2 'app: Unknown command.'
app --help >&2
return 1
end
end

View File

@@ -1,151 +0,0 @@
# @halostatue/fish-macos/functions/finder.fish:v7.0.1
function __macos_finder_defaults::query
set --query argv[1]
or return 1
set --function value (defaults read com.apple.Finder $argv[1] 2>/dev/null)
or return 1
switch $value
case 1
true
case '*'
false
end
end
function __macos_finder_defaults::set
set --query argv[1]
or return 1
set --query argv[2]
or return 1
defaults write com.apple.Finder $argv[1] -bool $argv[2]
and killall Finder
end
function __macos_finder_pwd::get
set --function window 1
if set --query argv[1]
set window $argv[1]
end
echo 'tell application "Finder"
if ('$window' <= (count Finder windows)) then
get POSIX path of (target of window '$window' as alias)
else
get POSIX path of (desktop as alias)
end if
end tell' | osascript
end
function __macos_finder_pwd::update
argparse --exclusive column,list,icon column list icon -- $argv
or return 1
set --function window_count 1
set --function view ''
set --function view_type ''
if set --query _flag_column
set view_type column
else if set --query _flag_list
set view_type list
else if set --query _flag_icon
set view_type icon
end
if test $view_type != ''
set view 'set the current view of the front Finder window to '$view_type' view'
end
set --query argv[1]; and set window_count $argv[1]
echo 'tell application "Finder"
if ('$window_count' <= (count Finder windows)) then
set the target of window '$window_count' to (POSIX file "'$PWD'") as string
else
open (POSIX file "'$PWD'") as string
end if
' $view '
end tell' | osascript >/dev/null
end
# Based on bashfinder: https://github.com/NapoleonWils0n/bashfinder.git
# and my port to zsh.
function finder --description 'Manipulate the finder with the current shell'
argparse --stop-nonopt h/help -- $argv
if set --query _flag_help
echo 'Usage: finder [options] subcommand [arguments...]
Interacts with the Finder. If a window number parameter is accepted in a
command, the first (front-most) window is number 1. If a lower window is
specified, or no window is specified, that window becomes the first window.
Subcommands:
cd Changes to the path of the Finder window
clean Removes .DS_Store files
column Changes the Finder window to PWD using column view
desktop-icons Shows or hides the desktop icons
hidden Shows or hides files that are normally hidden from the Finder
icon Changes the Finder window to PWD using icon view
list Changes the Finder window to PWD using list view
pushd Changes to the path of the Finder window with pushd
pwd Prints the path of the Finder window
quarantine Manages quarantine events
selected Print the selected files on the command-line
track Makes the first Finder window track with the shell PWD
untrack Disables Finder directory tracking
update Updates the Finder window to PWD
Options:
-h, --help Show this help'
return 0
end
set --function verb (string lower -- $argv[1])
set --erase argv[1]
switch $verb
case cd
__macos_finder_cd $argv
case clean
__macos_finder_clean $argv
case desktop-icons
__macos_finder_desktop_icons $argv
case hidden
__macos_finder_hidden $argv
case update
__macos_finder_update $argv
case list
__macos_finder_list $argv
case icon
__macos_finder_icon $argv
case column
__macos_finder_column $argv
case pwd
__macos_finder_pwd::get $argv[1]
case pushd
__macos_finder_pushd $argv
case quarantine
__macos_finder_quarantine $argv
case selected
__macos_finder_selected
case track
__macos_finder_track
case untrack
__macos_finder_untrack
case ''
echo >&2 'finder: No command provided.'
finder --help >&2
return 1
case '*'
echo $verb
echo >&2 'finder: Unknown command.'
finder --help >&2
return 1
end
end

View File

@@ -28,7 +28,7 @@ if contains newline $_tide_left_items # two line prompt initialization
test "$tide_left_prompt_frame_enabled" = true &&
set -l top_left_frame "$prompt_and_frame_color╭─" &&
set -l bot_left_frame "$prompt_and_frame_color╰─" &&
set column_offset (math $column_offset-2)
set column_offset 3
test "$tide_right_prompt_frame_enabled" = true &&
set -l top_right_frame "$prompt_and_frame_color─╮" &&
set -l bot_right_frame "$prompt_and_frame_color─╯" &&
@@ -145,21 +145,20 @@ end"
end
end
eval "function _tide_on_fish_exit --on-event fish_exit
# Inheriting instead of evaling because here load time is more important than runtime
function _tide_on_fish_exit --on-event fish_exit --inherit-variable prompt_var
set -e $prompt_var
end"
end
if test "$tide_prompt_transient_enabled" = true
function _tide_enter_transient
# If the commandline will be executed, or is empty
if commandline --is-valid || test -z "$(commandline)"
# Pager open usually means selecting, not running
# Can be untrue, but it's better than the alternative
if not commandline --paging-mode
set -g _tide_transient
set -g _tide_repaint
commandline -f repaint
end
# If the commandline will be executed or is empty, and the pager is not open
# Pager open usually means selecting, not running
# Can be untrue, but it's better than the alternative
if commandline --is-valid || test -z "$(commandline)" && not commandline --paging-mode
set -g _tide_transient
set -g _tide_repaint
commandline -f repaint
end
commandline -f execute
end

View File

@@ -1,46 +0,0 @@
# Always installs bindings for insert and default mode for simplicity and b/c it has almost no side-effect
# https://gitter.im/fish-shell/fish-shell?at=60a55915ee77a74d685fa6b1
function fzf_configure_bindings --description "Installs the default key bindings for fzf.fish with user overrides passed as options."
# no need to install bindings if not in interactive mode or running tests
status is-interactive || test "$CI" = true; or return
set -f options_spec h/help 'directory=?' 'git_log=?' 'git_status=?' 'history=?' 'processes=?' 'variables=?'
argparse --max-args=0 --ignore-unknown $options_spec -- $argv 2>/dev/null
if test $status -ne 0
echo "Invalid option or a positional argument was provided." >&2
_fzf_configure_bindings_help
return 22
else if set --query _flag_help
_fzf_configure_bindings_help
return
else
# Initialize with default key sequences and then override or disable them based on flags
# index 1 = directory, 2 = git_log, 3 = git_status, 4 = history, 5 = processes, 6 = variables
set -f key_sequences \e\cf \e\cl \e\cs \cr \e\cp \cv # \c = control, \e = escape
set --query _flag_directory && set key_sequences[1] "$_flag_directory"
set --query _flag_git_log && set key_sequences[2] "$_flag_git_log"
set --query _flag_git_status && set key_sequences[3] "$_flag_git_status"
set --query _flag_history && set key_sequences[4] "$_flag_history"
set --query _flag_processes && set key_sequences[5] "$_flag_processes"
set --query _flag_variables && set key_sequences[6] "$_flag_variables"
# If fzf bindings already exists, uninstall it first for a clean slate
if functions --query _fzf_uninstall_bindings
_fzf_uninstall_bindings
end
for mode in default insert
test -n $key_sequences[1] && bind --mode $mode $key_sequences[1] _fzf_search_directory
test -n $key_sequences[2] && bind --mode $mode $key_sequences[2] _fzf_search_git_log
test -n $key_sequences[3] && bind --mode $mode $key_sequences[3] _fzf_search_git_status
test -n $key_sequences[4] && bind --mode $mode $key_sequences[4] _fzf_search_history
test -n $key_sequences[5] && bind --mode $mode $key_sequences[5] _fzf_search_processes
test -n $key_sequences[6] && bind --mode $mode $key_sequences[6] "$_fzf_search_vars_command"
end
function _fzf_uninstall_bindings --inherit-variable key_sequences
bind --erase -- $key_sequences
bind --erase --mode insert -- $key_sequences
end
end
end

View File

@@ -1,14 +0,0 @@
# @halostatue/fish-macos/functions/has_app.fish:v7.0.1
function has_app --description 'Returns true if the named application exists'
# Suppress these flags being passed to __macos_app_find
argparse a/all q/quiet -- $argv
or return 1
if not set --query argv[1]
echo >&2 Usage: (status function) APPNAME...
return 1
end
__macos_app_find --exact --quiet $argv
end

View File

@@ -1,23 +0,0 @@
# @halostatue/fish-brew/functions/has_cask.fish:v3.2.1
function has_cask --description 'Test if the named cask or casks are installed'
command --query brew
or return 1
argparse --min-args 1 A/all -- $argv
or return 1
set --function found 0
for cask in $argv
if test -d (brew --prefix)/Caskroom/$cask
set found (math $found + 1)
end
end
if set --query _flag_all
test $found -eq (count $argv)
else
test $found -ne 0
end
end

View File

@@ -1,23 +0,0 @@
# @halostatue/fish-brew/functions/has_keg.fish:v3.2.1
function has_keg --description 'Test if the named keg or kegs are installed'
command --query brew
or return 1
argparse --min-args 1 A/all -- $argv
or return 1
set --function found 0
for keg in $argv
if test -d (brew --prefix)/Cellar/$keg
set found (math $found + 1)
end
end
if set --query _flag_all
test $found -eq (count $argv)
else
test $found -ne 0
end
end

View File

@@ -1,70 +0,0 @@
# @halostatue/fish-macos/functions/mac.fish:v7.0.1
function mac --description 'Manage several macOS functions'
argparse --stop-nonopt h/help -- $argv
if set --query _flag_help
echo 'Usage: mac [options] subcommand [arguments...]
Manage several macOS functions.
Subcommands:
airdrop Manages AirDrop.
airport Performs various WiFi (AirPort) operations
brightness Changes the screen brightness
flushdns Flushes the DNS cache
font-smoothing Enables or disables font smoothing
lsclean Cleans the LaunchServices registration list
mail Speed up Mail.app by vacuuming the envelope index
proxy-icon Enables or disables proxy icon delay
serialnumber Gets the machine serial number
touchid Manages Touch ID authorization for sudo
transparency Enables or disables interface transparency
version Shows the current macOS version
vol Controls the volume level
Options:
-h, --help Show this help'
return 0
end
set --function subcommand (string lower -- $argv[1])
set --erase argv[1]
switch $subcommand
case airdrop
__macos_mac_airdrop $argv
case airport
__macos_mac_airport $argv
case brightness
__macos_mac_brightness $argv
case flushdns
__macos_mac_flushdns $argv
case font-smoothing
__macos_mac_font_smoothing $argv
case lsclean
__macos_mac_lsclean $argv
case mail
__macos_mac_mail $argv
case proxy-icon
__macos_mac_proxy_icon $argv
case serialnumber
__macos_mac_serialnumber $argv
case touchid
__macos_mac_touchid $argv
case transparency
__macos_mac_transparency $argv
case vol
__macos_mac_vol $argv
case version
__macos_mac_version $argv
case ''
echo >&2 'mac: No command provided.'
mac --help >&2
return 1
case '*'
echo >&2 'mac: Unknown command.'
mac --help >&2
return 1
end
end

View File

@@ -1,77 +0,0 @@
# @halostatue/fish-macos/functions/manp.fish:v7.0.1
# Based on man2pdf.sh created by Pico Mitchell (of Random Applications)
# on 11/16/22, licensed under the MIT license.
function manp --description 'View a man page as a PDF'
set --function cache_path "/private/tmp/man PDFs"
if set --query --universal manp_cache_path
set cache_path $manp_cache_path
end
argparse --stop-nonopt h/help C/clear-cache -- $argv
if set --query _flag_help
echo 'Usage: '(status function)' --help
'(status function)' --clear-cache
'(status function)' [section] [man page]
Opens a macOS man page as a PDF. The generated PDFs are cached
in $manp_cache_path (/private/tmp/man PDFs).
Use --clear-cache to clear the cached PDFs manually. By default
they will be cleared on any OS upgrade.'
return 0
end
if set --query _flag_clear_cache
/bin/rm -rf $cache_path
return $status
end
set --function man_path (/usr/bin/man -w $argv 2> /dev/null)
if test -f $man_path
# Save every man page PDF into a sub-folder for the current OS version
# (and build) since man pages can be updated between OS versions, and
# don't want to retrieve an old cached version from a previous OS
# (when not saving to a temporary location).
set --local os_path $cache_path"/"(/usr/bin/sw_vers -productVersion)" ("(/usr/bin/sw_vers -buildVersion)")"
if not test -d $os_path
# If the man PDFs base path exists, but not the current OS sub-
# folder, that likely means that there has been an OS update
# since the last run, so clear the cache of the old man PDFs
# from the previous OS version by deleting the base path which
# will be re-created when the new latest OS sub-folder is
# created below.
if test -d $cache_path
/bin/rm -rf $cache_path
end
/bin/mkdir -p $os_path
end
set --local man_filename (path basename $man_path)
set --local man_section (path extension $man_filename | string replace . '')
set man_filename (string replace .$man_section '' $man_filename)
if test $man_section != 1
set man_filename $man_filename" ("$man_section")"
end
set --local pdf_path $os_path/man" "$man_filename.pdf
if not test -f $pdf_path
/usr/bin/mandoc -T pdf $man_path >$pdf_path
end
if set --query $manp_pdf_app_name
/usr/bin/open -af $manp_pdf_app_name $pdf_path
else
/usr/bin/open $pdf_path
end
else
/usr/bin/man $argv
end
end

View File

@@ -1,38 +0,0 @@
# @halostatue/fish-macos/functions/note.fish:v7.0.1
function note --description 'Add a note to Notes.app'
is_mac 'mountain lion'
or return 1
has_app Notes
or return 1
if set --query argv
set --function text $argv
else
set --function text (cat - | sed -e 's/$/<br>/')
end
test -z $text
or return 1
set --function head $text[1]
if set --query text[2]
set --function body $text[2..-1]
end
if set --query body
set --function properties '{name: "'$head'", body: "'($body[1..-1])'"}'
else
set --function properties '{name: "'$head'"}'
end
echo 'tell application "Notes"
tell account "iCloud"
tell folder "Notes"
make new note with properties ' $properties '
end tell
end tell
end tell' | osascript >/dev/null
end

View File

@@ -99,7 +99,7 @@ end
function __phpenv_find_version_file -a phpenv_filename
set -l phpenv_dir (pwd)
while test "$phpenv_dir" != /
while test "$phpenv_dir" != "/"
if test -f "$phpenv_dir/$phpenv_filename"
echo "$phpenv_dir/$phpenv_filename"
return
@@ -126,13 +126,13 @@ function __phpenv_parse_composer_version
end
set -l phpenv_platform_php (jq -r '.config.platform.php // empty' composer.json 2>/dev/null)
if test $status -eq 0 -a -n "$phpenv_platform_php" -a "$phpenv_platform_php" != null
if test $status -eq 0 -a -n "$phpenv_platform_php" -a "$phpenv_platform_php" != "null"
echo $phpenv_platform_php
return
end
set -l phpenv_require_php (jq -r '.require.php // empty' composer.json 2>/dev/null)
if test $status -eq 0 -a -n "$phpenv_require_php" -a "$phpenv_require_php" != null
if test $status -eq 0 -a -n "$phpenv_require_php" -a "$phpenv_require_php" != "null"
__phpenv_parse_semver_constraint $phpenv_require_php
return
end
@@ -189,7 +189,7 @@ set -g __phpenv_version_cache_time 0
function __phpenv_get_version_info
set -l current_time (date +%s)
set -l cache_duration 300 # 5 minutes
set -l cache_duration 300 # 5 minutes
# Return cached version if still valid
if test -n "$__phpenv_version_cache"
@@ -224,6 +224,8 @@ function __phpenv_get_cellar_path
set -g __phpenv_cellar_cache /opt/homebrew/Cellar
else if test -d /usr/local/Cellar
set -g __phpenv_cellar_cache /usr/local/Cellar
else if test -d /home/linuxbrew/.linuxbrew/Cellar
set -g __phpenv_cellar_cache /home/linuxbrew/.linuxbrew/Cellar
else
set -g __phpenv_cellar_cache ""
end
@@ -236,12 +238,15 @@ function __phpenv_ensure_taps
return 1
end
# Add taps if not already added
if not brew tap | grep -q shivammathur/php 2>/dev/null
brew tap shivammathur/php 2>/dev/null
end
if not brew tap | grep -q shivammathur/extensions 2>/dev/null
brew tap shivammathur/extensions 2>/dev/null
# Check and add required taps only if missing
set -l required_taps "shivammathur/php" "shivammathur/extensions"
for tap in $required_taps
if not brew tap | grep -q $tap 2>/dev/null
if not brew tap $tap 2>/dev/null
echo "Warning: Failed to add tap $tap" >&2
return 1
end
end
end
end
@@ -267,7 +272,7 @@ function __phpenv_list_installed
continue
end
if test "$phpenv_basename" = php
if test "$phpenv_basename" = "php"
set -l phpenv_latest (__phpenv_parse_version_field "latest" "8.4")
set -a phpenv_versions $phpenv_latest
else if echo $phpenv_basename | grep -qE '^php@[0-9]+\.[0-9]+$'
@@ -284,9 +289,9 @@ end
function __phpenv_resolve_version_alias -a phpenv_version
switch $phpenv_version
case latest
__phpenv_parse_version_field latest "8.4"
__phpenv_parse_version_field "latest" "8.4"
case nightly
__phpenv_parse_version_field nightly "8.5"
__phpenv_parse_version_field "nightly" "8.5"
case '8.x'
__phpenv_parse_version_field "8.x" "8.4"
case '7.x'
@@ -302,7 +307,7 @@ function __phpenv_get_formula_name -a phpenv_version
set -l phpenv_latest_version (__phpenv_parse_version_field "latest" "8.4")
if test "$phpenv_version" = "$phpenv_latest_version"
echo shivammathur/php/php
echo "shivammathur/php/php"
else
echo "shivammathur/php/php@$phpenv_version"
end
@@ -475,7 +480,7 @@ function __phpenv_use
set -l phpenv_version $argv[1]
# Handle special case: restore system PHP
if test "$phpenv_version" = system
if test "$phpenv_version" = "system"
__phpenv_restore_system_path
echo "Restored system PHP"
return 0
@@ -492,7 +497,7 @@ function __phpenv_use
end
if not __phpenv_is_version_installed $phpenv_version
if test "$(__phpenv_config_get auto-install)" = true
if test "$(__phpenv_config_get auto-install)" = "true"
__phpenv_install $phpenv_version
else
echo "PHP $phpenv_version is not installed. Install with: phpenv install $phpenv_version"
@@ -514,7 +519,7 @@ function __phpenv_local -a phpenv_version
return 1
end
echo $phpenv_version >.php-version
echo $phpenv_version > .php-version
echo "Set local PHP version to $phpenv_version"
end
@@ -569,8 +574,7 @@ function __phpenv_get_tap_versions
return
end
set -l phpenv_formulas (brew tap-info shivammathur/php --json 2>/dev/null | \
jq -r '.[]|(.formula_names[]?)' 2>/dev/null)
set -l phpenv_formulas (__phpenv_get_tap_formulas "shivammathur/php")
if test -z "$phpenv_formulas"
return
@@ -587,7 +591,7 @@ function __phpenv_get_tap_versions
continue
end
if test "$phpenv_clean_name" = php
if test "$phpenv_clean_name" = "php"
set -a phpenv_versions "$phpenv_latest_version (latest)"
else if echo $phpenv_clean_name | grep -qE '^php@[0-9]+\.[0-9]+$'
set -l phpenv_version (echo $phpenv_clean_name | sed 's/php@//')
@@ -672,39 +676,51 @@ function __phpenv_config -a phpenv_action phpenv_key phpenv_value
end
end
# Helper function to get environment variable value
function __phpenv_get_env_var -a key
switch $key
case global-version
echo $PHPENV_GLOBAL_VERSION
case auto-install
echo $PHPENV_AUTO_INSTALL
case auto-install-extensions
echo $PHPENV_AUTO_INSTALL_EXTENSIONS
case auto-switch
echo $PHPENV_AUTO_SWITCH
case default-extensions
echo $PHPENV_DEFAULT_EXTENSIONS
end
end
# Helper function to map config key to env var name
function __phpenv_env_var_name -a key
switch $key
case global-version
echo PHPENV_GLOBAL_VERSION
case auto-install
echo PHPENV_AUTO_INSTALL
case auto-install-extensions
echo PHPENV_AUTO_INSTALL_EXTENSIONS
case auto-switch
echo PHPENV_AUTO_SWITCH
case default-extensions
echo PHPENV_DEFAULT_EXTENSIONS
case '*'
echo ""
end
end
function __phpenv_config_get -a phpenv_key
set -l phpenv_env_var (__phpenv_env_var_name $phpenv_key)
set -l phpenv_value
set -l phpenv_source
switch $phpenv_key
case global-version
if test -n "$PHPENV_GLOBAL_VERSION"
set phpenv_value $PHPENV_GLOBAL_VERSION
set phpenv_source "fish universal variable"
end
case auto-install
if test -n "$PHPENV_AUTO_INSTALL"
set phpenv_value $PHPENV_AUTO_INSTALL
set phpenv_source "fish universal variable"
end
case auto-install-extensions
if test -n "$PHPENV_AUTO_INSTALL_EXTENSIONS"
set phpenv_value $PHPENV_AUTO_INSTALL_EXTENSIONS
set phpenv_source "fish universal variable"
end
case auto-switch
if test -n "$PHPENV_AUTO_SWITCH"
set phpenv_value $PHPENV_AUTO_SWITCH
set phpenv_source "fish universal variable"
end
case default-extensions
if test -n "$PHPENV_DEFAULT_EXTENSIONS"
set phpenv_value $PHPENV_DEFAULT_EXTENSIONS
set phpenv_source "fish universal variable"
end
end
if test -z "$phpenv_value"
# Check if environment variable is set
if test -n "$phpenv_env_var"; and set -q $phpenv_env_var
set phpenv_value (eval echo \$$phpenv_env_var)
set phpenv_source "fish universal variable"
else
# Check config files if environment variable is unset
for phpenv_config_file in ~/.config/fish/conf.d/phpenv.fish ~/.config/phpenv/config ~/.phpenv.fish
if test -f $phpenv_config_file
set -l phpenv_file_value (grep "^$phpenv_key=" $phpenv_config_file | cut -d= -f2- | head -1)
@@ -717,7 +733,7 @@ function __phpenv_config_get -a phpenv_key
end
end
if test "$argv[2]" = --verbose
if test "$argv[2]" = "--verbose"
if test -n "$phpenv_value"
echo "$phpenv_key = $phpenv_value (from $phpenv_source)"
else
@@ -867,19 +883,25 @@ function __phpenv_extensions_uninstall -a phpenv_extension
end
end
function __phpenv_get_available_extensions
# Unified helper for getting tap formulas
function __phpenv_get_tap_formulas -a tap_name
if not command -q brew
return 1
end
brew tap-info shivammathur/extensions --json 2>/dev/null | jq -r '.[]|(.formula_names[]?)' 2>/dev/null
brew tap-info $tap_name --json 2>/dev/null | \
jq -r '.[]|(.formula_names[]?)' 2>/dev/null
end
function __phpenv_get_available_extensions
__phpenv_get_tap_formulas "shivammathur/extensions"
end
function __phpenv_extension_available -a phpenv_extension phpenv_version
set -l phpenv_available_extensions (__phpenv_get_available_extensions)
if test -z "$phpenv_available_extensions"
return 0 # Assume available if can't check
return 0 # Assume available if can't check
end
for phpenv_ext_formula in $phpenv_available_extensions
@@ -935,7 +957,7 @@ function __phpenv_extensions_list
for phpenv_ext_dir in $phpenv_cellar_path/*@$phpenv_version
if test -d $phpenv_ext_dir
set -l phpenv_ext_name (basename $phpenv_ext_dir | sed "s/@$phpenv_version//")
if test "$phpenv_ext_name" != php
if test "$phpenv_ext_name" != "php"
echo " $phpenv_ext_name"
end
end
@@ -982,7 +1004,7 @@ function __phpenv_auto_switch --on-variable PWD
end
set -l phpenv_auto_switch (__phpenv_config_get auto-switch)
if test "$phpenv_auto_switch" = false
if test "$phpenv_auto_switch" = "false"
return 0
end
@@ -1005,7 +1027,7 @@ function __phpenv_auto_switch --on-variable PWD
set -g PHPENV_LAST_SWITCH_TIME $phpenv_current_time
else
set -l phpenv_auto_install (__phpenv_config_get auto-install)
if test "$phpenv_auto_install" = true
if test "$phpenv_auto_install" = "true"
echo "Auto-installing PHP $phpenv_new_version..."
if phpenv install "$phpenv_new_version"
set -g PHPENV_LAST_SWITCH_TIME $phpenv_current_time
@@ -1051,7 +1073,7 @@ function __phpenv_help
end
function __phpenv_validate_boolean -a phpenv_value
test "$phpenv_value" = true -o "$phpenv_value" = false
test "$phpenv_value" = "true" -o "$phpenv_value" = "false"
end
function __phpenv_validate_version -a phpenv_version

View File

@@ -1,20 +0,0 @@
# @halostatue/fish-macos/functions/ql.fish:v7.0.1
function ql --description 'QuickLook a file or directory'
# Updated based on https://gist.github.com/chockenberry/13c15466417b88e40f23e58df8091dac
if set --query argv[1]
qlmanage -p $argv >/dev/null 2>/dev/null
else
set --function root (mktemp -d)
command cat >$root/ql.stdin
set --function mime_type (file --brief --mime-type $root/ql.stdin)
set --function extension (grep $mime_type /etc/apache2/mime.types | awk '{ print $2; }')
if test -z $extension
qlmanage -p $root/ql.stdin >/dev/null 2>/dev/null
else
mv $root/ql.{stdin,$extension}
qlmanage -p $root/ql.$extension >/dev/null 2>/dev/null
end
end
end

View File

@@ -1,26 +0,0 @@
# @halostatue/fish-macos/functions/remind.fish:v7.0.1
function remind --description 'Add a reminder to Reminders.app'
is_mac 'mountain lion'
or return 1
has_app Reminders
or return 1
if set --query argv
set --function text $argv
else
set --function text (cat - | sed -e 's/$/<br>/')
end
test -z $text
and return 0
echo $text : text
echo 'tell application "Reminders"
tell the default list
make new reminder with properties {name: "'$text'"}
end tell
end tell' | osascript >/dev/null
end

Some files were not shown because too many files have changed in this diff Show More