From febeaf7bfd3667cdd0ddeb290915d61d543e8599 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Fri, 5 Jun 2020 17:12:33 +0300 Subject: nvim note taking functions --- .config/nvim/init.vim | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 02c459f..7fc630c 100755 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -151,15 +151,35 @@ autocmd FileType rust let b:dispatch = 'cargo run' "}}} " Functions {{{ + +function! CreateNote() + py3 import uuid + exe "e! " . fnameescape("~/Nextcloud/personal_wiki/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/papers/" . a:citekey . ".wiki") - let l:timestap="Report Created at: " . strftime("%c") + let l:timestap="%date " . strftime("%F") let l:text="= Came From =\n\n= Takeaways =\n\n= Might Go To =\n\n" put! =l:timestap put =l:text endfunction + +function! CreateReference(citekey) + exe "e! " . fnameescape("~/Nextcloud/personal_wiki/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 + " }}} Function " "{{{Misc Settings -- cgit v1.2.3-70-g09d2