| Crates.io | quickswitch |
| lib.rs | quickswitch |
| version | 0.2.1 |
| created_at | 2025-07-08 03:23:24.562877+00 |
| updated_at | 2025-07-16 07:38:38.944479+00 |
| description | A terminal-based tool for quickly switching between directories and files. |
| homepage | |
| repository | https://github.com/luodeb/quickswitch.git |
| max_upload_size | |
| id | 1742004 |
| size | 1,843,646 |
一个基于 Rust 的快速终端文件浏览器,提供美观的文本用户界面(TUI),让你能够快速浏览和选择文件夹。



可以从 GitHub Releases 页面下载最新的二进制文件。
下载后,解压并将可执行文件移动到系统路径中,例如 /usr/local/bin,或者别的 Path 路径中。
并重命名为 quickswitch,Windows 需要保留 .exe 拓展名
测试安装是否成功:
quickswitch.exe --version
直接使用 Cargo 安装 quickswitch
cargo install quickswitch
git clone https://github.com/luodeb/quickswitch.git
cd quickswitch
cargo build
cargo build --release
编译完成后,可执行文件位于:
target/debug/quickswitchtarget/release/quickswitch# 安装到 ~/.cargo/bin
cargo install --path .
# 或者手动复制到系统路径
sudo cp target/release/quickswitch /usr/local/bin/
为了实现快速目录切换功能,项目提供了 shell 函数包装器。
将以下函数添加到你的
~/.bashrc或~/.zshrc文件中末尾:eval "$(quickswitch --init bash)"绑定按键(可选/推荐)Ctrl + E:
bind '"\C-e": "qs\n"' # 普通模式 bind '"\C-w": "qshs\n"' # 历史模式重新加载配置:
source ~/.bashrc # 或 source ~/.zshrc
将以下函数添加到你的
~/.config/fish/config.fish文件中末尾:quickswitch --init fish | source绑定按键(可选/推荐)Ctrl + E:
bind \ce qs # 普通模式 bind \cw qshs # 历史模式重新加载配置:
source ~/.config/fish/config.fish
将以下函数添加到你的 PowerShell 配置文件(
code $profile)中:Invoke-Expression (& { (quickswitch.exe --init powershell | Out-String) })绑定按键(可选/推荐)Ctrl + E:
Import-Module PSReadLine # 绑定 Ctrl+E 快捷键 # 普通模式 Set-PSReadLineKeyHandler -Key 'Ctrl+e' ` -BriefDescription 'RunMyFunction' ` -ScriptBlock { [Microsoft.PowerShell.PSConsoleReadLine]::RevertLine() [Microsoft.PowerShell.PSConsoleReadLine]::Insert("qs") [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine() } # 历史模式 Set-PSReadLineKeyHandler -Key 'Ctrl+w' ` -BriefDescription 'RunMyFunction' ` -ScriptBlock { [Microsoft.PowerShell.PSConsoleReadLine]::RevertLine() [Microsoft.PowerShell.PSConsoleReadLine]::Insert("qshs") [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine() }重新加载配置:
. $profile
| 快捷键 | 功能 |
|---|---|
↑/↓ j/k |
上下选择文件/文件夹 |
←/→ h/l |
进入父目录/进入选中的目录 |
Enter |
选择当前目录并退出程序 |
Esc |
退出程序 |
/ |
实时搜索过滤 |
v |
切换到历史记录模式 |
Backspace |
删除搜索字符 |
┌─ Search files (ESC to quit, Enter to exit & cd, ←→ navigate, ↑↓ select) ─┐
│ your_search_term │
└──────────────────────────────────────────────────────────────────────────┘
┌─ Files - /current/path (filtered/total) ─┐ ┌─ Preview ─────────────────┐
│ 📁 directory1 │ │ 📁 directory1 │
│ 📁 directory2 │ │ 📄 file1.txt │
│ 📄 file1.txt │ │ 📄 file2.md │
│ 📄 file2.md │ │ ... and 5 more items │
└──────────────────────────────────────────┘ └───────────────────────────┘
主要依赖库:
ratatui: 现代化的 Rust TUI 库crossterm: 跨平台终端操作库anyhow: 错误处理库tokio: 异步运行时Rust 版本过旧
# 更新 Rust
rustup update
依赖下载失败
# 清理并重新构建
cargo clean
cargo build --release
程序无法启动
chmod +x target/release/quickswitch界面显示异常
Shell 函数不工作
欢迎提交 issues 和 pull requests!
# 克隆项目
git clone https://github.com/luodeb/quickswitch.git
cd quickswitch
# 安装开发依赖
cargo build
# 运行测试
cargo test
# 代码格式化
cargo fmt --all --
# 代码检查
cargo clippy
本项目采用 [Apache License] 许可证 - 查看 LICENSE 文件了解详情。