4 个版本
0.1.4 | 2023年4月8日 |
---|---|
0.1.3 | 2023年3月31日 |
0.1.1 | 2023年3月27日 |
0.1.0 | 2023年3月23日 |
#19 在 #key-bindings
56 每月下载量
91KB
2.5K SLoC
todui
TUI
功能
此应用允许您处理待办事项时所需的大部分功能
- 创建、编辑和删除任务
- 向任务添加链接
- 向任务添加截止日期
- 添加重复任务
- 向任务添加备注
- 将任务添加到组(例如工作、个人等)
如何使用?
您可以在终端的任何位置运行 TUI,执行 todui
。要使用 CLI,可以首先运行 todui --help
$ todui --help
A CLI and TUI for your todos
Usage: todui <COMMAND>
Commands:
ls Lists all the tasks
add Adds a task to your todos
delete Deletes a task from your todos
complete Marks a task as complete or incomplete
config Sets default configurations
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
例如
$ todui ls --format json --date-filter today
[{"id":108,"name":"LF112 Homework","date":"2023-03-16T23:59:59-04:00","repeats":{"DaysOfWeek":["Sunday","Tuesday","Thursday"]},"group":"School","description":null,"url":"https://google.com","complete":false},{"id":114,"name":"LF112 Async Thursday","date":"2023-03-16T23:59:59-04:00","repeats":"Weekly","group":"School","description":null,"url":"https://google.com","complete":false},{"id":107,"name":"EN221 Recitation","date":"2023-03-16T23:59:59-04:00","repeats":{"DaysOfWeek":["Tuesday","Thursday"]},"group":"School","description":null,"url":"https://google.com","complete":false}]
安装
使用 rusts 包管理器安装 todui。
cargo install todui
依赖项
此工具没有强制依赖项。但是,安装 Nerd Fonts 可以使图标看起来更好。如果您不想这样做,您始终可以使用自己的图标或将它们更改为纯文本,例如 [ ]
表示未完成的任务,以及 [x]
表示完成的任务。
文档
配置
配置文件位于
- Unix:
~/.config/todui/settings.json
- Windows:
C:\Users\<user>\AppData\Roaming\todui\settings.json
您可以使用预构建的命令来更改配置。例如,您可以通过运行以下命令将快捷键更改为 vi
模式:
todui config --mode vi
您还可以通过运行以下命令启用特殊图标:
todui config --icons special
要查看所有配置选项,请运行
todui config help
您还可以通过直接编辑文件来更改默认配置。默认配置如下
todui config --show
{
"date_formats": {
"display_date_format": "%a %b %-d",
"display_datetime_format": "%a %b %-d at %-H:%M",
"input_date_format": "%d-%m-%Y",
"input_date_hint": "DD-MM-YYYY",
"input_datetime_format": "%d-%m-%Y %H:%M",
"input_datetime_hint": "DD-MM-YYYY HH:MM"
},
"show_complete": true,
"current_group": null,
"icons": {
"complete": "[x]",
"incomplete": "[ ]",
"repeats": "[r]"
},
"colors": {
"primary_color": "LightGreen",
"secondary_color": "LightYellow",
"accent_color": "LightBlue"
},
"keybindings": {
"quit": "q",
"down": "Down",
"up": "Up",
"complete_task": "Space",
"toggle_completed_tasks": "h",
"delete_task": "Delete",
"new_task": "n",
"edit_task": "e",
"save_changes": "Enter",
"enter_insert_mode": "i",
"enter_normal_mode": "Esc",
"go_back": "Esc",
"open_link": "Enter",
"next_group": "Right",
"prev_group": "Left"
}
}
有关更多选项,请参阅 文档
快捷键
您可以在配置文件中修改所有快捷键。默认设置已经尽可能模仿 vim 的移动。您可以根据自己的喜好进行修改!
任务列表面板
快捷键 | 描述 |
---|---|
q |
退出应用程序 |
向下 |
向下移动一个任务 |
向上 |
向上移动一个任务 |
空格 |
将任务标记为完成 |
h |
切换隐藏已完成任务 |
d |
永久删除选定的任务 |
n |
打开新任务页面 |
e |
聚焦任务编辑面板 |
回车键 |
如果任务有相关链接,将在您首选的浏览器中打开它 |
向右键 |
选择下一个组 |
向左键 |
选择上一个组 |
编辑/新建任务面板
此面板有两种模式(类似于vim)。当您处于插入模式时,您可以修改字段来编辑或创建任务。当您处于正常模式时,您可以移动到字段,保存任务,后退或退出。
正常模式
快捷键 | 描述 |
---|---|
q |
退出应用程序 |
向下 |
移动到下一个字段 |
向上 |
移动到上一个字段 |
i |
进入插入模式 |
Esc键 |
返回到任务列表面板 |
回车键 |
保存更改或添加新任务 |
插入模式
快捷键 | 描述 |
---|---|
Esc键 |
退出插入模式/返回到正常模式 |
为什么是命令行界面(CLI)?
CLI访问您的待办事项引入了在舒适位置以编程方式修改或显示待办事项的方法。对于开发者来说,这可能意味着在打开终端时显示待办事项,作为通知,甚至是菜单栏。对我来说,菜单栏是我创建这个项目的原因。我曾经使用过Cron应用程序,非常喜欢能够在不打开任何东西的情况下看到当天的事件。因此,我创建了SketchyBar小工具来与我的待办事项交互。
依赖项
~7–19MB
~200K SLoC