From 55e15dce6f0a98cd81e068e58275b0bea8a5c3cb Mon Sep 17 00:00:00 2001 From: Max Schillinger Date: Tue, 11 Nov 2025 20:14:16 +0100 Subject: [PATCH] Add option to not define mappings Add this line to your .vimrc if you don't want this plugin to define any mappings: let g:todo_no_mappings = 1 --- README.markdown | 5 ++++ doc/todo.txt | 9 +++++- ftplugin/todo.vim | 70 ++++++++++++++++++++++++----------------------- 3 files changed, 49 insertions(+), 35 deletions(-) diff --git a/README.markdown b/README.markdown index f70cfdd..fcd149b 100644 --- a/README.markdown +++ b/README.markdown @@ -48,6 +48,11 @@ Mark as done: `X` Mark all tasks as done `D` Move completed tasks to done.txt +If you only want the syntax highlighting but no mappings, +you can add the following line to your .vimrc file: + + let g:todo_no_mappings = 1 + This plugin detects any text file with the name todo.txt or done.txt with an optional prefix that ends in a period (e.g. second.todo.txt, example.done.txt). If you want the help installed, run ":helptags ~/.vim/doc" inside vim after having copied the files. diff --git a/doc/todo.txt b/doc/todo.txt index 83861b2..0cefe86 100644 --- a/doc/todo.txt +++ b/doc/todo.txt @@ -56,7 +56,7 @@ date of creation: > r - replace existing date (default) n - do nothing - *'g:todo_load_python'* + *'g:todo_load_python'* Specify if the plugin should load the python module. Useful if you use Neovim for example or if perhaps you just don't have/want python for vim: > let g:todo_load_python = 1 @@ -64,6 +64,13 @@ for example or if perhaps you just don't have/want python for vim: > 1 - Load (default) 0 - Don't load + *'g:todo_no_mappings'* +Specify if the plugin should skip loading the default key mappings: + let g:todo_no_mappings = 1 +< + 0 - Load mappings (default) + 1 - No mappings + *'g:todo_done_filename'* Specify a custom filename for completed todo entries to be archived to. Useful for compatibility with other todo.txt editors, or as a matter of preference: diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index 548617b..9fe28d2 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -16,45 +16,47 @@ set cpo&vim setlocal textwidth=0 setlocal wrapmargin=0 -" Mappings {{{1 -" Sort tasks {{{2 -nnoremap