commit 6a67adda8269cfa1db01026ef77e587efc0b8a14 Author: Tyler Nguyen Date: Wed Jun 5 18:03:49 2024 -0500 chore: Initial commit diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..1c5122f Binary files /dev/null and b/.DS_Store differ diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl new file mode 100644 index 0000000..0e879d1 --- /dev/null +++ b/.chezmoi.toml.tmpl @@ -0,0 +1,15 @@ +[data] + name = "Tyler Nguyen" + email = "{{ onepasswordRead "op://Private/Tyler Nguyen/Identification/Public Email" }}" + +[edit] + command = "code" + args = ["--wait"] + +[diff] + command = "code" + args = ["--wait", "--diff", "$LOCAL", "$REMOTE"] + +[merge] + command = "code" + args = ["--wait", "$MERGED"] diff --git a/.chezmoidata.toml b/.chezmoidata.toml new file mode 100644 index 0000000..e69de29 diff --git a/.install-password-manager.sh b/.install-password-manager.sh new file mode 100644 index 0000000..a7dbbf2 --- /dev/null +++ b/.install-password-manager.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# exit immediately if password-manager-binary is already in $PATH +type password-manager-binary >/dev/null 2>&1 && exit + +case "$(uname -s)" in +Darwin) + # commands to install password-manager-binary on Darwin + brew install --cask 1password + ;; +Linux) + # commands to install password-manager-binary on Linux + ;; +*) + echo "unsupported OS" + exit 1 + ;; +esac diff --git a/dot_config/.DS_Store b/dot_config/.DS_Store new file mode 100644 index 0000000..841e332 Binary files /dev/null and b/dot_config/.DS_Store differ diff --git a/dot_config/atuin/_config.toml b/dot_config/atuin/_config.toml new file mode 100644 index 0000000..fb64fcc --- /dev/null +++ b/dot_config/atuin/_config.toml @@ -0,0 +1,207 @@ +## where to store your database, default is your system data directory +## linux/mac: ~/.local/share/atuin/history.db +## windows: %USERPROFILE%/.local/share/atuin/history.db +# db_path = "~/.history.db" + +## where to store your encryption key, default is your system data directory +## linux/mac: ~/.local/share/atuin/key +## windows: %USERPROFILE%/.local/share/atuin/key +# key_path = "~/.key" + +## where to store your auth session token, default is your system data directory +## linux/mac: ~/.local/share/atuin/session +## windows: %USERPROFILE%/.local/share/atuin/session +# session_path = "~/.session" + +## date format used, either "us" or "uk" +# dialect = "us" + +## default timezone to use when displaying time +## either "l", "local" to use the system's current local timezone, or an offset +## from UTC in the format of "<+|->H[H][:M[M][:S[S]]]" +## for example: "+9", "-05", "+03:30", "-01:23:45", etc. +# timezone = "local" + +## enable or disable automatic sync +# auto_sync = true + +## enable or disable automatic update checks +# update_check = true + +## address of the sync server +# sync_address = "https://api.atuin.sh" + +## how often to sync history. note that this is only triggered when a command +## is ran, so sync intervals may well be longer +## set it to 0 to sync after every command +# sync_frequency = "10m" + +## which search mode to use +## possible values: prefix, fulltext, fuzzy, skim +# search_mode = "fuzzy" + +## which filter mode to use +## possible values: global, host, session, directory +# filter_mode = "global" + +## With workspace filtering enabled, Atuin will filter for commands executed +## in any directory within a git repository tree (default: false) +# workspaces = false + +## which filter mode to use when atuin is invoked from a shell up-key binding +## the accepted values are identical to those of "filter_mode" +## leave unspecified to use same mode set in "filter_mode" +# filter_mode_shell_up_key_binding = "global" + +## which search mode to use when atuin is invoked from a shell up-key binding +## the accepted values are identical to those of "search_mode" +## leave unspecified to use same mode set in "search_mode" +# search_mode_shell_up_key_binding = "fuzzy" + +## which style to use +## possible values: auto, full, compact +# style = "auto" + +## the maximum number of lines the interface should take up +## set it to 0 to always go full screen +# inline_height = 0 + +## Invert the UI - put the search bar at the top , Default to `false` +# invert = false + +## enable or disable showing a preview of the selected command +## useful when the command is longer than the terminal width and is cut off +# show_preview = false + +## what to do when the escape key is pressed when searching +## possible values: return-original, return-query +# exit_mode = "return-original" + +## possible values: emacs, subl +# word_jump_mode = "emacs" + +## characters that count as a part of a word +# word_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + +## number of context lines to show when scrolling by pages +# scroll_context_lines = 1 + +## use ctrl instead of alt as the shortcut modifier key for numerical UI shortcuts +## alt-0 .. alt-9 +# ctrl_n_shortcuts = false + +## default history list format - can also be specified with the --format arg +# history_format = "{time}\t{command}\t{duration}" + +## prevent commands matching any of these regexes from being written to history. +## Note that these regular expressions are unanchored, i.e. if they don't start +## with ^ or end with $, they'll match anywhere in the command. +## For details on the supported regular expression syntax, see +## https://docs.rs/regex/latest/regex/#syntax +history_filter = [ +"ls", +"pwd", +"clear", +"exit", +] + +## prevent commands run with cwd matching any of these regexes from being written +## to history. Note that these regular expressions are unanchored, i.e. if they don't +## start with ^ or end with $, they'll match anywhere in CWD. +## For details on the supported regular expression syntax, see +## https://docs.rs/regex/latest/regex/#syntax +# cwd_filter = [ +# "^/very/secret/area", +# ] + +## Configure the maximum height of the preview to show. +## Useful when you have long scripts in your history that you want to distinguish +## by more than the first few lines. +# max_preview_height = 4 + +## Configure whether or not to show the help row, which includes the current Atuin +## version (and whether an update is available), a keymap hint, and the total +## amount of commands in your history. +# show_help = true + +## Configure whether or not to show tabs for search and inspect +# show_tabs = true + +## Defaults to true. This matches history against a set of default regex, and will not save it if we get a match. Defaults include +## 1. AWS key id +## 2. Github pat (old and new) +## 3. Slack oauth tokens (bot, user) +## 4. Slack webhooks +## 5. Stripe live/test keys +# secrets_filter = true + +## Defaults to true. If enabled, upon hitting enter Atuin will immediately execute the command. Press tab to return to the shell and edit. +# This applies for new installs. Old installs will keep the old behaviour unless configured otherwise. +enter_accept = true + +## Defaults to "emacs". This specifies the keymap on the startup of `atuin +## search`. If this is set to "auto", the startup keymap mode in the Atuin +## search is automatically selected based on the shell's keymap where the +## keybinding is defined. If this is set to "emacs", "vim-insert", or +## "vim-normal", the startup keymap mode in the Atuin search is forced to be +## the specified one. +# keymap_mode = "auto" + +## Cursor style in each keymap mode. If specified, the cursor style is changed +## in entering the cursor shape. Available values are "default" and +## "{blink,steady}-{block,underline,bar}". +# keymap_cursor = { emacs = "blink-block", vim_insert = "blink-block", vim_normal = "steady-block" } + +# network_connect_timeout = 5 +# network_timeout = 5 + +## Timeout (in seconds) for acquiring a local database connection (sqlite) +# local_timeout = 5 + +## Set this to true and Atuin will minimize motion in the UI - timers will not update live, etc. +## Alternatively, set env NO_MOTION=true +# prefers_reduced_motion = false + +[stats] +## Set commands where we should consider the subcommand for statistics. Eg, kubectl get vs just kubectl +# common_subcommands = [ +# "apt", +# "cargo", +# "composer", +# "dnf", +# "docker", +# "git", +# "go", +# "ip", +# "kubectl", +# "nix", +# "nmcli", +# "npm", +# "pecl", +# "pnpm", +# "podman", +# "port", +# "systemctl", +# "tmux", +# "yarn", +# ] + +## Set commands that should be totally stripped and ignored from stats +# common_prefix = ["sudo"] + +## Set commands that will be completely ignored from stats +# ignored_commands = [ +# "cd", +# "ls", +# "vi" +# ] + +[keys] +# Defaults to true. If disabled, using the up/down key won't exit the TUI when scrolled past the first/last entry. +# scroll_exits = false + +[sync] +# Enable sync v2 by default +# This ensures that sync v2 is enabled for new installs only +# In a later release it will become the default across the board +records = true diff --git a/dot_config/wezterm/wezterm.lua.tmpl b/dot_config/wezterm/wezterm.lua.tmpl new file mode 100644 index 0000000..7a2df07 --- /dev/null +++ b/dot_config/wezterm/wezterm.lua.tmpl @@ -0,0 +1,73 @@ +-- Pull in the wezterm API +local wezterm = require("wezterm") + +-- This table will hold the configuration. +local config = {} + +-- In newer versions of wezterm, use the config_builder which will +-- help provide clearer error messages +if wezterm.config_builder then + config = wezterm.config_builder() +end + +-- This is where you actually apply your config choices +config.automatically_reload_config = true +config.color_scheme = 'Solarized Dark - Patched' +config.command_palette_bg_color = '#073642' +config.command_palette_fg_color = '#93a1a1' +config.default_cursor_style = 'BlinkingBar' +config.font = wezterm.font 'Berkeley Mono' +config.font_size = 15 +config.initial_rows = 25 +config.initial_cols = 160 +config.max_fps = 120 +config.status_update_interval = 100 +config.tab_max_width = 60 +config.use_fancy_tab_bar = false +config.window_close_confirmation = 'NeverPrompt' +config.window_decorations = "RESIZE" + + +config.window_padding = { + left = '1cell', + right = '1cell', + top = '.25cell', + bottom = '.25cell', +} + +-- Retro Tab Bar +config.colors = { + tab_bar = { + background = '#001E27', + + active_tab = { + bg_color = '#2aa198', + fg_color = '#eee8d5', + }, + + inactive_tab = { + bg_color = '#002b36', + fg_color = '#586e75', + intensity = 'Half', + }, + + inactive_tab_hover = { + bg_color = '#859900', + fg_color = '#002b36', + italic = true, + }, + + new_tab = { + bg_color = '#002b36', + fg_color = '#eee8d5', + }, + + new_tab_hover = { + bg_color = '#859900', + fg_color = '#002b36', + }, + }, +} + +-- and finally, return the configuration to wezterm +return config diff --git a/dot_config/zsh/.DS_Store b/dot_config/zsh/.DS_Store new file mode 100644 index 0000000..f69090a Binary files /dev/null and b/dot_config/zsh/.DS_Store differ diff --git a/dot_config/zsh/completions/__atuin b/dot_config/zsh/completions/__atuin new file mode 100644 index 0000000..c64f48c --- /dev/null +++ b/dot_config/zsh/completions/__atuin @@ -0,0 +1,2435 @@ +#compdef atuin + +autoload -U is-at-least + +_atuin() { + typeset -A opt_args + typeset -a _arguments_options + local ret=1 + + if is-at-least 5.2; then + _arguments_options=(-s -S -C) + else + _arguments_options=(-s -C) + fi + + local context curcontext="$curcontext" state line + _arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +'-V[Print version]' \ +'--version[Print version]' \ +":: :_atuin_commands" \ +"*::: :->atuin" \ +&& ret=0 + case $state in + (atuin) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-command-$line[1]:" + case $line[1] in + (history) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_atuin__history_commands" \ +"*::: :->history" \ +&& ret=0 + + case $state in + (history) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-history-command-$line[1]:" + case $line[1] in + (start) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +'*::command:' \ +&& ret=0 +;; +(end) +_arguments "${_arguments_options[@]}" \ +'-e+[]:EXIT: ' \ +'--exit=[]:EXIT: ' \ +'-d+[]:DURATION: ' \ +'--duration=[]:DURATION: ' \ +'-h[Print help]' \ +'--help[Print help]' \ +':id:' \ +&& ret=0 +;; +(list) +_arguments "${_arguments_options[@]}" \ +'-r+[]' \ +'--reverse=[]' \ +'--timezone=[Display the command time in another timezone other than the configured default]:TIMEZONE: ' \ +'--tz=[Display the command time in another timezone other than the configured default]:TIMEZONE: ' \ +'-f+[Available variables\: {command}, {directory}, {duration}, {user}, {host}, {exit} and {time}. Example\: --format "{time} - \[{duration}\] - {directory}\$\\t{command}"]:FORMAT: ' \ +'--format=[Available variables\: {command}, {directory}, {duration}, {user}, {host}, {exit} and {time}. Example\: --format "{time} - \[{duration}\] - {directory}\$\\t{command}"]:FORMAT: ' \ +'-c[]' \ +'--cwd[]' \ +'-s[]' \ +'--session[]' \ +'--human[]' \ +'--cmd-only[Show only the text of the command]' \ +'--print0[Terminate the output with a null, for better multiline support]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(last) +_arguments "${_arguments_options[@]}" \ +'--timezone=[Display the command time in another timezone other than the configured default]:TIMEZONE: ' \ +'--tz=[Display the command time in another timezone other than the configured default]:TIMEZONE: ' \ +'-f+[Available variables\: {command}, {directory}, {duration}, {user}, {host} and {time}. Example\: --format "{time} - \[{duration}\] - {directory}\$\\t{command}"]:FORMAT: ' \ +'--format=[Available variables\: {command}, {directory}, {duration}, {user}, {host} and {time}. Example\: --format "{time} - \[{duration}\] - {directory}\$\\t{command}"]:FORMAT: ' \ +'--human[]' \ +'--cmd-only[Show only the text of the command]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(init-store) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(prune) +_arguments "${_arguments_options[@]}" \ +'-n[List matching history lines without performing the actual deletion]' \ +'--dry-run[List matching history lines without performing the actual deletion]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__history__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-history-help-command-$line[1]:" + case $line[1] in + (start) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(end) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(list) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(last) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(init-store) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(prune) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(import) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_atuin__import_commands" \ +"*::: :->import" \ +&& ret=0 + + case $state in + (import) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-import-command-$line[1]:" + case $line[1] in + (auto) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(zsh) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(zsh-hist-db) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(bash) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(resh) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(fish) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(nu) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(nu-hist-db) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(xonsh) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(xonsh-sqlite) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__import__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-import-help-command-$line[1]:" + case $line[1] in + (auto) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(zsh) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(zsh-hist-db) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(bash) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(resh) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(fish) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(nu) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(nu-hist-db) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(xonsh) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(xonsh-sqlite) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(stats) +_arguments "${_arguments_options[@]}" \ +'-c+[How many top commands to list]:COUNT: ' \ +'--count=[How many top commands to list]:COUNT: ' \ +'-n+[The number of consecutive commands to consider]:NGRAM_SIZE: ' \ +'--ngram-size=[The number of consecutive commands to consider]:NGRAM_SIZE: ' \ +'-h[Print help]' \ +'--help[Print help]' \ +'*::period -- Compute statistics for the specified period, leave blank for statistics since the beginning. See https\://docs.atuin.sh/reference/stats/ for more details:' \ +&& ret=0 +;; +(search) +_arguments "${_arguments_options[@]}" \ +'-c+[Filter search result by directory]:CWD: ' \ +'--cwd=[Filter search result by directory]:CWD: ' \ +'--exclude-cwd=[Exclude directory from results]:EXCLUDE_CWD: ' \ +'-e+[Filter search result by exit code]:EXIT: ' \ +'--exit=[Filter search result by exit code]:EXIT: ' \ +'--exclude-exit=[Exclude results with this exit code]:EXCLUDE_EXIT: ' \ +'-b+[Only include results added before this date]:BEFORE: ' \ +'--before=[Only include results added before this date]:BEFORE: ' \ +'--after=[Only include results after this date]:AFTER: ' \ +'--limit=[How many entries to return at most]:LIMIT: ' \ +'--offset=[Offset from the start of the results]:OFFSET: ' \ +'--filter-mode=[Allow overriding filter mode over config]:FILTER_MODE:(global host session directory workspace)' \ +'--search-mode=[Allow overriding search mode over config]:SEARCH_MODE:(prefix full-text fuzzy skim)' \ +'--keymap-mode=[Notify the keymap at the shell'\''s side]:KEYMAP_MODE:(emacs vim-normal vim-insert auto)' \ +'--timezone=[Display the command time in another timezone other than the configured default]:TIMEZONE: ' \ +'--tz=[Display the command time in another timezone other than the configured default]:TIMEZONE: ' \ +'-f+[Available variables\: {command}, {directory}, {duration}, {user}, {host}, {time}, {exit} and {relativetime}. Example\: --format "{time} - \[{duration}\] - {directory}\$\\t{command}"]:FORMAT: ' \ +'--format=[Available variables\: {command}, {directory}, {duration}, {user}, {host}, {time}, {exit} and {relativetime}. Example\: --format "{time} - \[{duration}\] - {directory}\$\\t{command}"]:FORMAT: ' \ +'--inline-height=[Set the maximum number of lines Atuin'\''s interface should take up]:INLINE_HEIGHT: ' \ +'-i[Open interactive search UI]' \ +'--interactive[Open interactive search UI]' \ +'--shell-up-key-binding[Marker argument used to inform atuin that it was invoked from a shell up-key binding (hidden from help to avoid confusion)]' \ +'--human[Use human-readable formatting for time]' \ +'--cmd-only[Show only the text of the command]' \ +'--delete[Delete anything matching this query. Will not print out the match]' \ +'--delete-it-all[Delete EVERYTHING!]' \ +'-r[Reverse the order of results, oldest first]' \ +'--reverse[Reverse the order of results, oldest first]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +'*::query:' \ +&& ret=0 +;; +(sync) +_arguments "${_arguments_options[@]}" \ +'-f[Force re-download everything]' \ +'--force[Force re-download everything]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(login) +_arguments "${_arguments_options[@]}" \ +'-u+[]:USERNAME: ' \ +'--username=[]:USERNAME: ' \ +'-p+[]:PASSWORD: ' \ +'--password=[]:PASSWORD: ' \ +'-k+[The encryption key for your account]:KEY: ' \ +'--key=[The encryption key for your account]:KEY: ' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(logout) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(register) +_arguments "${_arguments_options[@]}" \ +'-u+[]:USERNAME: ' \ +'--username=[]:USERNAME: ' \ +'-p+[]:PASSWORD: ' \ +'--password=[]:PASSWORD: ' \ +'-e+[]:EMAIL: ' \ +'--email=[]:EMAIL: ' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(key) +_arguments "${_arguments_options[@]}" \ +'--base64[Switch to base64 output of the key]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(status) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(account) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_atuin__account_commands" \ +"*::: :->account" \ +&& ret=0 + + case $state in + (account) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-account-command-$line[1]:" + case $line[1] in + (login) +_arguments "${_arguments_options[@]}" \ +'-u+[]:USERNAME: ' \ +'--username=[]:USERNAME: ' \ +'-p+[]:PASSWORD: ' \ +'--password=[]:PASSWORD: ' \ +'-k+[The encryption key for your account]:KEY: ' \ +'--key=[The encryption key for your account]:KEY: ' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(register) +_arguments "${_arguments_options[@]}" \ +'-u+[]:USERNAME: ' \ +'--username=[]:USERNAME: ' \ +'-p+[]:PASSWORD: ' \ +'--password=[]:PASSWORD: ' \ +'-e+[]:EMAIL: ' \ +'--email=[]:EMAIL: ' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(logout) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(delete) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(change-password) +_arguments "${_arguments_options[@]}" \ +'-c+[]:CURRENT_PASSWORD: ' \ +'--current-password=[]:CURRENT_PASSWORD: ' \ +'-n+[]:NEW_PASSWORD: ' \ +'--new-password=[]:NEW_PASSWORD: ' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__account__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-account-help-command-$line[1]:" + case $line[1] in + (login) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(register) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(logout) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(delete) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(change-password) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(kv) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_atuin__kv_commands" \ +"*::: :->kv" \ +&& ret=0 + + case $state in + (kv) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-kv-command-$line[1]:" + case $line[1] in + (set) +_arguments "${_arguments_options[@]}" \ +'-k+[]:KEY: ' \ +'--key=[]:KEY: ' \ +'-n+[]:NAMESPACE: ' \ +'--namespace=[]:NAMESPACE: ' \ +'-h[Print help]' \ +'--help[Print help]' \ +':value:' \ +&& ret=0 +;; +(get) +_arguments "${_arguments_options[@]}" \ +'-n+[]:NAMESPACE: ' \ +'--namespace=[]:NAMESPACE: ' \ +'-h[Print help]' \ +'--help[Print help]' \ +':key:' \ +&& ret=0 +;; +(list) +_arguments "${_arguments_options[@]}" \ +'-n+[]:NAMESPACE: ' \ +'--namespace=[]:NAMESPACE: ' \ +'-a[]' \ +'--all-namespaces[]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__kv__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-kv-help-command-$line[1]:" + case $line[1] in + (set) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(get) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(list) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(store) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_atuin__store_commands" \ +"*::: :->store" \ +&& ret=0 + + case $state in + (store) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-store-command-$line[1]:" + case $line[1] in + (status) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(rebuild) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +':tag:' \ +&& ret=0 +;; +(rekey) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +'::key -- The new key to use for encryption. Omit for a randomly-generated key:' \ +&& ret=0 +;; +(purge) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(verify) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(push) +_arguments "${_arguments_options[@]}" \ +'-t+[The tag to push (eg, '\''history'\''). Defaults to all tags]:TAG: ' \ +'--tag=[The tag to push (eg, '\''history'\''). Defaults to all tags]:TAG: ' \ +'--host=[The host to push, in the form of a UUID host ID. Defaults to the current host]:HOST: ' \ +'--force[Force push records This will override both host and tag, to be all hosts and all tags. First clear the remote store, then upload all of the local store]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(pull) +_arguments "${_arguments_options[@]}" \ +'-t+[The tag to push (eg, '\''history'\''). Defaults to all tags]:TAG: ' \ +'--tag=[The tag to push (eg, '\''history'\''). Defaults to all tags]:TAG: ' \ +'--force[Force push records This will first wipe the local store, and then download all records from the remote]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__store__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-store-help-command-$line[1]:" + case $line[1] in + (status) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(rebuild) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(rekey) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(purge) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(verify) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(push) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(pull) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(dotfiles) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_atuin__dotfiles_commands" \ +"*::: :->dotfiles" \ +&& ret=0 + + case $state in + (dotfiles) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-dotfiles-command-$line[1]:" + case $line[1] in + (alias) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_atuin__dotfiles__alias_commands" \ +"*::: :->alias" \ +&& ret=0 + + case $state in + (alias) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-dotfiles-alias-command-$line[1]:" + case $line[1] in + (set) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +':name:' \ +':value:' \ +&& ret=0 +;; +(delete) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +':name:' \ +&& ret=0 +;; +(list) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(import) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__dotfiles__alias__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-dotfiles-alias-help-command-$line[1]:" + case $line[1] in + (set) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(delete) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(list) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(import) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(help) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__dotfiles__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-dotfiles-help-command-$line[1]:" + case $line[1] in + (alias) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__dotfiles__help__alias_commands" \ +"*::: :->alias" \ +&& ret=0 + + case $state in + (alias) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-dotfiles-help-alias-command-$line[1]:" + case $line[1] in + (set) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(delete) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(list) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(import) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; +(help) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(init) +_arguments "${_arguments_options[@]}" \ +'--disable-ctrl-r[Disable the binding of CTRL-R to atuin]' \ +'--disable-up-arrow[Disable the binding of the Up Arrow key to atuin]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +':shell:((zsh\:"Zsh setup" +bash\:"Bash setup" +fish\:"Fish setup" +nu\:"Nu setup" +xonsh\:"Xonsh setup"))' \ +&& ret=0 +;; +(info) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(doctor) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(default-config) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(server) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_atuin__server_commands" \ +"*::: :->server" \ +&& ret=0 + + case $state in + (server) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-server-command-$line[1]:" + case $line[1] in + (start) +_arguments "${_arguments_options[@]}" \ +'--host=[The host address to bind]:HOST: ' \ +'-p+[The port to bind]:PORT: ' \ +'--port=[The port to bind]:PORT: ' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(default-config) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__server__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-server-help-command-$line[1]:" + case $line[1] in + (start) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(default-config) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(uuid) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(contributors) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(gen-completions) +_arguments "${_arguments_options[@]}" \ +'-s+[Set the shell for generating completions]:SHELL:(bash elvish fish nushell powershell zsh)' \ +'--shell=[Set the shell for generating completions]:SHELL:(bash elvish fish nushell powershell zsh)' \ +'-o+[Set the output directory]:OUT_DIR: ' \ +'--out-dir=[Set the output directory]:OUT_DIR: ' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-help-command-$line[1]:" + case $line[1] in + (history) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__help__history_commands" \ +"*::: :->history" \ +&& ret=0 + + case $state in + (history) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-help-history-command-$line[1]:" + case $line[1] in + (start) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(end) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(list) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(last) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(init-store) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(prune) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; +(import) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__help__import_commands" \ +"*::: :->import" \ +&& ret=0 + + case $state in + (import) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-help-import-command-$line[1]:" + case $line[1] in + (auto) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(zsh) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(zsh-hist-db) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(bash) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(resh) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(fish) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(nu) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(nu-hist-db) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(xonsh) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(xonsh-sqlite) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; +(stats) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(search) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(sync) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(login) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(logout) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(register) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(key) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(status) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(account) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__help__account_commands" \ +"*::: :->account" \ +&& ret=0 + + case $state in + (account) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-help-account-command-$line[1]:" + case $line[1] in + (login) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(register) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(logout) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(delete) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(change-password) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; +(kv) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__help__kv_commands" \ +"*::: :->kv" \ +&& ret=0 + + case $state in + (kv) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-help-kv-command-$line[1]:" + case $line[1] in + (set) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(get) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(list) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; +(store) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__help__store_commands" \ +"*::: :->store" \ +&& ret=0 + + case $state in + (store) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-help-store-command-$line[1]:" + case $line[1] in + (status) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(rebuild) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(rekey) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(purge) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(verify) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(push) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(pull) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; +(dotfiles) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__help__dotfiles_commands" \ +"*::: :->dotfiles" \ +&& ret=0 + + case $state in + (dotfiles) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-help-dotfiles-command-$line[1]:" + case $line[1] in + (alias) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__help__dotfiles__alias_commands" \ +"*::: :->alias" \ +&& ret=0 + + case $state in + (alias) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-help-dotfiles-alias-command-$line[1]:" + case $line[1] in + (set) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(delete) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(list) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(import) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(init) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(info) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(doctor) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(default-config) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(server) +_arguments "${_arguments_options[@]}" \ +":: :_atuin__help__server_commands" \ +"*::: :->server" \ +&& ret=0 + + case $state in + (server) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:atuin-help-server-command-$line[1]:" + case $line[1] in + (start) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(default-config) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; +(uuid) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(contributors) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(gen-completions) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +} + +(( $+functions[_atuin_commands] )) || +_atuin_commands() { + local commands; commands=( +'history:Manipulate shell history' \ +'import:Import shell history from file' \ +'stats:Calculate statistics for your history' \ +'search:Interactive history search' \ +'sync:Sync with the configured server' \ +'login:Login to the configured server' \ +'logout:Log out' \ +'register:Register with the configured server' \ +'key:Print the encryption key for transfer to another machine' \ +'status:Display the sync status' \ +'account:Manage your sync account' \ +'kv:Get or set small key-value pairs' \ +'store:Manage the atuin data store' \ +'dotfiles:Manage your dotfiles with Atuin' \ +'init:Print Atuin'\''s shell init script' \ +'info:Information about dotfiles locations and ENV vars' \ +'doctor:Run the doctor to check for common issues' \ +'default-config:Print example configuration' \ +'server:Start an atuin server' \ +'uuid:Generate a UUID' \ +'contributors:' \ +'gen-completions:Generate shell completions' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin commands' commands "$@" +} +(( $+functions[_atuin__account_commands] )) || +_atuin__account_commands() { + local commands; commands=( +'login:Login to the configured server' \ +'register:' \ +'logout:Log out' \ +'delete:Delete your account, and all synced data' \ +'change-password:Change your password' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin account commands' commands "$@" +} +(( $+functions[_atuin__help__account_commands] )) || +_atuin__help__account_commands() { + local commands; commands=( +'login:Login to the configured server' \ +'register:' \ +'logout:Log out' \ +'delete:Delete your account, and all synced data' \ +'change-password:Change your password' \ + ) + _describe -t commands 'atuin help account commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__alias_commands] )) || +_atuin__dotfiles__alias_commands() { + local commands; commands=( +'set:Set an alias' \ +'delete:Delete an alias' \ +'list:List all aliases' \ +'import:Import aliases set in the current shell' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin dotfiles alias commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__help__alias_commands] )) || +_atuin__dotfiles__help__alias_commands() { + local commands; commands=( +'set:Set an alias' \ +'delete:Delete an alias' \ +'list:List all aliases' \ +'import:Import aliases set in the current shell' \ + ) + _describe -t commands 'atuin dotfiles help alias commands' commands "$@" +} +(( $+functions[_atuin__help__dotfiles__alias_commands] )) || +_atuin__help__dotfiles__alias_commands() { + local commands; commands=( +'set:Set an alias' \ +'delete:Delete an alias' \ +'list:List all aliases' \ +'import:Import aliases set in the current shell' \ + ) + _describe -t commands 'atuin help dotfiles alias commands' commands "$@" +} +(( $+functions[_atuin__help__import__auto_commands] )) || +_atuin__help__import__auto_commands() { + local commands; commands=() + _describe -t commands 'atuin help import auto commands' commands "$@" +} +(( $+functions[_atuin__import__auto_commands] )) || +_atuin__import__auto_commands() { + local commands; commands=() + _describe -t commands 'atuin import auto commands' commands "$@" +} +(( $+functions[_atuin__import__help__auto_commands] )) || +_atuin__import__help__auto_commands() { + local commands; commands=() + _describe -t commands 'atuin import help auto commands' commands "$@" +} +(( $+functions[_atuin__help__import__bash_commands] )) || +_atuin__help__import__bash_commands() { + local commands; commands=() + _describe -t commands 'atuin help import bash commands' commands "$@" +} +(( $+functions[_atuin__import__bash_commands] )) || +_atuin__import__bash_commands() { + local commands; commands=() + _describe -t commands 'atuin import bash commands' commands "$@" +} +(( $+functions[_atuin__import__help__bash_commands] )) || +_atuin__import__help__bash_commands() { + local commands; commands=() + _describe -t commands 'atuin import help bash commands' commands "$@" +} +(( $+functions[_atuin__account__change-password_commands] )) || +_atuin__account__change-password_commands() { + local commands; commands=() + _describe -t commands 'atuin account change-password commands' commands "$@" +} +(( $+functions[_atuin__account__help__change-password_commands] )) || +_atuin__account__help__change-password_commands() { + local commands; commands=() + _describe -t commands 'atuin account help change-password commands' commands "$@" +} +(( $+functions[_atuin__help__account__change-password_commands] )) || +_atuin__help__account__change-password_commands() { + local commands; commands=() + _describe -t commands 'atuin help account change-password commands' commands "$@" +} +(( $+functions[_atuin__contributors_commands] )) || +_atuin__contributors_commands() { + local commands; commands=() + _describe -t commands 'atuin contributors commands' commands "$@" +} +(( $+functions[_atuin__help__contributors_commands] )) || +_atuin__help__contributors_commands() { + local commands; commands=() + _describe -t commands 'atuin help contributors commands' commands "$@" +} +(( $+functions[_atuin__default-config_commands] )) || +_atuin__default-config_commands() { + local commands; commands=() + _describe -t commands 'atuin default-config commands' commands "$@" +} +(( $+functions[_atuin__help__default-config_commands] )) || +_atuin__help__default-config_commands() { + local commands; commands=() + _describe -t commands 'atuin help default-config commands' commands "$@" +} +(( $+functions[_atuin__help__server__default-config_commands] )) || +_atuin__help__server__default-config_commands() { + local commands; commands=() + _describe -t commands 'atuin help server default-config commands' commands "$@" +} +(( $+functions[_atuin__server__default-config_commands] )) || +_atuin__server__default-config_commands() { + local commands; commands=() + _describe -t commands 'atuin server default-config commands' commands "$@" +} +(( $+functions[_atuin__server__help__default-config_commands] )) || +_atuin__server__help__default-config_commands() { + local commands; commands=() + _describe -t commands 'atuin server help default-config commands' commands "$@" +} +(( $+functions[_atuin__account__delete_commands] )) || +_atuin__account__delete_commands() { + local commands; commands=() + _describe -t commands 'atuin account delete commands' commands "$@" +} +(( $+functions[_atuin__account__help__delete_commands] )) || +_atuin__account__help__delete_commands() { + local commands; commands=() + _describe -t commands 'atuin account help delete commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__alias__delete_commands] )) || +_atuin__dotfiles__alias__delete_commands() { + local commands; commands=() + _describe -t commands 'atuin dotfiles alias delete commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__alias__help__delete_commands] )) || +_atuin__dotfiles__alias__help__delete_commands() { + local commands; commands=() + _describe -t commands 'atuin dotfiles alias help delete commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__help__alias__delete_commands] )) || +_atuin__dotfiles__help__alias__delete_commands() { + local commands; commands=() + _describe -t commands 'atuin dotfiles help alias delete commands' commands "$@" +} +(( $+functions[_atuin__help__account__delete_commands] )) || +_atuin__help__account__delete_commands() { + local commands; commands=() + _describe -t commands 'atuin help account delete commands' commands "$@" +} +(( $+functions[_atuin__help__dotfiles__alias__delete_commands] )) || +_atuin__help__dotfiles__alias__delete_commands() { + local commands; commands=() + _describe -t commands 'atuin help dotfiles alias delete commands' commands "$@" +} +(( $+functions[_atuin__doctor_commands] )) || +_atuin__doctor_commands() { + local commands; commands=() + _describe -t commands 'atuin doctor commands' commands "$@" +} +(( $+functions[_atuin__help__doctor_commands] )) || +_atuin__help__doctor_commands() { + local commands; commands=() + _describe -t commands 'atuin help doctor commands' commands "$@" +} +(( $+functions[_atuin__dotfiles_commands] )) || +_atuin__dotfiles_commands() { + local commands; commands=( +'alias:Manage shell aliases with Atuin' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin dotfiles commands' commands "$@" +} +(( $+functions[_atuin__help__dotfiles_commands] )) || +_atuin__help__dotfiles_commands() { + local commands; commands=( +'alias:Manage shell aliases with Atuin' \ + ) + _describe -t commands 'atuin help dotfiles commands' commands "$@" +} +(( $+functions[_atuin__help__history__end_commands] )) || +_atuin__help__history__end_commands() { + local commands; commands=() + _describe -t commands 'atuin help history end commands' commands "$@" +} +(( $+functions[_atuin__history__end_commands] )) || +_atuin__history__end_commands() { + local commands; commands=() + _describe -t commands 'atuin history end commands' commands "$@" +} +(( $+functions[_atuin__history__help__end_commands] )) || +_atuin__history__help__end_commands() { + local commands; commands=() + _describe -t commands 'atuin history help end commands' commands "$@" +} +(( $+functions[_atuin__help__import__fish_commands] )) || +_atuin__help__import__fish_commands() { + local commands; commands=() + _describe -t commands 'atuin help import fish commands' commands "$@" +} +(( $+functions[_atuin__import__fish_commands] )) || +_atuin__import__fish_commands() { + local commands; commands=() + _describe -t commands 'atuin import fish commands' commands "$@" +} +(( $+functions[_atuin__import__help__fish_commands] )) || +_atuin__import__help__fish_commands() { + local commands; commands=() + _describe -t commands 'atuin import help fish commands' commands "$@" +} +(( $+functions[_atuin__gen-completions_commands] )) || +_atuin__gen-completions_commands() { + local commands; commands=() + _describe -t commands 'atuin gen-completions commands' commands "$@" +} +(( $+functions[_atuin__help__gen-completions_commands] )) || +_atuin__help__gen-completions_commands() { + local commands; commands=() + _describe -t commands 'atuin help gen-completions commands' commands "$@" +} +(( $+functions[_atuin__help__kv__get_commands] )) || +_atuin__help__kv__get_commands() { + local commands; commands=() + _describe -t commands 'atuin help kv get commands' commands "$@" +} +(( $+functions[_atuin__kv__get_commands] )) || +_atuin__kv__get_commands() { + local commands; commands=() + _describe -t commands 'atuin kv get commands' commands "$@" +} +(( $+functions[_atuin__kv__help__get_commands] )) || +_atuin__kv__help__get_commands() { + local commands; commands=() + _describe -t commands 'atuin kv help get commands' commands "$@" +} +(( $+functions[_atuin__account__help_commands] )) || +_atuin__account__help_commands() { + local commands; commands=( +'login:Login to the configured server' \ +'register:' \ +'logout:Log out' \ +'delete:Delete your account, and all synced data' \ +'change-password:Change your password' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin account help commands' commands "$@" +} +(( $+functions[_atuin__account__help__help_commands] )) || +_atuin__account__help__help_commands() { + local commands; commands=() + _describe -t commands 'atuin account help help commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__alias__help_commands] )) || +_atuin__dotfiles__alias__help_commands() { + local commands; commands=( +'set:Set an alias' \ +'delete:Delete an alias' \ +'list:List all aliases' \ +'import:Import aliases set in the current shell' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin dotfiles alias help commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__alias__help__help_commands] )) || +_atuin__dotfiles__alias__help__help_commands() { + local commands; commands=() + _describe -t commands 'atuin dotfiles alias help help commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__help_commands] )) || +_atuin__dotfiles__help_commands() { + local commands; commands=( +'alias:Manage shell aliases with Atuin' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin dotfiles help commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__help__help_commands] )) || +_atuin__dotfiles__help__help_commands() { + local commands; commands=() + _describe -t commands 'atuin dotfiles help help commands' commands "$@" +} +(( $+functions[_atuin__help_commands] )) || +_atuin__help_commands() { + local commands; commands=( +'history:Manipulate shell history' \ +'import:Import shell history from file' \ +'stats:Calculate statistics for your history' \ +'search:Interactive history search' \ +'sync:Sync with the configured server' \ +'login:Login to the configured server' \ +'logout:Log out' \ +'register:Register with the configured server' \ +'key:Print the encryption key for transfer to another machine' \ +'status:Display the sync status' \ +'account:Manage your sync account' \ +'kv:Get or set small key-value pairs' \ +'store:Manage the atuin data store' \ +'dotfiles:Manage your dotfiles with Atuin' \ +'init:Print Atuin'\''s shell init script' \ +'info:Information about dotfiles locations and ENV vars' \ +'doctor:Run the doctor to check for common issues' \ +'default-config:Print example configuration' \ +'server:Start an atuin server' \ +'uuid:Generate a UUID' \ +'contributors:' \ +'gen-completions:Generate shell completions' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin help commands' commands "$@" +} +(( $+functions[_atuin__help__help_commands] )) || +_atuin__help__help_commands() { + local commands; commands=() + _describe -t commands 'atuin help help commands' commands "$@" +} +(( $+functions[_atuin__history__help_commands] )) || +_atuin__history__help_commands() { + local commands; commands=( +'start:Begins a new command in the history' \ +'end:Finishes a new command in the history (adds time, exit code)' \ +'list:List all items in history' \ +'last:Get the last command ran' \ +'init-store:' \ +'prune:Delete history entries matching the configured exclusion filters' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin history help commands' commands "$@" +} +(( $+functions[_atuin__history__help__help_commands] )) || +_atuin__history__help__help_commands() { + local commands; commands=() + _describe -t commands 'atuin history help help commands' commands "$@" +} +(( $+functions[_atuin__import__help_commands] )) || +_atuin__import__help_commands() { + local commands; commands=( +'auto:Import history for the current shell' \ +'zsh:Import history from the zsh history file' \ +'zsh-hist-db:Import history from the zsh history file' \ +'bash:Import history from the bash history file' \ +'resh:Import history from the resh history file' \ +'fish:Import history from the fish history file' \ +'nu:Import history from the nu history file' \ +'nu-hist-db:Import history from the nu history file' \ +'xonsh:Import history from xonsh json files' \ +'xonsh-sqlite:Import history from xonsh sqlite db' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin import help commands' commands "$@" +} +(( $+functions[_atuin__import__help__help_commands] )) || +_atuin__import__help__help_commands() { + local commands; commands=() + _describe -t commands 'atuin import help help commands' commands "$@" +} +(( $+functions[_atuin__kv__help_commands] )) || +_atuin__kv__help_commands() { + local commands; commands=( +'set:' \ +'get:' \ +'list:' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin kv help commands' commands "$@" +} +(( $+functions[_atuin__kv__help__help_commands] )) || +_atuin__kv__help__help_commands() { + local commands; commands=() + _describe -t commands 'atuin kv help help commands' commands "$@" +} +(( $+functions[_atuin__server__help_commands] )) || +_atuin__server__help_commands() { + local commands; commands=( +'start:Start the server' \ +'default-config:Print server example configuration' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin server help commands' commands "$@" +} +(( $+functions[_atuin__server__help__help_commands] )) || +_atuin__server__help__help_commands() { + local commands; commands=() + _describe -t commands 'atuin server help help commands' commands "$@" +} +(( $+functions[_atuin__store__help_commands] )) || +_atuin__store__help_commands() { + local commands; commands=( +'status:' \ +'rebuild:' \ +'rekey:' \ +'purge:' \ +'verify:' \ +'push:' \ +'pull:' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin store help commands' commands "$@" +} +(( $+functions[_atuin__store__help__help_commands] )) || +_atuin__store__help__help_commands() { + local commands; commands=() + _describe -t commands 'atuin store help help commands' commands "$@" +} +(( $+functions[_atuin__help__history_commands] )) || +_atuin__help__history_commands() { + local commands; commands=( +'start:Begins a new command in the history' \ +'end:Finishes a new command in the history (adds time, exit code)' \ +'list:List all items in history' \ +'last:Get the last command ran' \ +'init-store:' \ +'prune:Delete history entries matching the configured exclusion filters' \ + ) + _describe -t commands 'atuin help history commands' commands "$@" +} +(( $+functions[_atuin__history_commands] )) || +_atuin__history_commands() { + local commands; commands=( +'start:Begins a new command in the history' \ +'end:Finishes a new command in the history (adds time, exit code)' \ +'list:List all items in history' \ +'last:Get the last command ran' \ +'init-store:' \ +'prune:Delete history entries matching the configured exclusion filters' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin history commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__alias__help__import_commands] )) || +_atuin__dotfiles__alias__help__import_commands() { + local commands; commands=() + _describe -t commands 'atuin dotfiles alias help import commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__alias__import_commands] )) || +_atuin__dotfiles__alias__import_commands() { + local commands; commands=() + _describe -t commands 'atuin dotfiles alias import commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__help__alias__import_commands] )) || +_atuin__dotfiles__help__alias__import_commands() { + local commands; commands=() + _describe -t commands 'atuin dotfiles help alias import commands' commands "$@" +} +(( $+functions[_atuin__help__dotfiles__alias__import_commands] )) || +_atuin__help__dotfiles__alias__import_commands() { + local commands; commands=() + _describe -t commands 'atuin help dotfiles alias import commands' commands "$@" +} +(( $+functions[_atuin__help__import_commands] )) || +_atuin__help__import_commands() { + local commands; commands=( +'auto:Import history for the current shell' \ +'zsh:Import history from the zsh history file' \ +'zsh-hist-db:Import history from the zsh history file' \ +'bash:Import history from the bash history file' \ +'resh:Import history from the resh history file' \ +'fish:Import history from the fish history file' \ +'nu:Import history from the nu history file' \ +'nu-hist-db:Import history from the nu history file' \ +'xonsh:Import history from xonsh json files' \ +'xonsh-sqlite:Import history from xonsh sqlite db' \ + ) + _describe -t commands 'atuin help import commands' commands "$@" +} +(( $+functions[_atuin__import_commands] )) || +_atuin__import_commands() { + local commands; commands=( +'auto:Import history for the current shell' \ +'zsh:Import history from the zsh history file' \ +'zsh-hist-db:Import history from the zsh history file' \ +'bash:Import history from the bash history file' \ +'resh:Import history from the resh history file' \ +'fish:Import history from the fish history file' \ +'nu:Import history from the nu history file' \ +'nu-hist-db:Import history from the nu history file' \ +'xonsh:Import history from xonsh json files' \ +'xonsh-sqlite:Import history from xonsh sqlite db' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin import commands' commands "$@" +} +(( $+functions[_atuin__help__info_commands] )) || +_atuin__help__info_commands() { + local commands; commands=() + _describe -t commands 'atuin help info commands' commands "$@" +} +(( $+functions[_atuin__info_commands] )) || +_atuin__info_commands() { + local commands; commands=() + _describe -t commands 'atuin info commands' commands "$@" +} +(( $+functions[_atuin__help__init_commands] )) || +_atuin__help__init_commands() { + local commands; commands=() + _describe -t commands 'atuin help init commands' commands "$@" +} +(( $+functions[_atuin__init_commands] )) || +_atuin__init_commands() { + local commands; commands=() + _describe -t commands 'atuin init commands' commands "$@" +} +(( $+functions[_atuin__help__history__init-store_commands] )) || +_atuin__help__history__init-store_commands() { + local commands; commands=() + _describe -t commands 'atuin help history init-store commands' commands "$@" +} +(( $+functions[_atuin__history__help__init-store_commands] )) || +_atuin__history__help__init-store_commands() { + local commands; commands=() + _describe -t commands 'atuin history help init-store commands' commands "$@" +} +(( $+functions[_atuin__history__init-store_commands] )) || +_atuin__history__init-store_commands() { + local commands; commands=() + _describe -t commands 'atuin history init-store commands' commands "$@" +} +(( $+functions[_atuin__help__key_commands] )) || +_atuin__help__key_commands() { + local commands; commands=() + _describe -t commands 'atuin help key commands' commands "$@" +} +(( $+functions[_atuin__key_commands] )) || +_atuin__key_commands() { + local commands; commands=() + _describe -t commands 'atuin key commands' commands "$@" +} +(( $+functions[_atuin__help__kv_commands] )) || +_atuin__help__kv_commands() { + local commands; commands=( +'set:' \ +'get:' \ +'list:' \ + ) + _describe -t commands 'atuin help kv commands' commands "$@" +} +(( $+functions[_atuin__kv_commands] )) || +_atuin__kv_commands() { + local commands; commands=( +'set:' \ +'get:' \ +'list:' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin kv commands' commands "$@" +} +(( $+functions[_atuin__help__history__last_commands] )) || +_atuin__help__history__last_commands() { + local commands; commands=() + _describe -t commands 'atuin help history last commands' commands "$@" +} +(( $+functions[_atuin__history__help__last_commands] )) || +_atuin__history__help__last_commands() { + local commands; commands=() + _describe -t commands 'atuin history help last commands' commands "$@" +} +(( $+functions[_atuin__history__last_commands] )) || +_atuin__history__last_commands() { + local commands; commands=() + _describe -t commands 'atuin history last commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__alias__help__list_commands] )) || +_atuin__dotfiles__alias__help__list_commands() { + local commands; commands=() + _describe -t commands 'atuin dotfiles alias help list commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__alias__list_commands] )) || +_atuin__dotfiles__alias__list_commands() { + local commands; commands=() + _describe -t commands 'atuin dotfiles alias list commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__help__alias__list_commands] )) || +_atuin__dotfiles__help__alias__list_commands() { + local commands; commands=() + _describe -t commands 'atuin dotfiles help alias list commands' commands "$@" +} +(( $+functions[_atuin__help__dotfiles__alias__list_commands] )) || +_atuin__help__dotfiles__alias__list_commands() { + local commands; commands=() + _describe -t commands 'atuin help dotfiles alias list commands' commands "$@" +} +(( $+functions[_atuin__help__history__list_commands] )) || +_atuin__help__history__list_commands() { + local commands; commands=() + _describe -t commands 'atuin help history list commands' commands "$@" +} +(( $+functions[_atuin__help__kv__list_commands] )) || +_atuin__help__kv__list_commands() { + local commands; commands=() + _describe -t commands 'atuin help kv list commands' commands "$@" +} +(( $+functions[_atuin__history__help__list_commands] )) || +_atuin__history__help__list_commands() { + local commands; commands=() + _describe -t commands 'atuin history help list commands' commands "$@" +} +(( $+functions[_atuin__history__list_commands] )) || +_atuin__history__list_commands() { + local commands; commands=() + _describe -t commands 'atuin history list commands' commands "$@" +} +(( $+functions[_atuin__kv__help__list_commands] )) || +_atuin__kv__help__list_commands() { + local commands; commands=() + _describe -t commands 'atuin kv help list commands' commands "$@" +} +(( $+functions[_atuin__kv__list_commands] )) || +_atuin__kv__list_commands() { + local commands; commands=() + _describe -t commands 'atuin kv list commands' commands "$@" +} +(( $+functions[_atuin__account__help__login_commands] )) || +_atuin__account__help__login_commands() { + local commands; commands=() + _describe -t commands 'atuin account help login commands' commands "$@" +} +(( $+functions[_atuin__account__login_commands] )) || +_atuin__account__login_commands() { + local commands; commands=() + _describe -t commands 'atuin account login commands' commands "$@" +} +(( $+functions[_atuin__help__account__login_commands] )) || +_atuin__help__account__login_commands() { + local commands; commands=() + _describe -t commands 'atuin help account login commands' commands "$@" +} +(( $+functions[_atuin__help__login_commands] )) || +_atuin__help__login_commands() { + local commands; commands=() + _describe -t commands 'atuin help login commands' commands "$@" +} +(( $+functions[_atuin__login_commands] )) || +_atuin__login_commands() { + local commands; commands=() + _describe -t commands 'atuin login commands' commands "$@" +} +(( $+functions[_atuin__account__help__logout_commands] )) || +_atuin__account__help__logout_commands() { + local commands; commands=() + _describe -t commands 'atuin account help logout commands' commands "$@" +} +(( $+functions[_atuin__account__logout_commands] )) || +_atuin__account__logout_commands() { + local commands; commands=() + _describe -t commands 'atuin account logout commands' commands "$@" +} +(( $+functions[_atuin__help__account__logout_commands] )) || +_atuin__help__account__logout_commands() { + local commands; commands=() + _describe -t commands 'atuin help account logout commands' commands "$@" +} +(( $+functions[_atuin__help__logout_commands] )) || +_atuin__help__logout_commands() { + local commands; commands=() + _describe -t commands 'atuin help logout commands' commands "$@" +} +(( $+functions[_atuin__logout_commands] )) || +_atuin__logout_commands() { + local commands; commands=() + _describe -t commands 'atuin logout commands' commands "$@" +} +(( $+functions[_atuin__help__import__nu_commands] )) || +_atuin__help__import__nu_commands() { + local commands; commands=() + _describe -t commands 'atuin help import nu commands' commands "$@" +} +(( $+functions[_atuin__import__help__nu_commands] )) || +_atuin__import__help__nu_commands() { + local commands; commands=() + _describe -t commands 'atuin import help nu commands' commands "$@" +} +(( $+functions[_atuin__import__nu_commands] )) || +_atuin__import__nu_commands() { + local commands; commands=() + _describe -t commands 'atuin import nu commands' commands "$@" +} +(( $+functions[_atuin__help__import__nu-hist-db_commands] )) || +_atuin__help__import__nu-hist-db_commands() { + local commands; commands=() + _describe -t commands 'atuin help import nu-hist-db commands' commands "$@" +} +(( $+functions[_atuin__import__help__nu-hist-db_commands] )) || +_atuin__import__help__nu-hist-db_commands() { + local commands; commands=() + _describe -t commands 'atuin import help nu-hist-db commands' commands "$@" +} +(( $+functions[_atuin__import__nu-hist-db_commands] )) || +_atuin__import__nu-hist-db_commands() { + local commands; commands=() + _describe -t commands 'atuin import nu-hist-db commands' commands "$@" +} +(( $+functions[_atuin__help__history__prune_commands] )) || +_atuin__help__history__prune_commands() { + local commands; commands=() + _describe -t commands 'atuin help history prune commands' commands "$@" +} +(( $+functions[_atuin__history__help__prune_commands] )) || +_atuin__history__help__prune_commands() { + local commands; commands=() + _describe -t commands 'atuin history help prune commands' commands "$@" +} +(( $+functions[_atuin__history__prune_commands] )) || +_atuin__history__prune_commands() { + local commands; commands=() + _describe -t commands 'atuin history prune commands' commands "$@" +} +(( $+functions[_atuin__help__store__pull_commands] )) || +_atuin__help__store__pull_commands() { + local commands; commands=() + _describe -t commands 'atuin help store pull commands' commands "$@" +} +(( $+functions[_atuin__store__help__pull_commands] )) || +_atuin__store__help__pull_commands() { + local commands; commands=() + _describe -t commands 'atuin store help pull commands' commands "$@" +} +(( $+functions[_atuin__store__pull_commands] )) || +_atuin__store__pull_commands() { + local commands; commands=() + _describe -t commands 'atuin store pull commands' commands "$@" +} +(( $+functions[_atuin__help__store__purge_commands] )) || +_atuin__help__store__purge_commands() { + local commands; commands=() + _describe -t commands 'atuin help store purge commands' commands "$@" +} +(( $+functions[_atuin__store__help__purge_commands] )) || +_atuin__store__help__purge_commands() { + local commands; commands=() + _describe -t commands 'atuin store help purge commands' commands "$@" +} +(( $+functions[_atuin__store__purge_commands] )) || +_atuin__store__purge_commands() { + local commands; commands=() + _describe -t commands 'atuin store purge commands' commands "$@" +} +(( $+functions[_atuin__help__store__push_commands] )) || +_atuin__help__store__push_commands() { + local commands; commands=() + _describe -t commands 'atuin help store push commands' commands "$@" +} +(( $+functions[_atuin__store__help__push_commands] )) || +_atuin__store__help__push_commands() { + local commands; commands=() + _describe -t commands 'atuin store help push commands' commands "$@" +} +(( $+functions[_atuin__store__push_commands] )) || +_atuin__store__push_commands() { + local commands; commands=() + _describe -t commands 'atuin store push commands' commands "$@" +} +(( $+functions[_atuin__help__store__rebuild_commands] )) || +_atuin__help__store__rebuild_commands() { + local commands; commands=() + _describe -t commands 'atuin help store rebuild commands' commands "$@" +} +(( $+functions[_atuin__store__help__rebuild_commands] )) || +_atuin__store__help__rebuild_commands() { + local commands; commands=() + _describe -t commands 'atuin store help rebuild commands' commands "$@" +} +(( $+functions[_atuin__store__rebuild_commands] )) || +_atuin__store__rebuild_commands() { + local commands; commands=() + _describe -t commands 'atuin store rebuild commands' commands "$@" +} +(( $+functions[_atuin__account__help__register_commands] )) || +_atuin__account__help__register_commands() { + local commands; commands=() + _describe -t commands 'atuin account help register commands' commands "$@" +} +(( $+functions[_atuin__account__register_commands] )) || +_atuin__account__register_commands() { + local commands; commands=() + _describe -t commands 'atuin account register commands' commands "$@" +} +(( $+functions[_atuin__help__account__register_commands] )) || +_atuin__help__account__register_commands() { + local commands; commands=() + _describe -t commands 'atuin help account register commands' commands "$@" +} +(( $+functions[_atuin__help__register_commands] )) || +_atuin__help__register_commands() { + local commands; commands=() + _describe -t commands 'atuin help register commands' commands "$@" +} +(( $+functions[_atuin__register_commands] )) || +_atuin__register_commands() { + local commands; commands=() + _describe -t commands 'atuin register commands' commands "$@" +} +(( $+functions[_atuin__help__store__rekey_commands] )) || +_atuin__help__store__rekey_commands() { + local commands; commands=() + _describe -t commands 'atuin help store rekey commands' commands "$@" +} +(( $+functions[_atuin__store__help__rekey_commands] )) || +_atuin__store__help__rekey_commands() { + local commands; commands=() + _describe -t commands 'atuin store help rekey commands' commands "$@" +} +(( $+functions[_atuin__store__rekey_commands] )) || +_atuin__store__rekey_commands() { + local commands; commands=() + _describe -t commands 'atuin store rekey commands' commands "$@" +} +(( $+functions[_atuin__help__import__resh_commands] )) || +_atuin__help__import__resh_commands() { + local commands; commands=() + _describe -t commands 'atuin help import resh commands' commands "$@" +} +(( $+functions[_atuin__import__help__resh_commands] )) || +_atuin__import__help__resh_commands() { + local commands; commands=() + _describe -t commands 'atuin import help resh commands' commands "$@" +} +(( $+functions[_atuin__import__resh_commands] )) || +_atuin__import__resh_commands() { + local commands; commands=() + _describe -t commands 'atuin import resh commands' commands "$@" +} +(( $+functions[_atuin__help__search_commands] )) || +_atuin__help__search_commands() { + local commands; commands=() + _describe -t commands 'atuin help search commands' commands "$@" +} +(( $+functions[_atuin__search_commands] )) || +_atuin__search_commands() { + local commands; commands=() + _describe -t commands 'atuin search commands' commands "$@" +} +(( $+functions[_atuin__help__server_commands] )) || +_atuin__help__server_commands() { + local commands; commands=( +'start:Start the server' \ +'default-config:Print server example configuration' \ + ) + _describe -t commands 'atuin help server commands' commands "$@" +} +(( $+functions[_atuin__server_commands] )) || +_atuin__server_commands() { + local commands; commands=( +'start:Start the server' \ +'default-config:Print server example configuration' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin server commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__alias__help__set_commands] )) || +_atuin__dotfiles__alias__help__set_commands() { + local commands; commands=() + _describe -t commands 'atuin dotfiles alias help set commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__alias__set_commands] )) || +_atuin__dotfiles__alias__set_commands() { + local commands; commands=() + _describe -t commands 'atuin dotfiles alias set commands' commands "$@" +} +(( $+functions[_atuin__dotfiles__help__alias__set_commands] )) || +_atuin__dotfiles__help__alias__set_commands() { + local commands; commands=() + _describe -t commands 'atuin dotfiles help alias set commands' commands "$@" +} +(( $+functions[_atuin__help__dotfiles__alias__set_commands] )) || +_atuin__help__dotfiles__alias__set_commands() { + local commands; commands=() + _describe -t commands 'atuin help dotfiles alias set commands' commands "$@" +} +(( $+functions[_atuin__help__kv__set_commands] )) || +_atuin__help__kv__set_commands() { + local commands; commands=() + _describe -t commands 'atuin help kv set commands' commands "$@" +} +(( $+functions[_atuin__kv__help__set_commands] )) || +_atuin__kv__help__set_commands() { + local commands; commands=() + _describe -t commands 'atuin kv help set commands' commands "$@" +} +(( $+functions[_atuin__kv__set_commands] )) || +_atuin__kv__set_commands() { + local commands; commands=() + _describe -t commands 'atuin kv set commands' commands "$@" +} +(( $+functions[_atuin__help__history__start_commands] )) || +_atuin__help__history__start_commands() { + local commands; commands=() + _describe -t commands 'atuin help history start commands' commands "$@" +} +(( $+functions[_atuin__help__server__start_commands] )) || +_atuin__help__server__start_commands() { + local commands; commands=() + _describe -t commands 'atuin help server start commands' commands "$@" +} +(( $+functions[_atuin__history__help__start_commands] )) || +_atuin__history__help__start_commands() { + local commands; commands=() + _describe -t commands 'atuin history help start commands' commands "$@" +} +(( $+functions[_atuin__history__start_commands] )) || +_atuin__history__start_commands() { + local commands; commands=() + _describe -t commands 'atuin history start commands' commands "$@" +} +(( $+functions[_atuin__server__help__start_commands] )) || +_atuin__server__help__start_commands() { + local commands; commands=() + _describe -t commands 'atuin server help start commands' commands "$@" +} +(( $+functions[_atuin__server__start_commands] )) || +_atuin__server__start_commands() { + local commands; commands=() + _describe -t commands 'atuin server start commands' commands "$@" +} +(( $+functions[_atuin__help__stats_commands] )) || +_atuin__help__stats_commands() { + local commands; commands=() + _describe -t commands 'atuin help stats commands' commands "$@" +} +(( $+functions[_atuin__stats_commands] )) || +_atuin__stats_commands() { + local commands; commands=() + _describe -t commands 'atuin stats commands' commands "$@" +} +(( $+functions[_atuin__help__status_commands] )) || +_atuin__help__status_commands() { + local commands; commands=() + _describe -t commands 'atuin help status commands' commands "$@" +} +(( $+functions[_atuin__help__store__status_commands] )) || +_atuin__help__store__status_commands() { + local commands; commands=() + _describe -t commands 'atuin help store status commands' commands "$@" +} +(( $+functions[_atuin__status_commands] )) || +_atuin__status_commands() { + local commands; commands=() + _describe -t commands 'atuin status commands' commands "$@" +} +(( $+functions[_atuin__store__help__status_commands] )) || +_atuin__store__help__status_commands() { + local commands; commands=() + _describe -t commands 'atuin store help status commands' commands "$@" +} +(( $+functions[_atuin__store__status_commands] )) || +_atuin__store__status_commands() { + local commands; commands=() + _describe -t commands 'atuin store status commands' commands "$@" +} +(( $+functions[_atuin__help__store_commands] )) || +_atuin__help__store_commands() { + local commands; commands=( +'status:' \ +'rebuild:' \ +'rekey:' \ +'purge:' \ +'verify:' \ +'push:' \ +'pull:' \ + ) + _describe -t commands 'atuin help store commands' commands "$@" +} +(( $+functions[_atuin__store_commands] )) || +_atuin__store_commands() { + local commands; commands=( +'status:' \ +'rebuild:' \ +'rekey:' \ +'purge:' \ +'verify:' \ +'push:' \ +'pull:' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'atuin store commands' commands "$@" +} +(( $+functions[_atuin__help__sync_commands] )) || +_atuin__help__sync_commands() { + local commands; commands=() + _describe -t commands 'atuin help sync commands' commands "$@" +} +(( $+functions[_atuin__sync_commands] )) || +_atuin__sync_commands() { + local commands; commands=() + _describe -t commands 'atuin sync commands' commands "$@" +} +(( $+functions[_atuin__help__uuid_commands] )) || +_atuin__help__uuid_commands() { + local commands; commands=() + _describe -t commands 'atuin help uuid commands' commands "$@" +} +(( $+functions[_atuin__uuid_commands] )) || +_atuin__uuid_commands() { + local commands; commands=() + _describe -t commands 'atuin uuid commands' commands "$@" +} +(( $+functions[_atuin__help__store__verify_commands] )) || +_atuin__help__store__verify_commands() { + local commands; commands=() + _describe -t commands 'atuin help store verify commands' commands "$@" +} +(( $+functions[_atuin__store__help__verify_commands] )) || +_atuin__store__help__verify_commands() { + local commands; commands=() + _describe -t commands 'atuin store help verify commands' commands "$@" +} +(( $+functions[_atuin__store__verify_commands] )) || +_atuin__store__verify_commands() { + local commands; commands=() + _describe -t commands 'atuin store verify commands' commands "$@" +} +(( $+functions[_atuin__help__import__xonsh_commands] )) || +_atuin__help__import__xonsh_commands() { + local commands; commands=() + _describe -t commands 'atuin help import xonsh commands' commands "$@" +} +(( $+functions[_atuin__import__help__xonsh_commands] )) || +_atuin__import__help__xonsh_commands() { + local commands; commands=() + _describe -t commands 'atuin import help xonsh commands' commands "$@" +} +(( $+functions[_atuin__import__xonsh_commands] )) || +_atuin__import__xonsh_commands() { + local commands; commands=() + _describe -t commands 'atuin import xonsh commands' commands "$@" +} +(( $+functions[_atuin__help__import__xonsh-sqlite_commands] )) || +_atuin__help__import__xonsh-sqlite_commands() { + local commands; commands=() + _describe -t commands 'atuin help import xonsh-sqlite commands' commands "$@" +} +(( $+functions[_atuin__import__help__xonsh-sqlite_commands] )) || +_atuin__import__help__xonsh-sqlite_commands() { + local commands; commands=() + _describe -t commands 'atuin import help xonsh-sqlite commands' commands "$@" +} +(( $+functions[_atuin__import__xonsh-sqlite_commands] )) || +_atuin__import__xonsh-sqlite_commands() { + local commands; commands=() + _describe -t commands 'atuin import xonsh-sqlite commands' commands "$@" +} +(( $+functions[_atuin__help__import__zsh_commands] )) || +_atuin__help__import__zsh_commands() { + local commands; commands=() + _describe -t commands 'atuin help import zsh commands' commands "$@" +} +(( $+functions[_atuin__import__help__zsh_commands] )) || +_atuin__import__help__zsh_commands() { + local commands; commands=() + _describe -t commands 'atuin import help zsh commands' commands "$@" +} +(( $+functions[_atuin__import__zsh_commands] )) || +_atuin__import__zsh_commands() { + local commands; commands=() + _describe -t commands 'atuin import zsh commands' commands "$@" +} +(( $+functions[_atuin__help__import__zsh-hist-db_commands] )) || +_atuin__help__import__zsh-hist-db_commands() { + local commands; commands=() + _describe -t commands 'atuin help import zsh-hist-db commands' commands "$@" +} +(( $+functions[_atuin__import__help__zsh-hist-db_commands] )) || +_atuin__import__help__zsh-hist-db_commands() { + local commands; commands=() + _describe -t commands 'atuin import help zsh-hist-db commands' commands "$@" +} +(( $+functions[_atuin__import__zsh-hist-db_commands] )) || +_atuin__import__zsh-hist-db_commands() { + local commands; commands=() + _describe -t commands 'atuin import zsh-hist-db commands' commands "$@" +} + +if [ "$funcstack[1]" = "_atuin" ]; then + _atuin "$@" +else + compdef _atuin atuin +fi diff --git a/dot_config/zsh/completions/_chezmoi b/dot_config/zsh/completions/_chezmoi new file mode 100644 index 0000000..46af48d --- /dev/null +++ b/dot_config/zsh/completions/_chezmoi @@ -0,0 +1,212 @@ +#compdef chezmoi +compdef _chezmoi chezmoi + +# zsh completion for chezmoi -*- shell-script -*- + +__chezmoi_debug() +{ + local file="$BASH_COMP_DEBUG_FILE" + if [[ -n ${file} ]]; then + echo "$*" >> "${file}" + fi +} + +_chezmoi() +{ + local shellCompDirectiveError=1 + local shellCompDirectiveNoSpace=2 + local shellCompDirectiveNoFileComp=4 + local shellCompDirectiveFilterFileExt=8 + local shellCompDirectiveFilterDirs=16 + local shellCompDirectiveKeepOrder=32 + + local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder + local -a completions + + __chezmoi_debug "\n========= starting completion logic ==========" + __chezmoi_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}" + + # The user could have moved the cursor backwards on the command-line. + # We need to trigger completion from the $CURRENT location, so we need + # to truncate the command-line ($words) up to the $CURRENT location. + # (We cannot use $CURSOR as its value does not work when a command is an alias.) + words=("${=words[1,CURRENT]}") + __chezmoi_debug "Truncated words[*]: ${words[*]}," + + lastParam=${words[-1]} + lastChar=${lastParam[-1]} + __chezmoi_debug "lastParam: ${lastParam}, lastChar: ${lastChar}" + + # For zsh, when completing a flag with an = (e.g., chezmoi -n=) + # completions must be prefixed with the flag + setopt local_options BASH_REMATCH + if [[ "${lastParam}" =~ '-.*=' ]]; then + # We are dealing with a flag with an = + flagPrefix="-P ${BASH_REMATCH}" + fi + + # Prepare the command to obtain completions + requestComp="${words[1]} __complete ${words[2,-1]}" + if [ "${lastChar}" = "" ]; then + # If the last parameter is complete (there is a space following it) + # We add an extra empty parameter so we can indicate this to the go completion code. + __chezmoi_debug "Adding extra empty parameter" + requestComp="${requestComp} \"\"" + fi + + __chezmoi_debug "About to call: eval ${requestComp}" + + # Use eval to handle any environment variables and such + out=$(eval ${requestComp} 2>/dev/null) + __chezmoi_debug "completion output: ${out}" + + # Extract the directive integer following a : from the last line + local lastLine + while IFS='\n' read -r line; do + lastLine=${line} + done < <(printf "%s\n" "${out[@]}") + __chezmoi_debug "last line: ${lastLine}" + + if [ "${lastLine[1]}" = : ]; then + directive=${lastLine[2,-1]} + # Remove the directive including the : and the newline + local suffix + (( suffix=${#lastLine}+2)) + out=${out[1,-$suffix]} + else + # There is no directive specified. Leave $out as is. + __chezmoi_debug "No directive found. Setting do default" + directive=0 + fi + + __chezmoi_debug "directive: ${directive}" + __chezmoi_debug "completions: ${out}" + __chezmoi_debug "flagPrefix: ${flagPrefix}" + + if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then + __chezmoi_debug "Completion received error. Ignoring completions." + return + fi + + local activeHelpMarker="_activeHelp_ " + local endIndex=${#activeHelpMarker} + local startIndex=$((${#activeHelpMarker}+1)) + local hasActiveHelp=0 + while IFS='\n' read -r comp; do + # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker) + if [ "${comp[1,$endIndex]}" = "$activeHelpMarker" ];then + __chezmoi_debug "ActiveHelp found: $comp" + comp="${comp[$startIndex,-1]}" + if [ -n "$comp" ]; then + compadd -x "${comp}" + __chezmoi_debug "ActiveHelp will need delimiter" + hasActiveHelp=1 + fi + + continue + fi + + if [ -n "$comp" ]; then + # If requested, completions are returned with a description. + # The description is preceded by a TAB character. + # For zsh's _describe, we need to use a : instead of a TAB. + # We first need to escape any : as part of the completion itself. + comp=${comp//:/\\:} + + local tab="$(printf '\t')" + comp=${comp//$tab/:} + + __chezmoi_debug "Adding completion: ${comp}" + completions+=${comp} + lastComp=$comp + fi + done < <(printf "%s\n" "${out[@]}") + + # Add a delimiter after the activeHelp statements, but only if: + # - there are completions following the activeHelp statements, or + # - file completion will be performed (so there will be choices after the activeHelp) + if [ $hasActiveHelp -eq 1 ]; then + if [ ${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then + __chezmoi_debug "Adding activeHelp delimiter" + compadd -x "--" + hasActiveHelp=0 + fi + fi + + if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then + __chezmoi_debug "Activating nospace." + noSpace="-S ''" + fi + + if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then + __chezmoi_debug "Activating keep order." + keepOrder="-V" + fi + + if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then + # File extension filtering + local filteringCmd + filteringCmd='_files' + for filter in ${completions[@]}; do + if [ ${filter[1]} != '*' ]; then + # zsh requires a glob pattern to do file filtering + filter="\*.$filter" + fi + filteringCmd+=" -g $filter" + done + filteringCmd+=" ${flagPrefix}" + + __chezmoi_debug "File filtering command: $filteringCmd" + _arguments '*:filename:'"$filteringCmd" + elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then + # File completion for directories only + local subdir + subdir="${completions[1]}" + if [ -n "$subdir" ]; then + __chezmoi_debug "Listing directories in $subdir" + pushd "${subdir}" >/dev/null 2>&1 + else + __chezmoi_debug "Listing directories in ." + fi + + local result + _arguments '*:dirname:_files -/'" ${flagPrefix}" + result=$? + if [ -n "$subdir" ]; then + popd >/dev/null 2>&1 + fi + return $result + else + __chezmoi_debug "Calling _describe" + if eval _describe $keepOrder "completions" completions $flagPrefix $noSpace; then + __chezmoi_debug "_describe found some completions" + + # Return the success of having called _describe + return 0 + else + __chezmoi_debug "_describe did not find completions." + __chezmoi_debug "Checking if we should do file completion." + if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then + __chezmoi_debug "deactivating file completion" + + # We must return an error code here to let zsh know that there were no + # completions found by _describe; this is what will trigger other + # matching algorithms to attempt to find completions. + # For example zsh can match letters in the middle of words. + return 1 + else + # Perform file completion + __chezmoi_debug "Activating file completion" + + # We must return the result of this command, so it must be the + # last command, or else we must store its result to return it. + _arguments '*:filename:_files'" ${flagPrefix}" + fi + fi + fi +} + +# don't run the completion function when being source-ed or eval-ed +if [ "$funcstack[1]" = "_chezmoi" ]; then + _chezmoi +fi diff --git a/dot_config/zsh/completions/_orb b/dot_config/zsh/completions/_orb new file mode 100644 index 0000000..bc03559 --- /dev/null +++ b/dot_config/zsh/completions/_orb @@ -0,0 +1,205 @@ +#compdef orb + +# zsh completion for orb -*- shell-script -*- + +__orb_debug() +{ + local file="$BASH_COMP_DEBUG_FILE" + if [[ -n ${file} ]]; then + echo "$*" >> "${file}" + fi +} + +_orb() +{ + local shellCompDirectiveError=1 + local shellCompDirectiveNoSpace=2 + local shellCompDirectiveNoFileComp=4 + local shellCompDirectiveFilterFileExt=8 + local shellCompDirectiveFilterDirs=16 + + local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace + local -a completions + + __orb_debug "\n========= starting completion logic ==========" + __orb_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}" + + # The user could have moved the cursor backwards on the command-line. + # We need to trigger completion from the $CURRENT location, so we need + # to truncate the command-line ($words) up to the $CURRENT location. + # (We cannot use $CURSOR as its value does not work when a command is an alias.) + words=("${=words[1,CURRENT]}") + __orb_debug "Truncated words[*]: ${words[*]}," + + lastParam=${words[-1]} + lastChar=${lastParam[-1]} + __orb_debug "lastParam: ${lastParam}, lastChar: ${lastChar}" + + # For zsh, when completing a flag with an = (e.g., orb -n=) + # completions must be prefixed with the flag + setopt local_options BASH_REMATCH + if [[ "${lastParam}" =~ '-.*=' ]]; then + # We are dealing with a flag with an = + flagPrefix="-P ${BASH_REMATCH}" + fi + + # Prepare the command to obtain completions + requestComp="${words[1]} __complete ${words[2,-1]}" + if [ "${lastChar}" = "" ]; then + # If the last parameter is complete (there is a space following it) + # We add an extra empty parameter so we can indicate this to the go completion code. + __orb_debug "Adding extra empty parameter" + requestComp="${requestComp} \"\"" + fi + + __orb_debug "About to call: eval ${requestComp}" + + # Use eval to handle any environment variables and such + out=$(eval ${requestComp} 2>/dev/null) + __orb_debug "completion output: ${out}" + + # Extract the directive integer following a : from the last line + local lastLine + while IFS='\n' read -r line; do + lastLine=${line} + done < <(printf "%s\n" "${out[@]}") + __orb_debug "last line: ${lastLine}" + + if [ "${lastLine[1]}" = : ]; then + directive=${lastLine[2,-1]} + # Remove the directive including the : and the newline + local suffix + (( suffix=${#lastLine}+2)) + out=${out[1,-$suffix]} + else + # There is no directive specified. Leave $out as is. + __orb_debug "No directive found. Setting do default" + directive=0 + fi + + __orb_debug "directive: ${directive}" + __orb_debug "completions: ${out}" + __orb_debug "flagPrefix: ${flagPrefix}" + + if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then + __orb_debug "Completion received error. Ignoring completions." + return + fi + + local activeHelpMarker="_activeHelp_ " + local endIndex=${#activeHelpMarker} + local startIndex=$((${#activeHelpMarker}+1)) + local hasActiveHelp=0 + while IFS='\n' read -r comp; do + # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker) + if [ "${comp[1,$endIndex]}" = "$activeHelpMarker" ];then + __orb_debug "ActiveHelp found: $comp" + comp="${comp[$startIndex,-1]}" + if [ -n "$comp" ]; then + compadd -x "${comp}" + __orb_debug "ActiveHelp will need delimiter" + hasActiveHelp=1 + fi + + continue + fi + + if [ -n "$comp" ]; then + # If requested, completions are returned with a description. + # The description is preceded by a TAB character. + # For zsh's _describe, we need to use a : instead of a TAB. + # We first need to escape any : as part of the completion itself. + comp=${comp//:/\\:} + + local tab="$(printf '\t')" + comp=${comp//$tab/:} + + __orb_debug "Adding completion: ${comp}" + completions+=${comp} + lastComp=$comp + fi + done < <(printf "%s\n" "${out[@]}") + + # Add a delimiter after the activeHelp statements, but only if: + # - there are completions following the activeHelp statements, or + # - file completion will be performed (so there will be choices after the activeHelp) + if [ $hasActiveHelp -eq 1 ]; then + if [ ${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then + __orb_debug "Adding activeHelp delimiter" + compadd -x "--" + hasActiveHelp=0 + fi + fi + + if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then + __orb_debug "Activating nospace." + noSpace="-S ''" + fi + + if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then + # File extension filtering + local filteringCmd + filteringCmd='_files' + for filter in ${completions[@]}; do + if [ ${filter[1]} != '*' ]; then + # zsh requires a glob pattern to do file filtering + filter="\*.$filter" + fi + filteringCmd+=" -g $filter" + done + filteringCmd+=" ${flagPrefix}" + + __orb_debug "File filtering command: $filteringCmd" + _arguments '*:filename:'"$filteringCmd" + elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then + # File completion for directories only + local subdir + subdir="${completions[1]}" + if [ -n "$subdir" ]; then + __orb_debug "Listing directories in $subdir" + pushd "${subdir}" >/dev/null 2>&1 + else + __orb_debug "Listing directories in ." + fi + + local result + _arguments '*:dirname:_files -/'" ${flagPrefix}" + result=$? + if [ -n "$subdir" ]; then + popd >/dev/null 2>&1 + fi + return $result + else + __orb_debug "Calling _describe" + if eval _describe "completions" completions $flagPrefix $noSpace; then + __orb_debug "_describe found some completions" + + # Return the success of having called _describe + return 0 + else + __orb_debug "_describe did not find completions." + __orb_debug "Checking if we should do file completion." + if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then + __orb_debug "deactivating file completion" + + # We must return an error code here to let zsh know that there were no + # completions found by _describe; this is what will trigger other + # matching algorithms to attempt to find completions. + # For example zsh can match letters in the middle of words. + return 1 + else + # Perform file completion + __orb_debug "Activating file completion" + + # We must return the result of this command, so it must be the + # last command, or else we must store its result to return it. + _arguments '*:filename:_files'" ${flagPrefix}" + fi + fi + fi +} + +# don't run the completion function when being source-ed or eval-ed +if [ "$funcstack[1]" = "_orb" ]; then + _orb +fi diff --git a/dot_config/zsh/completions/_tailscale b/dot_config/zsh/completions/_tailscale new file mode 100644 index 0000000..b833510 --- /dev/null +++ b/dot_config/zsh/completions/_tailscale @@ -0,0 +1,198 @@ +#compdef tailscale +compdef _tailscale tailscale + +# Copyright 2013-2023 The Cobra Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# zsh completion for tailscale -*- shell-script -*- + +__tailscale_debug() +{ + local file="$BASH_COMP_DEBUG_FILE" + if [[ -n ${file} ]]; then + echo "$*" >> "${file}" + fi +} + +_tailscale() +{ + local shellCompDirectiveError=1 + local shellCompDirectiveNoSpace=2 + local shellCompDirectiveNoFileComp=4 + local shellCompDirectiveFilterFileExt=8 + local shellCompDirectiveFilterDirs=16 + local shellCompDirectiveKeepOrder=32 + + local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder + local -a completions + + __tailscale_debug "\n========= starting completion logic ==========" + __tailscale_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}" + + # The user could have moved the cursor backwards on the command-line. + # We need to trigger completion from the $CURRENT location, so we need + # to truncate the command-line ($words) up to the $CURRENT location. + # (We cannot use $CURSOR as its value does not work when a command is an alias.) + words=("${=words[1,CURRENT]}") + __tailscale_debug "Truncated words[*]: ${words[*]}," + + lastParam=${words[-1]} + lastChar=${lastParam[-1]} + __tailscale_debug "lastParam: ${lastParam}, lastChar: ${lastChar}" + + # For zsh, when completing a flag with an = (e.g., tailscale -n=) + # completions must be prefixed with the flag + setopt local_options BASH_REMATCH + if [[ "${lastParam}" =~ '-.*=' ]]; then + # We are dealing with a flag with an = + flagPrefix="-P ${BASH_REMATCH}" + fi + + # Prepare the command to obtain completions + requestComp="${words[1]} completion __complete --descs=true --flags=true -- ${words[2,-1]}" + if [ "${lastChar}" = "" ]; then + # If the last parameter is complete (there is a space following it) + # We add an extra empty parameter so we can indicate this to the go completion code. + __tailscale_debug "Adding extra empty parameter" + requestComp="${requestComp} \"\"" + fi + + __tailscale_debug "About to call: eval ${requestComp}" + + # Use eval to handle any environment variables and such + out=$(eval ${requestComp} 2>/dev/null) + __tailscale_debug "completion output: ${out}" + + # Extract the directive integer following a : from the last line + local lastLine + while IFS='\n' read -r line; do + lastLine=${line} + done < <(printf "%s\n" "${out[@]}") + __tailscale_debug "last line: ${lastLine}" + + if [ "${lastLine[1]}" = : ]; then + directive=${lastLine[2,-1]} + # Remove the directive including the : and the newline + local suffix + (( suffix=${#lastLine}+2)) + out=${out[1,-$suffix]} + else + # There is no directive specified. Leave $out as is. + __tailscale_debug "No directive found. Setting do default" + directive=0 + fi + + __tailscale_debug "directive: ${directive}" + __tailscale_debug "completions: ${out}" + __tailscale_debug "flagPrefix: ${flagPrefix}" + + if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then + __tailscale_debug "Completion received error. Ignoring completions." + return + fi + + while IFS='\n' read -r comp; do + if [ -n "$comp" ]; then + # If requested, completions are returned with a description. + # The description is preceded by a TAB character. + # For zsh's _describe, we need to use a : instead of a TAB. + # We first need to escape any : as part of the completion itself. + comp=${comp//:/\\:} + + local tab="$(printf '\t')" + comp=${comp//$tab/:} + + __tailscale_debug "Adding completion: ${comp}" + completions+=${comp} + lastComp=$comp + fi + done < <(printf "%s\n" "${out[@]}") + + if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then + __tailscale_debug "Activating nospace." + noSpace="-S ''" + fi + + if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then + __tailscale_debug "Activating keep order." + keepOrder="-V" + fi + + if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then + # File extension filtering + local filteringCmd + filteringCmd='_files' + for filter in ${completions[@]}; do + if [ ${filter[1]} != '*' ]; then + # zsh requires a glob pattern to do file filtering + filter="\*.$filter" + fi + filteringCmd+=" -g $filter" + done + filteringCmd+=" ${flagPrefix}" + + __tailscale_debug "File filtering command: $filteringCmd" + _arguments '*:filename:'"$filteringCmd" + elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then + # File completion for directories only + local subdir + subdir="${completions[1]}" + if [ -n "$subdir" ]; then + __tailscale_debug "Listing directories in $subdir" + pushd "${subdir}" >/dev/null 2>&1 + else + __tailscale_debug "Listing directories in ." + fi + + local result + _arguments '*:dirname:_files -/'" ${flagPrefix}" + result=$? + if [ -n "$subdir" ]; then + popd >/dev/null 2>&1 + fi + return $result + else + __tailscale_debug "Calling _describe" + if eval _describe $keepOrder "completions" completions $flagPrefix $noSpace; then + __tailscale_debug "_describe found some completions" + + # Return the success of having called _describe + return 0 + else + __tailscale_debug "_describe did not find completions." + __tailscale_debug "Checking if we should do file completion." + if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then + __tailscale_debug "deactivating file completion" + + # We must return an error code here to let zsh know that there were no + # completions found by _describe; this is what will trigger other + # matching algorithms to attempt to find completions. + # For example zsh can match letters in the middle of words. + return 1 + else + # Perform file completion + __tailscale_debug "Activating file completion" + + # We must return the result of this command, so it must be the + # last command, or else we must store its result to return it. + _arguments '*:filename:_files'" ${flagPrefix}" + fi + fi + fi +} + +# don't run the completion function when being source-ed or eval-ed +if [ "$funcstack[1]" = "_tailscale" ]; then + _tailscale +fi diff --git a/dot_gitconfig.tmpl b/dot_gitconfig.tmpl new file mode 100644 index 0000000..8510793 --- /dev/null +++ b/dot_gitconfig.tmpl @@ -0,0 +1,61 @@ +[core] + editor = code --wait + ignorecase = false +{{ if eq .chezmoi.os "windows" }} + sshCommand = C:/Windows/System32/OpenSSH/ssh.exe +{{ end }} + +[diff] + tool = vscode + +[difftool "vscode"] + cmd = code --wait --diff $LOCAL $REMOTE + +[merge] + tool = vscode + +[mergetool "vscode"] + cmd = code --wait $MERGED + +[user] + name = Tyler Nguyen + email = human@tylernguyen.email + +[includeIf "gitdir:src/tylernguyen@GitHub/"] + path = ./.tylernguyen@GitHub/.gitconfig + +[includeIf "gitdir:src/tylernguyen.codes/"] + path = ./.tylernguyen.codes/.gitconfig + +[gpg] + format = ssh +{{ if eq .chezmoi.os "windows" }} + program = c:\\Program Files (x86)\\GnuPG\\bin\\gpg.exe +{{ end }} + +[gpg "ssh"] +{{ if eq .chezmoi.os "windows" }} + program = "C:/Program Files/1Password/app/8/op-ssh-sign.exe" +{{ end }} +{{ if eq .chezmoi.os "darwin" }} + program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign +{{ end }} +{{ if eq .chezmoi.os "linux" }} + program = "/opt/1Password/op-ssh-sign" +{{ end }} + +[commit] + gpgSign = true + +[tag] + gpgSign = true + forceSignAnnotated = true + +[init] + defaultBranch = main + +[alias] + last = log -1 HEAD --stat + +[pull] + rebase = true diff --git a/dot_gitignore.tmpl b/dot_gitignore.tmpl new file mode 100644 index 0000000..575b057 --- /dev/null +++ b/dot_gitignore.tmpl @@ -0,0 +1,30 @@ +{{ if eq .chezmoi.os "darwin" }} +# Folder view configuration files +.DS_Store + +# Thumbnail cache files +._* + +# Files that might appear on external disks +.Spotlight-V100 +.Trashes +{{ end }} + +{{ if eq .chezmoi.os "linux" }} +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* +{{ end }} + +{{ if eq .chezmoi.os "windows" }} +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Folder view configuration files +[Dd]esktop.ini +{{ end }} diff --git a/dot_p10k.zsh b/dot_p10k.zsh new file mode 100644 index 0000000..fc692ec --- /dev/null +++ b/dot_p10k.zsh @@ -0,0 +1,197 @@ +# Generated by Powerlevel10k configuration wizard on 2024-05-30 at 19:20 CDT. +# Based on romkatv/powerlevel10k/config/p10k-pure.zsh, checksum 7533. +# Wizard options: nerdfont-v3 + powerline, small icons, pure, snazzy, rprompt, 12h time, +# 1 line, sparse, transient_prompt, instant_prompt=verbose. +# Type `p10k configure` to generate another config. +# +# Config file for Powerlevel10k with the style of Pure (https://github.com/sindresorhus/pure). +# +# Differences from Pure: +# +# - Git: +# - `@c4d3ec2c` instead of something like `v1.4.0~11` when in detached HEAD state. +# - No automatic `git fetch` (the same as in Pure with `PURE_GIT_PULL=0`). +# +# Apart from the differences listed above, the replication of Pure prompt is exact. This includes +# even the questionable parts. For example, just like in Pure, there is no indication of Git status +# being stale; prompt symbol is the same in command, visual and overwrite vi modes; when prompt +# doesn't fit on one line, it wraps around with no attempt to shorten it. +# +# If you like the general style of Pure but not particularly attached to all its quirks, type +# `p10k configure` and pick "Lean" style. This will give you slick minimalist prompt while taking +# advantage of Powerlevel10k features that aren't present in Pure. + +# Temporarily change options. +'builtin' 'local' '-a' 'p10k_config_opts' +[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') +[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') +[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') +'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' + +() { + emulate -L zsh -o extended_glob + + # Unset all configuration options. + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' + + # Zsh >= 5.1 is required. + [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return + + # Prompt colors. + # ANCHOR Solarized colors. + local grey='242' + local white='#F1F1F0' + local red='#dc322f' + local yellow='#b58900' + local blue='#268bd2' + local magenta='#d33682' + local cyan='#2aa198' + local green='#859900' + local violet='#6c71c4' + local orange='#cb4b16' + + # Left prompt segments. + typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( + # context # user@host + dir # current directory + vcs # git status + # command_execution_time # previous command duration + # virtualenv # python virtual environment + prompt_char # prompt symbol + ) + + # Right prompt segments. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( + command_execution_time # previous command duration + virtualenv # python virtual environment + context # user@host + time # current time + ) + + # Basic style options that define the overall prompt look. + typeset -g POWERLEVEL9K_BACKGROUND= # transparent background + typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace + typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space + typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol + typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION= # no segment icons + + # Add an empty line before each prompt except the first. This doesn't emulate the bug + # in Pure that makes prompt drift down whenever you use the Alt-C binding from fzf or similar. + typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true + + # Magenta prompt symbol if the last command succeeded. + typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS}_FOREGROUND=$green + # Red prompt symbol if the last command failed. + typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS}_FOREGROUND=$red + # Default prompt symbol. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' + # Prompt symbol in command vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' + # Prompt symbol in visual vi mode is the same as in command mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='❮' + # Prompt symbol in overwrite vi mode is the same as in command mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=false + + # Grey Python Virtual Environment. + typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=$grey + # Don't show Python version. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false + typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= + + # Blue current directory. + typeset -g POWERLEVEL9K_DIR_FOREGROUND=$blue + + # Context format when root: user@host. The first part white, the rest grey. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE="%F{$white}%n%f%F{$grey}@%m%f" + # Context format when not root: user@host. The whole thing grey. + typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE="%F{$grey}%n@%m%f" + # Don't show context unless root or in SSH. + typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_CONTENT_EXPANSION= + + # Show previous command duration only if it's >= 5s. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=5 + # Don't show fractional seconds. Thus, 7s rather than 7.3s. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 + # Duration format: 1d 2h 3m 4s. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' + # Yellow previous command duration. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=$yellow + + # Grey Git prompt. This makes stale prompts indistinguishable from up-to-date ones. + typeset -g POWERLEVEL9K_VCS_FOREGROUND=$grey + + # Disable async loading indicator to make directories that aren't Git repositories + # indistinguishable from large Git repositories without known state. + typeset -g POWERLEVEL9K_VCS_LOADING_TEXT= + + # Don't wait for Git status even for a millisecond, so that prompt always updates + # asynchronously when Git state changes. + typeset -g POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS=0 + + # Cyan ahead/behind arrows. + typeset -g POWERLEVEL9K_VCS_{INCOMING,OUTGOING}_CHANGESFORMAT_FOREGROUND=$cyan + # Don't show remote branch, current tag or stashes. + typeset -g POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind) + # Don't show the branch icon. + typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= + # When in detached HEAD state, show @commit where branch normally goes. + typeset -g POWERLEVEL9K_VCS_COMMIT_ICON='@' + # Don't show staged, unstaged, untracked indicators. + typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED}_ICON= + # Show '*' when there are staged, unstaged or untracked files. + typeset -g POWERLEVEL9K_VCS_DIRTY_ICON='*' + # Show '⇣' if local branch is behind remote. + typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON=':⇣' + # Show '⇡' if local branch is ahead of remote. + typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON=':⇡' + # Don't show the number of commits next to the ahead/behind arrows. + typeset -g POWERLEVEL9K_VCS_{COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=1 + # Remove space between '⇣' and '⇡' and all trailing spaces. + typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${${${P9K_CONTENT/⇣* :⇡/⇣⇡}// }//:/ }' + + # Grey current time. + typeset -g POWERLEVEL9K_TIME_FOREGROUND=$green + # Format for the current time: 09:51:02. See `man 3 strftime`. + typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%I:%M:%S %p}' + # If set to true, time will update when you hit enter. This way prompts for the past + # commands will contain the start times of their commands rather than the end times of + # their preceding commands. + typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false + + # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt + # when accepting a command line. Supported values: + # + # - off: Don't change prompt when accepting a command line. + # - always: Trim down prompt when accepting a command line. + # - same-dir: Trim down prompt when accepting a command line unless this is the first command + # typed after changing current working directory. + typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always + + # Instant prompt mode. + # + # - off: Disable instant prompt. Choose this if you've tried instant prompt and found + # it incompatible with your zsh configuration files. + # - quiet: Enable instant prompt and don't print warnings when detecting console output + # during zsh initialization. Choose this if you've read and understood + # https://github.com/romkatv/powerlevel10k#instant-prompt. + # - verbose: Enable instant prompt and print a warning when detecting console output during + # zsh initialization. Choose this if you've never tried instant prompt, haven't + # seen the warning, or if you are unsure what this all means. + typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose + + # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. + # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload + # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you + # really need it. + typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true + + # If p10k is already loaded, reload configuration. + # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. + (( ! $+functions[p10k] )) || p10k reload +} + +# Tell `p10k configure` which file it should overwrite. +typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} + +(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} +'builtin' 'unset' 'p10k_config_opts' diff --git a/dot_tylernguyen.codes.gitconfig.tmpl b/dot_tylernguyen.codes.gitconfig.tmpl new file mode 100644 index 0000000..c351ee2 --- /dev/null +++ b/dot_tylernguyen.codes.gitconfig.tmpl @@ -0,0 +1,2 @@ +[user] + signingkey = {{ onepasswordRead "op://Private/Gitea Signing Key/public key" }} diff --git a/dot_tylernguyen@GitHub.gitconfig.tmpl b/dot_tylernguyen@GitHub.gitconfig.tmpl new file mode 100644 index 0000000..1e11e20 --- /dev/null +++ b/dot_tylernguyen@GitHub.gitconfig.tmpl @@ -0,0 +1,2 @@ +[user] + signingkey = {{ onepasswordRead "op://Private/GitHub Signing Key/public key" }} diff --git a/dot_zprofile b/dot_zprofile new file mode 100644 index 0000000..c9e3e46 --- /dev/null +++ b/dot_zprofile @@ -0,0 +1,5 @@ + +eval "$(/opt/homebrew/bin/brew shellenv)" + +# Added by OrbStack: command-line tools and integration +source ~/.orbstack/shell/init.zsh 2>/dev/null || : diff --git a/dot_zshenv b/dot_zshenv new file mode 100644 index 0000000..e515f7d --- /dev/null +++ b/dot_zshenv @@ -0,0 +1,7 @@ +export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS' + --color=fg:-1,fg+:#839496,bg:-1,bg+:#073642 + --color=hl:#268bd2,hl+:#2aa198,info:#afaf87,marker:#859900 + --color=prompt:#cb4b16,spinner:#6c71c4,pointer:#6c71c4,header:#87afaf + --color=border:#839496,label:#aeaeae,query:#d9d9d9 + --preview-window="border-rounded" --prompt="» " + --marker=">" --pointer="◆" --separator="─" --scrollbar="│"' diff --git a/private_dot_gnupg/private_gpg-agent.conf.tmpl b/private_dot_gnupg/private_gpg-agent.conf.tmpl new file mode 100644 index 0000000..3ef1f60 --- /dev/null +++ b/private_dot_gnupg/private_gpg-agent.conf.tmpl @@ -0,0 +1,8 @@ +# LINK https://github.com/drduh/config/blob/master/gpg-agent.conf + +default-cache-ttl 60 +max-cache-ttl 120 + +{{ if eq .chezmoi.os "darwin" }} +pinentry-program /usr/local/bin/pinentry-mac +{{ end }} diff --git a/private_dot_ssh/authorized_keys.tmpl b/private_dot_ssh/authorized_keys.tmpl new file mode 100644 index 0000000..6f71ee3 --- /dev/null +++ b/private_dot_ssh/authorized_keys.tmpl @@ -0,0 +1,3 @@ +{{ range gitHubKeys "$GITHUB_USERNAME" -}} +{{ .Key }} +{{ end -}} diff --git a/private_dot_ssh/config.tmpl b/private_dot_ssh/config.tmpl new file mode 100644 index 0000000..f7a0dd8 --- /dev/null +++ b/private_dot_ssh/config.tmpl @@ -0,0 +1,18 @@ +{{ if eq .chezmoi.os "darwin" }} +Host {{ onepasswordRead "op://Secrets/Gitea/Secrets/Forward SSH Domain" }} + ProxyCommand /usr/local/bin/cloudflared access ssh --hostname %h +Host * + IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock" +{{ end }} + +{{ if eq .chezmoi.os "linux" }} +Host * + IdentityAgent ~/.1password/agent.sock +{{ end }} + +Host {{ onepasswordRead "op://Secrets/Hammerhead/Secrets/Local Static Address" }} + Port {{ onepasswordRead "op://Secrets/Gitea/Secrets/Local SSH Port" }} +{{ if eq .chezmoi.os "windows" }} +Host {{ onepasswordRead "op://Secrets/Gitea/Secrets/Forward SSH Domain" }} + ProxyCommand cloudflared access ssh --hostname %h +{{ end }} diff --git a/private_dot_zimrc b/private_dot_zimrc new file mode 100644 index 0000000..7c7084e --- /dev/null +++ b/private_dot_zimrc @@ -0,0 +1,30 @@ +# ALERT `zimfw install/uninstall` after modifications. + +# MODULES + +zmodule environment # Sets sane Zsh built-in environment options. +zmodule input # Applies correct bindkeys for input events. +zmodule termtitle # Sets a custom terminal title. +zmodule utility # Utility aliases and functions. Adds colour to ls, grep and less. + +# PROMPT + +zmodule romkatv/powerlevel10k --use degit + +# COMPLETION + +#zmodule zsh-users/zsh-completions --fpath src # Additional completion definitions for Zsh. + +# NOTE Completion must be sourced after all modules that add completion definitions. +zmodule completion # Enables and configures smart and extensive tab completion. + +zmodule Aloxaf/fzf-tab #Replace zsh's default completion selection menu with fzf + +# Modules that must be initialized last + +# NOTE zsh-users/zsh-history-substring-search must be sourced after zsh-users/zsh-syntax-highlighting +#zmodule zsh-users/zsh-history-substring-search # Fish-like history search (up arrow) for Zsh. +zmodule zsh-users/zsh-autosuggestions # Fish-like autosuggestions for Zsh. +# zsh-users/zsh-syntax-highlighting must be sourced after completion +# LINK https://github.com/zsh-users/zsh-syntax-highlighting#why-must-zsh-syntax-highlightingzsh-be-sourced-at-the-end-of-the-zshrc-file +zmodule zsh-users/zsh-syntax-highlighting # Fish-like syntax highlighting for Zsh. diff --git a/private_dot_zshrc b/private_dot_zshrc new file mode 100644 index 0000000..7741c57 --- /dev/null +++ b/private_dot_zshrc @@ -0,0 +1,131 @@ +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. +# Initialization code that may require console input (password prompts, [y/n] +# confirmations, etc.) must go above this block; everything else may go below. +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + +# User configuration sourced by interactive shells + +# ANCHOR Zsh configuration + +# History + +HISTSIZE=100000 +SAVEHIST=100000 +HISTORY_IGNORE="(ls|pwd|clear|exit)*" +HIST_STAMPS="yyyy-mm-dd" + +setopt SHARE_HISTORY # Share history between all sessions. +setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again. +setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate. +setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file. +setopt HIST_IGNORE_SPACE # Do not record an event starting with a space. + +# Input/output + +# Set editor default keymap to emacs (`-e`) or vi (`-v`) +bindkey -e + +# Prompt for spelling correction of commands. +#setopt CORRECT + +# Customize spelling correction prompt. +#SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? ' + +# Remove path separator from WORDCHARS. +WORDCHARS=${WORDCHARS//[\/]} + + +# Function paths configuration + +fpath=(~/.config/zsh/completions $fpath) + +# ANCHOR Zim configuration + +# Use degit instead of git as the default tool to install and update modules. +#zstyle ':zim:zmodule' use 'degit' + +# ANCHOR Module configuration + +# git + +# Set a custom prefix for the generated aliases. The default prefix is 'G'. +#zstyle ':zim:git' aliases-prefix 'g' + +# input + +# Append `../` to your input for each `.` you type after an initial `..` +#zstyle ':zim:input' double-dot-expand yes + +# termtitle + +# Set a custom terminal title format using prompt expansion escape sequences. +# See http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes +# If none is provided, the default '%n@%m: %~' is used. +zstyle ':zim:termtitle' format '%1~' + +# zsh-autosuggestions + +# Disable automatic widget re-binding on each precmd. This can be set when +# zsh-users/zsh-autosuggestions is the last module in your ~/.zimrc. +ZSH_AUTOSUGGEST_MANUAL_REBIND=1 + +# Customize the style that the suggestions are shown with. +# See https://github.com/zsh-users/zsh-autosuggestions/blob/master/README.md#suggestion-highlight-style +#ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=242' + +# zsh-syntax-highlighting + +# Set what highlighters will be used. +# See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md +ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets) + +# Customize the main highlighter styles. +# See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/main.md#how-to-tweak-it +#typeset -A ZSH_HIGHLIGHT_STYLES +#ZSH_HIGHLIGHT_STYLES[comment]='fg=242' + +# ANCHOR Initialize modules + +ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim +# Download zimfw plugin manager if missing. +if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then + if (( ${+commands[curl]} )); then + curl -fsSL --create-dirs -o ${ZIM_HOME}/zimfw.zsh \ + https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh + else + mkdir -p ${ZIM_HOME} && wget -nv -O ${ZIM_HOME}/zimfw.zsh \ + https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh + fi +fi +# Install missing modules, and update ${ZIM_HOME}/init.zsh if missing or outdated. +if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZDOTDIR:-${HOME}}/.zimrc ]]; then + source ${ZIM_HOME}/zimfw.zsh init -q +fi +# Initialize modules. +source ${ZIM_HOME}/init.zsh + +# ANCHOR Post-init module configuration + +# zsh-history-substring-search + +#zmodload -F zsh/terminfo +p:terminfo +# Bind ^[[A/^[[B manually so up/down works both before and after zle-line-init +#for key ('^[[A' '^P' ${terminfo[kcuu1]}) bindkey ${key} history-substring-search-up +#for key ('^[[B' '^N' ${terminfo[kcud1]}) bindkey ${key} history-substring-search-down +#for key ('k') bindkey -M vicmd ${key} history-substring-search-up +#for key ('j') bindkey -M vicmd ${key} history-substring-search-down +#unset key + +# Init fzf +source <(fzf --zsh) + +# Configure fzf-tab +# NOTE preview directory's content with eza when completing cd +zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls -1 --color=always $realpath' + +eval "$(atuin init zsh --disable-up-arrow)" + +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh