From dd3895ccbd78ee32fb55b3320c1af45f9e8e2774 Mon Sep 17 00:00:00 2001 From: Geoff Date: Tue, 5 May 2026 10:37:59 +0200 Subject: [PATCH] Dotfiles commit (try to keep under 50 characters) Multi-line description of commit, feel free to be detailed. [Ticket: X] ~ ~ ".git/COMMIT_EDITMSG" 14L, 297C --- .config/fish/completions/fisher.fish | 7 + .config/fish/completions/tldr.fish | 28 ++ .config/fish/conf.d/_pure_init.fish | 90 +++++ .config/fish/conf.d/alias.fish | 4 + .config/fish/conf.d/done.fish | 340 ++++++++++++++++++ .config/fish/conf.d/pure.fish | 124 +++++++ .config/fish/config.fish | 11 + .config/fish/custom.fish | 134 +++++++ .config/fish/fish_plugins | 2 + .config/fish/fish_variables | 84 +++++ .../functions/_pure_check_availability.fish | 15 + .../_pure_check_for_new_release.fish | 24 ++ ...ure_detect_container_by_cgroup_method.fish | 10 + .../_pure_detect_container_by_pid_method.fish | 14 + .config/fish/functions/_pure_format_time.fish | 49 +++ .../functions/_pure_get_prompt_symbol.fish | 12 + .../functions/_pure_is_inside_container.fish | 25 ++ .../_pure_is_single_line_prompt.fish | 5 + .config/fish/functions/_pure_k8s_context.fish | 3 + .../fish/functions/_pure_k8s_namespace.fish | 9 + .../fish/functions/_pure_parse_directory.fish | 23 ++ .../functions/_pure_parse_git_branch.fish | 4 + .../_pure_place_iterm2_prompt_mark.fish | 5 + .../functions/_pure_prefix_root_prompt.fish | 11 + .../fish/functions/_pure_print_prompt.fish | 12 + .../functions/_pure_print_prompt_rows.fish | 10 + .config/fish/functions/_pure_prompt.fish | 34 ++ .../functions/_pure_prompt_aws_profile.fish | 19 + .../functions/_pure_prompt_beginning.fish | 7 + .../_pure_prompt_command_duration.fish | 11 + .../functions/_pure_prompt_container.fish | 5 + .../_pure_prompt_current_folder.fish | 11 + .../fish/functions/_pure_prompt_ending.fish | 3 + .../functions/_pure_prompt_exit_status.fish | 30 ++ .../functions/_pure_prompt_first_line.fish | 41 +++ .config/fish/functions/_pure_prompt_git.fish | 26 ++ .../functions/_pure_prompt_git_branch.fish | 6 + .../functions/_pure_prompt_git_dirty.fish | 18 + .../_pure_prompt_git_pending_commits.fish | 33 ++ .../functions/_pure_prompt_git_stash.fish | 19 + .config/fish/functions/_pure_prompt_jobs.fish | 9 + .config/fish/functions/_pure_prompt_k8s.fish | 16 + .../fish/functions/_pure_prompt_new_line.fish | 11 + .../functions/_pure_prompt_nixdevshell.fish | 13 + .config/fish/functions/_pure_prompt_ssh.fish | 5 + .../fish/functions/_pure_prompt_symbol.fish | 20 ++ .../functions/_pure_prompt_system_time.fish | 6 + .../functions/_pure_prompt_transient.fish | 11 + .../fish/functions/_pure_prompt_vimode.fish | 6 + .../functions/_pure_prompt_virtualenv.fish | 20 ++ .config/fish/functions/_pure_set_color.fish | 19 + .config/fish/functions/_pure_set_default.fish | 11 + .../fish/functions/_pure_string_width.fish | 9 + .../fish/functions/_pure_user_at_host.fish | 13 + .config/fish/functions/fish_mode_prompt.fish | 2 + .config/fish/functions/fish_prompt.fish | 21 ++ .config/fish/functions/fish_title.fish | 15 + .../functions/fish_user_key_bindings.fish | 3 + .config/fish/functions/fisher.fish | 251 +++++++++++++ .config/fish/functions/fzf-complete.fish | 47 +++ .config/fish/functions/fzf.fish | 13 + .config/fish/functions/pacman.fish | 6 + .config/fish/functions/path.fish | 3 + 63 files changed, 1848 insertions(+) create mode 100644 .config/fish/completions/fisher.fish create mode 100644 .config/fish/completions/tldr.fish create mode 100644 .config/fish/conf.d/_pure_init.fish create mode 100644 .config/fish/conf.d/alias.fish create mode 100644 .config/fish/conf.d/done.fish create mode 100644 .config/fish/conf.d/pure.fish create mode 100644 .config/fish/config.fish create mode 100644 .config/fish/custom.fish create mode 100644 .config/fish/fish_plugins create mode 100644 .config/fish/fish_variables create mode 100644 .config/fish/functions/_pure_check_availability.fish create mode 100644 .config/fish/functions/_pure_check_for_new_release.fish create mode 100644 .config/fish/functions/_pure_detect_container_by_cgroup_method.fish create mode 100644 .config/fish/functions/_pure_detect_container_by_pid_method.fish create mode 100644 .config/fish/functions/_pure_format_time.fish create mode 100644 .config/fish/functions/_pure_get_prompt_symbol.fish create mode 100644 .config/fish/functions/_pure_is_inside_container.fish create mode 100644 .config/fish/functions/_pure_is_single_line_prompt.fish create mode 100644 .config/fish/functions/_pure_k8s_context.fish create mode 100644 .config/fish/functions/_pure_k8s_namespace.fish create mode 100644 .config/fish/functions/_pure_parse_directory.fish create mode 100644 .config/fish/functions/_pure_parse_git_branch.fish create mode 100644 .config/fish/functions/_pure_place_iterm2_prompt_mark.fish create mode 100644 .config/fish/functions/_pure_prefix_root_prompt.fish create mode 100644 .config/fish/functions/_pure_print_prompt.fish create mode 100644 .config/fish/functions/_pure_print_prompt_rows.fish create mode 100644 .config/fish/functions/_pure_prompt.fish create mode 100644 .config/fish/functions/_pure_prompt_aws_profile.fish create mode 100644 .config/fish/functions/_pure_prompt_beginning.fish create mode 100644 .config/fish/functions/_pure_prompt_command_duration.fish create mode 100644 .config/fish/functions/_pure_prompt_container.fish create mode 100644 .config/fish/functions/_pure_prompt_current_folder.fish create mode 100644 .config/fish/functions/_pure_prompt_ending.fish create mode 100644 .config/fish/functions/_pure_prompt_exit_status.fish create mode 100644 .config/fish/functions/_pure_prompt_first_line.fish create mode 100644 .config/fish/functions/_pure_prompt_git.fish create mode 100644 .config/fish/functions/_pure_prompt_git_branch.fish create mode 100644 .config/fish/functions/_pure_prompt_git_dirty.fish create mode 100644 .config/fish/functions/_pure_prompt_git_pending_commits.fish create mode 100644 .config/fish/functions/_pure_prompt_git_stash.fish create mode 100644 .config/fish/functions/_pure_prompt_jobs.fish create mode 100644 .config/fish/functions/_pure_prompt_k8s.fish create mode 100644 .config/fish/functions/_pure_prompt_new_line.fish create mode 100644 .config/fish/functions/_pure_prompt_nixdevshell.fish create mode 100644 .config/fish/functions/_pure_prompt_ssh.fish create mode 100644 .config/fish/functions/_pure_prompt_symbol.fish create mode 100644 .config/fish/functions/_pure_prompt_system_time.fish create mode 100644 .config/fish/functions/_pure_prompt_transient.fish create mode 100644 .config/fish/functions/_pure_prompt_vimode.fish create mode 100644 .config/fish/functions/_pure_prompt_virtualenv.fish create mode 100644 .config/fish/functions/_pure_set_color.fish create mode 100644 .config/fish/functions/_pure_set_default.fish create mode 100644 .config/fish/functions/_pure_string_width.fish create mode 100644 .config/fish/functions/_pure_user_at_host.fish create mode 100644 .config/fish/functions/fish_mode_prompt.fish create mode 100644 .config/fish/functions/fish_prompt.fish create mode 100644 .config/fish/functions/fish_title.fish create mode 100644 .config/fish/functions/fish_user_key_bindings.fish create mode 100644 .config/fish/functions/fisher.fish create mode 100644 .config/fish/functions/fzf-complete.fish create mode 100644 .config/fish/functions/fzf.fish create mode 100644 .config/fish/functions/pacman.fish create mode 100644 .config/fish/functions/path.fish diff --git a/.config/fish/completions/fisher.fish b/.config/fish/completions/fisher.fish new file mode 100644 index 0000000..6d23ce4 --- /dev/null +++ b/.config/fish/completions/fisher.fish @@ -0,0 +1,7 @@ +complete --command fisher --exclusive --long help --description "Print help" +complete --command fisher --exclusive --long version --description "Print version" +complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins" +complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins" +complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins" +complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex" +complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)" diff --git a/.config/fish/completions/tldr.fish b/.config/fish/completions/tldr.fish new file mode 100644 index 0000000..fc8b19e --- /dev/null +++ b/.config/fish/completions/tldr.fish @@ -0,0 +1,28 @@ +# +# Completions for the tealdeer implementation of tldr +# https://github.com/tealdeer-rs/tealdeer/ +# + +complete -c tldr -s h -l help -d 'Print the help message.' -f +complete -c tldr -s v -l version -d 'Show version information.' -f +complete -c tldr -s l -l list -d 'List all commands in the cache.' -f +complete -c tldr -s f -l render -d 'Render a specific markdown file.' -r +complete -c tldr -s p -l platform -d 'Override the operating system.' -xa 'linux macos sunos windows android freebsd netbsd openbsd' +complete -c tldr -s L -l language -d 'Override the language' -x +complete -c tldr -s u -l update -d 'Update the local cache.' -f +complete -c tldr -l no-auto-update -d 'If auto update is configured, disable it for this run.' -f +complete -c tldr -s c -l clear-cache -d 'Clear the local cache.' -f +complete -c tldr -l pager -d 'Use a pager to page output.' -f +complete -c tldr -s r -l raw -d 'Display the raw markdown instead of rendering it.' -f +complete -c tldr -s q -l quiet -d 'Suppress informational messages.' -f +complete -c tldr -l show-paths -d 'Show file and directory paths used by tealdeer.' -f +complete -c tldr -l seed-config -d 'Create a basic config.' -f +complete -c tldr -l color -d 'Controls when to use color.' -xa 'always auto never' + +function __tealdeer_entries + if set entries (tldr --list 2>/dev/null) + string replace -a -i -r "\,\s" "\n" $entries + end +end + +complete -f -c tldr -a '(__tealdeer_entries)' diff --git a/.config/fish/conf.d/_pure_init.fish b/.config/fish/conf.d/_pure_init.fish new file mode 100644 index 0000000..bc54f1b --- /dev/null +++ b/.config/fish/conf.d/_pure_init.fish @@ -0,0 +1,90 @@ +# Deactivate the default virtualenv prompt so that we can add our own +set --global --export VIRTUAL_ENV_DISABLE_PROMPT 1 + +# Whether or not is a fresh session +set --global _pure_fresh_session true + +set --global _pure_root (status current-filename | string replace --regex '/[^/]+$' '' | string replace --regex '/[^/]+$' '') + +# Register `_pure_prompt_new_line` as an event handler for `fish_prompt` +for fpath in $fish_function_path + test -e $fpath/_pure_prompt_new_line.fish && source $fpath/_pure_prompt_new_line.fish +end + +function _pure \ + --description 'Display branding for pure prompt' + + printf "%s %s" \ + (set_color $pure_color_warning)$pure_symbol_prompt$pure_symbol_reverse_prompt$pure_symbol_prompt \ + (set_color $pure_color_primary)"pure"(set_color normal) +end + +function _pure_install --on-event pure_install \ + --description 'Fisher handler when pure prompt is installed' + + source $_pure_root/conf.d/pure.fish + + printf "Now using: %s %s\n" \ + (_pure) \ + (set_color --bold $pure_color_success)$pure_version(set_color normal) +end + +# Fisher emit an event for all files under conf.d/. +# We listen to the event when the new conf.d/_pure_init.fish is sourced, +# to read old `pure_version` before sourcing conf.d/pure.fish happens. +function _pure_update --on-event _pure_init_update \ + --description 'Fisher handler pure prompt is updated' + + set --local previous_version $pure_version + source $_pure_root/conf.d/pure.fish + + printf "Updating: %s %s โ†’ %s\n\t%s\n" \ + (_pure) \ + (set_color $pure_color_info)$previous_version(set_color normal) \ + (set_color --bold $pure_color_success)$pure_version(set_color normal) \ + " ๐Ÿ“– release notes: "(set_color $pure_color_info)"https://github.com/pure-fish/pure/releases/tag/v$pure_version"(set_color normal) +end + +function _pure_uninstall --on-event pure_uninstall \ + --description 'Fisher handler pure prompt is uninstalled' + + rm -f $_pure_root/conf.d/pure.fish + + # erase existing fish_prompt and fish_title to default + functions --erase fish_prompt + functions --erase fish_title + + # restore fish_prompt and fish_title to default + # reload them into active session + # To remain compatible with both single-binary fish and traditional installations + # https://github.com/fish-shell/fish-shell/issues/11429#issuecomment-2834407208 + if status list-files functions/fish_prompt.fish >/dev/null # standalone binary Fish โ‰ฅ4.1.2 + status get-file functions/fish_prompt.fish \ + | tee $__fish_config_dir/functions/fish_prompt.fish \ + | source + status get-file functions/fish_title.fish \ + | tee $__fish_config_dir/functions/fish_title.fish \ + | source + else # traditional installation + cat $__fish_data_dir/functions/fish_prompt.fish \ + | tee $__fish_config_dir/functions/fish_prompt.fish \ + | source + cat $__fish_data_dir/functions/fish_title.fish \ + | tee $__fish_config_dir/functions/fish_title.fish \ + | source + end + + # delete _pure* files + for file in $_pure_root/{functions,conf.d}/_pure_* + rm -f $file + end + + # erase _pure* variables + set --names \ + | string replace --filter --regex '(^_?pure)' 'set --erase $1' \ + | source + # erase _pure* functions + functions --names --all \ + | string replace --filter --regex '(^_?pure)' 'functions --erase $1' \ + | source +end diff --git a/.config/fish/conf.d/alias.fish b/.config/fish/conf.d/alias.fish new file mode 100644 index 0000000..3a34be8 --- /dev/null +++ b/.config/fish/conf.d/alias.fish @@ -0,0 +1,4 @@ +# alias.fish + +set -x EDITOR nvim +set -x VISUAL nvim diff --git a/.config/fish/conf.d/done.fish b/.config/fish/conf.d/done.fish new file mode 100644 index 0000000..9252660 --- /dev/null +++ b/.config/fish/conf.d/done.fish @@ -0,0 +1,340 @@ +# MIT License + +# Copyright (c) 2016 Francisco Lourenรงo & Daniel Wehner + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if not status is-interactive + exit +end + +set -g __done_version 1.19.1 + +function __done_run_powershell_script + set -l powershell_exe (command --search "powershell.exe") + + if test $status -ne 0 + and command --search wslvar + + set -l powershell_exe (wslpath (wslvar windir)/System32/WindowsPowerShell/v1.0/powershell.exe) + end + + if string length --quiet "$powershell_exe" + and test -x "$powershell_exe" + + set cmd (string escape $argv) + + eval "$powershell_exe -Command $cmd" + end +end + +function __done_windows_notification -a title -a message + if test "$__done_notify_sound" -eq 1 + set soundopt "