mirror of
https://github.com/Xevion/dotfiles.git
synced 2026-01-31 10:24:12 -06:00
refactor: replace lazy zoxide with eager init and add fd-based directory discovery
- Switch from lazy-loaded z/zi to eager zoxide initialization in config.fish - Alias cd to use zoxide for automatic frecency tracking - Add Alt+D: discover directories from git root/cwd with fd+fzf (no gitignore) - Add Alt+Shift+D: discover directories from HOME with fd+fzf (depth 5)
This commit is contained in:
@@ -1,24 +1,15 @@
|
||||
# Lazy-load zoxide on first use of zi command
|
||||
# Interactive zoxide with fzf (initialization handled in config.fish)
|
||||
function zi --description "zoxide interactive smart cd"
|
||||
# Initialize zoxide only once (shared flag with z.fish)
|
||||
if not set -q __zoxide_initialized
|
||||
set -g __zoxide_initialized 1
|
||||
|
||||
# Configure fzf options for zoxide interactive mode
|
||||
set -gx _ZO_FZF_OPTS '
|
||||
# Configure fzf options for zoxide interactive mode
|
||||
set -gx _ZO_FZF_OPTS '
|
||||
--preview="lsd -1 --color=always --icon=always {2..}"
|
||||
--preview-window=down,30%
|
||||
'
|
||||
|
||||
# Run zoxide init
|
||||
if command -q zoxide
|
||||
zoxide init fish | source
|
||||
else
|
||||
echo "zoxide is not installed" >&2
|
||||
return 1
|
||||
end
|
||||
if command -q zoxide
|
||||
__zoxide_zi $argv
|
||||
else
|
||||
echo "zoxide is not installed" >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
# Execute the actual zi command (defined by zoxide init)
|
||||
__zoxide_zi $argv
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user