summaryrefslogtreecommitdiffstats
path: root/.config/nvim/after/plugin/functions.vim
blob: 415ad51ada4c9d6bca9dbdbee8df6e8a911b760f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
" Will learn to port promise
function! CreateNote()
    py3 import uuid
    exe "e! " . fnameescape("~/nextcloud/personal_wiki/text/box/" . py3eval('str(uuid.uuid4())[:6]') . ".wiki")
    let l:text="= up =\n\n= down =\n\n= keywords =\n\n"
    put  =l:text
    norm gg
endfunction

function! CreatePaper(citekey)
    exe "e! " . fnameescape("~/nextcloud/personal_wiki/text/papers/" . a:citekey . ".wiki")

    let l:timestap="%date " . strftime("%F")
    let l:title="%title "

    put! =l:timestap
    put  =l:title
endfunction

function! CreateReference(citekey)
    exe "e! " . fnameescape("~/nextcloud/personal_wiki/text/reference/" . a:citekey . ".wiki")

    let l:timestap="%date " . strftime("%F")
    let l:text="= Literature Notes =\n\n= Citation =\n\n"

    put! =l:timestap
    put  =l:text
endfunction