summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJersey <fonseca@uchicago.edu>2020-06-26 19:40:47 +0000
committerJersey <fonseca@uchicago.edu>2020-06-26 19:40:47 +0000
commit3a0192d5528b10654431d34aeb3b25086a745eae (patch)
tree0c39506fa42ee5f7bd561d94a59165f872679383
parent2dd6fc3cc12914274f39871d0431bf7c8e10c34e (diff)
parent45265df1b75f25e54b67e4ab63f57cbfc1979963 (diff)
Merge branch 'projects'
-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