25 Commits
v2.2.1 ... v2.3

Author SHA1 Message Date
129c281810 Update changelog 2016-03-31 12:10:27 +02:00
722d6e4b9a '+' on a raw url surrounds it with brackets
Fix #188
2016-03-21 09:02:22 +01:00
0001b3cda9 Copy CSS file also with :Vimwiki2HTML 2016-03-19 22:01:25 +01:00
68cdfe36df Unify all messages to the user 2016-03-19 21:29:42 +01:00
4956976bb6 Some fixes in the doc 2016-03-19 19:55:08 +01:00
4c2e13a284 Skip preformatted and math text while scanning for headers
Fix #191
2016-03-18 15:18:23 +01:00
4bd0690a52 Simplify some regexes 2016-03-18 15:16:59 +01:00
128581babc Merge remote-tracking branch 'optik-aper/master' into dev 2016-03-01 10:46:29 +01:00
c2d1869227 Escape tilde (~) in path names otherwise regex comparison gets upset 2016-02-29 16:12:56 -05:00
6f579711ab Merge pull request #186 from lotabout/master
fix #64: markdown style link support
2016-02-22 11:42:42 +01:00
6d96516ab4 enhance #64: generate same link type for visual mode and normal mode 2016-02-22 16:00:37 +08:00
0ea8d85b7f Sort links in the list generated by VimwikiGenerateTags
Fix #192
2016-02-19 11:32:58 +01:00
5f9dbca89c Small cleanup of the merged PR
Ref #187
2016-01-28 10:52:40 +01:00
2aeaea5f0d Merge pull request #187 from mMontu/nested
Dynamically detect nested syntaxes (fix #128)
2016-01-28 10:29:53 +01:00
a2888692fd Option for automatic detection of nested syntaxes 2016-01-27 13:30:30 -02:00
fc947523b0 Dynamically detect nested syntaxes (fix #128) 2016-01-27 10:14:49 -02:00
91a004bc23 Remove superfluous debug message 2016-01-25 13:47:41 +01:00
78cef05fa3 Fix HTML conversion of headers containing links
Fix #183
2016-01-22 13:32:01 +01:00
1db5924271 Update the changelog 2016-01-21 13:27:43 +01:00
ff90e980de Locate the .tags file correctly on windows
Ref #184
2016-01-21 13:27:08 +01:00
bb3026dba8 Include subdir in wiki page name when rebuilding tags
Ref #184
2016-01-21 13:25:04 +01:00
b0cc6ff0de fix #64: markdown style link support 2016-01-18 16:51:08 +08:00
949b29b694 Fix tags file path when 'path' contains spaces
Fix #176
2015-12-14 10:36:16 +01:00
f31550badb Merge pull request #165 from Tomsod/dev
Add command for opening yesterday's diary
2015-12-11 11:49:45 +01:00
64f71bc785 Add :VimwikiMakeYesterdayDiaryNote command
Opens diary for yesterday.
For when you stay up past midnight.
2015-10-29 01:00:00 +03:00
13 changed files with 301 additions and 143 deletions

View File

@ -390,7 +390,7 @@ function! vimwiki#base#system_open_link(url) "{{{
return
endif
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 "}}}
" vimwiki#base#open_link
@ -398,7 +398,7 @@ function! vimwiki#base#open_link(cmd, link, ...) "{{{
let link_infos = vimwiki#base#resolve_link(a:link)
if link_infos.filename == ''
echom 'Vimwiki Error: Unable to resolve link!'
echomsg 'Vimwiki Error: Unable to resolve link!'
return
endif
@ -505,7 +505,7 @@ function! vimwiki#base#backlinks() "{{{
endfor
if empty(locations)
echom 'vimwiki: no other file links to this file'
echomsg 'Vimwiki: No other file links to this file'
else
call setloclist(0, locations, 'r')
lopen
@ -823,7 +823,7 @@ function! vimwiki#base#check_links() "{{{
endfor
if empty(errors)
echom 'Vimwiki: all links are OK'
echomsg 'Vimwiki: All links are OK'
else
call setqflist(errors, 'r')
copen
@ -846,8 +846,8 @@ function! vimwiki#base#edit_file(command, filename, anchor, ...) "{{{
let ok = vimwiki#path#mkdir(dir, 1)
if !ok
echom ' '
echom 'Vimwiki: Unable to edit file in non-existent directory: '.dir
echomsg ' '
echomsg 'Vimwiki Error: Unable to edit file in non-existent directory: '.dir
return
endif
@ -880,7 +880,7 @@ endfunction " }}}
function! vimwiki#base#search_word(wikiRx, cmd) "{{{
let match_line = search(a:wikiRx, 's'.a:cmd)
if match_line == 0
echomsg 'vimwiki: Wiki link not found.'
echomsg 'Vimwiki: Wiki link not found'
endif
endfunction " }}}
@ -1281,7 +1281,7 @@ endfunction " }}}
" vimwiki#base#goto_index
function! vimwiki#base#goto_index(wnum, ...) "{{{
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
endif
@ -1319,7 +1319,7 @@ function! vimwiki#base#delete_link() "{{{
try
call delete(fname)
catch /.*/
echomsg 'vimwiki: Cannot delete "'.expand('%:t:r').'"!'
echomsg 'Vimwiki Error: Cannot delete "'.expand('%:t:r').'"!'
return
endtry
@ -1340,7 +1340,7 @@ function! vimwiki#base#rename_link() "{{{
" there is no file (new one maybe)
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.)'
return
endif
@ -1354,13 +1354,13 @@ function! vimwiki#base#rename_link() "{{{
if new_link =~# '[/\\]'
" 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
endif
" check new_fname - it should be 'good', not empty
if substitute(new_link, '\s', '', 'g') == ''
echomsg 'vimwiki: Cannot rename to an empty filename!'
echomsg 'Vimwiki Error: Cannot rename to an empty filename!'
return
endif
@ -1375,19 +1375,19 @@ function! vimwiki#base#rename_link() "{{{
" do not rename if file with such name exists
let fname = glob(new_fname)
if fname != ''
echomsg 'vimwiki: Cannot rename to "'.new_fname.
echomsg 'Vimwiki Error: Cannot rename to "'.new_fname.
\ '". File with that name exist!'
return
endif
" rename wiki link file
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))
if res != 0
throw "Cannot rename!"
end
catch /.*/
echomsg 'vimwiki: Cannot rename "'.expand('%:t:r').'" to "'.new_fname.'"'
echomsg 'Vimwiki Error: Cannot rename "'.expand('%:t:r').'" to "'.new_fname.'"'
return
endtry
@ -1428,7 +1428,7 @@ function! vimwiki#base#rename_link() "{{{
\ cur_buffer[1]])
" 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
endfunction " }}}
@ -1736,10 +1736,27 @@ endfunction " }}}
" a:create == 0: update if TOC exists
function! vimwiki#base#table_of_contents(create)
" collect new headers
let is_inside_pre_or_math = 0 " 1: inside pre, 2: inside math, 0: outside
let headers = []
let headers_levels = [['', 0], ['', 0], ['', 0], ['', 0], ['', 0], ['', 0]]
for lnum in range(1, line('$'))
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
continue
endif
@ -1904,6 +1921,15 @@ function! s:normalize_link_syntax_n() " {{{
return
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)
" rxWord is less permissive than rxWikiLinkUrl which is used in
" normalize_link_syntax_v
@ -1965,6 +1991,18 @@ function! vimwiki#base#normalize_link(is_visual_mode) "{{{
endif
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 {{{

View File

@ -161,7 +161,7 @@ endfunction "}}}
function! vimwiki#diary#make_note(wnum, ...) "{{{
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
endif
@ -191,7 +191,7 @@ endfunction "}}}
function! vimwiki#diary#goto_diary_index(wnum) "{{{
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
endif
@ -254,7 +254,7 @@ function! vimwiki#diary#generate_diary_section() "{{{
call vimwiki#base#update_listing_in_buffer(s:format_diary(),
\ VimwikiGet('diary_header'), content_rx, line('$')+1, 1)
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
endfunction "}}}

View File

@ -80,9 +80,10 @@ function! s:create_default_CSS(path) " {{{
if default_css != ''
let lines = readfile(default_css)
call writefile(lines, css_full_name)
echomsg "Default style.css has been created."
return 1
endif
endif
return 0
endfunction "}}}
function! s:template_full_name(name) "{{{
@ -112,7 +113,7 @@ function! s:get_html_template(template) "{{{
let lines = readfile(template_name)
return lines
catch /E484/
echomsg 'vimwiki: html template '.template_name.
echomsg 'Vimwiki: HTML template '.template_name.
\ ' does not exist!'
endtry
endif
@ -171,7 +172,7 @@ function! s:delete_html_files(path) "{{{
try
call delete(fname)
catch
echomsg 'vimwiki: Cannot delete '.fname
echomsg 'Vimwiki Error: Cannot delete '.fname
endtry
endfor
endfunction "}}}
@ -1046,6 +1047,8 @@ function! s:process_tag_h(line, id) "{{{
let h_part .= '>'
endif
let h_text = s:process_inline_tags(h_text, a:id)
let line = h_part.h_text.'</h'.h_level.'></div>'
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.para = s:close_tag_para(state.para, res_lines)
let line = s:process_inline_tags(line, state.header_ids)
call add(res_lines, line)
endif
endif
@ -1366,7 +1367,7 @@ function! vimwiki#html#CustomWiki2HTML(path, wikifile, force) "{{{
\ (len(VimwikiGet('subdir')) > 0 ? shellescape(s:root_path(VimwikiGet('subdir'))) : '-'))
endfunction " }}}
function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{
function! s:convert_file(path_html, wikifile) "{{{
let done = 0
let wikifile = fnamemodify(a:wikifile, ":p")
@ -1456,13 +1457,13 @@ function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{
if nohtml
echon "\r"."%nohtml placeholder found"
return
return ''
endif
call s:remove_blank_lines(ldest)
"" process end of file
"" close opened tags if any
" process end of file
" close opened tags if any
let lines = []
call s:close_tag_quote(state.quote, 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%
"" make html file.
call writefile(html_lines, path_html.htmlfile)
let done = 1
endif
if done == 0
echomsg 'vimwiki: conversion to HTML is not supported for this syntax!!!'
return
echomsg 'Vimwiki Error: Conversion to HTML is not supported for this syntax'
return ''
endif
return path_html.htmlfile
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) "{{{
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
endif
echomsg 'Saving vimwiki files...'
echomsg 'Vimwiki: Saving Vimwiki files ...'
let save_eventignore = &eventignore
let &eventignore = "all"
let cur_buf = bufname('%')
@ -1526,10 +1533,10 @@ function! vimwiki#html#WikiAll2HTML(path_html) "{{{
let path_html = expand(a: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)
echomsg 'Converting wiki to html files...'
echomsg 'Vimwiki: Converting wiki to html files ...'
let setting_more = &more
setlocal nomore
@ -1547,20 +1554,23 @@ function! vimwiki#html#WikiAll2HTML(path_html) "{{{
call VimwikiSet('invsubdir', vimwiki#base#invsubdir(subdir))
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
echomsg 'Skipping '.wikifile
echomsg 'Vimwiki: Skipping '.wikifile
endif
endfor
" reset 'subdir' state variable
call VimwikiSet('subdir', current_subdir)
call VimwikiSet('invsubdir', current_invsubdir)
call s:create_default_CSS(path_html)
echomsg 'HTML exported to '.path_html
echomsg 'Done!'
let created = s:create_default_CSS(path_html)
if created
echomsg 'Vimwiki: Default style.css has been created'
endif
echomsg 'Vimwiki: HTML exported to '.path_html
echomsg 'Vimwiki: Done!'
let &more = setting_more
endfunction "}}}

View File

@ -376,10 +376,10 @@ endfunction "}}}
"If there is no second argument, 0 is returned at a header, otherwise the
"header is skipped
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
while cur_ln <= line('$') &&
\ getline(cur_ln) !~# '^\s*'.g:vimwiki_rxPreEnd.'\s*$'
\ getline(cur_ln) !~# g:vimwiki_rxPreEnd
let cur_ln += 1
endwhile
let next_line = cur_ln
@ -404,10 +404,10 @@ endfunction "}}}
function! s:get_prev_line(lnum) "{{{
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
while 1
if cur_ln == 0 || getline(cur_ln) =~# '^\s*'.g:vimwiki_rxPreStart
if cur_ln == 0 || getline(cur_ln) =~# g:vimwiki_rxPreStart
break
endif
let cur_ln -= 1

View File

@ -108,6 +108,8 @@ function! vimwiki#markdown_base#follow_link(split, ...) "{{{ Parse link at curso
if lnk != ""
if !VimwikiLinkHandler(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)
endif
endif
@ -173,7 +175,7 @@ function! s:normalize_link_syntax_n() " {{{
if !empty(lnk)
let sub = vimwiki#base#normalize_link_helper(lnk,
\ g:vimwiki_rxWord, '',
\ g:vimwiki_WikiLinkTemplate1)
\ g:vimwiki_Weblink1Template)
call vimwiki#base#replacestr_at_cursor('\V'.lnk, sub)
return
endif
@ -192,9 +194,10 @@ function! s:normalize_link_syntax_v() " {{{
try
norm! gvy
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
norm! `>pgvd

View File

@ -148,3 +148,22 @@ function! vimwiki#path#is_absolute(path) "{{{
return a:path =~# '\m^/\|\~/'
endif
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

View File

@ -41,12 +41,14 @@ function! vimwiki#tags#update_tags(full_rebuild, all_files) "{{{
call s:write_tags_metadata(metadata)
else " full rebuild
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 =
\ getftime(vimwiki#tags#metadata_file_path())
let metadata = s:load_tags_metadata()
for file in files
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 metadata = s:remove_page_from_tags(metadata, page_name)
let metadata = s:merge_tags(metadata, page_name, tags)
@ -139,7 +141,7 @@ endfunction " }}}
" vimwiki#tags#metadata_file_path
" Returns tags metadata file path
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 " }}}
" s:load_tags_metadata
@ -315,7 +317,7 @@ function! vimwiki#tags#generate_tags(...) abort "{{{
\ '',
\ substitute(g:vimwiki_rxH2_Template, '__Header__', tagname, ''),
\ '' ])
for taglink in tags_entries[tagname]
for taglink in sort(tags_entries[tagname])
call add(lines, bullet .
\ substitute(g:vimwiki_WikiLinkTemplate1, '__LinkUrl__', taglink, ''))
endfor

View File

@ -415,7 +415,6 @@ function! vimwiki#tbl#goto_prev_col() "{{{
let newcol = s:get_indent(lnum)
let max_lens = s:get_cell_max_lens(lnum)
let prev_cell_len = 0
echom string(max_lens)
for cell_len in values(max_lens)
let delta = cell_len + 3 " +3 == 2 spaces + 1 separator |<space>...<space>
if newcol + delta > curcol-1

View File

@ -38,7 +38,7 @@ function! vimwiki#u#count_first_sym(line) "{{{
endfunction "}}}
function! vimwiki#u#escape(string) "{{{
return escape(a:string, '.*[]\^$')
return escape(a:string, '~.*[]\^$')
endfunction "}}}
" Load concrete Wiki syntax: sets regexes and templates for headers and links

View File

@ -9,7 +9,7 @@
|___| |___| |_| |_||__| |__||___| |___| |_||___| ~
Version: 2.2
Version: 2.3
==============================================================================
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,
'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
index.
open it. Edit the file, save it, and then press Backspace to jump back to
your index.
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
@ -196,6 +196,24 @@ See also |:VimwikiMakeDiaryNote|
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
@ -358,70 +376,72 @@ gLr Renumber list items in all numbered lists in the whole
:nmap <c-r> <Plug>VimwikiRenumberAllLists
<
*vimwiki_glstar* *vimwiki_gLstar*
gl* Make a list item out of normal line or change the symbol
of the current item to *.
gl* Make a list item out of a normal line or change the
symbol of the current item to *.
gL* Change the symbol of the current list to *.
To remap: >
noremap glo :VimwikiChangeSymbolTo *<CR>
noremap glO :VimwikiChangeSymbolInListTo *<CR>
<
*vimwiki_gl#* *vimwiki_gL#*
gl# Make a list item out of normal line or change the symbol
of the current item to #.
gl# Make a list item out of a normal line or change the
symbol of the current item to #.
gL# Change the symbol of the current list to #.
To remap: >
noremap glo :VimwikiChangeSymbolTo #<CR>
noremap glO :VimwikiChangeSymbolInListTo #<CR>
<
*vimwiki_gl-* *vimwiki_gL-*
gl- Make a list item out of normal line or change the symbol
of the current item to -.
gl- Make a list item out of a normal line or change the
symbol of the current item to -.
gL- Change the symbol of the current list to -.
To remap: >
noremap glo :VimwikiChangeSymbolTo -<CR>
noremap glO :VimwikiChangeSymbolInListTo -<CR>
<
*vimwiki_gl1* *vimwiki_gL1*
gl1 Make a list item out of normal line or change the symbol
of the current item to 1., the numbering is adjusted
according to the surrounding list items.
gl1 Make a list item out of a normal line or change the
symbol of the current item to 1., the numbering is
adjusted according to the surrounding list items.
gL1 Change the symbol of the current list to 1. 2. 3. ...
To remap: >
noremap glo :VimwikiChangeSymbolTo 1.<CR>
noremap glO :VimwikiChangeSymbolInListTo 1.<CR>
<
*vimwiki_gla* *vimwiki_gLa*
gla Make a list item out of normal line or change the symbol
of the current item to a), the numbering is adjusted
according to the surrounding list items.
gla Make a list item out of a normal line or change the
symbol of the current item to a), the numbering is
adjusted according to the surrounding list items.
gLa Change the symbol of the current list to a) b) c) ...
To remap: >
noremap glo :VimwikiChangeSymbolTo a)<CR>
noremap glO :VimwikiChangeSymbolInListTo a)<CR>
<
*vimwiki_glA* *vimwiki_gLA*
glA Make a list item out of normal line or change the symbol
of the current item to A), the numbering is adjusted
according to the surrounding list items.
glA Make a list item out of a normal line or change the
symbol of the current item to A), the numbering is
adjusted according to the surrounding list items.
gLA Change the symbol of the current list to A) B) C) ...
To remap: >
noremap glo :VimwikiChangeSymbolTo A)<CR>
noremap glO :VimwikiChangeSymbolInListTo A)<CR>
<
*vimwiki_gli* *vimwiki_gLi*
gli Make a list item out of normal line or change the symbol
of the current item to i), the numbering is adjusted
according to the surrounding list items.
gLi Change the symbol of the current list to i) ii) iii) ...
gli Make a list item out of a normal line or change the
symbol of the current item to i), the numbering is
adjusted according to the surrounding list items.
gLi Change the symbol of the current list to
i) ii) iii) ...
To remap: >
noremap glo :VimwikiChangeSymbolTo i)<CR>
noremap glO :VimwikiChangeSymbolInListTo i)<CR>
<
*vimwiki_glI* *vimwiki_gLI*
glI Make a list item out of normal line or change the symbol
of the current item to I), the numbering is adjusted
according to the surrounding list items.
gLI Change the symbol of the current list to I) II) III) ...
glI Make a list item out of a normal line or change the
symbol of the current item to I), the numbering is
adjusted according to the surrounding list items.
gLI Change the symbol of the current list to
I) II) III) ...
To remap: >
noremap glo :VimwikiChangeSymbolTo I)<CR>
noremap glO :VimwikiChangeSymbolInListTo I)<CR>
@ -567,6 +587,9 @@ il A single list item.
*:VimwikiTabMakeDiaryNote*
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*
@ -793,8 +816,8 @@ identify wikilinks whose targets are not found.
Interwiki:~
If you maintain more than one wiki, you can create interwiki links between them
by adding a numbered prefix "wikiX:" in front of a link: >
If you maintain more than one wiki, you can create interwiki links between
them by adding a numbered prefix "wikiX:" in front of a link: >
[[wiki1:This is a link]]
or: >
[[wiki1:This is a link source|Description of the link]]
@ -873,7 +896,7 @@ in HTML: >
alt="Vimwiki"/>
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: >
<img src="http://vimwiki.googlecode.com/hg/images/vimwiki_logo.png"
alt="cool stuff" style="width:150px; height:120px"/>
@ -914,7 +937,7 @@ Reference-style links: >
a) [Link Name][Id]
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 "]".
@ -1149,7 +1172,7 @@ E.g.:
}}$
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
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).
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).
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.
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 use Vim's built-in tag search functionality (see |tagsrch.txt|) or
@ -1290,7 +1313,7 @@ Hit |zr| one more time:
* [ ] Do stuff 3~
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.
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*
== Knitting club ==
=== Knitting projects ===
- [ ] a funny *pig*
- [ ] a scary *dog*
- [ ] a *funny pig*
- [ ] a *scary dog*
Then, to jump from your index.wiki directly to your knitting projects, use: >
[[Todo#Knitting projects]]
Or, to jump to an individual project, use this link: >
[[Todo#pig]]
[[Todo#funny pig]]
Or, to jump to a tag, use this link: >
[[Todo#todo-lists]]
If there are multiple instances of an anchor, you can use the long form which
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
|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.
@ -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.
@ -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*
------------------------------------------------------------------------------
Key Default value~
@ -2075,7 +2120,7 @@ Key Default value~
list_margin -1
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
|:VimwikiGenerateLinks|), the Table of contents (|vimwiki-toc|) 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.
Value Description~
'' Disable folding.
'expr' Folding based on expression (folds sections and code blocks).
'syntax' Folding based on syntax (folds sections; slower than 'expr').
'list' Folding based on expression (folds list subitems; much slower).
'' Disable folding
'expr' Folding based on expression (folds sections and code blocks)
'syntax' Folding based on syntax (folds sections; slower than 'expr')
'list' Folding based on expression (folds list subitems; much slower)
Default: ''
@ -2311,7 +2356,7 @@ A second example handles a new scheme, "vfile:", which behaves similar to
endif
let link_infos = vimwiki#base#resolve_link(link)
if link_infos.filename == ''
echom 'Vimwiki Error: Unable to resolve link!'
echomsg 'Vimwiki Error: Unable to resolve link!'
return 0
else
exe 'tabnew ' . fnameescape(link_infos.filename)
@ -2406,7 +2451,7 @@ Default: 1
------------------------------------------------------------------------------
*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.
If you have 'enc=utf-8' and set up >
@ -2432,7 +2477,7 @@ Value Description~
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.
@ -2519,9 +2564,9 @@ Default: '' (empty)
------------------------------------------------------------------------------
*g:vimwiki_valid_html_tags*
Case-insensitive comma separated list of HTML tags that can be used in Vimwiki.
When converting to HTML, these tags are left as they are, while every other
tag is escaped.
Case-insensitive comma separated list of HTML tags that can be used in
Vimwiki. When converting to HTML, these tags are left as they are, while
every other tag is escaped.
Default: 'b,i,s,u,sub,sup,kbd,br,hr'
@ -2544,10 +2589,10 @@ they would not be deleted after |:VimwikiAll2HTML|.
------------------------------------------------------------------------------
*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 sets |conceallevel| to g:vimwiki_conceallevel every time a Vimwiki
Vimwiki sets 'conceallevel' to g:vimwiki_conceallevel every time a Vimwiki
buffer is entered.
With default settings, Vimwiki conceals one-character markers, shortens long
@ -2559,7 +2604,7 @@ Default: 2
------------------------------------------------------------------------------
*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.
Value Description~
@ -2683,30 +2728,59 @@ Old homepage: http://code.google.com/p/vimwiki/
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
- Stuart Andrews (tub78)
- Stuart Andrews (@tub78)
- Tomas Pospichal
- Daniel Schemala (EinfachToll) as current maintainer
- Larry Hynes (larryhynes)
- Hector Arciga (harciga)
- Alexey Radkov (lyokha)
- Aaron Franks (af)
- Dan Bernier (danbernier)
- Carl Helmertz (chelmertz)
- Karl Yngve Lervåg (lervag)
- Patrick Davey (patrickdavey)
- Ivan Tishchenko (t7ko)
- 修昊 (Svtter)
- Marcelo D Montu (mMontu)
- Daniel Schemala (@EinfachToll) as current maintainer
- Larry Hynes (@larryhynes)
- Hector Arciga (@harciga)
- Alexey Radkov (@lyokha)
- Aaron Franks (@af)
- Dan Bernier (@danbernier)
- Carl Helmertz (@chelmertz)
- Karl Yngve Lervåg (@lervag)
- Patrick Davey (@patrickdavey)
- Ivan Tishchenko (@t7ko)
- 修昊 (@Svtter)
- Marcelo D Montu (@mMontu)
- John Kaul
- Hongbo Liu (hiberabyss)
- Hongbo Liu (@hiberabyss)
- @Tomsod
- @wangzq
- Jinzhou Zhang (@lotabout)
- Michael Riley (@optik-aper)
==============================================================================
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)~
Removed:~
@ -2714,7 +2788,7 @@ Removed:~
want it back, file an issue at Github.
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
* Always jump to the first occurrence of a tag in a file
* Don't move the cursor when updating the TOC
@ -2735,7 +2809,7 @@ New:~
* more key maps for list manipulation, see |vimwiki-list-manipulation|
* improved automatic adjustment of checkboxes
* 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_map_prefix|
* Support for wiki links absolute to the wiki root
@ -2743,7 +2817,7 @@ New:~
* Issue #24: Basic support for remote directories via netrw
* Issue #50: in HTML, tables can now be embedded in lists
* 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
Changed:~
@ -2790,11 +2864,6 @@ Fixed:~
* Corrected website links in documentation. code.google is dead, long live
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~
* Concealing of links can be turned off - set |g:vimwiki_url_maxsave| to 0.

View File

@ -31,7 +31,7 @@ execute 'setlocal suffixesadd='.VimwikiGet('ext')
setlocal isfname-=[,]
" gf}}}
exe "setlocal tags+=" . vimwiki#tags#metadata_file_path()
exe "setlocal tags+=" . escape(vimwiki#tags#metadata_file_path(), ' \|"')
" MISC }}}
@ -173,9 +173,9 @@ function! VimwikiFoldLevel(lnum) "{{{
if line =~# g:vimwiki_rxHeader
return '>'.vimwiki#u#count_first_sym(line)
" Code block folding...
elseif line =~# '^\s*'.g:vimwiki_rxPreStart
elseif line =~# g:vimwiki_rxPreStart
return 'a1'
elseif line =~# '^\s*'.g:vimwiki_rxPreEnd.'\s*$'
elseif line =~# g:vimwiki_rxPreEnd
return 's1'
else
return "="
@ -221,7 +221,7 @@ function! VimwikiFoldText() "{{{
let main_text = substitute(line, '^\s*', repeat(' ',indent(v:foldstart)), '')
let fold_len = v:foldend - v:foldstart + 1
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)
return main_text.len_text
else

View File

@ -334,6 +334,7 @@ let s:vimwiki_defaults.template_default = 'default'
let s:vimwiki_defaults.template_ext = '.tpl'
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_toc = 0
" 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)
command! -count=1 VimwikiTabMakeDiaryNote
\ 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
\ call vimwiki#diary#generate_diary_section()
@ -506,6 +509,12 @@ endif
nnoremap <unique><script> <Plug>VimwikiTabMakeDiaryNote
\ :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 {{{

View File

@ -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 " {{{
let s:conceal = exists("+conceallevel") ? ' conceal' : ''
@ -444,11 +450,11 @@ execute 'syntax match VimwikiCodeT /'.g:vimwiki_rxCode.'/ contained contains=Vim
" <hr> horizontal rule
execute 'syntax match VimwikiHR /'.g:vimwiki_rxHR.'/'
execute 'syntax region VimwikiPre start=/^\s*'.g:vimwiki_rxPreStart.
\ '/ end=/^\s*'.g:vimwiki_rxPreEnd.'\s*$/ contains=@Spell'
execute 'syntax region VimwikiPre start=/'.g:vimwiki_rxPreStart.
\ '/ end=/'.g:vimwiki_rxPreEnd.'/ contains=@Spell'
execute 'syntax region VimwikiMath start=/^\s*'.g:vimwiki_rxMathStart.
\ '/ end=/^\s*'.g:vimwiki_rxMathEnd.'\s*$/ contains=@Spell'
execute 'syntax region VimwikiMath start=/'.g:vimwiki_rxMathStart.
\ '/ end=/'.g:vimwiki_rxMathEnd.'/ contains=@Spell'
" placeholders
@ -588,19 +594,22 @@ let b:current_syntax="vimwiki"
" EMBEDDED syntax setup "{{{
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)
for [s:hl_syntax, s:vim_syntax] in items(s:nested)
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*'.g:vimwiki_rxPreEnd, 'VimwikiPre')
\ g:vimwiki_rxPreEnd, 'VimwikiPre')
endfor
endif
" LaTeX
call vimwiki#base#nested_syntax('tex',
\ '^\s*'.g:vimwiki_rxMathStart.'\%(.*[[:blank:][:punct:]]\)\?'.
\ g:vimwiki_rxMathStart.'\%(.*[[:blank:][:punct:]]\)\?'.
\ '\%([[:blank:][:punct:]].*\)\?',
\ '^\s*'.g:vimwiki_rxMathEnd, 'VimwikiMath')
\ g:vimwiki_rxMathEnd, 'VimwikiMath')
"}}}