From aa5a702057099c1977228c49f3ae038e7cd1fa53 Mon Sep 17 00:00:00 2001 From: fretep Date: Thu, 19 Apr 2018 21:02:42 +1000 Subject: [PATCH 1/2] Use setlocal for nrformats --- autoload/todo.vim | 4 ---- ftplugin/todo.vim | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/autoload/todo.vim b/autoload/todo.vim index 8b6c928..937c3e0 100644 --- a/autoload/todo.vim +++ b/autoload/todo.vim @@ -29,10 +29,6 @@ function! todo#GetCurpos() return getpos('.') endfunction -" Increment and Decrement The Priority. -" TODO: Make nrformats local to buffers of type todo -:set nf=octal,hex,alpha - function! todo#PrioritizeIncrease() normal! 0f)h endfunction diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index 8eb68fb..ed3d53e 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -16,11 +16,14 @@ set cpo&vim " General options {{{1 " Some options lose their values when window changes. They will be set every -" time this script is invocated, which is whenever a file of this type is +" time this script is invoked, which is whenever a file of this type is " created or edited. setlocal textwidth=0 setlocal wrapmargin=0 +" Increment and decrement the priority use and on alpha +setlocal nrformats+=alpha + " Mappings {{{1 nnoremap TodotxtIncrementDueDateNormal :call ChangeDueDateWrapper(1, "\TodotxtIncrementDueDateNormal") From f23b1c2cac9d2407825ff1cae01ecd1ea93510ff Mon Sep 17 00:00:00 2001 From: fretep Date: Thu, 19 Apr 2018 21:37:53 +1000 Subject: [PATCH 2/2] Update mappings to be more consistent in use of map arguments, and also move the mappings outside of the Todo_txt_do_not_map block --- ftplugin/todo.vim | 101 +++++++++++++++++++++++++--------------------- 1 file changed, 54 insertions(+), 47 deletions(-) diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index ed3d53e..2083426 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -26,74 +26,81 @@ setlocal nrformats+=alpha " Mappings {{{1 -nnoremap TodotxtIncrementDueDateNormal :call ChangeDueDateWrapper(1, "\TodotxtIncrementDueDateNormal") -vnoremap TodotxtIncrementDueDateVisual :call ChangeDueDateWrapper(1, "\TodotxtIncrementDueDateVisual") -nnoremap TodotxtDecrementDueDateNormal :call ChangeDueDateWrapper(-1, "\TodotxtDecrementDueDateNormal") -vnoremap TodotxtDecrementDueDateVisual :call ChangeDueDateWrapper(-1, "\TodotxtDecrementDueDateVisual") +" mappings that users can map alternate keys to {{{2 +" if they choose not to map default keys (or otherwise) +nnoremap