装完还要在 .bashrc 或 zshrc 里定义 lk 函数,否则无法 cd 到选中目录;图标显示需先安装 Nerd Fonts 并加 --icons;打开文件依赖 EDITOR 或 WALK_EDITOR 环境变量
终端文件导航器,用方向键或 hjkl 浏览目录,退出时把目标路径交给 cd
在终端里用的文件管理器,用键盘就能浏览目录、快速跳转和操作文件,不用离开命令行。
核心能力
- 按 esc 或 q 退出并把当前目录传给 cd
- 空格切换预览模式,可直接预览图片
- dd 删除文件或目录,按 u 撤销
- 斜杠触发模糊搜索,快速定位文件
- 用 WALK_OPEN_WITH 按扩展名指定打开命令
容易踩的坑
- v1.13.0最新正式版2025-02-19 · 2025-02-19 13:04 UTC
Walk — a terminal file manager.
In this release:
- Fixed: startPath not being set properly by @aymanbagabas in https://github.com/antonmedv/walk/pull/163
- Added syntax highlighting by @aymanbagabas in https://github.com/antonmedv/walk/pull/162
- v1.12.02025-02-09 · 2025-02-09 21:33 UTC
查看更新说明
Walk — a terminal file manager.
In this release:
- Added
WALK_MAIN_COLORenv var to change walk primary color. - Added
WALK_OPEN_WITHenv var to control in which programs open which file type. - Added
WALK_STATUS_BARenv var to be able to configure any status bar you want.
- Added
- v1.11.02025-02-07 · 2025-02-07 15:17 UTC
查看更新说明
Walk — a terminal file manager.
In this release:
- Fixed
--previewmode. - Added
--with-borderflag for preview mode. - Added yank of current file path.
- Added
?key with usage info.
- Fixed
- v1.10.12025-02-07 · 2025-02-07 12:44 UTC
查看更新说明
Walk — a terminal file manager.
In this release:
- Fixed image preview - now images are properly displayed.
- v1.10.02024-06-27 · 2024-06-27 13:11 UTC
查看更新说明
Walk — a terminal file manager.
In this release:
- Bug fixes.
- Files arrangement algorithm improvements.
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
🥾 walk
Walk — a terminal navigator; a cd and ls replacement.
Run lk, navigate using arrows or hjkl. Press, esc to jump to a new location; or ctrl+c to stay.
Install
brew install walk
pkg_add walk
go install github.com/antonmedv/walk@latest
curl https://raw.githubusercontent.com/antonmedv/walk/master/install.sh | sh
Or download prebuild binaries.
Setup
Put the next function into the .bashrc or a similar config:
function lk {
cd "$(walk "$@")"
}
function lk
set loc (walk $argv); and cd $loc;
end
function lk() {
cd $(walk $args)
}
Now use lk command to start walking.
Features
Preview mode
Press Space to toggle preview mode.
Delete file or directory
Press dd to delete file or directory. Press u to undo.
Display icons
Install Nerd Fonts and add --icons flag.
Image preview
No additional setup is required.
Usage
| Key binding | Description |
|---|---|
| arrows, hjkl | Move cursor |
| shift + arrows | Jump to start/end |
| enter | Enter directory |
| backspace | Exit directory |
| space | Toggle preview |
| esc, q | Exit with cd |
| ctrl + c | Exit without cd |
| / | Fuzzy search |
| d, delete | Delete file or dir |
| y | yank current dir |
| . | Hide hidden files |
Configuration
The EDITOR or WALK_EDITOR environment variable used for opening files from
the walk.
export EDITOR=vim
To specify a command to be used to open files per extension, use the WALK_OPEN_WITH environment variable.
export WALK_OPEN_WITH="txt:less -N;go:vim;md:glow -p"
The WALK_REMOVE_CMD environment variable can be used to specify a command to
be used to remove files. This is useful if you want to use a different
command to remove files than the default rm.
export WALK_REMOVE_CMD=trash
Change main color with WALK_MAIN_COLOR environment variable. Available colors
are here.
export WALK_MAIN_COLOR="#0000FF"
Use WALK_STATUS_BAR environment variable to specify a status bar program.
export WALK_STATUS_BAR="Size() + ' ' + Mode()"
Flags
Flags can be used to change the default behavior of the program.
| Flag | Description |
|---|---|
--icons | Show icons |
--dir-only | Show dirs only |
--hide-hidden | Hide hidden files |
--preview | Start with preview mode on |
--with-border | Show border in preview mode |
--fuzzy | Start with fuzzy search on |