mirror of
https://github.com/freitass/todo.txt-vim.git
synced 2025-11-16 13:53:47 -05:00
Fixes #28
This commit is contained in:
@@ -7,33 +7,33 @@
|
|||||||
|
|
||||||
This plugin gives syntax highlighting to [todo.txt](http://todotxt.com/) files. It also defines a few mappings, to help with editing these files:
|
This plugin gives syntax highlighting to [todo.txt](http://todotxt.com/) files. It also defines a few mappings, to help with editing these files:
|
||||||
|
|
||||||
`<leader>-s` : Sort the file
|
`<localleader>-s` : Sort the file
|
||||||
|
|
||||||
`<leader>-s+` : Sort the file on +Projects
|
`<localleader>-s+` : Sort the file on +Projects
|
||||||
|
|
||||||
`<leader>-s@` : Sort the file on @Contexts
|
`<localleader>-s@` : Sort the file on @Contexts
|
||||||
|
|
||||||
`<leader>-sd` : Sort the file on dates
|
`<localleader>-sd` : Sort the file on dates
|
||||||
|
|
||||||
`<leader>-j` : Lower the priority of the current line
|
`<localleader>-j` : Lower the priority of the current line
|
||||||
|
|
||||||
`<leader>-k` : Increase the priority of the current line
|
`<localleader>-k` : Increase the priority of the current line
|
||||||
|
|
||||||
`<leader>-a` : Add the priority (A) to the current line
|
`<localleader>-a` : Add the priority (A) to the current line
|
||||||
|
|
||||||
`<leader>-b` : Add the priority (B) to the current line
|
`<localleader>-b` : Add the priority (B) to the current line
|
||||||
|
|
||||||
`<leader>-c` : Add the priority (C) to the current line
|
`<localleader>-c` : Add the priority (C) to the current line
|
||||||
|
|
||||||
`<leader>-d` : Insert the current date
|
`<localleader>-d` : Insert the current date
|
||||||
|
|
||||||
`date<tab>` : (Insert mode) Insert the current date
|
`date<tab>` : (Insert mode) Insert the current date
|
||||||
|
|
||||||
`<leader>-x` : Mark task as done (inserts current date as completion date)
|
`<localleader>-x` : Mark task as done (inserts current date as completion date)
|
||||||
|
|
||||||
`<leader>-X` : Mark all tasks as completed
|
`<localleader>-X` : Mark all tasks as completed
|
||||||
|
|
||||||
`<leader>-D` : Move completed tasks to done.txt
|
`<localleader>-D` : Move completed tasks to done.txt
|
||||||
|
|
||||||
If you want the help installed, run ":helptags ~/.vim/doc" inside vim after having copied the files.
|
If you want the help installed, run ":helptags ~/.vim/doc" inside vim after having copied the files.
|
||||||
Then you will be able to get the commands help with: :h todo.txt
|
Then you will be able to get the commands help with: :h todo.txt
|
||||||
|
|||||||
28
doc/todo.txt
28
doc/todo.txt
@@ -3,32 +3,32 @@
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
COMMANDS *todo-commands*
|
COMMANDS *todo-commands*
|
||||||
|
|
||||||
`<leader>-s` : Sort the file
|
`<localleader>-s` : Sort the file
|
||||||
|
|
||||||
`<leader>-s+` : Sort the file on +Projects
|
`<localleader>-s+` : Sort the file on +Projects
|
||||||
|
|
||||||
`<leader>-s@` : Sort the file on @Contexts
|
`<localleader>-s@` : Sort the file on @Contexts
|
||||||
|
|
||||||
`<leader>-sd` : Sort the file on dates
|
`<localleader>-sd` : Sort the file on dates
|
||||||
|
|
||||||
`<leader>-j` : Lower the priority of the current line
|
`<localleader>-j` : Lower the priority of the current line
|
||||||
|
|
||||||
`<leader>-k` : Increase the priority of the current line
|
`<localleader>-k` : Increase the priority of the current line
|
||||||
|
|
||||||
`<leader>-a` : Add the priority (A) to the current line
|
`<localleader>-a` : Add the priority (A) to the current line
|
||||||
|
|
||||||
`<leader>-b` : Add the priority (B) to the current line
|
`<localleader>-b` : Add the priority (B) to the current line
|
||||||
|
|
||||||
`<leader>-c` : Add the priority (C) to the current line
|
`<localleader>-c` : Add the priority (C) to the current line
|
||||||
|
|
||||||
`<leader>-d` : Insert the current date
|
`<localleader>-d` : Insert the current date
|
||||||
|
|
||||||
`date<tab>` : (Insert mode) Insert the current date
|
`date<tab>` : (Insert mode) Insert the current date
|
||||||
|
|
||||||
`<leader>-x` : Mark task as done (inserts current date as completion date)
|
`<localleader>-x` : Mark task as done (inserts current date as completion date)
|
||||||
|
|
||||||
`<leader>-X` : Mark all tasks as completed
|
`<localleader>-X` : Mark all tasks as completed
|
||||||
|
|
||||||
`<leader>-D` : Move completed tasks to done.txt
|
`<localleader>-D` : Move completed tasks to done.txt
|
||||||
|
|
||||||
<leader> is \ by default, so <leader>-s means you type \s
|
See :h <localleader> for more information about the commands' prefix.
|
||||||
|
|||||||
@@ -18,77 +18,77 @@ setlocal wrapmargin=0
|
|||||||
|
|
||||||
" Mappings {{{1
|
" Mappings {{{1
|
||||||
" Sort tasks {{{2
|
" Sort tasks {{{2
|
||||||
if !hasmapto("<leader>s",'n')
|
if !hasmapto("<localleader>s",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>s :%sort<CR>
|
nnoremap <script> <silent> <buffer> <localleader>s :%sort<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>s",'v')
|
if !hasmapto("<localleader>s",'v')
|
||||||
vnoremap <script> <silent> <buffer> <leader>s :sort<CR>
|
vnoremap <script> <silent> <buffer> <localleader>s :sort<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>s@",'n')
|
if !hasmapto("<localleader>s@",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>s@ :%call todo#txt#sort_by_context()<CR>
|
nnoremap <script> <silent> <buffer> <localleader>s@ :%call todo#txt#sort_by_context()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>s@",'v')
|
if !hasmapto("<localleader>s@",'v')
|
||||||
vnoremap <script> <silent> <buffer> <leader>s@ :call todo#txt#sort_by_context()<CR>
|
vnoremap <script> <silent> <buffer> <localleader>s@ :call todo#txt#sort_by_context()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>s+",'n')
|
if !hasmapto("<localleader>s+",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>s+ :%call todo#txt#sort_by_project()<CR>
|
nnoremap <script> <silent> <buffer> <localleader>s+ :%call todo#txt#sort_by_project()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>s+",'v')
|
if !hasmapto("<localleader>s+",'v')
|
||||||
vnoremap <script> <silent> <buffer> <leader>s+ :call todo#txt#sort_by_project()<CR>
|
vnoremap <script> <silent> <buffer> <localleader>s+ :call todo#txt#sort_by_project()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>sd",'n')
|
if !hasmapto("<localleader>sd",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>sd :%call todo#txt#sort_by_date()<CR>
|
nnoremap <script> <silent> <buffer> <localleader>sd :%call todo#txt#sort_by_date()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>sd",'v')
|
if !hasmapto("<localleader>sd",'v')
|
||||||
vnoremap <script> <silent> <buffer> <leader>sd :call todo#txt#sort_by_date()<CR>
|
vnoremap <script> <silent> <buffer> <localleader>sd :call todo#txt#sort_by_date()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Change priority {{{2
|
" Change priority {{{2
|
||||||
if !hasmapto("<leader>j",'n')
|
if !hasmapto("<localleader>j",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>j :call todo#txt#prioritize_increase()<CR>
|
nnoremap <script> <silent> <buffer> <localleader>j :call todo#txt#prioritize_increase()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>j",'v')
|
if !hasmapto("<localleader>j",'v')
|
||||||
vnoremap <script> <silent> <buffer> <leader>j :call todo#txt#prioritize_increase()<CR>
|
vnoremap <script> <silent> <buffer> <localleader>j :call todo#txt#prioritize_increase()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>k",'n')
|
if !hasmapto("<localleader>k",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>k :call todo#txt#prioritize_decrease()<CR>
|
nnoremap <script> <silent> <buffer> <localleader>k :call todo#txt#prioritize_decrease()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>k",'v')
|
if !hasmapto("<localleader>k",'v')
|
||||||
vnoremap <script> <silent> <buffer> <leader>k :call todo#txt#prioritize_decrease()<CR>
|
vnoremap <script> <silent> <buffer> <localleader>k :call todo#txt#prioritize_decrease()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>a",'n')
|
if !hasmapto("<localleader>a",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>a :call todo#txt#prioritize_add('A')<CR>
|
nnoremap <script> <silent> <buffer> <localleader>a :call todo#txt#prioritize_add('A')<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>a",'v')
|
if !hasmapto("<localleader>a",'v')
|
||||||
vnoremap <script> <silent> <buffer> <leader>a :call todo#txt#prioritize_add('A')<CR>
|
vnoremap <script> <silent> <buffer> <localleader>a :call todo#txt#prioritize_add('A')<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>b",'n')
|
if !hasmapto("<localleader>b",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>b :call todo#txt#prioritize_add('B')<CR>
|
nnoremap <script> <silent> <buffer> <localleader>b :call todo#txt#prioritize_add('B')<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>b",'v')
|
if !hasmapto("<localleader>b",'v')
|
||||||
vnoremap <script> <silent> <buffer> <leader>b :call todo#txt#prioritize_add('B')<CR>
|
vnoremap <script> <silent> <buffer> <localleader>b :call todo#txt#prioritize_add('B')<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>c",'n')
|
if !hasmapto("<localleader>c",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>c :call todo#txt#prioritize_add('C')<CR>
|
nnoremap <script> <silent> <buffer> <localleader>c :call todo#txt#prioritize_add('C')<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>c",'v')
|
if !hasmapto("<localleader>c",'v')
|
||||||
vnoremap <script> <silent> <buffer> <leader>c :call todo#txt#prioritize_add('C')<CR>
|
vnoremap <script> <silent> <buffer> <localleader>c :call todo#txt#prioritize_add('C')<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Insert date {{{2
|
" Insert date {{{2
|
||||||
@@ -96,31 +96,31 @@ if !hasmapto("date<Tab>",'i')
|
|||||||
inoremap <script> <silent> <buffer> date<Tab> <C-R>=strftime("%Y-%m-%d")<CR>
|
inoremap <script> <silent> <buffer> date<Tab> <C-R>=strftime("%Y-%m-%d")<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>d",'n')
|
if !hasmapto("<localleader>d",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>d :call todo#txt#prepend_date()<CR>
|
nnoremap <script> <silent> <buffer> <localleader>d :call todo#txt#prepend_date()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>d",'v')
|
if !hasmapto("<localleader>d",'v')
|
||||||
vnoremap <script> <silent> <buffer> <leader>d :call todo#txt#prepend_date()<CR>
|
vnoremap <script> <silent> <buffer> <localleader>d :call todo#txt#prepend_date()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Mark done {{{2
|
" Mark done {{{2
|
||||||
if !hasmapto("<leader>x",'n')
|
if !hasmapto("<localleader>x",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>x :call todo#txt#mark_as_done()<CR>
|
nnoremap <script> <silent> <buffer> <localleader>x :call todo#txt#mark_as_done()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>x",'v')
|
if !hasmapto("<localleader>x",'v')
|
||||||
vnoremap <script> <silent> <buffer> <leader>x :call todo#txt#mark_as_done()<CR>
|
vnoremap <script> <silent> <buffer> <localleader>x :call todo#txt#mark_as_done()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Mark all done {{{2
|
" Mark all done {{{2
|
||||||
if !hasmapto("<leader>X",'n')
|
if !hasmapto("<localleader>X",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>X :call todo#txt#mark_all_as_done()<CR>
|
nnoremap <script> <silent> <buffer> <localleader>X :call todo#txt#mark_all_as_done()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Remove completed {{{2
|
" Remove completed {{{2
|
||||||
if !hasmapto("<leader>D",'n')
|
if !hasmapto("<localleader>D",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>D :call todo#txt#remove_completed()<CR>
|
nnoremap <script> <silent> <buffer> <localleader>D :call todo#txt#remove_completed()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Folding {{{1
|
" Folding {{{1
|
||||||
|
|||||||
Reference in New Issue
Block a user