Merge pull request #19 from ha17/dev-sorting-priority-changing

Dev sorting priority changing
This commit is contained in:
Leandro Freitas
2014-10-30 15:42:25 -02:00
2 changed files with 43 additions and 0 deletions

View File

@@ -10,6 +10,14 @@ mappings, to help with edition of these files:
`<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
`date<tab>` : (Insert mode) Insert the current date

View File

@@ -45,6 +45,41 @@ if !hasmapto("<leader>s",'n')
if !hasmapto("<leader>s",'n')
nnoremap <script> <silent> <buffer> <leader>s :sort<CR>
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
endfunction
function! TodoTxtPrioritizeDecrease()
normal! 0f)h
endfunction
if !hasmapto("<leader>j",'n')
nnoremap <script> <silent> <buffer> <leader>j :call TodoTxtPrioritizeIncrease()<CR>
endif
if !hasmapto("<leader>j",'v')
vnoremap <script> <silent> <buffer> <leader>j :call TodoTxtPrioritizeIncrease()<CR>
endif
if !hasmapto("<leader>k",'n')
nnoremap <script> <silent> <buffer> <leader>k :call TodoTxtPrioritizeDecrease()<CR>
endif
if !hasmapto("<leader>k",'v')
vnoremap <script> <silent> <buffer> <leader>k :call TodoTxtPrioritizeDecrease()<CR>
endif
" Insert date {{{2
if !hasmapto("date<Tab>",'i')