Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 48 additions & 14 deletions home/dot_config/exact_sheldon/plugin_sources/common.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,21 @@ export FZF_DEFAULT_OPTS="--reverse"
#
# Zsh-related Plugins
#
# Keep the zle-critical plugins eager.
# Deferring syntax-highlighting or autopair reintroduced a
# post-prompt input hitch during fresh interactive zsh startup.
# Autosuggestions and completions can stay deferred without
# hurting input readiness.

[plugins.zsh-syntax-highlighting]
github = 'zsh-users/zsh-syntax-highlighting'
# Needs its widgets ready before the first keypress.
apply = ['source']

[plugins.zsh-autopair]
github = 'hlissner/zsh-autopair'
# Wraps the first edit widgets, so keep it eager too.
apply = ['source']

[plugins.zsh-autosuggestions]
github = 'zsh-users/zsh-autosuggestions'
Expand All @@ -71,14 +86,6 @@ apply = ['defer']
github = 'zsh-users/zsh-completions'
apply = ['defer']

[plugins.zsh-syntax-highlighting]
github = 'zsh-users/zsh-syntax-highlighting'
apply = ['defer']

[plugins.zsh-autopair]
github = 'hlissner/zsh-autopair'
apply = ['defer']

[plugins.zsh-history-on-success]
github = 'nyoungstudios/zsh-history-on-success'

Expand Down Expand Up @@ -112,7 +119,35 @@ setopt INC_APPEND_HISTORY
#

[plugins.mise]
inline = 'eval "$(~/.local/bin/mise activate zsh)"'
inline = '''
eval "$(~/.local/bin/mise activate zsh --no-hook-env)"

function _mise_hook() {
eval "$(~/.local/bin/mise hook-env -s zsh)"
}

function _mise_hook_precmd() {
eval "$(~/.local/bin/mise hook-env -s zsh --reason precmd)"
}

function _mise_hook_chpwd() {
eval "$(~/.local/bin/mise hook-env -s zsh --reason chpwd)"
}

typeset -ag precmd_functions
typeset -ag chpwd_functions

if [[ -z "${precmd_functions[(r)_mise_hook_precmd]+1}" ]]; then
precmd_functions=( _mise_hook_precmd ${precmd_functions[@]} )
fi

if [[ -z "${chpwd_functions[(r)_mise_hook_chpwd]+1}" ]]; then
chpwd_functions=( _mise_hook_chpwd ${chpwd_functions[@]} )
fi

_mise_hook
export __MISE_ZSH_PRECMD_RUN=1
'''

#
# Language-related plugins
Expand All @@ -123,14 +158,13 @@ inline = '''
function _lang() {
export LANG='en_US.UTF-8'
}
zsh-defer _lang
_lang
'''

[plugins.go]
inline = '''
function _go() {
export GOPATH="${HOME}/ghq"
export GOROOT=$(go env GOROOT)

typeset -gU path
path=(
Expand All @@ -139,7 +173,7 @@ function _go() {
${HOME}/.go/bin(N-/)
)
}
zsh-defer _go
_go
'''

[plugins.rust]
Expand All @@ -151,7 +185,7 @@ function _rust() {
${HOME}/.cargo/bin(N-/)
)
}
zsh-defer _rust
_rust
'''

[plugins.bun]
Expand Down Expand Up @@ -207,5 +241,5 @@ function _private_dotfiles() {
source "$filepath"
fi
}
zsh-defer _private_dotfiles
_private_dotfiles
'''
2 changes: 1 addition & 1 deletion home/dot_config/exact_sheldon/plugin_sources/server.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function _server_path() {
${HOME}/.local/bin/server(N-/)
)
}
zsh-defer _server_path
_server_path
'''

#
Expand Down
3 changes: 1 addition & 2 deletions home/dot_zprofile
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
eval "$(~/.local/bin/mise activate zsh)"

# mise is initialized from ~/.zshrc via sheldon to avoid duplicate startup work.
Loading