summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJersey <fonseca@uchicago.edu>2020-06-26 19:35:53 +0000
committerJersey <fonseca@uchicago.edu>2020-06-26 19:35:53 +0000
commit7b47dbc0db6bdc1ca25951b8b580fd8950a513b3 (patch)
tree272d59fb5220b43ac1fd66b0f2db2f78399532d9
parent0807b7aed40a1c9758f6944e0ee8c8f448ff6c58 (diff)
makes directory to new path
-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..537edb3 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_c . "/todo.md"
50 endif 54 endif
51endfunction 55endfunction
52 56