Feature: VimwikiPasteLink to get absolute wiki link to the current file
This commit is contained in:
committed by
Brennen Bearnes
parent
1aa417fbd8
commit
7d937615c1
@@ -221,6 +221,17 @@ function! vimwiki#path#is_absolute(path) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:get_wikifile_link(wikifile) abort
|
||||||
|
return vimwiki#base#subdir(vimwiki#vars#get_wikilocal('path'), a:wikifile).
|
||||||
|
\ fnamemodify(a:wikifile, ':t:r')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! vimwiki#path#PasteLink(wikifile) abort
|
||||||
|
execute 'r !echo "[[/'.s:get_wikifile_link(a:wikifile).']]"'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
if vimwiki#u#is_windows()
|
if vimwiki#u#is_windows()
|
||||||
" Combine: a directory and a file into one path, doesn't generate duplicate
|
" Combine: a directory and a file into one path, doesn't generate duplicate
|
||||||
" path separator in case the directory is also having an ending / or \. This
|
" path separator in case the directory is also having an ending / or \. This
|
||||||
|
|||||||
@@ -974,6 +974,14 @@ Vimwiki file.
|
|||||||
colors are configured by |vimwiki-option-color_dic| and the format of the
|
colors are configured by |vimwiki-option-color_dic| and the format of the
|
||||||
surrounding color tags by |vimwiki-option-color_tag_template|
|
surrounding color tags by |vimwiki-option-color_tag_template|
|
||||||
|
|
||||||
|
*:VimwikiPasteLink*
|
||||||
|
Pastes an absolute wiki link (relative to the wiki root) to the current
|
||||||
|
wiki file into the current buffer
|
||||||
|
|
||||||
|
*:VimwikiPasteUrl*
|
||||||
|
Pastes the url to the html file corresponding to the current wiki file
|
||||||
|
into the current buffer
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
5. Wiki syntax *vimwiki-syntax*
|
5. Wiki syntax *vimwiki-syntax*
|
||||||
@@ -3914,6 +3922,7 @@ Contributors and their Github usernames in roughly chronological order:
|
|||||||
- Brennen Bearnes
|
- Brennen Bearnes
|
||||||
- Stefan Schuhbäck (@stefanSchuhbaeck)
|
- Stefan Schuhbäck (@stefanSchuhbaeck)
|
||||||
- Vinny Furia (@vinnyfuria)
|
- Vinny Furia (@vinnyfuria)
|
||||||
|
- paperbenni (@paperbenni)
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
16. Changelog *vimwiki-changelog*
|
16. Changelog *vimwiki-changelog*
|
||||||
@@ -3970,6 +3979,8 @@ New:~
|
|||||||
* PR #934: RSS feed generation for diary with :VimwikiRss.
|
* PR #934: RSS feed generation for diary with :VimwikiRss.
|
||||||
* Feature: Add option |vimwiki-option-template_date_format| to configure
|
* Feature: Add option |vimwiki-option-template_date_format| to configure
|
||||||
alternative date string format
|
alternative date string format
|
||||||
|
* Feature: Add |VimwikiPasteLink| to paste an absolute wiki link to the
|
||||||
|
current file
|
||||||
|
|
||||||
Changed:~
|
Changed:~
|
||||||
* PR #1047: Allow to replace default mapping of VimwikiToggleListItem
|
* PR #1047: Allow to replace default mapping of VimwikiToggleListItem
|
||||||
|
|||||||
@@ -369,6 +369,7 @@ command! -buffer -nargs=* -complete=custom,vimwiki#tags#complete_tags
|
|||||||
\ call vimwiki#tags#generate_tags(1, <f-args>)
|
\ call vimwiki#tags#generate_tags(1, <f-args>)
|
||||||
|
|
||||||
command! -buffer VimwikiPasteUrl call vimwiki#html#PasteUrl(expand('%:p'))
|
command! -buffer VimwikiPasteUrl call vimwiki#html#PasteUrl(expand('%:p'))
|
||||||
|
command! -buffer VimwikiPasteLink call vimwiki#path#PasteLink(expand('%:p'))
|
||||||
command! -buffer VimwikiCatUrl call vimwiki#html#CatUrl(expand('%:p'))
|
command! -buffer VimwikiCatUrl call vimwiki#html#CatUrl(expand('%:p'))
|
||||||
command! -buffer -nargs=* -range -complete=custom,vimwiki#base#complete_colorize
|
command! -buffer -nargs=* -range -complete=custom,vimwiki#base#complete_colorize
|
||||||
\ VimwikiColorize <line1>,<line2>call vimwiki#base#colorize(<f-args>)
|
\ VimwikiColorize <line1>,<line2>call vimwiki#base#colorize(<f-args>)
|
||||||
|
|||||||
Reference in New Issue
Block a user