Compare commits

...

2 Commits

Author SHA1 Message Date
gechandesu
ad8ef2798d
Update todolist.vim 2021-09-02 07:50:28 +03:00
gechandesu
c7d24bcbb0
Update README.md 2021-09-02 07:49:52 +03:00
2 changed files with 19 additions and 16 deletions

View File

@ -1,22 +1,23 @@
# todolist-syntax
Vim syntax file for todo lists (**\*.td**).
Vim syntax file for todo lists (**\*.todo**, **\*.td**).
# Installation
```shell
mkdir -p ~/.vim/syntax
wget -O ~/.vim/syntax/todolist.vim https://raw.githubusercontent.com/gechandesu/todolist-syntax/main/todolist.vim
echo 'autocmd BufRead,BufNewFile *.td set filetype=todolist' >> ~/.vim/filetype.vim
echo 'autocmd BufRead,BufNewFile *.todo,*.td set filetype=todolist' >> ~/.vim/filetype.vim
```
# Syntax
```
- Uncompleted task (blue)
- Uncompleted task (light blue)
+ Completed task (green)
x Rejected task (red)
# Comment (cyan)
TODO mark
# Comment
\Marked text (yellow background)\
`Code (magenta)`
Plain text
```

View File

@ -1,5 +1,5 @@
" Vim syntax file
" Language: TODO list file (.td)
" Language: Todo list file (.todo, .td)
" Maintainer: gd <http://nixhacks.net>
" Latest Revision: 31 Aug 2021
@ -7,15 +7,17 @@ if exists("b:current_syntax")
finish
endif
syn keyword LsTodo TODO
syn match LsComment /#.*/
syn match LsCompleted /^\s*+\s\+\S.*/
syn match LsUncompleted /^\s*-\s\+\S.*/
syn match LsRejected /^\s*x\s\+\S.*/
syn region tdCode start='`' end='`'
syn region tdMarked start='\\' end='\\'
syn match tdComment /#.*/
syn match tdCompleted /^\s*+\s\+\S.*/
syn match tdUncompleted /^\s*-\s\+\S.*/
syn match tdRejected /^\s*x\s\+\S.*/
" Highlight
hi LsUncompleted ctermfg=blue guifg=#0000ff
hi LsCompleted ctermfg=green guifg=#00ff00
hi LsRejected ctermfg=red guifg=#ff0000
hi LsComment ctermfg=cyan guifg=#00ffff
hi LsTodo ctermfg=black ctermbg=yellow guifg=#000000 guibg=#ffff00
hi tdCode ctermfg=magenta guifg=#ff00ff
hi tdMarked ctermfg=black ctermbg=yellow guifg=#000000 guibg=#ffff00
hi tdUncompleted ctermfg=lightblue guifg=#add8e6
hi tdCompleted ctermfg=green guifg=#00ff00
hi tdRejected ctermfg=red guifg=#ff0000
hi tdComment ctermfg=cyan guifg=#00ffff