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
From VS Code Marketplace (Coming Soon)
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X
or Cmd+Shift+X
)
- Search for "Todo.txt"
- Click "Install"
From VSIX File
- Download the
.vsix
file from Releases
- Open VS Code
- Press
Ctrl+Shift+P
(Windows/Linux) or Cmd+Shift+P
(Mac)
- Type "Extensions: Install from VSIX"
- Select the downloaded
.vsix
file
Usage
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
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"
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)
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
Support
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
Development Setup
Prerequisites
- Node.js (v16 or later)
- npm
- VS Code
Method 1: Build from Source
Clone the repository:
git clone https://github.com/Bootta11/todotxt-language.git
cd todotxt-vscode
Install dependencies:
npm install
Install VSCE globally (for packaging):
npm install -g vsce
Compile TypeScript:
npm run compile
Package the extension:
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 Mode
Clone and setup (follow steps 1-4 from Method 1)
Open in VS Code:
code .
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
Project Structure
todotxt-extension/
├── package.json # Extension manifest
├── tsconfig.json # TypeScript configuration
├── src/
│ └── extension.ts # Main extension logic
├── syntaxes/
│ └── todotxt.tmLanguage.json # Syntax highlighting rules
├── themes/
│ └── todotxt-theme.json # Color theme
└── language-configuration.json # Language configuration
Making Changes
- Edit syntax rules: Modify
syntaxes/todotxt.tmLanguage.json
- Update colors: Edit
themes/todotxt-theme.json
- Add functionality: Update
src/extension.ts
- Run compilation:
npm run compile
- Test changes: Press
F5
to launch Extension Development Host
Continuous Integration & Deployment
This project uses GitHub Actions to automatically build and publish the extension on new commits to the main branch.
Setup Required Secrets
To enable automatic publishing, you need to add the following secrets to your GitHub repository:
Go to your repository settings: Settings
→ Secrets and variables
→ Actions
Add the following repository secrets:
How it works
- On main branch commits: The extension is automatically published to both marketplaces (requires that version inside package.json is updated)
Manual Publishing
If you prefer to publish manually, you can use the npm scripts:
# Publish to OpenVSX Registry
npm run publish-ovsx
# Publish to VS Code Marketplace
npm run publish-vsix
# Publish to both
npm run publish
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
Made with ❤️ for the todo.txt community