2 |
mdt
3 |
A simple command-line markdown todo list manager inspired by t
4 |

5 |
6 |
7 | Demo GIF using starship prompt, purify theme, JetBrains Mono font, along with NvChad and st
8 |
9 |
10 |
11 |
12 | ## :sparkles: Features
13 |
14 | - Minimal set of functionality designed to finish tasks instead of organizing them.
15 | - Flexible, future-proof markdown file format that you can use to add additional context and notes to your tasks.
16 | - Nice, interactive command-line interface to quickly capture and check tasks.
17 |
18 | ## :package: Dependencies
19 |
20 | - POSIX-compliant shell (dash, bash, zsh etc.)
21 | - [gum](https://github.com/charmbracelet/gum#installation)
22 |
23 | ## :rocket: Installation
24 |
25 | ### Arch Linux
26 |
27 | ```sh
28 | paru -S mdt # or with your AUR helper of choice
29 | ```
30 |
31 | ### macOS (Homebrew)
32 |
33 | ```sh
34 | brew install mdt
35 | ```
36 |
37 | ### Manually with `make`
38 |
39 | ```sh
40 | # Clone the repo
41 | git clone https://github.com/basilioss/mdt
42 |
43 | # Change your current directory to mdt
44 | cd mdt
45 |
46 | # Install
47 | sudo make install
48 |
49 | # Update
50 | git pull
51 | sudo make install
52 |
53 | # Remove
54 | sudo make uninstall
55 | ```
56 |
57 | ### Manually with `curl`
58 |
59 | ```sh
60 | # Download
61 | curl -L https://raw.githubusercontent.com/basilioss/mdt/main/mdt > mdt
62 | # Make it executable
63 | chmod +x mdt
64 | # Move it somewhere in your $PATH
65 | mv mdt ~/.local/bin
66 | ```
67 |
68 | ## :gear: Configuration
69 |
70 | | Option | Environment Variable | Description |
71 | | ------------------ | --------------------- | -------------------------------------------------------------------------------------------------------------------- |
72 | | -d, --dir | MDT_DIR | Path to the tasks directory. By default the current working directory. |
73 | | -i, --inbox | MDT_INBOX | Path to the inbox file. By default "TODO.md". |
74 | | -m, --add-multiple | MDT_ADD_MULTIPLE_TASKS | Add multiple tasks at once. |
75 | | -u, --unite-tasks | MDT_UNITE_TASKS | List all tasks in the file. By default false, if tasks are separated by headings, mdt will prompt you to select one. |
76 | | --color | MDT_MAIN_COLOR | Main color. |
77 | | --prompt | MDT_PROMPT | Input prompt character. Default is '◆'. |
78 | | --cursor | MDT_CURSOR | Selection character. Default is '➔'. |
79 | | --item-width | MDT_ITEM_WIDTH | Todo items width. 0 for no wrap, default is 75. |
80 | | --input-width | MDT_INPUT_WIDTH | Input prompt width. 0 for no wrap, default is 65. |
81 | | --editor | MDT_EDITOR, EDITOR | Markdown file editor. |
82 | | | MDT_CHECKBOX_PREFIX | Prefix of markdown checkboxes `[ ]`/`[x]`. Default is '-'. |
83 |
84 | Examples of using options:
85 |
86 | ```sh
87 | # Static path to the inbox
88 | alias mdt='mdt --dir ~/tasks --inbox ~/tasks/inbox.md'
89 | # Dynamic path to the inbox
90 | alias mdt='mdt --dir ~/tasks --inbox ~/tasks/"$(date -I).md"'
91 | ```
92 |
93 | Examples of using environment variables:
94 |
95 | ```sh
96 | export MDT_MAIN_COLOR='#5FAFFF'
97 | export MDT_EDITOR='nvim -c "set nonumber"'
98 | ```
99 |
100 | ## :keyboard: Keybindings
101 |
102 | | Keybinding | Description |
103 | | ---------------------------- | ------------------- |
104 | | ↓/↑, j/k, Ctrl+j/k, Ctrl+n/p | Move up/down |
105 | | ←/→, g/G | Move top/bottom |
106 | | Tab/Space/x | Select |
107 | | a/A | Select/unselect all |
108 | | Enter | Accept |
109 |
110 |
--------------------------------------------------------------------------------
/mdt:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # https://github.com/basilioss/mdt
3 |
4 | # Configuration ################################
5 |
6 | dir="${MDT_DIR}"
7 | inbox="${MDT_INBOX}"
8 | add_multiple_tasks="${MDT_ADD_MULTIPLE_TASKS:-0}"
9 | unite_tasks="${MDT_UNITE_TASKS:-0}"
10 | display_titles="${MDT_DISPLAY_TITLES:-0}"
11 | todo_filename="${MDT_NEW_FILE_NAMES}"
12 | color="${MDT_MAIN_COLOR:-5}"
13 | prompt="${MDT_PROMPT:-◆}"
14 | cursor="${MDT_CURSOR:-➔}"
15 | item_width="${MDT_ITEM_WIDTH:-75}"
16 | input_width="${MDT_INPUT_WIDTH:-65}"
17 | file_editor="${MDT_EDITOR:-${EDITOR}}"
18 | checkbox_prefix="${MDT_CHECKBOX_PREFIX:--}"
19 |
20 | ################################################
21 |
22 | me="${0##*/}"
23 | mdt_version="1.4.0"
24 |
25 | print_help() {
26 | printf %s "\
27 | ${me} - command-line markdown todo list manager
28 |
29 | Usage
30 | ${me} [-d|--dir