Added two new sorting functions and a way to increase/decrease priorities easily
See README for more details: <leader>s@ - sort by @contexts <leader>s+ - sort by +projects <leader>j - decrease priority <leader>k - increase priority
This commit is contained in:
@@ -10,6 +10,14 @@ mappings, to help with edition of these files:
|
|||||||
|
|
||||||
`<leader>-s` : Sort the file
|
`<leader>-s` : Sort the file
|
||||||
|
|
||||||
|
`<leader>-s+` : Sort the file on +Projects
|
||||||
|
|
||||||
|
`<leader>-s@` : Sort the file on @Contexts
|
||||||
|
|
||||||
|
`<leader>-j` : Lower the priority (cursor must by on priority)
|
||||||
|
|
||||||
|
`<leader>-k` : Increase the priority (cursor must by on priority)
|
||||||
|
|
||||||
`<leader>-d` : Insert the current date
|
`<leader>-d` : Insert the current date
|
||||||
|
|
||||||
`date<tab>` : (Insert mode) Insert the current date
|
`date<tab>` : (Insert mode) Insert the current date
|
||||||
|
|||||||
@@ -45,6 +45,47 @@ if !hasmapto("<leader>s",'n')
|
|||||||
if !hasmapto("<leader>s",'n')
|
if !hasmapto("<leader>s",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>s :sort<CR>
|
nnoremap <script> <silent> <buffer> <leader>s :sort<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !hasmapto("<leader>s@",'n')
|
||||||
|
nnoremap <script> <silent> <buffer> <leader>s@ :sort /.\{-}\ze@/ <CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !hasmapto("<leader>s+",'n')
|
||||||
|
nnoremap <script> <silent> <buffer> <leader>s+ :sort /.\{-}\ze+/ <CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Increment and Decrement The Priority
|
||||||
|
:set nf=octal,hex,alpha
|
||||||
|
|
||||||
|
function! TodoTxtPrioritizeIncrease()
|
||||||
|
"normal! 0f)h<C-a>
|
||||||
|
normal! 0f)h
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! TodoTxtPrioritizeDecrease()
|
||||||
|
"normal! 0f)h<C-a>
|
||||||
|
normal! 0f)h
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
if !hasmapto("<leader>j",'n')
|
||||||
|
"nnoremap <script> <silent> <buffer> <leader>j 0f)h<C-a>
|
||||||
|
nnoremap <script> <silent> <buffer> <leader>j :call TodoTxtPrioritizeIncrease()<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !hasmapto("<leader>j",'v')
|
||||||
|
"vnoremap <script> <silent> <buffer> <leader>j 0f)h<C-a>
|
||||||
|
vnoremap <script> <silent> <buffer> <leader>j :call TodoTxtPrioritizeIncrease()<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !hasmapto("<leader>k",'n')
|
||||||
|
"nnoremap <script> <silent> <buffer> <leader>k 0f)h<C-x>
|
||||||
|
nnoremap <script> <silent> <buffer> <leader>k :call TodoTxtPrioritizeDecrease()<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !hasmapto("<leader>k",'v')
|
||||||
|
"vnoremap <script> <silent> <buffer> <leader>k 0f)h<C-x>
|
||||||
|
vnoremap <script> <silent> <buffer> <leader>k :call TodoTxtPrioritizeDecrease()<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