Created
March 24, 2023 15:09
-
-
Save redongh/ea111445631f4ee65e3c635c4aafc324 to your computer and use it in GitHub Desktop.
vimwiki-test with wiki-external links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# redongh markdown vimwiki test | |
* vimwiki-defs my `.vimrc`: | |
``` | |
let g:vimwiki_global_ext = 0 | |
let g:vimwiki_list = [{ | |
\ 'path': '~/vimwiki/', | |
\ 'path_html': '~/vimwiki.out.html', | |
\ 'custom_wiki2html': '~/vimwiki.helpers/convert.py', | |
\ 'syntax': 'markdown', | |
\ 'ext': '.mdw', | |
\ }] | |
``` | |
* override in my `.vimrc`: | |
``` | |
function! VimwikiLinkHandler(link) | |
if a:link =~# '^file:' | |
try | |
execute ':split ' . a:link[5:] | |
return 1 | |
catch | |
echo "Failed opening file-link in vim." | |
endtry | |
elseif a:link =~# '^raw:' | |
try | |
execute ':split ' . '~/' . a:link[4:] | |
return 1 | |
catch | |
echo "Failed opening raw-link in vim." | |
endtry | |
endif | |
return 0 | |
endfunction | |
``` | |
* convert.py as used by gpanders on [comment477815553](https://github.com/vimwiki/vimwiki/issues/642#issuecomment-477815553) | |
* a common [internal-link](internal-link) | |
* a file link to [external-txtfile](file://$HOME/testsubdir/external.txt) | |
* a raw link to [external-txtfile](raw:testsubdir/external.txt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
test-contribution for vimwiki issue1271