parent
61910cd93a
commit
f497a4abc7
@ -132,7 +132,7 @@ function! vimwiki#base#setup_buffer_state(idx) " {{{ Init page-specific variable
|
|||||||
call VimwikiSet('invsubdir', vimwiki#base#invsubdir(subdir), a:idx)
|
call VimwikiSet('invsubdir', vimwiki#base#invsubdir(subdir), a:idx)
|
||||||
|
|
||||||
if vimwiki#vars#get_global('auto_chdir') == 1
|
if vimwiki#vars#get_global('auto_chdir') == 1
|
||||||
exe 'lcd' VimwikiGet('path')
|
exe 'lcd' vimwiki#vars#get_wikilocal('path')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" update cache
|
" update cache
|
||||||
@ -209,7 +209,7 @@ endfunction "}}}
|
|||||||
|
|
||||||
" vimwiki#base#current_subdir
|
" vimwiki#base#current_subdir
|
||||||
function! vimwiki#base#current_subdir(idx)"{{{
|
function! vimwiki#base#current_subdir(idx)"{{{
|
||||||
return vimwiki#base#subdir(VimwikiGet('path', a:idx), expand('%:p'))
|
return vimwiki#base#subdir(vimwiki#vars#get_wikilocal('path', a:idx), expand('%:p'))
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
" vimwiki#base#invsubdir
|
" vimwiki#base#invsubdir
|
||||||
@ -223,7 +223,7 @@ function! vimwiki#base#find_wiki(path) "{{{
|
|||||||
let path = vimwiki#path#path_norm(vimwiki#path#chomp_slash(a:path))
|
let path = vimwiki#path#path_norm(vimwiki#path#chomp_slash(a:path))
|
||||||
let idx = 0
|
let idx = 0
|
||||||
while idx < len(g:vimwiki_list)
|
while idx < len(g:vimwiki_list)
|
||||||
let idx_path = expand(VimwikiGet('path', idx))
|
let idx_path = expand(vimwiki#vars#get_wikilocal('path', idx))
|
||||||
let idx_path = vimwiki#path#path_norm(vimwiki#path#chomp_slash(idx_path))
|
let idx_path = vimwiki#path#path_norm(vimwiki#path#chomp_slash(idx_path))
|
||||||
if vimwiki#path#is_equal(
|
if vimwiki#path#is_equal(
|
||||||
\ vimwiki#path#path_common_pfx(idx_path, path), idx_path)
|
\ vimwiki#path#path_common_pfx(idx_path, path), idx_path)
|
||||||
@ -316,7 +316,7 @@ function! vimwiki#base#resolve_link(link_text, ...) "{{{
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if !is_relative || link_infos.index != source_wiki
|
if !is_relative || link_infos.index != source_wiki
|
||||||
let root_dir = VimwikiGet('path', link_infos.index)
|
let root_dir = vimwiki#vars#get_wikilocal('path', link_infos.index)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let link_infos.filename = root_dir . link_text
|
let link_infos.filename = root_dir . link_text
|
||||||
@ -334,7 +334,7 @@ function! vimwiki#base#resolve_link(link_text, ...) "{{{
|
|||||||
let link_infos.index = source_wiki
|
let link_infos.index = source_wiki
|
||||||
|
|
||||||
let link_infos.filename =
|
let link_infos.filename =
|
||||||
\ VimwikiGet('path', link_infos.index) .
|
\ vimwiki#vars#get_wikilocal('path', link_infos.index) .
|
||||||
\ vimwiki#vars#get_wikilocal('diary_rel_path', link_infos.index) .
|
\ vimwiki#vars#get_wikilocal('diary_rel_path', link_infos.index) .
|
||||||
\ link_text .
|
\ link_text .
|
||||||
\ VimwikiGet('ext', link_infos.index)
|
\ VimwikiGet('ext', link_infos.index)
|
||||||
@ -481,7 +481,7 @@ function! vimwiki#base#goto(...) "{{{
|
|||||||
let anchor = a:0 > 1 ? a:2 : ''
|
let anchor = a:0 > 1 ? a:2 : ''
|
||||||
|
|
||||||
call vimwiki#base#edit_file(':e',
|
call vimwiki#base#edit_file(':e',
|
||||||
\ VimwikiGet('path') . key . VimwikiGet('ext'),
|
\ vimwiki#vars#get_wikilocal('path') . key . VimwikiGet('ext'),
|
||||||
\ anchor)
|
\ anchor)
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
@ -518,9 +518,9 @@ endfunction "}}}
|
|||||||
function! vimwiki#base#find_files(wiki_nr, directories_only)
|
function! vimwiki#base#find_files(wiki_nr, directories_only)
|
||||||
let wiki_nr = a:wiki_nr
|
let wiki_nr = a:wiki_nr
|
||||||
if wiki_nr >= 0
|
if wiki_nr >= 0
|
||||||
let root_directory = VimwikiGet('path', wiki_nr)
|
let root_directory = vimwiki#vars#get_wikilocal('path', wiki_nr)
|
||||||
else
|
else
|
||||||
let root_directory = VimwikiGet('path').vimwiki#vars#get_wikilocal('diary_rel_path')
|
let root_directory = vimwiki#vars#get_wikilocal('path') . vimwiki#vars#get_wikilocal('diary_rel_path')
|
||||||
let wiki_nr = g:vimwiki_current_idx
|
let wiki_nr = g:vimwiki_current_idx
|
||||||
endif
|
endif
|
||||||
if a:directories_only
|
if a:directories_only
|
||||||
@ -548,9 +548,9 @@ function! vimwiki#base#get_wikilinks(wiki_nr, also_absolute_links)
|
|||||||
if a:wiki_nr == g:vimwiki_current_idx
|
if a:wiki_nr == g:vimwiki_current_idx
|
||||||
let cwd = vimwiki#path#wikify_path(expand('%:p:h'))
|
let cwd = vimwiki#path#wikify_path(expand('%:p:h'))
|
||||||
elseif a:wiki_nr < 0
|
elseif a:wiki_nr < 0
|
||||||
let cwd = VimwikiGet('path').vimwiki#vars#get_wikilocal('diary_rel_path')
|
let cwd = vimwiki#vars#get_wikilocal('path') . vimwiki#vars#get_wikilocal('diary_rel_path')
|
||||||
else
|
else
|
||||||
let cwd = VimwikiGet('path', a:wiki_nr)
|
let cwd = vimwiki#vars#get_wikilocal('path', a:wiki_nr)
|
||||||
endif
|
endif
|
||||||
let result = []
|
let result = []
|
||||||
for wikifile in files
|
for wikifile in files
|
||||||
@ -561,9 +561,9 @@ function! vimwiki#base#get_wikilinks(wiki_nr, also_absolute_links)
|
|||||||
if a:also_absolute_links
|
if a:also_absolute_links
|
||||||
for wikifile in files
|
for wikifile in files
|
||||||
if a:wiki_nr == g:vimwiki_current_idx
|
if a:wiki_nr == g:vimwiki_current_idx
|
||||||
let cwd = VimwikiGet('path')
|
let cwd = vimwiki#vars#get_wikilocal('path')
|
||||||
elseif a:wiki_nr < 0
|
elseif a:wiki_nr < 0
|
||||||
let cwd = VimwikiGet('path').vimwiki#vars#get_wikilocal('diary_rel_path')
|
let cwd = vimwiki#vars#get_wikilocal('path') . vimwiki#vars#get_wikilocal('diary_rel_path')
|
||||||
endif
|
endif
|
||||||
let wikifile = fnamemodify(wikifile, ':r') " strip extension
|
let wikifile = fnamemodify(wikifile, ':r') " strip extension
|
||||||
let wikifile = '/'.vimwiki#path#relpath(cwd, wikifile)
|
let wikifile = '/'.vimwiki#path#relpath(cwd, wikifile)
|
||||||
@ -578,9 +578,9 @@ function! vimwiki#base#get_wiki_directories(wiki_nr)
|
|||||||
let dirs = vimwiki#base#find_files(a:wiki_nr, 1)
|
let dirs = vimwiki#base#find_files(a:wiki_nr, 1)
|
||||||
if a:wiki_nr == g:vimwiki_current_idx
|
if a:wiki_nr == g:vimwiki_current_idx
|
||||||
let cwd = vimwiki#path#wikify_path(expand('%:p:h'))
|
let cwd = vimwiki#path#wikify_path(expand('%:p:h'))
|
||||||
let root_dir = VimwikiGet('path')
|
let root_dir = vimwiki#vars#get_wikilocal('path')
|
||||||
else
|
else
|
||||||
let cwd = VimwikiGet('path', a:wiki_nr)
|
let cwd = vimwiki#vars#get_wikilocal('path', a:wiki_nr)
|
||||||
endif
|
endif
|
||||||
let result = ['./']
|
let result = ['./']
|
||||||
for wikidir in dirs
|
for wikidir in dirs
|
||||||
@ -790,7 +790,7 @@ function! vimwiki#base#check_links() "{{{
|
|||||||
|
|
||||||
" mark every index file as reachable
|
" mark every index file as reachable
|
||||||
for idx in range(len(g:vimwiki_list))
|
for idx in range(len(g:vimwiki_list))
|
||||||
let index_file = VimwikiGet('path', idx) . VimwikiGet('index', idx) .
|
let index_file = vimwiki#vars#get_wikilocal('path', idx) . VimwikiGet('index', idx) .
|
||||||
\ VimwikiGet('ext', idx)
|
\ VimwikiGet('ext', idx)
|
||||||
if filereadable(index_file)
|
if filereadable(index_file)
|
||||||
let reachable_wikifiles[index_file] = 1
|
let reachable_wikifiles[index_file] = 1
|
||||||
@ -942,7 +942,7 @@ function! s:print_wiki_list() "{{{
|
|||||||
let sep = ' '
|
let sep = ' '
|
||||||
echohl None
|
echohl None
|
||||||
endif
|
endif
|
||||||
echo (idx + 1).sep.VimwikiGet('path', idx)
|
echo (idx + 1) . sep . vimwiki#vars#get_wikilocal('path', idx)
|
||||||
let idx += 1
|
let idx += 1
|
||||||
endwhile
|
endwhile
|
||||||
echohl None
|
echohl None
|
||||||
@ -976,7 +976,7 @@ function! s:update_wiki_links_dir(dir, old_fname, new_fname) " {{{
|
|||||||
let old_fname_r = vimwiki#base#apply_template(
|
let old_fname_r = vimwiki#base#apply_template(
|
||||||
\ g:vimwiki_WikiLinkMatchUrlTemplate, old_fname, '', '')
|
\ g:vimwiki_WikiLinkMatchUrlTemplate, old_fname, '', '')
|
||||||
|
|
||||||
let files = split(glob(VimwikiGet('path').a:dir.'*'.VimwikiGet('ext')), '\n')
|
let files = split(glob(vimwiki#vars#get_wikilocal('path').a:dir.'*'.VimwikiGet('ext')), '\n')
|
||||||
for fname in files
|
for fname in files
|
||||||
call s:update_wiki_link(fname, old_fname_r, new_fname)
|
call s:update_wiki_link(fname, old_fname_r, new_fname)
|
||||||
endfor
|
endfor
|
||||||
@ -1309,7 +1309,7 @@ function! vimwiki#base#goto_index(wnum, ...) "{{{
|
|||||||
|
|
||||||
call Validate_wiki_options(idx)
|
call Validate_wiki_options(idx)
|
||||||
call vimwiki#base#edit_file(cmd,
|
call vimwiki#base#edit_file(cmd,
|
||||||
\ VimwikiGet('path', idx).VimwikiGet('index', idx).
|
\ vimwiki#vars#get_wikilocal('path', idx).VimwikiGet('index', idx).
|
||||||
\ VimwikiGet('ext', idx),
|
\ VimwikiGet('ext', idx),
|
||||||
\ '')
|
\ '')
|
||||||
call vimwiki#base#setup_buffer_state(idx)
|
call vimwiki#base#setup_buffer_state(idx)
|
||||||
@ -1378,7 +1378,7 @@ function! vimwiki#base#rename_link() "{{{
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let new_link = subdir.new_link
|
let new_link = subdir.new_link
|
||||||
let new_fname = VimwikiGet('path').new_link.VimwikiGet('ext')
|
let new_fname = vimwiki#vars#get_wikilocal('path') . new_link . VimwikiGet('ext')
|
||||||
|
|
||||||
" do not rename if file with such name exists
|
" do not rename if file with such name exists
|
||||||
let fname = glob(new_fname)
|
let fname = glob(new_fname)
|
||||||
@ -1389,7 +1389,7 @@ function! vimwiki#base#rename_link() "{{{
|
|||||||
endif
|
endif
|
||||||
" rename wiki link file
|
" rename wiki link file
|
||||||
try
|
try
|
||||||
echomsg 'Vimwiki: Renaming '.VimwikiGet('path').old_fname.' to '.new_fname
|
echomsg 'Vimwiki: Renaming '.vimwiki#vars#get_wikilocal('path').old_fname.' to '.new_fname
|
||||||
let res = rename(expand('%:p'), expand(new_fname))
|
let res = rename(expand('%:p'), expand(new_fname))
|
||||||
if res != 0
|
if res != 0
|
||||||
throw "Cannot rename!"
|
throw "Cannot rename!"
|
||||||
@ -1857,7 +1857,7 @@ endfunction " }}}
|
|||||||
function! s:is_diary_file(filename) " {{{
|
function! s:is_diary_file(filename) " {{{
|
||||||
let file_path = vimwiki#path#path_norm(a:filename)
|
let file_path = vimwiki#path#path_norm(a:filename)
|
||||||
let rel_path = vimwiki#vars#get_wikilocal('diary_rel_path')
|
let rel_path = vimwiki#vars#get_wikilocal('diary_rel_path')
|
||||||
let diary_path = vimwiki#path#path_norm(VimwikiGet('path') . rel_path)
|
let diary_path = vimwiki#path#path_norm(vimwiki#vars#get_wikilocal('path') . rel_path)
|
||||||
return rel_path != ''
|
return rel_path != ''
|
||||||
\ && file_path =~# '^'.vimwiki#u#escape(diary_path)
|
\ && file_path =~# '^'.vimwiki#u#escape(diary_path)
|
||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
@ -1887,8 +1887,8 @@ endfunction " }}}
|
|||||||
" s:normalize_link_in_diary
|
" s:normalize_link_in_diary
|
||||||
function! s:normalize_link_in_diary(lnk) " {{{
|
function! s:normalize_link_in_diary(lnk) " {{{
|
||||||
let link = a:lnk . VimwikiGet('ext')
|
let link = a:lnk . VimwikiGet('ext')
|
||||||
let link_wiki = VimwikiGet('path') . '/' . link
|
let link_wiki = vimwiki#vars#get_wikilocal('path') . '/' . link
|
||||||
let link_diary = VimwikiGet('path') . '/'
|
let link_diary = vimwiki#vars#get_wikilocal('path') . '/'
|
||||||
\ . vimwiki#vars#get_wikilocal('diary_rel_path') . '/' . link
|
\ . vimwiki#vars#get_wikilocal('diary_rel_path') . '/' . link
|
||||||
let link_exists_in_diary = filereadable(link_diary)
|
let link_exists_in_diary = filereadable(link_diary)
|
||||||
let link_exists_in_wiki = filereadable(link_wiki)
|
let link_exists_in_wiki = filereadable(link_wiki)
|
||||||
|
@ -22,7 +22,7 @@ endfunction "}}}
|
|||||||
|
|
||||||
function! s:diary_path(...) "{{{
|
function! s:diary_path(...) "{{{
|
||||||
let idx = a:0 == 0 ? g:vimwiki_current_idx : a:1
|
let idx = a:0 == 0 ? g:vimwiki_current_idx : a:1
|
||||||
return VimwikiGet('path', idx).vimwiki#vars#get_wikilocal('diary_rel_path', idx)
|
return vimwiki#vars#get_wikilocal('path', idx).vimwiki#vars#get_wikilocal('diary_rel_path', idx)
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
function! s:diary_index(...) "{{{
|
function! s:diary_index(...) "{{{
|
||||||
@ -84,7 +84,7 @@ endfun "}}}
|
|||||||
|
|
||||||
fun! s:get_diary_links() "{{{
|
fun! s:get_diary_links() "{{{
|
||||||
let rx = '^\d\{4}-\d\d-\d\d'
|
let rx = '^\d\{4}-\d\d-\d\d'
|
||||||
let s_files = glob(VimwikiGet('path').vimwiki#vars#get_wikilocal('diary_rel_path').'*'.VimwikiGet('ext'))
|
let s_files = glob(vimwiki#vars#get_wikilocal('path').vimwiki#vars#get_wikilocal('diary_rel_path').'*'.VimwikiGet('ext'))
|
||||||
let files = split(s_files, '\n')
|
let files = split(s_files, '\n')
|
||||||
call filter(files, 'fnamemodify(v:val, ":t") =~# "'.escape(rx, '\').'"')
|
call filter(files, 'fnamemodify(v:val, ":t") =~# "'.escape(rx, '\').'"')
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ function! vimwiki#diary#make_note(wnum, ...) "{{{
|
|||||||
let idx = 0
|
let idx = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call vimwiki#path#mkdir(VimwikiGet('path', idx).vimwiki#vars#get_wikilocal('diary_rel_path', idx))
|
call vimwiki#path#mkdir(vimwiki#vars#get_wikilocal('path', idx).vimwiki#vars#get_wikilocal('diary_rel_path', idx))
|
||||||
|
|
||||||
if a:0 && a:1 == 1
|
if a:0 && a:1 == 1
|
||||||
let cmd = 'tabedit'
|
let cmd = 'tabedit'
|
||||||
@ -285,7 +285,7 @@ endfunction "}}}
|
|||||||
function vimwiki#diary#calendar_sign(day, month, year) "{{{
|
function vimwiki#diary#calendar_sign(day, month, year) "{{{
|
||||||
let day = s:prefix_zero(a:day)
|
let day = s:prefix_zero(a:day)
|
||||||
let month = s:prefix_zero(a:month)
|
let month = s:prefix_zero(a:month)
|
||||||
let sfile = VimwikiGet('path').vimwiki#vars#get_wikilocal('diary_rel_path').
|
let sfile = vimwiki#vars#get_wikilocal('path').vimwiki#vars#get_wikilocal('diary_rel_path').
|
||||||
\ a:year.'-'.month.'-'.day.VimwikiGet('ext')
|
\ a:year.'-'.month.'-'.day.VimwikiGet('ext')
|
||||||
return filereadable(expand(sfile))
|
return filereadable(expand(sfile))
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
@ -68,7 +68,7 @@ endfunction " }}}
|
|||||||
|
|
||||||
function! s:default_CSS_full_name(path) " {{{
|
function! s:default_CSS_full_name(path) " {{{
|
||||||
let path = expand(a:path)
|
let path = expand(a:path)
|
||||||
let css_full_name = path.VimwikiGet('css_name')
|
let css_full_name = path . vimwiki#vars#get_wikilocal('css_name')
|
||||||
return css_full_name
|
return css_full_name
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
@ -162,8 +162,8 @@ function! s:delete_html_files(path) "{{{
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" delete if there is no corresponding wiki file
|
" delete if there is no corresponding wiki file
|
||||||
let subdir = vimwiki#base#subdir(VimwikiGet('path_html'), fname)
|
let subdir = vimwiki#base#subdir(vimwiki#vars#get_wikilocal('path_html'), fname)
|
||||||
let wikifile = VimwikiGet('path').subdir.
|
let wikifile = vimwiki#vars#get_wikilocal('path').subdir.
|
||||||
\fnamemodify(fname, ":t:r").VimwikiGet('ext')
|
\fnamemodify(fname, ":t:r").VimwikiGet('ext')
|
||||||
if filereadable(wikifile)
|
if filereadable(wikifile)
|
||||||
continue
|
continue
|
||||||
@ -231,7 +231,7 @@ function! s:is_html_uptodate(wikifile) "{{{
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let wikifile = fnamemodify(a:wikifile, ":p")
|
let wikifile = fnamemodify(a:wikifile, ":p")
|
||||||
let htmlfile = expand(VimwikiGet('path_html').VimwikiGet('subdir').
|
let htmlfile = expand(vimwiki#vars#get_wikilocal('path_html') . VimwikiGet('subdir') .
|
||||||
\fnamemodify(wikifile, ":t:r").".html")
|
\fnamemodify(wikifile, ":t:r").".html")
|
||||||
|
|
||||||
if getftime(wikifile) <= getftime(htmlfile) && tpl_time <= getftime(htmlfile)
|
if getftime(wikifile) <= getftime(htmlfile) && tpl_time <= getftime(htmlfile)
|
||||||
@ -1483,7 +1483,7 @@ function! s:convert_file(path_html, wikifile) "{{{
|
|||||||
call map(html_lines, 'substitute(v:val, "%root_path%", "'.
|
call map(html_lines, 'substitute(v:val, "%root_path%", "'.
|
||||||
\ s:root_path(VimwikiGet('subdir')) .'", "g")')
|
\ s:root_path(VimwikiGet('subdir')) .'", "g")')
|
||||||
|
|
||||||
let css_name = expand(VimwikiGet('css_name'))
|
let css_name = expand(vimwiki#vars#get_wikilocal('css_name'))
|
||||||
let css_name = substitute(css_name, '\', '/', 'g')
|
let css_name = substitute(css_name, '\', '/', 'g')
|
||||||
call map(html_lines, 'substitute(v:val, "%css%", "'. css_name .'", "g")')
|
call map(html_lines, 'substitute(v:val, "%css%", "'. css_name .'", "g")')
|
||||||
|
|
||||||
@ -1544,12 +1544,12 @@ function! vimwiki#html#WikiAll2HTML(path_html) "{{{
|
|||||||
let current_subdir = VimwikiGet('subdir')
|
let current_subdir = VimwikiGet('subdir')
|
||||||
let current_invsubdir = VimwikiGet('invsubdir')
|
let current_invsubdir = VimwikiGet('invsubdir')
|
||||||
|
|
||||||
let wikifiles = split(glob(VimwikiGet('path').'**/*'.VimwikiGet('ext')), '\n')
|
let wikifiles = split(glob(vimwiki#vars#get_wikilocal('path').'**/*'.VimwikiGet('ext')), '\n')
|
||||||
for wikifile in wikifiles
|
for wikifile in wikifiles
|
||||||
let wikifile = fnamemodify(wikifile, ":p")
|
let wikifile = fnamemodify(wikifile, ":p")
|
||||||
|
|
||||||
" temporarily adjust 'subdir' and 'invsubdir' state variables
|
" temporarily adjust 'subdir' and 'invsubdir' state variables
|
||||||
let subdir = vimwiki#base#subdir(VimwikiGet('path'), wikifile)
|
let subdir = vimwiki#base#subdir(vimwiki#vars#get_wikilocal('path'), wikifile)
|
||||||
call VimwikiSet('subdir', subdir)
|
call VimwikiSet('subdir', subdir)
|
||||||
call VimwikiSet('invsubdir', vimwiki#base#invsubdir(subdir))
|
call VimwikiSet('invsubdir', vimwiki#base#invsubdir(subdir))
|
||||||
|
|
||||||
@ -1583,10 +1583,9 @@ function! s:binary_exists(fname) "{{{
|
|||||||
return executable(expand(a:fname))
|
return executable(expand(a:fname))
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
" uses VimwikiGet('path')
|
|
||||||
function! s:get_wikifile_url(wikifile) "{{{
|
function! s:get_wikifile_url(wikifile) "{{{
|
||||||
return VimwikiGet('path_html').
|
return vimwiki#vars#get_wikilocal('path_html') .
|
||||||
\ vimwiki#base#subdir(VimwikiGet('path'), a:wikifile).
|
\ vimwiki#base#subdir(vimwiki#vars#get_wikilocal('path'), a:wikifile).
|
||||||
\ fnamemodify(a:wikifile, ":t:r").'.html'
|
\ fnamemodify(a:wikifile, ":t:r").'.html'
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ function! vimwiki#tags#update_tags(full_rebuild, all_files) "{{{
|
|||||||
call s:write_tags_metadata(metadata)
|
call s:write_tags_metadata(metadata)
|
||||||
else " full rebuild
|
else " full rebuild
|
||||||
let files = vimwiki#base#find_files(g:vimwiki_current_idx, 0)
|
let files = vimwiki#base#find_files(g:vimwiki_current_idx, 0)
|
||||||
let wiki_base_dir = VimwikiGet('path', g:vimwiki_current_idx)
|
let wiki_base_dir = vimwiki#vars#get_wikilocal('path', g:vimwiki_current_idx)
|
||||||
let tags_file_last_modification =
|
let tags_file_last_modification =
|
||||||
\ getftime(vimwiki#tags#metadata_file_path())
|
\ getftime(vimwiki#tags#metadata_file_path())
|
||||||
let metadata = s:load_tags_metadata()
|
let metadata = s:load_tags_metadata()
|
||||||
@ -141,7 +141,7 @@ endfunction " }}}
|
|||||||
" vimwiki#tags#metadata_file_path
|
" vimwiki#tags#metadata_file_path
|
||||||
" Returns tags metadata file path
|
" Returns tags metadata file path
|
||||||
function! vimwiki#tags#metadata_file_path() abort "{{{
|
function! vimwiki#tags#metadata_file_path() abort "{{{
|
||||||
return fnamemodify(vimwiki#path#join_path(VimwikiGet('path'), s:TAGS_METADATA_FILE_NAME), ':p')
|
return fnamemodify(vimwiki#path#join_path(vimwiki#vars#get_wikilocal('path'), s:TAGS_METADATA_FILE_NAME), ':p')
|
||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
|
|
||||||
" s:load_tags_metadata
|
" s:load_tags_metadata
|
||||||
|
@ -245,18 +245,18 @@ endfunction "}}}
|
|||||||
command! -buffer Vimwiki2HTML
|
command! -buffer Vimwiki2HTML
|
||||||
\ if filewritable(expand('%')) | silent noautocmd w | endif
|
\ if filewritable(expand('%')) | silent noautocmd w | endif
|
||||||
\ <bar>
|
\ <bar>
|
||||||
\ let res = vimwiki#html#Wiki2HTML(expand(VimwikiGet('path_html')),
|
\ let res = vimwiki#html#Wiki2HTML(expand(vimwiki#vars#get_wikilocal('path_html')),
|
||||||
\ expand('%'))
|
\ expand('%'))
|
||||||
\ <bar>
|
\ <bar>
|
||||||
\ if res != '' | echo 'Vimwiki: HTML conversion is done, output: '.expand(VimwikiGet('path_html')) | endif
|
\ if res != '' | echo 'Vimwiki: HTML conversion is done, output: ' . expand(vimwiki#vars#get_wikilocal('path_html')) | endif
|
||||||
command! -buffer Vimwiki2HTMLBrowse
|
command! -buffer Vimwiki2HTMLBrowse
|
||||||
\ if filewritable(expand('%')) | silent noautocmd w | endif
|
\ if filewritable(expand('%')) | silent noautocmd w | endif
|
||||||
\ <bar>
|
\ <bar>
|
||||||
\ call vimwiki#base#system_open_link(vimwiki#html#Wiki2HTML(
|
\ call vimwiki#base#system_open_link(vimwiki#html#Wiki2HTML(
|
||||||
\ expand(VimwikiGet('path_html')),
|
\ expand(vimwiki#vars#get_wikilocal('path_html')),
|
||||||
\ expand('%')))
|
\ expand('%')))
|
||||||
command! -buffer VimwikiAll2HTML
|
command! -buffer VimwikiAll2HTML
|
||||||
\ call vimwiki#html#WikiAll2HTML(expand(VimwikiGet('path_html')))
|
\ call vimwiki#html#WikiAll2HTML(expand(vimwiki#vars#get_wikilocal('path_html')))
|
||||||
|
|
||||||
command! -buffer VimwikiTOC call vimwiki#base#table_of_contents(1)
|
command! -buffer VimwikiTOC call vimwiki#base#table_of_contents(1)
|
||||||
|
|
||||||
@ -279,10 +279,10 @@ command! -buffer -nargs=0 VimwikiBacklinks call vimwiki#base#backlinks()
|
|||||||
command! -buffer -nargs=0 VWB call vimwiki#base#backlinks()
|
command! -buffer -nargs=0 VWB call vimwiki#base#backlinks()
|
||||||
|
|
||||||
exe 'command! -buffer -nargs=* VimwikiSearch lvimgrep <args> '.
|
exe 'command! -buffer -nargs=* VimwikiSearch lvimgrep <args> '.
|
||||||
\ escape(VimwikiGet('path').'**/*'.VimwikiGet('ext'), ' ')
|
\ escape(vimwiki#vars#get_wikilocal('path').'**/*'.VimwikiGet('ext'), ' ')
|
||||||
|
|
||||||
exe 'command! -buffer -nargs=* VWS lvimgrep <args> '.
|
exe 'command! -buffer -nargs=* VWS lvimgrep <args> '.
|
||||||
\ escape(VimwikiGet('path').'**/*'.VimwikiGet('ext'), ' ')
|
\ escape(vimwiki#vars#get_wikilocal('path').'**/*'.VimwikiGet('ext'), ' ')
|
||||||
|
|
||||||
command! -buffer -nargs=+ -complete=custom,vimwiki#base#complete_links_escaped
|
command! -buffer -nargs=+ -complete=custom,vimwiki#base#complete_links_escaped
|
||||||
\ VimwikiGoto call vimwiki#base#goto(<f-args>)
|
\ VimwikiGoto call vimwiki#base#goto(<f-args>)
|
||||||
@ -643,7 +643,7 @@ if vimwiki#vars#get_wikilocal('auto_export')
|
|||||||
" Automatically generate HTML on page write.
|
" Automatically generate HTML on page write.
|
||||||
augroup vimwiki
|
augroup vimwiki
|
||||||
au BufWritePost <buffer>
|
au BufWritePost <buffer>
|
||||||
\ call vimwiki#html#Wiki2HTML(expand(VimwikiGet('path_html')),
|
\ call vimwiki#html#Wiki2HTML(expand(vimwiki#vars#get_wikilocal('path_html')),
|
||||||
\ expand('%'))
|
\ expand('%'))
|
||||||
augroup END
|
augroup END
|
||||||
endif
|
endif
|
||||||
|
@ -20,11 +20,11 @@ function! s:default(varname, value) "{{{
|
|||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
function! s:path_html(idx) "{{{
|
function! s:path_html(idx) "{{{
|
||||||
let path_html = VimwikiGet('path_html', a:idx)
|
let path_html = vimwiki#vars#get_wikilocal('path_html', a:idx)
|
||||||
if !empty(path_html)
|
if !empty(path_html)
|
||||||
return path_html
|
return path_html
|
||||||
else
|
else
|
||||||
let path = VimwikiGet('path', a:idx)
|
let path = vimwiki#vars#get_wikilocal('path', a:idx)
|
||||||
return substitute(path, '[/\\]\+$', '', '').'_html/'
|
return substitute(path, '[/\\]\+$', '', '').'_html/'
|
||||||
endif
|
endif
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
@ -40,8 +40,8 @@ function! s:normalize_path(path) "{{{
|
|||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
function! Validate_wiki_options(idx) " {{{
|
function! Validate_wiki_options(idx) " {{{
|
||||||
call VimwikiSet('path', s:normalize_path(VimwikiGet('path', a:idx)), a:idx)
|
call vimwiki#vars#set_wikilocal('path', s:normalize_path(vimwiki#vars#get_wikilocal('path', a:idx)), a:idx)
|
||||||
call VimwikiSet('path_html', s:normalize_path(s:path_html(a:idx)), a:idx)
|
call vimwiki#vars#set_wikilocal('path_html', s:normalize_path(s:path_html(a:idx)), a:idx)
|
||||||
call vimwiki#vars#set_wikilocal('template_path',
|
call vimwiki#vars#set_wikilocal('template_path',
|
||||||
\ s:normalize_path(vimwiki#vars#get_wikilocal('template_path', a:idx)), a:idx)
|
\ s:normalize_path(vimwiki#vars#get_wikilocal('template_path', a:idx)), a:idx)
|
||||||
call vimwiki#vars#set_wikilocal('diary_rel_path',
|
call vimwiki#vars#set_wikilocal('diary_rel_path',
|
||||||
@ -139,7 +139,7 @@ function! s:setup_buffer_enter() "{{{
|
|||||||
" to force a rescan of the filesystem which may have changed
|
" to force a rescan of the filesystem which may have changed
|
||||||
" and update VimwikiLinks syntax group that depends on it;
|
" and update VimwikiLinks syntax group that depends on it;
|
||||||
" b:vimwiki_fs_rescan indicates that setup_filetype() has not been run
|
" b:vimwiki_fs_rescan indicates that setup_filetype() has not been run
|
||||||
if exists("b:vimwiki_fs_rescan") && VimwikiGet('maxhi')
|
if exists("b:vimwiki_fs_rescan") && vimwiki#vars#get_wikilocal('maxhi')
|
||||||
set syntax=vimwiki
|
set syntax=vimwiki
|
||||||
endif
|
endif
|
||||||
let b:vimwiki_fs_rescan = 1
|
let b:vimwiki_fs_rescan = 1
|
||||||
@ -320,12 +320,8 @@ endif "}}}
|
|||||||
|
|
||||||
" DEFAULT wiki {{{
|
" DEFAULT wiki {{{
|
||||||
let s:vimwiki_defaults = {}
|
let s:vimwiki_defaults = {}
|
||||||
let s:vimwiki_defaults.path = '~/vimwiki/'
|
|
||||||
let s:vimwiki_defaults.path_html = '' " '' is replaced by derived path.'_html/'
|
|
||||||
let s:vimwiki_defaults.css_name = 'style.css'
|
|
||||||
let s:vimwiki_defaults.index = 'index'
|
let s:vimwiki_defaults.index = 'index'
|
||||||
let s:vimwiki_defaults.ext = '.wiki'
|
let s:vimwiki_defaults.ext = '.wiki'
|
||||||
let s:vimwiki_defaults.maxhi = 0
|
|
||||||
let s:vimwiki_defaults.syntax = 'default'
|
let s:vimwiki_defaults.syntax = 'default'
|
||||||
|
|
||||||
" is wiki temporary -- was added to g:vimwiki_list by opening arbitrary wiki
|
" is wiki temporary -- was added to g:vimwiki_list by opening arbitrary wiki
|
||||||
@ -439,7 +435,7 @@ nnoremap <unique><script> <Plug>VimwikiMakeYesterdayDiaryNote
|
|||||||
function! s:build_menu(topmenu)
|
function! s:build_menu(topmenu)
|
||||||
let idx = 0
|
let idx = 0
|
||||||
while idx < len(g:vimwiki_list)
|
while idx < len(g:vimwiki_list)
|
||||||
let norm_path = fnamemodify(VimwikiGet('path', idx), ':h:t')
|
let norm_path = fnamemodify(vimwiki#vars#get_wikilocal('path', idx), ':h:t')
|
||||||
let norm_path = escape(norm_path, '\ \.')
|
let norm_path = escape(norm_path, '\ \.')
|
||||||
execute 'menu '.a:topmenu.'.Open\ index.'.norm_path.
|
execute 'menu '.a:topmenu.'.Open\ index.'.norm_path.
|
||||||
\ ' :call vimwiki#base#goto_index('.(idx + 1).')<CR>'
|
\ ' :call vimwiki#base#goto_index('.(idx + 1).')<CR>'
|
||||||
|
@ -9,18 +9,14 @@ elseif exists("b:current_syntax")
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
"TODO do nothing if ...? (?)
|
|
||||||
if VimwikiGet('maxhi')
|
if vimwiki#vars#get_wikilocal('maxhi')
|
||||||
let b:existing_wikifiles =
|
let b:existing_wikifiles =
|
||||||
\ vimwiki#base#get_wikilinks(g:vimwiki_current_idx, 1)
|
\ vimwiki#base#get_wikilinks(g:vimwiki_current_idx, 1)
|
||||||
let b:existing_wikidirs =
|
let b:existing_wikidirs =
|
||||||
\ vimwiki#base#get_wiki_directories(g:vimwiki_current_idx)
|
\ vimwiki#base#get_wiki_directories(g:vimwiki_current_idx)
|
||||||
endif
|
endif
|
||||||
"let b:xxx = 1
|
|
||||||
"TODO ? update wikilink syntax group here if really needed (?) for :e and such
|
|
||||||
"if VimwikiGet('maxhi')
|
|
||||||
" ...
|
|
||||||
"endif
|
|
||||||
|
|
||||||
call vimwiki#u#reload_regexes()
|
call vimwiki#u#reload_regexes()
|
||||||
|
|
||||||
@ -214,7 +210,7 @@ endfunction "}}}
|
|||||||
|
|
||||||
|
|
||||||
" use max highlighting - could be quite slow if there are too many wikifiles
|
" use max highlighting - could be quite slow if there are too many wikifiles
|
||||||
if VimwikiGet('maxhi')
|
if vimwiki#vars#get_wikilocal('maxhi')
|
||||||
" WikiLink
|
" WikiLink
|
||||||
call s:add_target_syntax_OFF(g:vimwiki_rxWikiLink)
|
call s:add_target_syntax_OFF(g:vimwiki_rxWikiLink)
|
||||||
" WikiIncl
|
" WikiIncl
|
||||||
|
@ -280,7 +280,7 @@ endfunction "}}}
|
|||||||
|
|
||||||
|
|
||||||
" use max highlighting - could be quite slow if there are too many wikifiles
|
" use max highlighting - could be quite slow if there are too many wikifiles
|
||||||
if VimwikiGet('maxhi')
|
if vimwiki#vars#get_wikilocal('maxhi')
|
||||||
" WikiLink
|
" WikiLink
|
||||||
call s:add_target_syntax_OFF(g:vimwiki_rxWikiLink1, 'VimwikiWikiLink1')
|
call s:add_target_syntax_OFF(g:vimwiki_rxWikiLink1, 'VimwikiWikiLink1')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user