Refactor zsh4humans to foxshell - complete rebrand with new repository integration

This commit is contained in:
Arctic 2025-07-04 11:56:44 -05:00
parent 0610f4aeab
commit 2b6ea4f5a3
7 changed files with 908 additions and 51 deletions

62
.zshrc
View file

@ -2,55 +2,55 @@
# shell customization and configuration (including exported environment
# variables such as PATH) in this file or in files sourced from it.
#
# Documentation: https://github.com/romkatv/zsh4humans/blob/v5/README.md.
# Documentation: https://git.foxdale.tech/Arctic/foxshell/blob/main/README.md.
# Periodic auto-update on Zsh startup: 'ask' or 'no'.
# You can manually run `z4h update` to update everything.
zstyle ':z4h:' auto-update 'no'
# You can manually run `foxshell update` to update everything.
zstyle ':foxshell:' auto-update 'no'
# Ask whether to auto-update this often; has no effect if auto-update is 'no'.
zstyle ':z4h:' auto-update-days '28'
zstyle ':foxshell:' auto-update-days '28'
# Keyboard type: 'mac' or 'pc'.
zstyle ':z4h:bindkey' keyboard 'pc'
zstyle ':foxshell:bindkey' keyboard 'pc'
# Mark up shell's output with semantic information.
zstyle ':z4h:' term-shell-integration 'yes'
zstyle ':foxshell:' term-shell-integration 'yes'
# Right-arrow key accepts one character ('partial-accept') from
# command autosuggestions or the whole thing ('accept')?
zstyle ':z4h:autosuggestions' forward-char 'accept'
zstyle ':foxshell:autosuggestions' forward-char 'accept'
# Recursively traverse directories when TAB-completing files.
zstyle ':z4h:fzf-complete' recurse-dirs 'no'
zstyle ':foxshell:fzf-complete' recurse-dirs 'no'
# Enable direnv to automatically source .envrc files.
zstyle ':z4h:direnv' enable 'no'
zstyle ':foxshell:direnv' enable 'no'
# Show "loading" and "unloading" notifications from direnv.
zstyle ':z4h:direnv:success' notify 'yes'
zstyle ':foxshell:direnv:success' notify 'yes'
# Enable ('yes') or disable ('no') automatic teleportation of z4h over
# Enable ('yes') or disable ('no') automatic teleportation of foxshell over
# SSH when connecting to these hosts.
zstyle ':z4h:ssh:example-hostname1' enable 'yes'
zstyle ':z4h:ssh:*.example-hostname2' enable 'no'
zstyle ':foxshell:ssh:example-hostname1' enable 'yes'
zstyle ':foxshell:ssh:*.example-hostname2' enable 'no'
# The default value if none of the overrides above match the hostname.
zstyle ':z4h:ssh:*' enable 'no'
zstyle ':foxshell:ssh:*' enable 'no'
# Send these files over to the remote host when connecting over SSH to the
# enabled hosts.
zstyle ':z4h:ssh:*' send-extra-files '~/.nanorc' '~/.env.zsh'
zstyle ':foxshell:ssh:*' send-extra-files '~/.nanorc' '~/.env.zsh'
# Clone additional Git repositories from GitHub.
#
# This doesn't do anything apart from cloning the repository and keeping it
# up-to-date. Cloned files can be used after `z4h init`. This is just an
# up-to-date. Cloned files can be used after `foxshell init`. This is just an
# example. If you don't plan to use Oh My Zsh, delete this line.
z4h install ohmyzsh/ohmyzsh || return
foxshell install ohmyzsh/ohmyzsh || return
# Install or update core components (fzf, zsh-autosuggestions, etc.) and
# initialize Zsh. After this point console I/O is unavailable until Zsh
# is fully initialized. Everything that requires user interaction or can
# perform network I/O must be done above. Everything else is best done below.
z4h init || return
foxshell init || return
# Extend PATH.
path=(~/bin $path)
@ -59,25 +59,25 @@ path=(~/bin $path)
export GPG_TTY=$TTY
# Source additional local files if they exist.
z4h source ~/.env.zsh
foxshell source ~/.env.zsh
# Use additional Git repositories pulled in with `z4h install`.
# Use additional Git repositories pulled in with `foxshell install`.
#
# This is just an example that you should delete. It does nothing useful.
z4h source ohmyzsh/ohmyzsh/lib/diagnostics.zsh # source an individual file
z4h load ohmyzsh/ohmyzsh/plugins/emoji-clock # load a plugin
foxshell source ohmyzsh/ohmyzsh/lib/diagnostics.zsh # source an individual file
foxshell load ohmyzsh/ohmyzsh/plugins/emoji-clock # load a plugin
# Define key bindings.
z4h bindkey z4h-backward-kill-word Ctrl+Backspace Ctrl+H
z4h bindkey z4h-backward-kill-zword Ctrl+Alt+Backspace
foxshell bindkey foxshell-backward-kill-word Ctrl+Backspace Ctrl+H
foxshell bindkey foxshell-backward-kill-zword Ctrl+Alt+Backspace
z4h bindkey undo Ctrl+/ Shift+Tab # undo the last command line change
z4h bindkey redo Alt+/ # redo the last undone command line change
foxshell bindkey undo Ctrl+/ Shift+Tab # undo the last command line change
foxshell bindkey redo Alt+/ # redo the last undone command line change
z4h bindkey z4h-cd-back Alt+Left # cd into the previous directory
z4h bindkey z4h-cd-forward Alt+Right # cd into the next directory
z4h bindkey z4h-cd-up Alt+Up # cd into the parent directory
z4h bindkey z4h-cd-down Alt+Down # cd into a child directory
foxshell bindkey foxshell-cd-back Alt+Left # cd into the previous directory
foxshell bindkey foxshell-cd-forward Alt+Right # cd into the next directory
foxshell bindkey foxshell-cd-up Alt+Up # cd into the parent directory
foxshell bindkey foxshell-cd-down Alt+Down # cd into a child directory
# Autoload functions.
autoload -Uz zmv
@ -87,7 +87,7 @@ function md() { [[ $# == 1 ]] && mkdir -p -- "$1" && cd -- "$1" }
compdef _directories md
# Define named directories: ~w <=> Windows home directory on WSL.
[[ -z $z4h_win_home ]] || hash -d w=$z4h_win_home
[[ -z $foxshell_win_home ]] || hash -d w=$foxshell_win_home
# Define aliases.
alias tree='tree -a -I .git'