summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugin')
-rw-r--r--plugin/bujo.vim14
1 files changed, 9 insertions, 5 deletions
diff --git a/plugin/bujo.vim b/plugin/bujo.vim
index e8b7077..a2fa976 100644
--- a/plugin/bujo.vim
+++ b/plugin/bujo.vim
@@ -30,10 +30,10 @@ endfunction
30" GetToplevelFolder() gives us a clean name of the git repository that we are 30" GetToplevelFolder() gives us a clean name of the git repository that we are
31" currently working in 31" currently working in
32function s:GetToplevelFolder() 32function s:GetToplevelFolder()
33 let absolute_path = system("git rev-parse --show-toplevel") 33 let absolute_path = system("git rev-parse --show-toplevel")
34 let repo_name = split(absolute_path, "/") 34 let repo_name = split(absolute_path, "/")
35 let repo_name_clean = split(repo_name[-1], '\v\n')[0] 35 let repo_name_clean = split(repo_name[-1], '\v\n')[0]
36 return repo_name_clean 36 return repo_name_clean
37endfunction 37endfunction
38 38
39" OpenTodo() opens the respective todo.md file from $HOME/.cache/bujo 39" OpenTodo() opens the respective todo.md file from $HOME/.cache/bujo
@@ -46,7 +46,11 @@ function s:OpenTodo(...)
46 exe ":30vs" . g:bujo#todo_file_path . "/todo.md" 46 exe ":30vs" . g:bujo#todo_file_path . "/todo.md"
47 else 47 else
48 let repo_name_clean = s:GetToplevelFolder() 48 let repo_name_clean = s:GetToplevelFolder()
49 exe ":30vs" . g:bujo#todo_file_path . "/" . repo_name_clean . "/todo.md" 49 let todo_path = g:bujo#todo_file_path . "/" . repo_name_clean
50 if empty(glob(todo_path))
51 call mkdir(todo_path)
52 endif
53 exe ":30vs" . todo_path . "/todo.md"
50 endif 54 endif
51endfunction 55endfunction
52 56