Open GoogleCodeExporter opened 8 years ago
I agree, this has to be solved.
Original comment by habamax
on 30 May 2012 at 3:01
I have changed local: behaviour. It opens links using system default apps.
Original comment by habamax
on 30 May 2012 at 6:26
Here's a handler that handles 'vlocal:' and 'vfile:' schemes.
function! VimwikiLinkHandler(link) "{{{ Use Vim to open links with the
" 'vlocal:' or 'vfile:' schemes. E.g.:
" 1) [[vfile:///~/Code/PythonProject/abc123.py]], and
" 2) [[vlocal:./|Wiki Home]]
let link = a:link
if link =~ "vlocal:" || link =~ "vfile:"
let link = link[1:]
else
return 0
endif
let [idx, scheme, path, subdir, lnk, ext, url] =
\ vimwiki#base#resolve_scheme(link, 0)
if g:vimwiki_debug
echom 'LinkHandler: idx='.idx.', scheme=[v]'.scheme.', path='.path.
\ ', subdir='.subdir.', lnk='.lnk.', ext='.ext.', url='.url
endif
if url == ''
echom 'Vimwiki Error: Unable to resolve link!'
return 0
else
call vimwiki#base#edit_file('tabnew', url, [], 0)
return 1
endif
endfunction " }}}
Original comment by stu.andrews
on 31 May 2012 at 2:41
Including the following line in your vimrc, together with the
VimwikiLinkHandler defined above, ensures that the vlocal: and vfile: links are
highlighted as existing links, similar to maxhi=0.
let g:vimwiki_schemes = 'wiki\d\+,diary,local,vlocal,vfile'
Original comment by stu.andrews
on 31 May 2012 at 3:22
Wouldn't it be better to mandatory highlight every link that has scheme as
existing?
Just to avoid manual g:vimwiki_schemes update?
Original comment by habamax
on 31 May 2012 at 3:57
This four schemes is good.
Original comment by numbch...@gmail.com
on 31 May 2012 at 4:47
@numbchild: keep us informed on how they perform ... we've been known to take
1-step forward and 2-steps back
@maxim: I agree that updating g:vimwiki_schemes like this is a little technical
and error prone. Can you be more specific about your highlighting suggestion?
Since ':' is now a valid filename character, how would we distinguish the file
[[issue316_:_g]] from the "issue316_"-scheme that is pointing to the file "_g"?
Just to clarify: In my tests with maxhi=1, the link [[vlocal:index.wiki]] was
highlighted as missing. Then, by adding the g:vimwiki_schemes lines, it is
highlighted as existing.
... there is also the idea from
http://code.google.com/p/vimwiki/source/detail?r=9567e6083b7c
Original comment by stu.andrews
on 31 May 2012 at 2:08
Stuart, I don't know yet. We should think about it. Let us wait with it till
vimwiki2.0 is released.
Original comment by habamax
on 31 May 2012 at 5:07
Original issue reported on code.google.com by
stu.andrews
on 30 May 2012 at 2:25