summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorJersey Fonseca <fonseca@uchicago.edu>2020-06-25 00:44:39 +0000
committerGitHub <noreply@github.com>2020-06-25 00:44:39 +0000
commit3b24c57ef433b79f24af8ae6ae4b7466bb89c483 (patch)
tree10c7412075bf0b5838d6556d76d345046c964cfd /plugin
parent9c3df779c9355086819c7abf0641827ae242f169 (diff)
parente126e779aefb5e6b1144a9f27d7f373595db2fb4 (diff)
Merge pull request #1 from ahmedselim2017/master
Added variables for cache file and mappings
Diffstat (limited to 'plugin')
-rw-r--r--plugin/bujo.vim9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugin/bujo.vim b/plugin/bujo.vim
index bc13304..d5203e9 100644
--- a/plugin/bujo.vim
+++ b/plugin/bujo.vim
@@ -1,18 +1,19 @@
1"Make bujo directory if it doesn't exist" 1"Make bujo directory if it doesn't exist"
2if empty(glob('~/bujo')) 2let g:bujo#todo_file_path = get(g:, "bujo#todo_file_path", $HOME . "/.cache/bujo")
3 call mkdir($HOME . '/bujo', 'p') 3if empty(glob(g:bujo#todo_file_path))
4 call mkdir(g:bujo#todo_file_path)
4endif 5endif
5autocmd bufnewfile todo.md call append(0, '#Todo') 6autocmd bufnewfile todo.md call append(0, '#Todo')
6autocmd bufnewfile todo.md call append(1, 'Date: ') 7autocmd bufnewfile todo.md call append(1, 'Date: ')
7autocmd bufnewfile,bufreadpre todo.md exe "g/Date: */s/Date: /Date: " .strftime("%a %d %b %Y") 8autocmd bufnewfile,bufreadpre todo.md exe "g/Date: */s/Date: /Date: " .strftime("%a %d %b %Y")
8autocmd bufnewfile,Bufwritepre,filewritepre todo.md execute "normal G" 9autocmd bufnewfile,Bufwritepre,filewritepre todo.md execute "normal Go"
9 10
10 11
11 12
12" Open the bujo todo list file 13" Open the bujo todo list file
13function s:OpenTodo() 14function s:OpenTodo()
14 "30 makes it open at width 30 15 "30 makes it open at width 30
15 exe ":30vs ~/bujo/todo.md" 16 exe ":30vs" . g:bujo#todo_file_path . "/todo.md"
16endfunction 17endfunction
17 18
18if !exists(":Todo") 19if !exists(":Todo")