diff options
author | Jersey <fonseca@uchicago.edu> | 2020-06-24 19:44:33 +0000 |
---|---|---|
committer | Jersey <fonseca@uchicago.edu> | 2020-06-24 19:44:33 +0000 |
commit | 90e5518188c66bbdb40398a7f0c88ca1f1115958 (patch) | |
tree | 668459737cc42b55eb76a2ef06e58796cae5807a | |
parent | fb7ee996a618e50c1e608a4faf3f093e2dc35f6c (diff) |
adding date to todo
-rw-r--r-- | plugin/bujo.vim | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/plugin/bujo.vim b/plugin/bujo.vim index 01f17a5..cc8a84e 100644 --- a/plugin/bujo.vim +++ b/plugin/bujo.vim | |||
@@ -1,6 +1,17 @@ | |||
1 | autocmd BufWritePre,FileWritePre todo.md ks|call LastMod()|'s | ||
2 | fun LastMod() | ||
3 | if line("$") > 20 | ||
4 | let l = 20 | ||
5 | else | ||
6 | let l = line("$") | ||
7 | endif | ||
8 | exe "1," . l . "g/Date: /s/Date: .*/Date: " . | ||
9 | \ strftime("%Y %b %d") | ||
10 | endfun | ||
11 | |||
12 | "Make bujo directory if it doesn't exist" | ||
1 | if empty(glob('~/bujo')) | 13 | if empty(glob('~/bujo')) |
2 | call mkdir($HOME . '/bujo', 'p') | 14 | call mkdir($HOME . '/bujo', 'p') |
3 | exe "!mv ./../templates/todo.md ~/bujo/" | ||
4 | endif | 15 | endif |
5 | 16 | ||
6 | " Open the bujo todo list file | 17 | " Open the bujo todo list file |