Smart file search and insertion for Zsh ✨
Insert file paths from fuzzy search directly into your command line.
zsh-smart-insert is a Zsh plugin that provides interactive widgets to search for files and content using fd
, rg
, and fzf
. It inserts the result directly into your shell with optional command prefixes.
fd
+ fzf
ripgrep
vim
, cat
, less
, code
)bat
fzf
Interactive fuzzy search Link fd
File system search Link rg
Content search engine Link bat
Preview with syntax highlighting Link
git clone https://github.com/lgdevlop/zsh-smart-insert.git ~/.zsh-smart-insert echo "source ~/.zsh-smart-insert/zsh-smart-insert.plugin.zsh" >> ~/.zshrc source ~/.zshrc
zinit light lgdevlop/zsh-smart-insert
antigen bundle lgdevlop/zsh-smart-insertOh My Zsh (manual plugin)
git clone https://github.com/lgdevlop/zsh-smart-insert.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-smart-insert
Then add to your .zshrc
:
plugins=(git zsh-smart-insert)
Reload with:
omz reload # if using Oh My Zsh # or source ~/.zshrc
Alt+f
– Pick files by name with fd
Alt+g
– Search files by name with rg
Alt+s
– Search file content with live reloadEach result is inserted at the cursor with an optional prefix.
Example: Select a file with
vim
as prefix → insertsvim ./my/file.txt
More examples in project-docs/examples.md
You can customize behavior with environment variables:
# Custom prefix options (fzf menu) export ZSH_SMART_INSERT_PREFIXES="nvim:less:code" # Custom directories to ignore in fd/rg export ZSH_SMART_INSERT_IGNOREDIRS=".git/*:node_modules/:dist/:.venv/"Key Action
Alt+f
Fuzzy file picker with preview Alt+g
File name search with rg
Alt+s
Content search with live reload Ctrl+/
Toggle preview in FZF
See project-docs/shortcuts.md
for full reference.
.
├── zsh-smart-insert.plugin.zsh # Plugin entry point
├── functions/ # Reusable Zsh helpers
├── internal/ # ZLE widgets (fzf search)
├── scripts/ # Automation (e.g. release notes)
├── project-docs/ # Docs: shortcuts, examples
├── .github/workflows/ # CI/CD pipelines
├── install.sh # Interactive installer
bat
Contributions are welcome! Open an issue or submit a pull request.
See CONTRIBUTING.md
and CODE_OF_CONDUCT.md
.
MIT — See LICENSE
.
Made with ❤️ by Leonardo Gomes
✨ zsh-smart-insert — Insert smarter, search faster!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4