This repository contains project management scripts
-
projectJump: 这是一个路径跳转工具,主要用于在项目结构中方便地在特定目录之间跳转。支持通过命令行参数来指定跳转的目标路径。
参数:- code:跳转到 code/ 目录
- pipeline:跳转到 code/pipeline/private/ 目录
- src:跳转到 code/src/private/ 目录
- data:跳转到 data/ 目录
- info:跳转到 info/ 目录
- knowledge:跳转到 knowledge/private/ 目录
- result:跳转到 result/ 目录
- root:显示项目的根目录
- base:显示项目根目录的基础名称(即去掉路径的部分,仅显示项目名)
- -fzf:通过 fzf 交互式选择目录 (optional, 默认从root开始遍历,可与code\pipeline\src\data\info\knowledge\result参数组合指定目录选择的起始位置)
- 其他任何参数:返回当前路径(CurrentPath)
使用方法:
- 确保有一个 Git 仓库
git init
这个命令会在当前目录下创建一个新的 .git 目录,表示该目录成为一个 Git 仓库 - 在 Ranger(终端文件管理器)中使用快捷键,配置 ranger 的 rc.conf 文件:
map gc eval from ranger.ext.spawn import spawn; fm.cd(spawn("projectJump code").strip());fm.ui.win.redrawwin()
定义 gc 作为 ranger 里的快捷键,运行projectJump并传入 code 参数,返回 code/ 目录的路径。 - 在 Emacs 的 ranger.el 插件中使用,修改 ranger-go 函数:
('c (string-trim (shell-command-to-string "projectJump code")))
c:绑定 c 按键到跳转命令。最终结果:按 c 时,ranger.el 会跳转到 code/ 目录。 - 在 Shell 终端中使用 alias:
alias gc='cd $(projectJump code)'
定义 gc 为一个快捷键。