" Copyright (c) 2016, 2020, 2021 Teddy Wing
"
" Twodo is free software: you can redistribute it and/or modify
" it under the terms of the GNU General Public License as published by
" the Free Software Foundation, either version 3 of the License, or
" (at your option) any later version.
"
" Twodo is distributed in the hope that it will be useful,
" but WITHOUT ANY WARRANTY; without even the implied warranty of
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
" GNU General Public License for more details.
"
" You should have received a copy of the GNU General Public License
" along with Twodo. If not, see .
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
if exists('g:no_plugin_maps') || exists('g:no_todo_maps')
finish
endif
nnoremap TwodoNewTodoBelow o-
nnoremap TwodoNewTodoAbove O-
nnoremap TwodoMarkComplete :call todo#MarkComplete()
nnoremap TwodoMarkDeleted :call todo#MarkDeleted()
nnoremap TwodoMarkPartiallyCompleted :call todo#MarkPartiallyCompleted()
nnoremap TwodoRemoveOldTodos :call todo#RemoveOldTodos()
nnoremap TwodoEscalate :call todo#Escalate()
nnoremap TwodoDescalate :call todo#Descalate()
nnoremap TwodoNextIncomplete :call todo#motion#NextIncomplete()
nnoremap TwodoPreviousIncomplete :call todo#motion#PreviousIncomplete()
onoremap TwodoNextIncomplete :call todo#motion#NextIncomplete()
onoremap TwodoPreviousIncomplete :call todo#motion#PreviousIncomplete()
nnoremap TwodoNextRegular :call todo#motion#NextRegular()
nnoremap TwodoPreviousRegular :call todo#motion#PreviousRegular()
onoremap TwodoNextRegular :call todo#motion#NextRegular()
onoremap TwodoPreviousRegular :call todo#motion#PreviousRegular()
nnoremap TwodoNextImportant :call todo#motion#NextImportant()
nnoremap TwodoPreviousImportant :call todo#motion#PreviousImportant()
onoremap TwodoNextImportant :call todo#motion#NextImportant()
onoremap TwodoPreviousImportant :call todo#motion#PreviousImportant()
if !hasmapto('TwodoNewTodoBelow') && !maparg('n', 'n')
nmap n TwodoNewTodoBelow
endif
if !hasmapto('TwodoNewTodoAbove') && !maparg('N', 'n')
nmap N TwodoNewTodoAbove
endif
if !hasmapto('TwodoMarkComplete') && !maparg('c', 'n')
nmap c TwodoMarkComplete
endif
if !hasmapto('TwodoMarkDeleted') && !maparg('d', 'n')
nmap d TwodoMarkDeleted
endif
if !hasmapto('TwodoMarkPartiallyCompleted') && !maparg('s', 'n')
nmap s TwodoMarkPartiallyCompleted
endif
if !hasmapto('TwodoRemoveOldTodos') && !maparg('R', 'n')
nmap R TwodoRemoveOldTodos
endif
if !hasmapto('TwodoEscalate') && !maparg('=', 'n')
nmap = TwodoEscalate
endif
if !hasmapto('TwodoDescalate') && !maparg('-', 'n')
nmap - TwodoDescalate
endif
if !hasmapto('TwodoNextIncomplete', 'n') && !maparg(']u', 'n')
nmap ]u TwodoNextIncomplete
endif
if !hasmapto('TwodoNextIncomplete', 'o') && !maparg(']u', 'o')
omap ]u TwodoNextIncomplete
endif
if !hasmapto('TwodoPreviousIncomplete', 'n') && !maparg('[u', 'n')
nmap [u TwodoPreviousIncomplete
endif
if !hasmapto('TwodoPreviousIncomplete', 'o') && !maparg('[u', 'o')
omap [u TwodoPreviousIncomplete
endif
if !hasmapto('TwodoNextRegular', 'n') && !maparg(']o', 'n')
nmap ]o TwodoNextRegular
endif
if !hasmapto('TwodoNextRegular', 'o') && !maparg(']o', 'o')
omap ]o TwodoNextRegular
endif
if !hasmapto('TwodoPreviousRegular', 'n') && !maparg('[o', 'n')
nmap [o TwodoPreviousRegular
endif
if !hasmapto('TwodoPreviousRegular', 'o') && !maparg('[o', 'o')
omap [o TwodoPreviousRegular
endif
if !hasmapto('TwodoNextImportant', 'n') && !maparg(']y', 'n')
nmap ]y TwodoNextImportant
endif
if !hasmapto('TwodoNextImportant', 'o') && !maparg(']y', 'o')
omap ]y TwodoNextImportant
endif
if !hasmapto('TwodoPreviousImportant', 'n') && !maparg('[y', 'n')
nmap [y TwodoPreviousImportant
endif
if !hasmapto('TwodoPreviousImportant', 'o') && !maparg('[y', 'o')
omap [y TwodoPreviousImportant
endif