Todo.txt VS Code Extension
A VS Code extension that provides syntax highlighting and formatting for todo.txt files.
Features
- 🎨 Syntax Highlighting: Beautiful color coding for different todo.txt elements
- ✅ Completed Tasks: Completed tasks (
x 2024-01-15 Task
) appear in green with strikethrough
- 🎯 Priority Support: Priority levels
(A)
, (B)
, etc. highlighted in red
- 📅 Date Recognition: ISO dates highlighted in purple
- 🏷️ Projects & Contexts: Projects
+project
in blue, contexts @context
in orange
- 💡 Auto-completion: Smart suggestions for priorities, dates, and completion markers
- ⌨️ Commands: Toggle task completion and add priorities
Installation
Method 1: Install from VSIX (Recommended)
Build the extension:
npm install -g vsce
npm install
npm run compile
vsce package
Install in VS Code:
- Open VS Code
- Press
Ctrl+Shift+P
(Windows/Linux) or Cmd+Shift+P
(Mac)
- Type "Extensions: Install from VSIX"
- Select the generated
.vsix
file
Method 2: Development Setup
Clone/create the extension folder
Create the folder structure:
todotxt-extension/
├── package.json
├── tsconfig.json
├── src/
│ └── extension.ts
├── syntaxes/
│ └── todotxt.tmLanguage.json
├── themes/
│ └── todotxt-theme.json
└── language-configuration.json
Copy the provided files into their respective locations
Install dependencies:
npm install
Compile TypeScript:
npm run compile
Test the extension:
- Press
F5
in VS Code to launch Extension Development Host
- Create a new file with
.todo.txt
extension
- Start typing todo.txt formatted content
The extension recognizes the standard todo.txt format:
Basic Tasks
Call Mom
Buy groceries
Completed Tasks (Green + Strikethrough)
x 2024-01-15 Call Mom
x 2024-01-14 Buy groceries
Note: If strikethrough doesn't appear immediately:
- Try reloading VS Code window (
Ctrl+Shift+P
→ "Developer: Reload Window")
- Ensure you're using a compatible theme
- Check that the file is recognized as todo.txt language (bottom-right corner of VS Code)
Priority Tasks (Red + Bold)
(A) Important meeting
(B) Less urgent task
(C) Low priority item
Projects and Contexts
Call Mom +family @home
Buy groceries +household @store
Dates and Key-Value Pairs
2024-01-15 Call Mom +family due:2024-01-16
x 2024-01-14 Buy groceries +household @store
Commands & Shortcuts
Keyboard Shortcuts
- Toggle Task Completion:
Alt+Shift+T
(Windows/Linux) or Cmd+Shift+T
(Mac)
- Toggles
x YYYY-MM-DD
prefix on current line
- Works in reverse: removes completion if already completed
- Move Completed Tasks to done.txt:
Alt+Shift+D
(Windows/Linux) or Cmd+Shift+D
(Mac)
- Finds all completed tasks (lines starting with
x
)
- Moves them to configurable done file (default:
done.txt
) in the same directory
- Creates done file if it doesn't exist
- Removes completed tasks from current file
Command Palette Commands
- Add Priority:
Ctrl+Shift+P
then search "Add Priority"
- Shows quick-pick menu to select priority (A-F)
- Inserts
(A)
format at cursor position
Configuration
The extension is fully configurable through VS Code settings. Access via:
File > Preferences > Settings
(Windows/Linux)
Code > Preferences > Settings
(Mac)
- Search for "todotxt"
Available Settings
{
"todotxt.toggleCompletionKey": "alt+shift+t",
"todotxt.toggleCompletionKeyMac": "cmd+shift+t",
"todotxt.moveCompletedKey": "alt+shift+d",
"todotxt.moveCompletedKeyMac": "cmd+shift+d",
"todotxt.doneFileName": "done.txt",
"todotxt.autoSave": false
}
Setting Descriptions
- toggleCompletionKey: Keyboard shortcut for Windows/Linux (default:
alt+shift+t
)
- toggleCompletionKeyMac: Keyboard shortcut for Mac (default:
cmd+shift+t
)
- moveCompletedKey: Archive shortcut for Windows/Linux (default:
alt+shift+d
)
- moveCompletedKeyMac: Archive shortcut for Mac (default:
cmd+shift+d
)
- doneFileName: Name of archive file (default:
done.txt
)
- autoSave: Automatically save after toggling completion (default:
false
)
Custom Key Bindings
You can override the default shortcuts in your keybindings.json
:
[
{
"key": "ctrl+enter",
"command": "todotxt.toggleCompletion",
"when": "editorTextFocus && resourceExtname == '.todo.txt'"
}
]
Color Scheme
- ✅ Completed tasks: Green with strikethrough
- 🔴 Priorities: Red and bold
- 🔵 Projects (
+project
): Blue and bold
- 🟡 Contexts (
@context
): Orange and italic
- 🟣 Dates: Purple
- 🔷 Key-value pairs: Cyan for keys, green for values
- 💬 Comments (
#comment
): Gray and italic
File Associations
The extension automatically activates for:
.todo.txt
files
.todotxt
files
Troubleshooting
Strikethrough not showing?
- Reload window:
Ctrl+Shift+P
→ "Developer: Reload Window"
- Check language mode: Bottom-right corner should show "Todo.txt"
- Theme compatibility: Some themes may override strikethrough styling
- Manual activation:
Ctrl+Shift+P
→ "Change Language Mode" → "Todo.txt"
Shortcuts not working?
- Check conflicts: Go to
File > Preferences > Keyboard Shortcuts
and search for conflicts
- Customize bindings: Override in settings or keybindings.json
- File context: Shortcuts only work in todo.txt files
Extension not activating?
- File extension: Ensure file ends with
.todo.txt
, .todotxt
, or is named todo.txt
- Reload extension:
Ctrl+Shift+P
→ "Developer: Reload Window"
- Check installation: Extensions panel should show "Todo.txt Language Support" as enabled
Development
To modify the extension:
- Edit the grammar in
syntaxes/todotxt.tmLanguage.json
for syntax rules
- Modify colors in
themes/todotxt-theme.json
for appearance
- Update functionality in
src/extension.ts
for commands and features
- Run
npm run compile
to rebuild
- Press
F5
to test changes
Contributing
We welcome contributions! Here's how you can help:
- Report Issues: Found a bug or have a feature request? Open an issue
- Submit Pull Requests: Fork the repository and submit your improvements
- Share Feedback: Let us know how the extension works for you
Development Setup
- Clone the repository
- Run
npm install
to install dependencies
- Press
F5
in VS Code to launch Extension Development Host
- Make changes and test in the development instance
License
This project is licensed under the MIT License - see the LICENSE file for details.
What this means:
- ✅ Commercial use allowed
- ✅ Modification allowed
- ✅ Distribution allowed
- ✅ Private use allowed
- ❗ License and copyright notice must be included
- ❗ No warranty provided
Support
Made with ❤️ for the todo.txt community