summaryrefslogtreecommitdiff
path: root/plugin/bujo.vim
blob: cca68bba21e646edcd839fbda9e201882fe10dfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"Make bujo directory if it doesn't exist"
if empty(glob('~/bujo'))
  call mkdir($HOME . '/bujo', 'p')
endif
autocmd bufnewfile todo.md call append(0, '  __________  ____  ____\n/_  __/ __ \/ __ \/ __ \\n  / / / / / / / / / / / /\n  / / / /_/ / /_/ / /_/ /\n /_/  \____/_____/\____/')
autocmd bufnewfile todo.md call append(7, '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"



" Open the bujo todo list file
function s:OpenTodo()
  "30 makes it open at width 30
  exe ":30vs ~/bujo/todo.md" 
endfunction

if !exists(":Todo")
  command Todo :call s:OpenTodo()
endif