diff --git a/main.ts b/main.ts index 5923a60..911a914 100644 --- a/main.ts +++ b/main.ts @@ -1,4 +1,4 @@ -import { App, Plugin, PluginManifest, TFile, WorkspaceLeaf } from 'obsidian'; +import { App, Plugin, PluginManifest, TFile, WorkspaceLeaf, Editor, MarkdownView } from 'obsidian'; import { VIEW_TYPE_TODO } from './constants'; import { TodoItemView, TodoItemViewProps } from './ui/TodoItemView'; import { TodoItem, TodoItemStatus } from './model/TodoItem'; @@ -24,6 +24,16 @@ export default class TodoPlugin extends Plugin { this.dateFormatter = new DateFormatter(this.settings.dateFormat); this.addSettingTab(new SettingsTab(this.app, this)); + this.addCommand({ + id: 'create-todo-list', + name: '☐ Create', + editorCallback: (editor: Editor) => { + let originVal: string = editor.getValue(); + originVal += '- [ ] '; + editor.setValue(originVal); + }, + }); + this.registerView(VIEW_TYPE_TODO, (leaf: WorkspaceLeaf) => { const todos: TodoItem[] = []; const props = { diff --git a/manifest.json b/manifest.json index d5500a7..d7f9dc5 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "id": "obsidian-plugin-todo", - "name": "Obsidian TODO | Text-based GTD", + "name": "TODO", "version": "0.2.7", "minAppVersion": "0.11.0", "description": "Text-based GTD in Obsidian. Collects all outstanding TODOs from your vault and presents them in lists Today, Scheduled, Inbox and Someday/Maybe.",