Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
129c281810 | |||
722d6e4b9a | |||
0001b3cda9 | |||
68cdfe36df | |||
4956976bb6 | |||
4c2e13a284 | |||
4bd0690a52 | |||
128581babc | |||
c2d1869227 | |||
6f579711ab | |||
6d96516ab4 | |||
0ea8d85b7f | |||
5f9dbca89c | |||
2aeaea5f0d | |||
a2888692fd | |||
fc947523b0 | |||
91a004bc23 | |||
78cef05fa3 | |||
1db5924271 | |||
ff90e980de | |||
bb3026dba8 | |||
b0cc6ff0de | |||
949b29b694 | |||
f31550badb | |||
64f71bc785 |
@ -390,7 +390,7 @@ function! vimwiki#base#system_open_link(url) "{{{
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
endtry
|
endtry
|
||||||
echomsg 'Default Vimwiki link handler was unable to open the HTML file!'
|
echomsg 'Vimwiki Error: Default Vimwiki link handler was unable to open the HTML file!'
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
" vimwiki#base#open_link
|
" vimwiki#base#open_link
|
||||||
@ -398,7 +398,7 @@ function! vimwiki#base#open_link(cmd, link, ...) "{{{
|
|||||||
let link_infos = vimwiki#base#resolve_link(a:link)
|
let link_infos = vimwiki#base#resolve_link(a:link)
|
||||||
|
|
||||||
if link_infos.filename == ''
|
if link_infos.filename == ''
|
||||||
echom 'Vimwiki Error: Unable to resolve link!'
|
echomsg 'Vimwiki Error: Unable to resolve link!'
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -505,7 +505,7 @@ function! vimwiki#base#backlinks() "{{{
|
|||||||
endfor
|
endfor
|
||||||
|
|
||||||
if empty(locations)
|
if empty(locations)
|
||||||
echom 'vimwiki: no other file links to this file'
|
echomsg 'Vimwiki: No other file links to this file'
|
||||||
else
|
else
|
||||||
call setloclist(0, locations, 'r')
|
call setloclist(0, locations, 'r')
|
||||||
lopen
|
lopen
|
||||||
@ -823,7 +823,7 @@ function! vimwiki#base#check_links() "{{{
|
|||||||
endfor
|
endfor
|
||||||
|
|
||||||
if empty(errors)
|
if empty(errors)
|
||||||
echom 'Vimwiki: all links are OK'
|
echomsg 'Vimwiki: All links are OK'
|
||||||
else
|
else
|
||||||
call setqflist(errors, 'r')
|
call setqflist(errors, 'r')
|
||||||
copen
|
copen
|
||||||
@ -846,8 +846,8 @@ function! vimwiki#base#edit_file(command, filename, anchor, ...) "{{{
|
|||||||
let ok = vimwiki#path#mkdir(dir, 1)
|
let ok = vimwiki#path#mkdir(dir, 1)
|
||||||
|
|
||||||
if !ok
|
if !ok
|
||||||
echom ' '
|
echomsg ' '
|
||||||
echom 'Vimwiki: Unable to edit file in non-existent directory: '.dir
|
echomsg 'Vimwiki Error: Unable to edit file in non-existent directory: '.dir
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -880,7 +880,7 @@ endfunction " }}}
|
|||||||
function! vimwiki#base#search_word(wikiRx, cmd) "{{{
|
function! vimwiki#base#search_word(wikiRx, cmd) "{{{
|
||||||
let match_line = search(a:wikiRx, 's'.a:cmd)
|
let match_line = search(a:wikiRx, 's'.a:cmd)
|
||||||
if match_line == 0
|
if match_line == 0
|
||||||
echomsg 'vimwiki: Wiki link not found.'
|
echomsg 'Vimwiki: Wiki link not found'
|
||||||
endif
|
endif
|
||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
|
|
||||||
@ -1281,7 +1281,7 @@ endfunction " }}}
|
|||||||
" vimwiki#base#goto_index
|
" vimwiki#base#goto_index
|
||||||
function! vimwiki#base#goto_index(wnum, ...) "{{{
|
function! vimwiki#base#goto_index(wnum, ...) "{{{
|
||||||
if a:wnum > len(g:vimwiki_list)
|
if a:wnum > len(g:vimwiki_list)
|
||||||
echom "vimwiki: Wiki ".a:wnum." is not registered in g:vimwiki_list!"
|
echomsg 'Vimwiki Error: Wiki '.a:wnum.' is not registered in g:vimwiki_list!'
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -1319,7 +1319,7 @@ function! vimwiki#base#delete_link() "{{{
|
|||||||
try
|
try
|
||||||
call delete(fname)
|
call delete(fname)
|
||||||
catch /.*/
|
catch /.*/
|
||||||
echomsg 'vimwiki: Cannot delete "'.expand('%:t:r').'"!'
|
echomsg 'Vimwiki Error: Cannot delete "'.expand('%:t:r').'"!'
|
||||||
return
|
return
|
||||||
endtry
|
endtry
|
||||||
|
|
||||||
@ -1340,7 +1340,7 @@ function! vimwiki#base#rename_link() "{{{
|
|||||||
|
|
||||||
" there is no file (new one maybe)
|
" there is no file (new one maybe)
|
||||||
if glob(expand('%:p')) == ''
|
if glob(expand('%:p')) == ''
|
||||||
echomsg 'vimwiki: Cannot rename "'.expand('%:p').
|
echomsg 'Vimwiki Error: Cannot rename "'.expand('%:p').
|
||||||
\'". It does not exist! (New file? Save it before renaming.)'
|
\'". It does not exist! (New file? Save it before renaming.)'
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
@ -1354,13 +1354,13 @@ function! vimwiki#base#rename_link() "{{{
|
|||||||
|
|
||||||
if new_link =~# '[/\\]'
|
if new_link =~# '[/\\]'
|
||||||
" It is actually doable but I do not have free time to do it.
|
" It is actually doable but I do not have free time to do it.
|
||||||
echomsg 'vimwiki: Cannot rename to a filename with path!'
|
echomsg 'Vimwiki Error: Cannot rename to a filename with path!'
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" check new_fname - it should be 'good', not empty
|
" check new_fname - it should be 'good', not empty
|
||||||
if substitute(new_link, '\s', '', 'g') == ''
|
if substitute(new_link, '\s', '', 'g') == ''
|
||||||
echomsg 'vimwiki: Cannot rename to an empty filename!'
|
echomsg 'Vimwiki Error: Cannot rename to an empty filename!'
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -1375,19 +1375,19 @@ function! vimwiki#base#rename_link() "{{{
|
|||||||
" 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)
|
||||||
if fname != ''
|
if fname != ''
|
||||||
echomsg 'vimwiki: Cannot rename to "'.new_fname.
|
echomsg 'Vimwiki Error: Cannot rename to "'.new_fname.
|
||||||
\ '". File with that name exist!'
|
\ '". File with that name exist!'
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
" rename wiki link file
|
" rename wiki link file
|
||||||
try
|
try
|
||||||
echomsg "Renaming ".VimwikiGet('path').old_fname." to ".new_fname
|
echomsg 'Vimwiki: Renaming '.VimwikiGet('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!"
|
||||||
end
|
end
|
||||||
catch /.*/
|
catch /.*/
|
||||||
echomsg 'vimwiki: Cannot rename "'.expand('%:t:r').'" to "'.new_fname.'"'
|
echomsg 'Vimwiki Error: Cannot rename "'.expand('%:t:r').'" to "'.new_fname.'"'
|
||||||
return
|
return
|
||||||
endtry
|
endtry
|
||||||
|
|
||||||
@ -1428,7 +1428,7 @@ function! vimwiki#base#rename_link() "{{{
|
|||||||
\ cur_buffer[1]])
|
\ cur_buffer[1]])
|
||||||
" execute 'bwipeout '.escape(cur_buffer[0], ' ')
|
" execute 'bwipeout '.escape(cur_buffer[0], ' ')
|
||||||
|
|
||||||
echomsg old_fname." is renamed to ".new_fname
|
echomsg 'Vimwiki: '.old_fname.' is renamed to '.new_fname
|
||||||
|
|
||||||
let &more = setting_more
|
let &more = setting_more
|
||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
@ -1736,10 +1736,27 @@ endfunction " }}}
|
|||||||
" a:create == 0: update if TOC exists
|
" a:create == 0: update if TOC exists
|
||||||
function! vimwiki#base#table_of_contents(create)
|
function! vimwiki#base#table_of_contents(create)
|
||||||
" collect new headers
|
" collect new headers
|
||||||
|
let is_inside_pre_or_math = 0 " 1: inside pre, 2: inside math, 0: outside
|
||||||
let headers = []
|
let headers = []
|
||||||
let headers_levels = [['', 0], ['', 0], ['', 0], ['', 0], ['', 0], ['', 0]]
|
let headers_levels = [['', 0], ['', 0], ['', 0], ['', 0], ['', 0], ['', 0]]
|
||||||
for lnum in range(1, line('$'))
|
for lnum in range(1, line('$'))
|
||||||
let line_content = getline(lnum)
|
let line_content = getline(lnum)
|
||||||
|
if (is_inside_pre_or_math == 1 && line_content =~# g:vimwiki_rxPreEnd) ||
|
||||||
|
\ (is_inside_pre_or_math == 2 && line_content =~# g:vimwiki_rxMathEnd)
|
||||||
|
let is_inside_pre_or_math = 0
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
if is_inside_pre_or_math > 0
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
if line_content =~# g:vimwiki_rxPreStart
|
||||||
|
let is_inside_pre_or_math = 1
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
if line_content =~# g:vimwiki_rxMathStart
|
||||||
|
let is_inside_pre_or_math = 2
|
||||||
|
continue
|
||||||
|
endif
|
||||||
if line_content !~# g:vimwiki_rxHeader
|
if line_content !~# g:vimwiki_rxHeader
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
@ -1904,6 +1921,15 @@ function! s:normalize_link_syntax_n() " {{{
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" try Weblink
|
||||||
|
let lnk = vimwiki#base#matchstr_at_cursor(g:vimwiki_rxWeblink)
|
||||||
|
if !empty(lnk)
|
||||||
|
let sub = vimwiki#base#normalize_link_helper(lnk,
|
||||||
|
\ lnk, '', g:vimwiki_WikiLinkTemplate2)
|
||||||
|
call vimwiki#base#replacestr_at_cursor(g:vimwiki_rxWeblink, sub)
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
" try Word (any characters except separators)
|
" try Word (any characters except separators)
|
||||||
" rxWord is less permissive than rxWikiLinkUrl which is used in
|
" rxWord is less permissive than rxWikiLinkUrl which is used in
|
||||||
" normalize_link_syntax_v
|
" normalize_link_syntax_v
|
||||||
@ -1965,6 +1991,18 @@ function! vimwiki#base#normalize_link(is_visual_mode) "{{{
|
|||||||
endif
|
endif
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
|
" vimwiki#base#detect_nested_syntax
|
||||||
|
function! vimwiki#base#detect_nested_syntax() "{{{
|
||||||
|
let last_word = '\v.*<(\w+)\s*$'
|
||||||
|
let lines = map(filter(getline(1, "$"), 'v:val =~ "{{{" && v:val =~ last_word'),
|
||||||
|
\ 'substitute(v:val, last_word, "\\=submatch(1)", "")')
|
||||||
|
let dict = {}
|
||||||
|
for elem in lines
|
||||||
|
let dict[elem] = elem
|
||||||
|
endfor
|
||||||
|
return dict
|
||||||
|
endfunction "}}}
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Command completion functions {{{
|
" Command completion functions {{{
|
||||||
|
@ -161,7 +161,7 @@ endfunction "}}}
|
|||||||
|
|
||||||
function! vimwiki#diary#make_note(wnum, ...) "{{{
|
function! vimwiki#diary#make_note(wnum, ...) "{{{
|
||||||
if a:wnum > len(g:vimwiki_list)
|
if a:wnum > len(g:vimwiki_list)
|
||||||
echom "vimwiki: Wiki ".a:wnum." is not registered in g:vimwiki_list!"
|
echomsg 'Vimwiki Error: Wiki '.a:wnum.' is not registered in g:vimwiki_list!'
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ endfunction "}}}
|
|||||||
|
|
||||||
function! vimwiki#diary#goto_diary_index(wnum) "{{{
|
function! vimwiki#diary#goto_diary_index(wnum) "{{{
|
||||||
if a:wnum > len(g:vimwiki_list)
|
if a:wnum > len(g:vimwiki_list)
|
||||||
echom "vimwiki: Wiki ".a:wnum." is not registered in g:vimwiki_list!"
|
echomsg 'Vimwiki Error: Wiki '.a:wnum.' is not registered in g:vimwiki_list!'
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -254,7 +254,7 @@ function! vimwiki#diary#generate_diary_section() "{{{
|
|||||||
call vimwiki#base#update_listing_in_buffer(s:format_diary(),
|
call vimwiki#base#update_listing_in_buffer(s:format_diary(),
|
||||||
\ VimwikiGet('diary_header'), content_rx, line('$')+1, 1)
|
\ VimwikiGet('diary_header'), content_rx, line('$')+1, 1)
|
||||||
else
|
else
|
||||||
echom "vimwiki: You can generate diary links only in a diary index page!"
|
echomsg 'Vimwiki Error: You can generate diary links only in a diary index page!'
|
||||||
endif
|
endif
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
|
@ -80,9 +80,10 @@ function! s:create_default_CSS(path) " {{{
|
|||||||
if default_css != ''
|
if default_css != ''
|
||||||
let lines = readfile(default_css)
|
let lines = readfile(default_css)
|
||||||
call writefile(lines, css_full_name)
|
call writefile(lines, css_full_name)
|
||||||
echomsg "Default style.css has been created."
|
return 1
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
return 0
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
function! s:template_full_name(name) "{{{
|
function! s:template_full_name(name) "{{{
|
||||||
@ -112,7 +113,7 @@ function! s:get_html_template(template) "{{{
|
|||||||
let lines = readfile(template_name)
|
let lines = readfile(template_name)
|
||||||
return lines
|
return lines
|
||||||
catch /E484/
|
catch /E484/
|
||||||
echomsg 'vimwiki: html template '.template_name.
|
echomsg 'Vimwiki: HTML template '.template_name.
|
||||||
\ ' does not exist!'
|
\ ' does not exist!'
|
||||||
endtry
|
endtry
|
||||||
endif
|
endif
|
||||||
@ -171,7 +172,7 @@ function! s:delete_html_files(path) "{{{
|
|||||||
try
|
try
|
||||||
call delete(fname)
|
call delete(fname)
|
||||||
catch
|
catch
|
||||||
echomsg 'vimwiki: Cannot delete '.fname
|
echomsg 'Vimwiki Error: Cannot delete '.fname
|
||||||
endtry
|
endtry
|
||||||
endfor
|
endfor
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
@ -1046,6 +1047,8 @@ function! s:process_tag_h(line, id) "{{{
|
|||||||
let h_part .= '>'
|
let h_part .= '>'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let h_text = s:process_inline_tags(h_text, a:id)
|
||||||
|
|
||||||
let line = h_part.h_text.'</h'.h_level.'></div>'
|
let line = h_part.h_text.'</h'.h_level.'></div>'
|
||||||
|
|
||||||
let processed = 1
|
let processed = 1
|
||||||
@ -1252,8 +1255,6 @@ function! s:parse_line(line, state) " {{{
|
|||||||
let state.quote = s:close_tag_quote(state.quote, res_lines)
|
let state.quote = s:close_tag_quote(state.quote, res_lines)
|
||||||
let state.para = s:close_tag_para(state.para, res_lines)
|
let state.para = s:close_tag_para(state.para, res_lines)
|
||||||
|
|
||||||
let line = s:process_inline_tags(line, state.header_ids)
|
|
||||||
|
|
||||||
call add(res_lines, line)
|
call add(res_lines, line)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -1366,7 +1367,7 @@ function! vimwiki#html#CustomWiki2HTML(path, wikifile, force) "{{{
|
|||||||
\ (len(VimwikiGet('subdir')) > 0 ? shellescape(s:root_path(VimwikiGet('subdir'))) : '-'))
|
\ (len(VimwikiGet('subdir')) > 0 ? shellescape(s:root_path(VimwikiGet('subdir'))) : '-'))
|
||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
|
|
||||||
function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{
|
function! s:convert_file(path_html, wikifile) "{{{
|
||||||
let done = 0
|
let done = 0
|
||||||
|
|
||||||
let wikifile = fnamemodify(a:wikifile, ":p")
|
let wikifile = fnamemodify(a:wikifile, ":p")
|
||||||
@ -1456,13 +1457,13 @@ function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{
|
|||||||
|
|
||||||
if nohtml
|
if nohtml
|
||||||
echon "\r"."%nohtml placeholder found"
|
echon "\r"."%nohtml placeholder found"
|
||||||
return
|
return ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call s:remove_blank_lines(ldest)
|
call s:remove_blank_lines(ldest)
|
||||||
|
|
||||||
"" process end of file
|
" process end of file
|
||||||
"" close opened tags if any
|
" close opened tags if any
|
||||||
let lines = []
|
let lines = []
|
||||||
call s:close_tag_quote(state.quote, lines)
|
call s:close_tag_quote(state.quote, lines)
|
||||||
call s:close_tag_para(state.para, lines)
|
call s:close_tag_para(state.para, lines)
|
||||||
@ -1494,28 +1495,34 @@ function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{
|
|||||||
|
|
||||||
let html_lines = s:html_insert_contents(html_lines, ldest) " %contents%
|
let html_lines = s:html_insert_contents(html_lines, ldest) " %contents%
|
||||||
|
|
||||||
"" make html file.
|
|
||||||
call writefile(html_lines, path_html.htmlfile)
|
call writefile(html_lines, path_html.htmlfile)
|
||||||
let done = 1
|
let done = 1
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if done == 0
|
if done == 0
|
||||||
echomsg 'vimwiki: conversion to HTML is not supported for this syntax!!!'
|
echomsg 'Vimwiki Error: Conversion to HTML is not supported for this syntax'
|
||||||
return
|
return ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return path_html.htmlfile
|
return path_html.htmlfile
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
|
function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{
|
||||||
|
let result = s:convert_file(a:path_html, a:wikifile)
|
||||||
|
if result != ''
|
||||||
|
call s:create_default_CSS(a:path_html)
|
||||||
|
endif
|
||||||
|
return result
|
||||||
|
endfunction "}}}
|
||||||
|
|
||||||
function! vimwiki#html#WikiAll2HTML(path_html) "{{{
|
function! vimwiki#html#WikiAll2HTML(path_html) "{{{
|
||||||
if !s:syntax_supported() && !s:use_custom_wiki2html()
|
if !s:syntax_supported() && !s:use_custom_wiki2html()
|
||||||
echomsg 'vimwiki: conversion to HTML is not supported for this syntax!!!'
|
echomsg 'Vimwiki Error: Conversion to HTML is not supported for this syntax'
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
echomsg 'Saving vimwiki files...'
|
echomsg 'Vimwiki: Saving Vimwiki files ...'
|
||||||
let save_eventignore = &eventignore
|
let save_eventignore = &eventignore
|
||||||
let &eventignore = "all"
|
let &eventignore = "all"
|
||||||
let cur_buf = bufname('%')
|
let cur_buf = bufname('%')
|
||||||
@ -1526,10 +1533,10 @@ function! vimwiki#html#WikiAll2HTML(path_html) "{{{
|
|||||||
let path_html = expand(a:path_html)
|
let path_html = expand(a:path_html)
|
||||||
call vimwiki#path#mkdir(path_html)
|
call vimwiki#path#mkdir(path_html)
|
||||||
|
|
||||||
echomsg 'Deleting non-wiki html files...'
|
echomsg 'Vimwiki: Deleting non-wiki html files ...'
|
||||||
call s:delete_html_files(path_html)
|
call s:delete_html_files(path_html)
|
||||||
|
|
||||||
echomsg 'Converting wiki to html files...'
|
echomsg 'Vimwiki: Converting wiki to html files ...'
|
||||||
let setting_more = &more
|
let setting_more = &more
|
||||||
setlocal nomore
|
setlocal nomore
|
||||||
|
|
||||||
@ -1547,20 +1554,23 @@ function! vimwiki#html#WikiAll2HTML(path_html) "{{{
|
|||||||
call VimwikiSet('invsubdir', vimwiki#base#invsubdir(subdir))
|
call VimwikiSet('invsubdir', vimwiki#base#invsubdir(subdir))
|
||||||
|
|
||||||
if !s:is_html_uptodate(wikifile)
|
if !s:is_html_uptodate(wikifile)
|
||||||
echomsg 'Processing '.wikifile
|
echomsg 'Vimwiki: Processing '.wikifile
|
||||||
|
|
||||||
call vimwiki#html#Wiki2HTML(path_html, wikifile)
|
call s:convert_file(path_html, wikifile)
|
||||||
else
|
else
|
||||||
echomsg 'Skipping '.wikifile
|
echomsg 'Vimwiki: Skipping '.wikifile
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
" reset 'subdir' state variable
|
" reset 'subdir' state variable
|
||||||
call VimwikiSet('subdir', current_subdir)
|
call VimwikiSet('subdir', current_subdir)
|
||||||
call VimwikiSet('invsubdir', current_invsubdir)
|
call VimwikiSet('invsubdir', current_invsubdir)
|
||||||
|
|
||||||
call s:create_default_CSS(path_html)
|
let created = s:create_default_CSS(path_html)
|
||||||
echomsg 'HTML exported to '.path_html
|
if created
|
||||||
echomsg 'Done!'
|
echomsg 'Vimwiki: Default style.css has been created'
|
||||||
|
endif
|
||||||
|
echomsg 'Vimwiki: HTML exported to '.path_html
|
||||||
|
echomsg 'Vimwiki: Done!'
|
||||||
|
|
||||||
let &more = setting_more
|
let &more = setting_more
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
@ -376,10 +376,10 @@ endfunction "}}}
|
|||||||
"If there is no second argument, 0 is returned at a header, otherwise the
|
"If there is no second argument, 0 is returned at a header, otherwise the
|
||||||
"header is skipped
|
"header is skipped
|
||||||
function! s:get_next_line(lnum, ...) "{{{
|
function! s:get_next_line(lnum, ...) "{{{
|
||||||
if getline(a:lnum) =~# '^\s*'.g:vimwiki_rxPreStart
|
if getline(a:lnum) =~# g:vimwiki_rxPreStart
|
||||||
let cur_ln = a:lnum + 1
|
let cur_ln = a:lnum + 1
|
||||||
while cur_ln <= line('$') &&
|
while cur_ln <= line('$') &&
|
||||||
\ getline(cur_ln) !~# '^\s*'.g:vimwiki_rxPreEnd.'\s*$'
|
\ getline(cur_ln) !~# g:vimwiki_rxPreEnd
|
||||||
let cur_ln += 1
|
let cur_ln += 1
|
||||||
endwhile
|
endwhile
|
||||||
let next_line = cur_ln
|
let next_line = cur_ln
|
||||||
@ -404,10 +404,10 @@ endfunction "}}}
|
|||||||
function! s:get_prev_line(lnum) "{{{
|
function! s:get_prev_line(lnum) "{{{
|
||||||
let prev_line = prevnonblank(a:lnum-1)
|
let prev_line = prevnonblank(a:lnum-1)
|
||||||
|
|
||||||
if getline(prev_line) =~# '^\s*'.g:vimwiki_rxPreEnd.'\s*$'
|
if getline(prev_line) =~# g:vimwiki_rxPreEnd
|
||||||
let cur_ln = a:lnum - 1
|
let cur_ln = a:lnum - 1
|
||||||
while 1
|
while 1
|
||||||
if cur_ln == 0 || getline(cur_ln) =~# '^\s*'.g:vimwiki_rxPreStart
|
if cur_ln == 0 || getline(cur_ln) =~# g:vimwiki_rxPreStart
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
let cur_ln -= 1
|
let cur_ln -= 1
|
||||||
|
@ -108,6 +108,8 @@ function! vimwiki#markdown_base#follow_link(split, ...) "{{{ Parse link at curso
|
|||||||
if lnk != ""
|
if lnk != ""
|
||||||
if !VimwikiLinkHandler(lnk)
|
if !VimwikiLinkHandler(lnk)
|
||||||
if !vimwiki#markdown_base#open_reflink(lnk)
|
if !vimwiki#markdown_base#open_reflink(lnk)
|
||||||
|
" remove the extension from the filename if exists
|
||||||
|
let lnk = substitute(lnk, VimwikiGet('ext').'$', '', '')
|
||||||
call vimwiki#base#open_link(cmd, lnk)
|
call vimwiki#base#open_link(cmd, lnk)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -173,7 +175,7 @@ function! s:normalize_link_syntax_n() " {{{
|
|||||||
if !empty(lnk)
|
if !empty(lnk)
|
||||||
let sub = vimwiki#base#normalize_link_helper(lnk,
|
let sub = vimwiki#base#normalize_link_helper(lnk,
|
||||||
\ g:vimwiki_rxWord, '',
|
\ g:vimwiki_rxWord, '',
|
||||||
\ g:vimwiki_WikiLinkTemplate1)
|
\ g:vimwiki_Weblink1Template)
|
||||||
call vimwiki#base#replacestr_at_cursor('\V'.lnk, sub)
|
call vimwiki#base#replacestr_at_cursor('\V'.lnk, sub)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
@ -192,9 +194,10 @@ function! s:normalize_link_syntax_v() " {{{
|
|||||||
try
|
try
|
||||||
norm! gvy
|
norm! gvy
|
||||||
let visual_selection = @"
|
let visual_selection = @"
|
||||||
let visual_selection = substitute(g:vimwiki_WikiLinkTemplate1, '__LinkUrl__', '\='."'".visual_selection."'", '')
|
let link = substitute(g:vimwiki_Weblink1Template, '__LinkUrl__', '\='."'".visual_selection."'", '')
|
||||||
|
let link = substitute(link, '__LinkDescription__', '\='."'".visual_selection."'", '')
|
||||||
|
|
||||||
call setreg('"', visual_selection, 'v')
|
call setreg('"', link, 'v')
|
||||||
|
|
||||||
" paste result
|
" paste result
|
||||||
norm! `>pgvd
|
norm! `>pgvd
|
||||||
|
@ -148,3 +148,22 @@ function! vimwiki#path#is_absolute(path) "{{{
|
|||||||
return a:path =~# '\m^/\|\~/'
|
return a:path =~# '\m^/\|\~/'
|
||||||
endif
|
endif
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
|
|
||||||
|
" 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
|
||||||
|
" is because on windows ~\vimwiki//.tags is invalid but ~\vimwiki/.tags is a
|
||||||
|
" valid path.
|
||||||
|
if vimwiki#u#is_windows()
|
||||||
|
function! vimwiki#path#join_path(directory, file)
|
||||||
|
let directory = vimwiki#path#chomp_slash(a:directory)
|
||||||
|
let file = substitute(a:file, '\m^[\\/]\+', '', '')
|
||||||
|
return directory . '/' . file
|
||||||
|
endfunction
|
||||||
|
else
|
||||||
|
function! vimwiki#path#join_path(directory, file)
|
||||||
|
let directory = substitute(a:directory, '\m/\+$', '', '')
|
||||||
|
let file = substitute(a:file, '\m^/\+', '', '')
|
||||||
|
return directory . '/' . file
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
|
@ -41,12 +41,14 @@ 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 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()
|
||||||
for file in files
|
for file in files
|
||||||
if all_files || getftime(file) >= tags_file_last_modification
|
if all_files || getftime(file) >= tags_file_last_modification
|
||||||
let page_name = fnamemodify(file, ':t:r')
|
let subdir = vimwiki#base#subdir(wiki_base_dir, file)
|
||||||
|
let page_name = subdir . fnamemodify(file, ':t:r')
|
||||||
let tags = s:scan_tags(readfile(file), page_name)
|
let tags = s:scan_tags(readfile(file), page_name)
|
||||||
let metadata = s:remove_page_from_tags(metadata, page_name)
|
let metadata = s:remove_page_from_tags(metadata, page_name)
|
||||||
let metadata = s:merge_tags(metadata, page_name, tags)
|
let metadata = s:merge_tags(metadata, page_name, tags)
|
||||||
@ -139,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(VimwikiGet('path') . '/' . s:TAGS_METADATA_FILE_NAME, ':p')
|
return fnamemodify(vimwiki#path#join_path(VimwikiGet('path'), s:TAGS_METADATA_FILE_NAME), ':p')
|
||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
|
|
||||||
" s:load_tags_metadata
|
" s:load_tags_metadata
|
||||||
@ -315,7 +317,7 @@ function! vimwiki#tags#generate_tags(...) abort "{{{
|
|||||||
\ '',
|
\ '',
|
||||||
\ substitute(g:vimwiki_rxH2_Template, '__Header__', tagname, ''),
|
\ substitute(g:vimwiki_rxH2_Template, '__Header__', tagname, ''),
|
||||||
\ '' ])
|
\ '' ])
|
||||||
for taglink in tags_entries[tagname]
|
for taglink in sort(tags_entries[tagname])
|
||||||
call add(lines, bullet .
|
call add(lines, bullet .
|
||||||
\ substitute(g:vimwiki_WikiLinkTemplate1, '__LinkUrl__', taglink, ''))
|
\ substitute(g:vimwiki_WikiLinkTemplate1, '__LinkUrl__', taglink, ''))
|
||||||
endfor
|
endfor
|
||||||
|
@ -415,7 +415,6 @@ function! vimwiki#tbl#goto_prev_col() "{{{
|
|||||||
let newcol = s:get_indent(lnum)
|
let newcol = s:get_indent(lnum)
|
||||||
let max_lens = s:get_cell_max_lens(lnum)
|
let max_lens = s:get_cell_max_lens(lnum)
|
||||||
let prev_cell_len = 0
|
let prev_cell_len = 0
|
||||||
echom string(max_lens)
|
|
||||||
for cell_len in values(max_lens)
|
for cell_len in values(max_lens)
|
||||||
let delta = cell_len + 3 " +3 == 2 spaces + 1 separator |<space>...<space>
|
let delta = cell_len + 3 " +3 == 2 spaces + 1 separator |<space>...<space>
|
||||||
if newcol + delta > curcol-1
|
if newcol + delta > curcol-1
|
||||||
|
@ -38,7 +38,7 @@ function! vimwiki#u#count_first_sym(line) "{{{
|
|||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
function! vimwiki#u#escape(string) "{{{
|
function! vimwiki#u#escape(string) "{{{
|
||||||
return escape(a:string, '.*[]\^$')
|
return escape(a:string, '~.*[]\^$')
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
" Load concrete Wiki syntax: sets regexes and templates for headers and links
|
" Load concrete Wiki syntax: sets regexes and templates for headers and links
|
||||||
|
225
doc/vimwiki.txt
225
doc/vimwiki.txt
@ -9,7 +9,7 @@
|
|||||||
|___| |___| |_| |_||__| |__||___| |___| |_||___| ~
|
|___| |___| |_| |_||__| |__||___| |___| |_||___| ~
|
||||||
|
|
||||||
|
|
||||||
Version: 2.2
|
Version: 2.3
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
CONTENTS *vimwiki*
|
CONTENTS *vimwiki*
|
||||||
@ -78,8 +78,8 @@ Feed it with the following example:
|
|||||||
|
|
||||||
Place your cursor on 'Tasks' and press Enter to create a link. Once pressed,
|
Place your cursor on 'Tasks' and press Enter to create a link. Once pressed,
|
||||||
'Tasks' will become '[[Tasks]]' -- a Vimwiki link. Press Enter again to
|
'Tasks' will become '[[Tasks]]' -- a Vimwiki link. Press Enter again to
|
||||||
open it. Edit the file, save it, and then press Backspace to jump back to your
|
open it. Edit the file, save it, and then press Backspace to jump back to
|
||||||
index.
|
your index.
|
||||||
|
|
||||||
A Vimwiki link can be constructed from more than one word. Just visually
|
A Vimwiki link can be constructed from more than one word. Just visually
|
||||||
select the words to be linked and press Enter. Try it with 'Project
|
select the words to be linked and press Enter. Try it with 'Project
|
||||||
@ -196,6 +196,24 @@ See also |:VimwikiMakeDiaryNote|
|
|||||||
See also |:VimwikiTabMakeDiaryNote|
|
See also |:VimwikiTabMakeDiaryNote|
|
||||||
|
|
||||||
|
|
||||||
|
[count]<Leader>w<Leader>y or <Plug>VimwikiMakeYesterdayDiaryNote
|
||||||
|
Open diary wiki-file for yesterday of the [count]'s wiki.
|
||||||
|
|
||||||
|
<Leader>w<Leader>y opens diary wiki-file for yesterday in the first
|
||||||
|
wiki from |g:vimwiki_list|.
|
||||||
|
1<Leader>w<Leader>y as above opens diary wiki-file for yesterday in
|
||||||
|
the first wiki from |g:vimwiki_list|.
|
||||||
|
2<Leader>w<Leader>y opens diary wiki-file for yesterday in the second
|
||||||
|
wiki from |g:vimwiki_list|.
|
||||||
|
3<Leader>w<Leader>y opens diary wiki-file for yesterday in the third
|
||||||
|
wiki from |g:vimwiki_list|.
|
||||||
|
etc.
|
||||||
|
To remap: >
|
||||||
|
:nmap <Leader>dy <Plug>VimwikiMakeYesterdayDiaryNote
|
||||||
|
<
|
||||||
|
See also |:VimwikiMakeYesterdayDiaryNote|
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
3.2. Local mappings
|
3.2. Local mappings
|
||||||
|
|
||||||
@ -358,70 +376,72 @@ gLr Renumber list items in all numbered lists in the whole
|
|||||||
:nmap <c-r> <Plug>VimwikiRenumberAllLists
|
:nmap <c-r> <Plug>VimwikiRenumberAllLists
|
||||||
<
|
<
|
||||||
*vimwiki_glstar* *vimwiki_gLstar*
|
*vimwiki_glstar* *vimwiki_gLstar*
|
||||||
gl* Make a list item out of normal line or change the symbol
|
gl* Make a list item out of a normal line or change the
|
||||||
of the current item to *.
|
symbol of the current item to *.
|
||||||
gL* Change the symbol of the current list to *.
|
gL* Change the symbol of the current list to *.
|
||||||
To remap: >
|
To remap: >
|
||||||
noremap glo :VimwikiChangeSymbolTo *<CR>
|
noremap glo :VimwikiChangeSymbolTo *<CR>
|
||||||
noremap glO :VimwikiChangeSymbolInListTo *<CR>
|
noremap glO :VimwikiChangeSymbolInListTo *<CR>
|
||||||
<
|
<
|
||||||
*vimwiki_gl#* *vimwiki_gL#*
|
*vimwiki_gl#* *vimwiki_gL#*
|
||||||
gl# Make a list item out of normal line or change the symbol
|
gl# Make a list item out of a normal line or change the
|
||||||
of the current item to #.
|
symbol of the current item to #.
|
||||||
gL# Change the symbol of the current list to #.
|
gL# Change the symbol of the current list to #.
|
||||||
To remap: >
|
To remap: >
|
||||||
noremap glo :VimwikiChangeSymbolTo #<CR>
|
noremap glo :VimwikiChangeSymbolTo #<CR>
|
||||||
noremap glO :VimwikiChangeSymbolInListTo #<CR>
|
noremap glO :VimwikiChangeSymbolInListTo #<CR>
|
||||||
<
|
<
|
||||||
*vimwiki_gl-* *vimwiki_gL-*
|
*vimwiki_gl-* *vimwiki_gL-*
|
||||||
gl- Make a list item out of normal line or change the symbol
|
gl- Make a list item out of a normal line or change the
|
||||||
of the current item to -.
|
symbol of the current item to -.
|
||||||
gL- Change the symbol of the current list to -.
|
gL- Change the symbol of the current list to -.
|
||||||
To remap: >
|
To remap: >
|
||||||
noremap glo :VimwikiChangeSymbolTo -<CR>
|
noremap glo :VimwikiChangeSymbolTo -<CR>
|
||||||
noremap glO :VimwikiChangeSymbolInListTo -<CR>
|
noremap glO :VimwikiChangeSymbolInListTo -<CR>
|
||||||
<
|
<
|
||||||
*vimwiki_gl1* *vimwiki_gL1*
|
*vimwiki_gl1* *vimwiki_gL1*
|
||||||
gl1 Make a list item out of normal line or change the symbol
|
gl1 Make a list item out of a normal line or change the
|
||||||
of the current item to 1., the numbering is adjusted
|
symbol of the current item to 1., the numbering is
|
||||||
according to the surrounding list items.
|
adjusted according to the surrounding list items.
|
||||||
gL1 Change the symbol of the current list to 1. 2. 3. ...
|
gL1 Change the symbol of the current list to 1. 2. 3. ...
|
||||||
To remap: >
|
To remap: >
|
||||||
noremap glo :VimwikiChangeSymbolTo 1.<CR>
|
noremap glo :VimwikiChangeSymbolTo 1.<CR>
|
||||||
noremap glO :VimwikiChangeSymbolInListTo 1.<CR>
|
noremap glO :VimwikiChangeSymbolInListTo 1.<CR>
|
||||||
<
|
<
|
||||||
*vimwiki_gla* *vimwiki_gLa*
|
*vimwiki_gla* *vimwiki_gLa*
|
||||||
gla Make a list item out of normal line or change the symbol
|
gla Make a list item out of a normal line or change the
|
||||||
of the current item to a), the numbering is adjusted
|
symbol of the current item to a), the numbering is
|
||||||
according to the surrounding list items.
|
adjusted according to the surrounding list items.
|
||||||
gLa Change the symbol of the current list to a) b) c) ...
|
gLa Change the symbol of the current list to a) b) c) ...
|
||||||
To remap: >
|
To remap: >
|
||||||
noremap glo :VimwikiChangeSymbolTo a)<CR>
|
noremap glo :VimwikiChangeSymbolTo a)<CR>
|
||||||
noremap glO :VimwikiChangeSymbolInListTo a)<CR>
|
noremap glO :VimwikiChangeSymbolInListTo a)<CR>
|
||||||
<
|
<
|
||||||
*vimwiki_glA* *vimwiki_gLA*
|
*vimwiki_glA* *vimwiki_gLA*
|
||||||
glA Make a list item out of normal line or change the symbol
|
glA Make a list item out of a normal line or change the
|
||||||
of the current item to A), the numbering is adjusted
|
symbol of the current item to A), the numbering is
|
||||||
according to the surrounding list items.
|
adjusted according to the surrounding list items.
|
||||||
gLA Change the symbol of the current list to A) B) C) ...
|
gLA Change the symbol of the current list to A) B) C) ...
|
||||||
To remap: >
|
To remap: >
|
||||||
noremap glo :VimwikiChangeSymbolTo A)<CR>
|
noremap glo :VimwikiChangeSymbolTo A)<CR>
|
||||||
noremap glO :VimwikiChangeSymbolInListTo A)<CR>
|
noremap glO :VimwikiChangeSymbolInListTo A)<CR>
|
||||||
<
|
<
|
||||||
*vimwiki_gli* *vimwiki_gLi*
|
*vimwiki_gli* *vimwiki_gLi*
|
||||||
gli Make a list item out of normal line or change the symbol
|
gli Make a list item out of a normal line or change the
|
||||||
of the current item to i), the numbering is adjusted
|
symbol of the current item to i), the numbering is
|
||||||
according to the surrounding list items.
|
adjusted according to the surrounding list items.
|
||||||
gLi Change the symbol of the current list to i) ii) iii) ...
|
gLi Change the symbol of the current list to
|
||||||
|
i) ii) iii) ...
|
||||||
To remap: >
|
To remap: >
|
||||||
noremap glo :VimwikiChangeSymbolTo i)<CR>
|
noremap glo :VimwikiChangeSymbolTo i)<CR>
|
||||||
noremap glO :VimwikiChangeSymbolInListTo i)<CR>
|
noremap glO :VimwikiChangeSymbolInListTo i)<CR>
|
||||||
<
|
<
|
||||||
*vimwiki_glI* *vimwiki_gLI*
|
*vimwiki_glI* *vimwiki_gLI*
|
||||||
glI Make a list item out of normal line or change the symbol
|
glI Make a list item out of a normal line or change the
|
||||||
of the current item to I), the numbering is adjusted
|
symbol of the current item to I), the numbering is
|
||||||
according to the surrounding list items.
|
adjusted according to the surrounding list items.
|
||||||
gLI Change the symbol of the current list to I) II) III) ...
|
gLI Change the symbol of the current list to
|
||||||
|
I) II) III) ...
|
||||||
To remap: >
|
To remap: >
|
||||||
noremap glo :VimwikiChangeSymbolTo I)<CR>
|
noremap glo :VimwikiChangeSymbolTo I)<CR>
|
||||||
noremap glO :VimwikiChangeSymbolInListTo I)<CR>
|
noremap glO :VimwikiChangeSymbolInListTo I)<CR>
|
||||||
@ -567,6 +587,9 @@ il A single list item.
|
|||||||
*:VimwikiTabMakeDiaryNote*
|
*:VimwikiTabMakeDiaryNote*
|
||||||
Open diary wiki-file for today of the current wiki in a new tab.
|
Open diary wiki-file for today of the current wiki in a new tab.
|
||||||
|
|
||||||
|
*:VimwikiMakeYesterdayDiaryNote*
|
||||||
|
Open diary wiki-file for yesterday of the current wiki.
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
4.2. Local commands *vimwiki-local-commands*
|
4.2. Local commands *vimwiki-local-commands*
|
||||||
@ -793,8 +816,8 @@ identify wikilinks whose targets are not found.
|
|||||||
|
|
||||||
Interwiki:~
|
Interwiki:~
|
||||||
|
|
||||||
If you maintain more than one wiki, you can create interwiki links between them
|
If you maintain more than one wiki, you can create interwiki links between
|
||||||
by adding a numbered prefix "wikiX:" in front of a link: >
|
them by adding a numbered prefix "wikiX:" in front of a link: >
|
||||||
[[wiki1:This is a link]]
|
[[wiki1:This is a link]]
|
||||||
or: >
|
or: >
|
||||||
[[wiki1:This is a link source|Description of the link]]
|
[[wiki1:This is a link source|Description of the link]]
|
||||||
@ -873,7 +896,7 @@ in HTML: >
|
|||||||
alt="Vimwiki"/>
|
alt="Vimwiki"/>
|
||||||
|
|
||||||
Transclude image with alternate text and some style: >
|
Transclude image with alternate text and some style: >
|
||||||
{{http://.../vimwiki_logo.png|cool stuff|style="width:150px; height: 120px;"}}
|
{{http://.../vimwiki_logo.png|cool stuff|style="width:150px;height:120px;"}}
|
||||||
in HTML: >
|
in HTML: >
|
||||||
<img src="http://vimwiki.googlecode.com/hg/images/vimwiki_logo.png"
|
<img src="http://vimwiki.googlecode.com/hg/images/vimwiki_logo.png"
|
||||||
alt="cool stuff" style="width:150px; height:120px"/>
|
alt="cool stuff" style="width:150px; height:120px"/>
|
||||||
@ -914,7 +937,7 @@ Reference-style links: >
|
|||||||
a) [Link Name][Id]
|
a) [Link Name][Id]
|
||||||
b) [Id][], using the "implicit link name" shortcut
|
b) [Id][], using the "implicit link name" shortcut
|
||||||
|
|
||||||
Reference style links must always include *two* consecutive pairs of
|
Reference style links must always include two consecutive pairs of
|
||||||
[-brackets, and field entries can not use "[" or "]".
|
[-brackets, and field entries can not use "[" or "]".
|
||||||
|
|
||||||
|
|
||||||
@ -1149,7 +1172,7 @@ E.g.:
|
|||||||
}}$
|
}}$
|
||||||
|
|
||||||
Note: no matter how many lines are used in the text file, the HTML will
|
Note: no matter how many lines are used in the text file, the HTML will
|
||||||
compress it to *one* line only.
|
compress it to one line only.
|
||||||
|
|
||||||
Block environment is similar to block display, but is able to use specific
|
Block environment is similar to block display, but is able to use specific
|
||||||
LaTeX environments, such as 'align'. The syntax is the same as for block
|
LaTeX environments, such as 'align'. The syntax is the same as for block
|
||||||
@ -1164,7 +1187,7 @@ Similar compression rules for the HTML page hold (as MathJax interprets the
|
|||||||
LaTeX code).
|
LaTeX code).
|
||||||
|
|
||||||
Note: the highlighting in Vim is automatic. For the rendering in HTML, you
|
Note: the highlighting in Vim is automatic. For the rendering in HTML, you
|
||||||
have two *alternative* options:
|
have two alternative options:
|
||||||
|
|
||||||
1. using the MathJax server for rendering (needs internet connection).
|
1. using the MathJax server for rendering (needs internet connection).
|
||||||
Add to your HTML template the following line:
|
Add to your HTML template the following line:
|
||||||
@ -1200,7 +1223,7 @@ Text which starts with 4 or more spaces is a blockquote.
|
|||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
5.10. Comments *vimwiki-syntax-comments*
|
5.10. Comments *vimwiki-syntax-comments*
|
||||||
|
|
||||||
A line that starts with %% is a comment.
|
A line that starts with %% is a comment.
|
||||||
E.g.: >
|
E.g.: >
|
||||||
@ -1215,7 +1238,7 @@ E.g.: >
|
|||||||
<
|
<
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
5.12. Tags *vimwiki-syntax-tags*
|
5.12. Tags *vimwiki-syntax-tags*
|
||||||
|
|
||||||
You can tag a wiki file, a header or an arbitrary place in a wiki file. Then,
|
You can tag a wiki file, a header or an arbitrary place in a wiki file. Then,
|
||||||
you can use Vim's built-in tag search functionality (see |tagsrch.txt|) or
|
you can use Vim's built-in tag search functionality (see |tagsrch.txt|) or
|
||||||
@ -1290,7 +1313,7 @@ Hit |zr| one more time:
|
|||||||
* [ ] Do stuff 3~
|
* [ ] Do stuff 3~
|
||||||
|
|
||||||
Note: If you use the default Vimwiki syntax, folding on list items will work
|
Note: If you use the default Vimwiki syntax, folding on list items will work
|
||||||
properly only if all of them are indented using the current |shiftwidth|.
|
properly only if all of them are indented using the current 'shiftwidth'.
|
||||||
For MediaWiki, * or # should be in the first column.
|
For MediaWiki, * or # should be in the first column.
|
||||||
|
|
||||||
To turn folding on/off check |g:vimwiki_folding|.
|
To turn folding on/off check |g:vimwiki_folding|.
|
||||||
@ -1619,21 +1642,21 @@ For example, consider the following file "Todo.wiki": >
|
|||||||
- [ ] beg for *pay rise*
|
- [ ] beg for *pay rise*
|
||||||
== Knitting club ==
|
== Knitting club ==
|
||||||
=== Knitting projects ===
|
=== Knitting projects ===
|
||||||
- [ ] a funny *pig*
|
- [ ] a *funny pig*
|
||||||
- [ ] a scary *dog*
|
- [ ] a *scary dog*
|
||||||
|
|
||||||
Then, to jump from your index.wiki directly to your knitting projects, use: >
|
Then, to jump from your index.wiki directly to your knitting projects, use: >
|
||||||
[[Todo#Knitting projects]]
|
[[Todo#Knitting projects]]
|
||||||
|
|
||||||
Or, to jump to an individual project, use this link: >
|
Or, to jump to an individual project, use this link: >
|
||||||
[[Todo#pig]]
|
[[Todo#funny pig]]
|
||||||
|
|
||||||
Or, to jump to a tag, use this link: >
|
Or, to jump to a tag, use this link: >
|
||||||
[[Todo#todo-lists]]
|
[[Todo#todo-lists]]
|
||||||
|
|
||||||
If there are multiple instances of an anchor, you can use the long form which
|
If there are multiple instances of an anchor, you can use the long form which
|
||||||
consists of the complete header hierarchy, separated by '#': >
|
consists of the complete header hierarchy, separated by '#': >
|
||||||
[[Todo#My tasks#Knitting club#Knitting projects#dog]]
|
[[Todo#My tasks#Knitting club#Knitting projects#scary dog]]
|
||||||
|
|
||||||
If you don't feel like typing the whole stuff, type just [[Todo# and then
|
If you don't feel like typing the whole stuff, type just [[Todo# and then
|
||||||
|i_CTRL-X_CTRL-O| to start the omni completion of anchors.
|
|i_CTRL-X_CTRL-O| to start the omni completion of anchors.
|
||||||
@ -1693,7 +1716,7 @@ described in |vimwiki-temporary-wiki|. For a list of per-wiki options, see
|
|||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
12.1 Registered Wiki *g:vimwiki_list* *vimwiki-register-wiki*
|
12.1 Registered Wiki *g:vimwiki_list* *vimwiki-register-wiki*
|
||||||
|
|
||||||
One or more wikis can be registered using the |g:vimwiki_list| variable.
|
One or more wikis can be registered using the |g:vimwiki_list| variable.
|
||||||
|
|
||||||
@ -1734,7 +1757,7 @@ For clarity, in your .vimrc file you can define wiki options using separate
|
|||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
12.2 Temporary Wiki *vimwiki-temporary-wiki*
|
12.2 Temporary Wiki *vimwiki-temporary-wiki*
|
||||||
|
|
||||||
|
|
||||||
The creation of temporary wikis allows you to create a wiki on the fly.
|
The creation of temporary wikis allows you to create a wiki on the fly.
|
||||||
@ -1994,6 +2017,28 @@ or in: >
|
|||||||
}}}
|
}}}
|
||||||
|
|
||||||
|
|
||||||
|
*vimwiki-option-automatic_nested_syntaxes*
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
Key Default value~
|
||||||
|
automatic_nested_syntaxes 1
|
||||||
|
|
||||||
|
Description~
|
||||||
|
If set, the nested syntaxes (|vimwiki-option-nested_syntaxes|) are
|
||||||
|
automatically derived when opening a buffer.
|
||||||
|
Just write your preformatted text in your file like this >
|
||||||
|
{{{xxx
|
||||||
|
my preformatted text
|
||||||
|
}}}
|
||||||
|
|
||||||
|
where xxx is a Vim filetype.
|
||||||
|
|
||||||
|
Note that you may have to reload the file (|:edit|) to see the highlight.
|
||||||
|
|
||||||
|
Since every file is scanned for the markers of preformatted text when it is
|
||||||
|
opened, it can be slow when you have huge files. In this case, set this option
|
||||||
|
to 0.
|
||||||
|
|
||||||
|
|
||||||
*vimwiki-option-diary_rel_path*
|
*vimwiki-option-diary_rel_path*
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
Key Default value~
|
Key Default value~
|
||||||
@ -2075,7 +2120,7 @@ Key Default value~
|
|||||||
list_margin -1
|
list_margin -1
|
||||||
|
|
||||||
Description~
|
Description~
|
||||||
Width of left-hand margin for lists. When negative, the current |shiftwidth|
|
Width of left-hand margin for lists. When negative, the current 'shiftwidth'
|
||||||
is used. This affects the appearance of the generated links (see
|
is used. This affects the appearance of the generated links (see
|
||||||
|:VimwikiGenerateLinks|), the Table of contents (|vimwiki-toc|) and the
|
|:VimwikiGenerateLinks|), the Table of contents (|vimwiki-toc|) and the
|
||||||
behavior of the list manipulation commands |:VimwikiListChangeLevel| and the
|
behavior of the list manipulation commands |:VimwikiListChangeLevel| and the
|
||||||
@ -2230,10 +2275,10 @@ Enable/disable Vimwiki's folding (outline) functionality. Folding in Vimwiki
|
|||||||
can uses either the 'expr' or the 'syntax' |foldmethod| of Vim.
|
can uses either the 'expr' or the 'syntax' |foldmethod| of Vim.
|
||||||
|
|
||||||
Value Description~
|
Value Description~
|
||||||
'' Disable folding.
|
'' Disable folding
|
||||||
'expr' Folding based on expression (folds sections and code blocks).
|
'expr' Folding based on expression (folds sections and code blocks)
|
||||||
'syntax' Folding based on syntax (folds sections; slower than 'expr').
|
'syntax' Folding based on syntax (folds sections; slower than 'expr')
|
||||||
'list' Folding based on expression (folds list subitems; much slower).
|
'list' Folding based on expression (folds list subitems; much slower)
|
||||||
|
|
||||||
Default: ''
|
Default: ''
|
||||||
|
|
||||||
@ -2311,7 +2356,7 @@ A second example handles a new scheme, "vfile:", which behaves similar to
|
|||||||
endif
|
endif
|
||||||
let link_infos = vimwiki#base#resolve_link(link)
|
let link_infos = vimwiki#base#resolve_link(link)
|
||||||
if link_infos.filename == ''
|
if link_infos.filename == ''
|
||||||
echom 'Vimwiki Error: Unable to resolve link!'
|
echomsg 'Vimwiki Error: Unable to resolve link!'
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
exe 'tabnew ' . fnameescape(link_infos.filename)
|
exe 'tabnew ' . fnameescape(link_infos.filename)
|
||||||
@ -2406,7 +2451,7 @@ Default: 1
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*g:vimwiki_w32_dir_enc*
|
*g:vimwiki_w32_dir_enc*
|
||||||
|
|
||||||
Convert directory name from current |encoding| into 'g:vimwiki_w32_dir_enc'
|
Convert directory name from current 'encoding' into 'g:vimwiki_w32_dir_enc'
|
||||||
before it is created.
|
before it is created.
|
||||||
|
|
||||||
If you have 'enc=utf-8' and set up >
|
If you have 'enc=utf-8' and set up >
|
||||||
@ -2432,7 +2477,7 @@ Value Description~
|
|||||||
|
|
||||||
Default: 0
|
Default: 0
|
||||||
|
|
||||||
Note: Vim 7.3 has a new function |strdisplaywidth|, so for users of an up to
|
Note: Vim 7.3 has a new function |strdisplaywidth()|, so for users of an up to
|
||||||
date Vim, this option is obsolete.
|
date Vim, this option is obsolete.
|
||||||
|
|
||||||
|
|
||||||
@ -2519,9 +2564,9 @@ Default: '' (empty)
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*g:vimwiki_valid_html_tags*
|
*g:vimwiki_valid_html_tags*
|
||||||
|
|
||||||
Case-insensitive comma separated list of HTML tags that can be used in Vimwiki.
|
Case-insensitive comma separated list of HTML tags that can be used in
|
||||||
When converting to HTML, these tags are left as they are, while every other
|
Vimwiki. When converting to HTML, these tags are left as they are, while
|
||||||
tag is escaped.
|
every other tag is escaped.
|
||||||
|
|
||||||
Default: 'b,i,s,u,sub,sup,kbd,br,hr'
|
Default: 'b,i,s,u,sub,sup,kbd,br,hr'
|
||||||
|
|
||||||
@ -2544,10 +2589,10 @@ they would not be deleted after |:VimwikiAll2HTML|.
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*g:vimwiki_conceallevel*
|
*g:vimwiki_conceallevel*
|
||||||
|
|
||||||
In Vim 7.3 |conceallevel| is local to the current window, thus if you open a
|
In Vim 7.3 'conceallevel' is local to the current window, thus if you open a
|
||||||
Vimwiki buffer in a new tab or window, it would be set to the default value.
|
Vimwiki buffer in a new tab or window, it would be set to the default value.
|
||||||
|
|
||||||
Vimwiki sets |conceallevel| to g:vimwiki_conceallevel every time a Vimwiki
|
Vimwiki sets 'conceallevel' to g:vimwiki_conceallevel every time a Vimwiki
|
||||||
buffer is entered.
|
buffer is entered.
|
||||||
|
|
||||||
With default settings, Vimwiki conceals one-character markers, shortens long
|
With default settings, Vimwiki conceals one-character markers, shortens long
|
||||||
@ -2559,7 +2604,7 @@ Default: 2
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*g:vimwiki_autowriteall*
|
*g:vimwiki_autowriteall*
|
||||||
|
|
||||||
In Vim |autowriteall| is a global setting. With g:vimwiki_autowriteall Vimwiki
|
In Vim 'autowriteall' is a global setting. With g:vimwiki_autowriteall Vimwiki
|
||||||
makes it local to its buffers.
|
makes it local to its buffers.
|
||||||
|
|
||||||
Value Description~
|
Value Description~
|
||||||
@ -2683,30 +2728,59 @@ Old homepage: http://code.google.com/p/vimwiki/
|
|||||||
|
|
||||||
Contributors and their Github usernames in roughly chronological order:
|
Contributors and their Github usernames in roughly chronological order:
|
||||||
|
|
||||||
- Maxim Kim (habamax) <habamax@gmail.com> as original author
|
- Maxim Kim (@habamax) <habamax@gmail.com> as original author
|
||||||
- the people here: http://code.google.com/p/vimwiki/people/list
|
- the people here: http://code.google.com/p/vimwiki/people/list
|
||||||
- Stuart Andrews (tub78)
|
- Stuart Andrews (@tub78)
|
||||||
- Tomas Pospichal
|
- Tomas Pospichal
|
||||||
- Daniel Schemala (EinfachToll) as current maintainer
|
- Daniel Schemala (@EinfachToll) as current maintainer
|
||||||
- Larry Hynes (larryhynes)
|
- Larry Hynes (@larryhynes)
|
||||||
- Hector Arciga (harciga)
|
- Hector Arciga (@harciga)
|
||||||
- Alexey Radkov (lyokha)
|
- Alexey Radkov (@lyokha)
|
||||||
- Aaron Franks (af)
|
- Aaron Franks (@af)
|
||||||
- Dan Bernier (danbernier)
|
- Dan Bernier (@danbernier)
|
||||||
- Carl Helmertz (chelmertz)
|
- Carl Helmertz (@chelmertz)
|
||||||
- Karl Yngve Lervåg (lervag)
|
- Karl Yngve Lervåg (@lervag)
|
||||||
- Patrick Davey (patrickdavey)
|
- Patrick Davey (@patrickdavey)
|
||||||
- Ivan Tishchenko (t7ko)
|
- Ivan Tishchenko (@t7ko)
|
||||||
- 修昊 (Svtter)
|
- 修昊 (@Svtter)
|
||||||
- Marcelo D Montu (mMontu)
|
- Marcelo D Montu (@mMontu)
|
||||||
- John Kaul
|
- John Kaul
|
||||||
- Hongbo Liu (hiberabyss)
|
- Hongbo Liu (@hiberabyss)
|
||||||
|
- @Tomsod
|
||||||
|
- @wangzq
|
||||||
|
- Jinzhou Zhang (@lotabout)
|
||||||
|
- Michael Riley (@optik-aper)
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
15. Changelog *vimwiki-changelog*
|
15. Changelog *vimwiki-changelog*
|
||||||
|
|
||||||
|
|
||||||
|
Issue numbers starting with '#' are issues from
|
||||||
|
https://github.com/vimwiki/vimwiki/issues/, all others from
|
||||||
|
http://code.google.com/p/vimwiki/issues/list. They may be accessible from
|
||||||
|
https://github.com/vimwiki-backup/vimwiki/issues.
|
||||||
|
|
||||||
|
|
||||||
|
2.3 (2016-03-31)~
|
||||||
|
|
||||||
|
New:
|
||||||
|
* Add |:VimwikiMakeYesterdayDiaryNote| command
|
||||||
|
* Issue #128: add option |vimwiki-option-automatic_nested_syntaxes|
|
||||||
|
* Issue #192: Sort links in the list generated by |:VimwikiGenerateTags|
|
||||||
|
|
||||||
|
Fixed:
|
||||||
|
* Issue #176: Fix issue when the wiki path contains spaces
|
||||||
|
* Also look for tags in wiki files in subdirectories
|
||||||
|
* Locate the .tags file correctly on Windows
|
||||||
|
* Issue #183: Fix HTML conversion of headers containing links
|
||||||
|
* Issue #64: create correct Markdown links when pressing CR on a word
|
||||||
|
* Issue #191: ignore headers inside preformatted text when creating the TOC
|
||||||
|
* Create the standard CSS file also if only one file is converted to HTML
|
||||||
|
* Fix #188: |vimwiki_+| on a raw url surrounds it with brackets
|
||||||
|
* various minor fixes
|
||||||
|
|
||||||
|
|
||||||
2.2.1 (2015-12-10)~
|
2.2.1 (2015-12-10)~
|
||||||
|
|
||||||
Removed:~
|
Removed:~
|
||||||
@ -2714,7 +2788,7 @@ Removed:~
|
|||||||
want it back, file an issue at Github.
|
want it back, file an issue at Github.
|
||||||
|
|
||||||
Fixed:~
|
Fixed:~
|
||||||
* Don't do random things when the user has remapped the z key
|
* Issue #175: Don't do random things when the user has remapped the z key
|
||||||
* Don't ask for confirmation when following an URL in MacOS
|
* Don't ask for confirmation when following an URL in MacOS
|
||||||
* Always jump to the first occurrence of a tag in a file
|
* Always jump to the first occurrence of a tag in a file
|
||||||
* Don't move the cursor when updating the TOC
|
* Don't move the cursor when updating the TOC
|
||||||
@ -2735,7 +2809,7 @@ New:~
|
|||||||
* more key maps for list manipulation, see |vimwiki-list-manipulation|
|
* more key maps for list manipulation, see |vimwiki-list-manipulation|
|
||||||
* improved automatic adjustment of checkboxes
|
* improved automatic adjustment of checkboxes
|
||||||
* text objects for list items, see |vimwiki-text-objects|
|
* text objects for list items, see |vimwiki-text-objects|
|
||||||
* New command |VimwikiCheckLinks| to check for broken links
|
* New command |:VimwikiCheckLinks| to check for broken links
|
||||||
* New global option |g:vimwiki_auto_chdir|
|
* New global option |g:vimwiki_auto_chdir|
|
||||||
* New global option |g:vimwiki_map_prefix|
|
* New global option |g:vimwiki_map_prefix|
|
||||||
* Support for wiki links absolute to the wiki root
|
* Support for wiki links absolute to the wiki root
|
||||||
@ -2743,7 +2817,7 @@ New:~
|
|||||||
* Issue #24: Basic support for remote directories via netrw
|
* Issue #24: Basic support for remote directories via netrw
|
||||||
* Issue #50: in HTML, tables can now be embedded in lists
|
* Issue #50: in HTML, tables can now be embedded in lists
|
||||||
* When converting to HTML, show a message with the output directory
|
* When converting to HTML, show a message with the output directory
|
||||||
* Add auto completion for |VimwikiGoto|
|
* Add auto completion for |:VimwikiGoto|
|
||||||
* Add Chinese Readme file
|
* Add Chinese Readme file
|
||||||
|
|
||||||
Changed:~
|
Changed:~
|
||||||
@ -2790,11 +2864,6 @@ Fixed:~
|
|||||||
* Corrected website links in documentation. code.google is dead, long live
|
* Corrected website links in documentation. code.google is dead, long live
|
||||||
Github!
|
Github!
|
||||||
|
|
||||||
Issue numbers starting with '#' are issues from
|
|
||||||
https://github.com/vimwiki/vimwiki/issues/, all others from
|
|
||||||
http://code.google.com/p/vimwiki/issues/list. They may be accessible from
|
|
||||||
https://github.com/vimwiki-backup/vimwiki/issues.
|
|
||||||
|
|
||||||
2.1~
|
2.1~
|
||||||
|
|
||||||
* Concealing of links can be turned off - set |g:vimwiki_url_maxsave| to 0.
|
* Concealing of links can be turned off - set |g:vimwiki_url_maxsave| to 0.
|
||||||
|
@ -31,7 +31,7 @@ execute 'setlocal suffixesadd='.VimwikiGet('ext')
|
|||||||
setlocal isfname-=[,]
|
setlocal isfname-=[,]
|
||||||
" gf}}}
|
" gf}}}
|
||||||
|
|
||||||
exe "setlocal tags+=" . vimwiki#tags#metadata_file_path()
|
exe "setlocal tags+=" . escape(vimwiki#tags#metadata_file_path(), ' \|"')
|
||||||
|
|
||||||
" MISC }}}
|
" MISC }}}
|
||||||
|
|
||||||
@ -173,9 +173,9 @@ function! VimwikiFoldLevel(lnum) "{{{
|
|||||||
if line =~# g:vimwiki_rxHeader
|
if line =~# g:vimwiki_rxHeader
|
||||||
return '>'.vimwiki#u#count_first_sym(line)
|
return '>'.vimwiki#u#count_first_sym(line)
|
||||||
" Code block folding...
|
" Code block folding...
|
||||||
elseif line =~# '^\s*'.g:vimwiki_rxPreStart
|
elseif line =~# g:vimwiki_rxPreStart
|
||||||
return 'a1'
|
return 'a1'
|
||||||
elseif line =~# '^\s*'.g:vimwiki_rxPreEnd.'\s*$'
|
elseif line =~# g:vimwiki_rxPreEnd
|
||||||
return 's1'
|
return 's1'
|
||||||
else
|
else
|
||||||
return "="
|
return "="
|
||||||
@ -221,7 +221,7 @@ function! VimwikiFoldText() "{{{
|
|||||||
let main_text = substitute(line, '^\s*', repeat(' ',indent(v:foldstart)), '')
|
let main_text = substitute(line, '^\s*', repeat(' ',indent(v:foldstart)), '')
|
||||||
let fold_len = v:foldend - v:foldstart + 1
|
let fold_len = v:foldend - v:foldstart + 1
|
||||||
let len_text = ' ['.fold_len.'] '
|
let len_text = ' ['.fold_len.'] '
|
||||||
if line !~# '^\s*'.g:vimwiki_rxPreStart
|
if line !~# g:vimwiki_rxPreStart
|
||||||
let [main_text, spare_len] = s:shorten_text(main_text, 50)
|
let [main_text, spare_len] = s:shorten_text(main_text, 50)
|
||||||
return main_text.len_text
|
return main_text.len_text
|
||||||
else
|
else
|
||||||
|
@ -334,6 +334,7 @@ let s:vimwiki_defaults.template_default = 'default'
|
|||||||
let s:vimwiki_defaults.template_ext = '.tpl'
|
let s:vimwiki_defaults.template_ext = '.tpl'
|
||||||
|
|
||||||
let s:vimwiki_defaults.nested_syntaxes = {}
|
let s:vimwiki_defaults.nested_syntaxes = {}
|
||||||
|
let s:vimwiki_defaults.automatic_nested_syntaxes = 1
|
||||||
let s:vimwiki_defaults.auto_export = 0
|
let s:vimwiki_defaults.auto_export = 0
|
||||||
let s:vimwiki_defaults.auto_toc = 0
|
let s:vimwiki_defaults.auto_toc = 0
|
||||||
" 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
|
||||||
@ -464,6 +465,8 @@ command! -count=1 VimwikiMakeDiaryNote
|
|||||||
\ call vimwiki#diary#make_note(v:count1)
|
\ call vimwiki#diary#make_note(v:count1)
|
||||||
command! -count=1 VimwikiTabMakeDiaryNote
|
command! -count=1 VimwikiTabMakeDiaryNote
|
||||||
\ call vimwiki#diary#make_note(v:count1, 1)
|
\ call vimwiki#diary#make_note(v:count1, 1)
|
||||||
|
command! -count=1 VimwikiMakeYesterdayDiaryNote
|
||||||
|
\ call vimwiki#diary#make_note(v:count1, 0, strftime(VimwikiGet('diary_link_fmt', v:count1 - 1), localtime() - 60*60*24))
|
||||||
|
|
||||||
command! VimwikiDiaryGenerateLinks
|
command! VimwikiDiaryGenerateLinks
|
||||||
\ call vimwiki#diary#generate_diary_section()
|
\ call vimwiki#diary#generate_diary_section()
|
||||||
@ -506,6 +509,12 @@ endif
|
|||||||
nnoremap <unique><script> <Plug>VimwikiTabMakeDiaryNote
|
nnoremap <unique><script> <Plug>VimwikiTabMakeDiaryNote
|
||||||
\ :VimwikiTabMakeDiaryNote<CR>
|
\ :VimwikiTabMakeDiaryNote<CR>
|
||||||
|
|
||||||
|
if !hasmapto('<Plug>VimwikiMakeYesterdayDiaryNote')
|
||||||
|
exe 'nmap <silent><unique> '.g:vimwiki_map_prefix.'<Leader>y <Plug>VimwikiMakeYesterdayDiaryNote'
|
||||||
|
endif
|
||||||
|
nnoremap <unique><script> <Plug>VimwikiMakeYesterdayDiaryNote
|
||||||
|
\ :VimwikiMakeYesterdayDiaryNote<CR>
|
||||||
|
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
" MENU {{{
|
" MENU {{{
|
||||||
|
@ -315,6 +315,12 @@ endfor
|
|||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
|
let g:vimwiki_rxPreStart = '^\s*'.g:vimwiki_rxPreStart
|
||||||
|
let g:vimwiki_rxPreEnd = '^\s*'.g:vimwiki_rxPreEnd.'\s*$'
|
||||||
|
|
||||||
|
let g:vimwiki_rxMathStart = '^\s*'.g:vimwiki_rxMathStart
|
||||||
|
let g:vimwiki_rxMathEnd = '^\s*'.g:vimwiki_rxMathEnd.'\s*$'
|
||||||
|
|
||||||
" possibly concealed chars " {{{
|
" possibly concealed chars " {{{
|
||||||
let s:conceal = exists("+conceallevel") ? ' conceal' : ''
|
let s:conceal = exists("+conceallevel") ? ' conceal' : ''
|
||||||
|
|
||||||
@ -444,11 +450,11 @@ execute 'syntax match VimwikiCodeT /'.g:vimwiki_rxCode.'/ contained contains=Vim
|
|||||||
" <hr> horizontal rule
|
" <hr> horizontal rule
|
||||||
execute 'syntax match VimwikiHR /'.g:vimwiki_rxHR.'/'
|
execute 'syntax match VimwikiHR /'.g:vimwiki_rxHR.'/'
|
||||||
|
|
||||||
execute 'syntax region VimwikiPre start=/^\s*'.g:vimwiki_rxPreStart.
|
execute 'syntax region VimwikiPre start=/'.g:vimwiki_rxPreStart.
|
||||||
\ '/ end=/^\s*'.g:vimwiki_rxPreEnd.'\s*$/ contains=@Spell'
|
\ '/ end=/'.g:vimwiki_rxPreEnd.'/ contains=@Spell'
|
||||||
|
|
||||||
execute 'syntax region VimwikiMath start=/^\s*'.g:vimwiki_rxMathStart.
|
execute 'syntax region VimwikiMath start=/'.g:vimwiki_rxMathStart.
|
||||||
\ '/ end=/^\s*'.g:vimwiki_rxMathEnd.'\s*$/ contains=@Spell'
|
\ '/ end=/'.g:vimwiki_rxMathEnd.'/ contains=@Spell'
|
||||||
|
|
||||||
|
|
||||||
" placeholders
|
" placeholders
|
||||||
@ -588,19 +594,22 @@ let b:current_syntax="vimwiki"
|
|||||||
|
|
||||||
" EMBEDDED syntax setup "{{{
|
" EMBEDDED syntax setup "{{{
|
||||||
let s:nested = VimwikiGet('nested_syntaxes')
|
let s:nested = VimwikiGet('nested_syntaxes')
|
||||||
|
if VimwikiGet('automatic_nested_syntaxes')
|
||||||
|
let s:nested = extend(s:nested, vimwiki#base#detect_nested_syntax())
|
||||||
|
endif
|
||||||
if !empty(s:nested)
|
if !empty(s:nested)
|
||||||
for [s:hl_syntax, s:vim_syntax] in items(s:nested)
|
for [s:hl_syntax, s:vim_syntax] in items(s:nested)
|
||||||
call vimwiki#base#nested_syntax(s:vim_syntax,
|
call vimwiki#base#nested_syntax(s:vim_syntax,
|
||||||
\ '^\s*'.g:vimwiki_rxPreStart.'\%(.*[[:blank:][:punct:]]\)\?'.
|
\ g:vimwiki_rxPreStart.'\%(.*[[:blank:][:punct:]]\)\?'.
|
||||||
\ s:hl_syntax.'\%([[:blank:][:punct:]].*\)\?',
|
\ s:hl_syntax.'\%([[:blank:][:punct:]].*\)\?',
|
||||||
\ '^\s*'.g:vimwiki_rxPreEnd, 'VimwikiPre')
|
\ g:vimwiki_rxPreEnd, 'VimwikiPre')
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
" LaTeX
|
" LaTeX
|
||||||
call vimwiki#base#nested_syntax('tex',
|
call vimwiki#base#nested_syntax('tex',
|
||||||
\ '^\s*'.g:vimwiki_rxMathStart.'\%(.*[[:blank:][:punct:]]\)\?'.
|
\ g:vimwiki_rxMathStart.'\%(.*[[:blank:][:punct:]]\)\?'.
|
||||||
\ '\%([[:blank:][:punct:]].*\)\?',
|
\ '\%([[:blank:][:punct:]].*\)\?',
|
||||||
\ '^\s*'.g:vimwiki_rxMathEnd, 'VimwikiMath')
|
\ g:vimwiki_rxMathEnd, 'VimwikiMath')
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user