Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

First commit

  • Loading branch information...
commit 5e01176acd99c9c0557a76024c7cc4267c342292 0 parents
@txus txus authored
22 Readme.md
@@ -0,0 +1,22 @@
+# vim-todo
+
+Easy-peasy todo list manager for VIM!
+
+##Usage
+
+Basically vim-todo works with .todo files and gives them syntax highlighting
+and some special commands. There are two modes: normal and edit.
+
+Normal mode is default. **j** and **k** let you navigate among tasks. **v** marks a
+task as finished and **x** un-finishes it.
+
+When you press **e**, you enter edit mode, and you can navigate the file with vim
+modes normally, so you can add new tasks and change things.
+
+You can find an example.todo file to see how a vim-todo file looks like :)
+
+##Known issues
+* Filetype detect does not work. Workaround: create a todo.vim file in
+ your ~/.vim/ftdetect folder with the following line:
+
+ au BufRead,BufNewFile *.todo,TODO setfiletype todo
18 example.todo
@@ -0,0 +1,18 @@
+= TODO
+
+== 29 Sep 2010
+
+ === Project Foo
+ [v] Do something
+ [ ] Do something else
+
+ === Bar enhancements
+ [v] Call someone
+ [v] Deliver this and that
+ [ ] Call project manager (16.15)
+
+== 30 Sep 2010
+
+ === Project Foo
+ [ ] Deliver project
+ [ ] Set up server
1  ftdetect/todo.vim
@@ -0,0 +1 @@
+au BufRead,BufNewFile *.todo,TODO setfiletype todo
34 ftplugin/todo.vim
@@ -0,0 +1,34 @@
+" Only do this when not done yet for this buffer
+if (exists("b:did_ftplugin"))
+ finish
+endif
+let b:did_ftplugin = 1
+
+" Start in normal mode
+let g:todo_edit = 0
+
+nmap <silent> j $/[<cr>l:noh<cr>
+nmap <silent> k 0?]<cr>h:noh<cr>
+nmap <silent> x r
+nmap <silent> v rv
+
+nmap <silent> e :call TodoEditToggle()<CR>
+
+function! TodoEditToggle()
+ if g:todo_edit
+ let g:todo_edit = 0
+ nmap <silent> j $/[<cr>l:noh<cr>
+ nmap <silent> k 0?]<cr>h:noh<cr>
+ nmap <silent> x r
+ nmap <silent> v rv
+ else
+ let g:todo_edit = 1
+ unmap j
+ unmap k
+ unmap x
+ unmap v
+ endif
+endfunction
+
+" nmap <silent> j $/[<cr>l:noh<cr>
+" nmap <silent> k 0?]<cr>h:noh<cr>
32 syntax/todo.vim
@@ -0,0 +1,32 @@
+" Vim syntax file
+" Language: .todo files
+" Maintainer: Josep M. Bach <josep.m.bachNOSPAN@gmail.com>
+" Last Change: 2010 Sep 29
+
+if exists("b:current_syntax")
+ finish
+endif
+
+syn match DATE "\d\{2}\s\D\+\s\d\{4}"
+syn match TIME "\(\d\d\.\d\d\)"
+
+syn match xProjectTag /===/ nextgroup=xProject skipwhite
+syn match xProject /\D\+/ contained
+
+syn match xOkValue /√/ contained
+
+syn region xOk start=/\[/ end=/\]/ contains=xOkValue
+syn match xEmpty /\[\s\]/
+syn match xTitle /TODO/
+
+hi link xOk Type
+hi link xEmpty Statement
+hi link xTitle Error
+hi link xProject Identifier
+
+hi link DATE Todo
+hi link TIME Special
+
+let b:current_syntax = "todo"
+
+" vim: ts=8 sw=2
Please sign in to comment.
Something went wrong with that request. Please try again.