From 1dd6ac51ae70ce12b3777e4de2d3e9b3201afeb6 Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Tue, 8 Oct 2024 20:36:56 +0200 Subject: [PATCH] Update wiki.vim config --- .vim/after/plugin/wiki.vim | 93 ++++++++++++++++++++++++++++++++------ 1 file changed, 79 insertions(+), 14 deletions(-) diff --git a/.vim/after/plugin/wiki.vim b/.vim/after/plugin/wiki.vim index 33f1602..289810b 100644 --- a/.vim/after/plugin/wiki.vim +++ b/.vim/after/plugin/wiki.vim @@ -17,27 +17,92 @@ autocmd BufEnter *.md if expand('%:t') =~ 'my-' | echo 'personal file' | endif autocmd BufEnter *.md if expand('%:t') =~ 'project_' | echo 'project file' | endif " Only load wiki.vim for zk directory -let g:wiki_global_load=0 -let g:wiki_root='~/.zk' let g:wiki_index_name='index' -let g:wiki_zotero_root='~/doc/Zotero' -let g:wiki_filetypes=['md'] -let g:wiki_completion_case_sensitive=0 " Links let g:wiki_link_extension='' " Do not automatically transform to link, use `wf` for this -let g:wiki_link_toggle_on_follow=0 let g:wiki_link_target_type='md' -" E.g. transform `My link` into `[My link](my-link.md)` -function Slugify(text) abort - return [substitute(tolower(a:text), '\s\+', '-', 'g'), a:text] -endfunction - -let g:wiki_map_text_to_link='Slugify' - vmap wf (wiki-link-toggle-visual) -" Automatically save when navigation +" +" Links +" + +" +" Options +" + +" +" Events +" + +" +" Mappings and commands +" + +" +" Completion +" + +let g:wiki_completion_enabled=1 +let g:wiki_completion_case_sensitive=0 + +" +" Tags +" + +" +" Templates +" + +let g:wiki_templates = [ + \ { 'match_re': '^my-', + \ 'source_filename': '.my.md'}, + \ { 'match_re': '^project[-_]', + \ 'source_filename': '.project.md'}, + \ { 'match_re': '^blog[-_]', + \ 'source_filename': '.blog.md'}, + \ { 'match_re': '^journal[-_]', + \ 'source_filename': '.journal.md'}, + \ { 'match_func': { x -> v:true }, + \ 'source_filename': '.md'}, + \] + +" +" Advanced configuration +" + +let g:wiki_filetypes=['md'] +let g:wiki_root='~/.zk' +let g:wiki_global_load=0 +let g:wiki_link_creation = { + \ 'md': { + \ 'link_type': 'md', + \ 'url_extension': '', + \ 'url_transform': { x -> substitute(tolower(x), '\s\+', '-', 'g') }, + \ }, + \ '_': { + \ 'link_type': 'wiki', + \ 'url_extension': '', + \ }, + \} + +" let g:wiki_link_default_schemes +" let g:wiki_link_schemes +let g:wiki_link_toggle_on_follow=0 +" let g:wiki_link_transforms +" let g:wiki_mappings_use_defaults +" let g:wiki_mappings_global +" let g:wiki_mappings_local +" let g:wiki_mappings_local_journal +" ... tags +" let g:wiki_template_month_names +" let g:wiki_template_title_month = +" let g:wiki_template_title_week +" let g:wiki_ui_method let g:wiki_write_on_nav=1 +let g:wiki_zotero_root='~/.local/share/zotero' +" ... mappings and commands +" ...