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
10 changes: 5 additions & 5 deletions shell-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ A powerful ZSH plugin that provides intelligent command transformation, file tag
Before using this plugin, ensure you have the following tools installed:

- **fzf** - Command-line fuzzy finder
- **fd** - Fast file finder (alternative to find)
- **ripgrep (rg)** - Fast file finder and search tool
- **forge** - The Forge CLI tool

### Installation of Prerequisites

```bash
# macOS (using Homebrew)
brew install fzf fd
brew install fzf ripgrep

# Ubuntu/Debian
sudo apt install fzf fd-find
sudo apt install fzf ripgrep

# Arch Linux
sudo pacman -S fzf fd
sudo pacman -S fzf ripgrep
```

## Usage
Expand Down Expand Up @@ -197,7 +197,7 @@ This will check:
- Forge installation and version
- Plugin and theme loading status
- Completions availability
- Dependencies (fzf, fd, bat)
- Dependencies (fzf, ripgrep, bat)
- ZSH plugins (autosuggestions, syntax-highlighting)
- Editor configuration and PATH setup
- Nerd Font support for icons
Expand Down
21 changes: 7 additions & 14 deletions shell-plugin/doctor.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -200,23 +200,16 @@ else
print_result fail "fzf not found" "Required for interactive features. See installation: https://github.com/junegunn/fzf#installation"
fi

# Check for fd/fdfind - used for file discovery
if command -v fd &> /dev/null; then
local fd_version=$(fd --version 2>&1 | awk '{print $2}')
if [[ -n "$fd_version" ]]; then
print_result pass "fd: ${fd_version}"
# Check for ripgrep - used for file discovery
if command -v rg &> /dev/null; then
local rg_version=$(rg --version 2>&1 | head -n1 | awk '{print $2}')
if [[ -n "$rg_version" ]]; then
print_result pass "ripgrep: ${rg_version}"
else
print_result pass "fd: installed"
fi
elif command -v fdfind &> /dev/null; then
local fd_version=$(fdfind --version 2>&1 | awk '{print $2}')
if [[ -n "$fd_version" ]]; then
print_result pass "fdfind: ${fd_version}"
else
print_result pass "fdfind: installed"
print_result pass "ripgrep: installed"
fi
else
print_result warn "fd/fdfind not found" "Enhanced file discovery. See installation: https://github.com/sharkdp/fd#installation"
print_result fail "ripgrep not found" "Required for file discovery. See installation: https://github.com/BurntSushi/ripgrep#installation"
fi

# Check for bat - used for syntax highlighting
Expand Down
3 changes: 2 additions & 1 deletion shell-plugin/lib/completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ function forge-completion() {
$_FORGE_PREVIEW_WINDOW
)

local file_list=$($_FORGE_FD_CMD --type f --type d --hidden --exclude .git)
# List files with rg, then add directories with find (excluding .git)
local file_list=$({ $_FORGE_RG_CMD --files})
if [[ -n "$filter_text" ]]; then
selected=$(echo "$file_list" | _forge_fzf --query "$filter_text" "${fzf_args[@]}")
else
Expand Down
5 changes: 3 additions & 2 deletions shell-plugin/lib/config.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ typeset -h _FORGE_MAX_COMMIT_DIFF="${FORGE_MAX_COMMIT_DIFF:-100000}"
typeset -h _FORGE_DELIMITER='\s\s+'
typeset -h _FORGE_PREVIEW_WINDOW="--preview-window=top:75%:wrap:border-sharp"

# Detect fd command - Ubuntu/Debian use 'fdfind', others use 'fd'
typeset -h _FORGE_FD_CMD="$(command -v fdfind 2>/dev/null || command -v fd 2>/dev/null || echo 'fd')"
# Use ripgrep for file discovery
typeset -h _FORGE_RG_CMD="$(command -v rg 2>/dev/null || echo 'rg')"
# typeset -h _FORGE_FD_CMD="$(command -v fdfind 2>/dev/null || command -v fd 2>/dev/null || echo 'fd')"

# Detect bat command - use bat if available, otherwise fall back to cat
if command -v bat &>/dev/null; then
Expand Down
Loading