Add g:TodoTxtUseAbbrevInsertMode to control usage of abbreviations or

mapping in insert mode
This commit is contained in:
Ricky Anderson
2020-01-07 00:39:34 +07:00
parent 2bedaf4672
commit 36fd3b427d

View File

@@ -61,10 +61,17 @@ if !exists("g:Todo_txt_do_not_map") || ! g:Todo_txt_do_not_map
noremap <script> <silent> <buffer> <localleader>c :call todo#PrioritizeAdd('C')<CR>
" Insert date {{{3
if get(g:, "TodoTxtUseAbbrevInsertMode", 0)
inoreabbrev <script> <silent> <buffer> date: <C-R>=strftime("%Y-%m-%d")<CR>
inoreabbrev <script> <silent> <buffer> due: due:<C-R>=strftime("%Y-%m-%d")<CR>
inoreabbrev <script> <silent> <buffer> DUE: DUE:<C-R>=strftime("%Y-%m-%d")<CR>
else
inoremap <script> <silent> <buffer> date<Tab> <C-R>=strftime("%Y-%m-%d")<CR>
inoremap <script> <silent> <buffer> due: due:<C-R>=strftime("%Y-%m-%d")<CR>
inoremap <script> <silent> <buffer> DUE: DUE:<C-R>=strftime("%Y-%m-%d")<CR>
endif
noremap <script> <silent> <buffer> <localleader>d :call todo#PrependDate()<CR>