From 727a5ab3612bfd7823a0608bf04c0fb1cc1d317c Mon Sep 17 00:00:00 2001 From: ahmedselim2017 Date: Thu, 25 Jun 2020 02:47:47 +0300 Subject: Added todo_file_path --- plugin/bujo.vim | 9 +++++---- 1 file 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 @@ "Make bujo directory if it doesn't exist" -if empty(glob('~/bujo')) - call mkdir($HOME . '/bujo', 'p') +let g:bujo#todo_file_path = get(g:, "bujo#todo_file_path", $HOME . "/.cache/bujo") +if empty(glob(g:bujo#todo_file_path)) + call mkdir(g:bujo#todo_file_path) endif autocmd bufnewfile todo.md call append(0, '#Todo') autocmd bufnewfile todo.md call append(1, 'Date: ') autocmd bufnewfile,bufreadpre todo.md exe "g/Date: */s/Date: /Date: " .strftime("%a %d %b %Y") -autocmd bufnewfile,Bufwritepre,filewritepre todo.md execute "normal G" +autocmd bufnewfile,Bufwritepre,filewritepre todo.md execute "normal Go" " Open the bujo todo list file function s:OpenTodo() "30 makes it open at width 30 - exe ":30vs ~/bujo/todo.md" + exe ":30vs" . g:bujo#todo_file_path . "/todo.md" endfunction if !exists(":Todo") -- cgit v1.2.3