mirror of
https://github.com/freitass/todo.txt-vim.git
synced 2025-11-16 05:43:47 -05:00
Merge branch 'dev-add-priority' of https://github.com/ha17/todo.txt-vim into ha17-dev-add-priority
This commit is contained in:
@@ -14,9 +14,15 @@ mappings, to help with editing these files:
|
|||||||
|
|
||||||
`<leader>-s@` : Sort the file on @Contexts
|
`<leader>-s@` : Sort the file on @Contexts
|
||||||
|
|
||||||
`<leader>-j` : Lower the priority (cursor must by on priority)
|
`<leader>-j` : Lower the priority of the current line
|
||||||
|
|
||||||
`<leader>-k` : Increase the priority (cursor must by on priority)
|
`<leader>-k` : Increase the priority of the current line
|
||||||
|
|
||||||
|
`<leader>-a` : Add the priority (A) to the current line
|
||||||
|
|
||||||
|
`<leader>-c` : Add the priority (B) to the current line
|
||||||
|
|
||||||
|
`<leader>-b` : Add the priority (C) to the current line
|
||||||
|
|
||||||
`<leader>-d` : Insert the current date
|
`<leader>-d` : Insert the current date
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,15 @@ function! TodoTxtPrioritizeDecrease()
|
|||||||
function! TodoTxtPrioritizeDecrease()
|
function! TodoTxtPrioritizeDecrease()
|
||||||
normal! 0f)h
|
normal! 0f)h
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! TodoTxtPrioritizeAdd (priority)
|
||||||
|
" Need to figure out how to only do this if the first visible letter in a line is not (
|
||||||
|
:call TodoTxtPrioritizeAddAction(a:priority)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! TodoTxtPrioritizeAddAction (priority)
|
||||||
|
execute "normal! mq0i(".a:priority.") \<esc>`q"
|
||||||
|
endfunction
|
||||||
|
|
||||||
if !hasmapto("<leader>j",'n')
|
if !hasmapto("<leader>j",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>j :call TodoTxtPrioritizeIncrease()<CR>
|
nnoremap <script> <silent> <buffer> <leader>j :call TodoTxtPrioritizeIncrease()<CR>
|
||||||
@@ -80,6 +89,30 @@ if !hasmapto("<leader>k",'v')
|
|||||||
if !hasmapto("<leader>k",'v')
|
if !hasmapto("<leader>k",'v')
|
||||||
vnoremap <script> <silent> <buffer> <leader>k :call TodoTxtPrioritizeDecrease()<CR>
|
vnoremap <script> <silent> <buffer> <leader>k :call TodoTxtPrioritizeDecrease()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !hasmapto("<leader>a",'n')
|
||||||
|
nnoremap <script> <silent> <buffer> <leader>a :call TodoTxtPrioritizeAdd('A')<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !hasmapto("<leader>a",'v')
|
||||||
|
vnoremap <script> <silent> <buffer> <leader>a :call TodoTxtPrioritizeAdd('A')<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !hasmapto("<leader>b",'n')
|
||||||
|
nnoremap <script> <silent> <buffer> <leader>b :call TodoTxtPrioritizeAdd('B')<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !hasmapto("<leader>b",'v')
|
||||||
|
vnoremap <script> <silent> <buffer> <leader>b :call TodoTxtPrioritizeAdd('B')<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !hasmapto("<leader>c",'n')
|
||||||
|
nnoremap <script> <silent> <buffer> <leader>c :call TodoTxtPrioritizeAdd('C')<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !hasmapto("<leader>c",'v')
|
||||||
|
vnoremap <script> <silent> <buffer> <leader>c :call TodoTxtPrioritizeAdd('C')<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
" Insert date {{{2
|
" Insert date {{{2
|
||||||
if !hasmapto("date<Tab>",'i')
|
if !hasmapto("date<Tab>",'i')
|
||||||
|
|||||||
Reference in New Issue
Block a user