commit 926a20d3cef72f86965822e8ce75f8711794b1d4
parent 69b4b0e6e31b1a18cef80213d3f42c042ab011f1
Author: Dimitrije Dobrota <mail@dimitrijedobrota.com>
Date: Sat, 14 Oct 2023 20:38:29 +0000
Basic VimWiki config and template for daily diary
Diffstat:
3 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/.xdg/config/vim/bin/vimwiki-diary-template b/.xdg/config/vim/bin/vimwiki-diary-template
@@ -0,0 +1,40 @@
+#!/usr/bin/python3
+
+import sys
+import datetime
+
+template = """# {date}
+
+## Daily Checklist
+
+* [ ] Leetcode
+
+
+## Todo
+
+
+
+## ESP
+
+### Effort
+
+
+
+### Success
+
+
+
+### Progress
+
+
+
+## Notes
+"""
+
+
+date = datetime.date.today()
+if len(sys.argv) < 2:
+ date = sys.argv[1].rsplit("/", 1)[1];
+ date = date.split(".", 1)[0];
+
+print(template.format(date = date));
diff --git a/.xdg/config/vim/vimrc b/.xdg/config/vim/vimrc
@@ -30,6 +30,8 @@ Plugin 'keremc/asyncomplete-clang.vim'
Plugin 'sheerun/vim-polyglot'
Plugin 'bfrg/vim-cpp-modern'
+Plugin 'vimwiki/vimwiki'
+
Plugin 'morhetz/gruvbox'
call vundle#end()
@@ -40,6 +42,7 @@ filetype plugin indent on
" File settings
set encoding=utf8
set autoread
+set syntax=on
" Spelling
set spell
@@ -105,3 +108,4 @@ highlight Visual ctermfg=yellow ctermbg=gray
source <sfile>:h/clangd.vim
source <sfile>:h/gruvbox.vim
+source <sfile>:h/wiki.vim
diff --git a/.xdg/config/vim/wiki.vim b/.xdg/config/vim/wiki.vim
@@ -0,0 +1,6 @@
+let g:wikidir = $XDG_DATA_HOME."/vimwiki"
+let g:diarydir = g:wikidir."/diary"
+
+let g:vimwiki_list = [{'path': g:wikidir, 'syntax': 'markdown', 'ext': '.md'}]
+
+execute 'au BufNewFile ' . g:diarydir .'/*.md :silent 0r !<sfile>:h/bin/vimwiki-diary-template "%"'