Skip to content

Instantly share code, notes, and snippets.

@redongh
Created March 24, 2023 15:09
Show Gist options
  • Save redongh/ea111445631f4ee65e3c635c4aafc324 to your computer and use it in GitHub Desktop.
Save redongh/ea111445631f4ee65e3c635c4aafc324 to your computer and use it in GitHub Desktop.
vimwiki-test with wiki-external links
# 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)
@redongh
Copy link
Author

redongh commented Mar 24, 2023

test-contribution for vimwiki issue1271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment