Made each heading link to itself, by placing an <a> tag inside each
<h[1-6]> tag.
Also adds class="header" to each header, allowing for the CSS rule
.header a { ... }
to remove all styling from the inner links, allowing the outputed
document to look like before.
This reverts commit 599a0e9083.
Sorry, we can't simply change the syntax of something as basic as a
link, even if the old syntax is wrong. We need to keep Vimwiki
reasonably backwards compatible.
Two reasons whey the links in markdown wikis are not updated:
1. The markdown link pattern is wrong, should be []() rather than [][];
2. The logic of getting wiki local var cannot get correct wiki index as:
a. the renamed file's buffer is removed and %:p would return empty
b. the function that gets the wiki local var depends on buffer's %:p
value to find the wiki it belongs to and it would always return -1
and result in the default option values instead the user's option
The fix is
1. fix the markdown link pattern regex;
2. keep the renamed file's buffer open during the period of updating the link
Before, the cursor would jump to the TOC a lot when pressing <C-o> etc.,
because it is changed every time the buffer is saved.
Use :keepjumps to make it less intrusive. Sadly, the cursor still jumps
to the TOC when you press u and C-r, but it seems there is no way around
it.
Apparently, switching buffers in connection with disabled events caused
the highlighting to disappear. Solution: use the :wa command to save all
buffers. A disadvantage is that now also non-Vimwiki buffers are saved,
but I think that is bearable.
Will fix normalization of links like [[local:./foo.txt]]
Also, allow schemes to end with a number, so that e.g. [[wiki1:foo]]
will normalize as expected.
The only real condition we care about is whether the selection is
contained within a single line. It is practical to do something like
V<CR> to link a whole line, and AFAIK there is no reason for why that
doesn't work.
- make it work for markdown and media syntax as well
- don't find headers in preformatted text or headers of the form = foo ==
- introduce iH and aH text objects for headers plus subheaders
- add a count to include parent headers
Inspired by #462
This was committed by accident. Since 53745e8 had to be done by machine
this it not a real revert, but a redo of 53745e8. Due to the matter of
53745e8 it's slightly different.
* Allow HTML-style comment syntax
Allow <!-- HTML comments --> in vimwiki's highlight for markdown.
* Avoid matching "TODO" on word boundaries
Do not match e.g. "xTODO:" as if it were "TODO:".
This also lifts the requirement of ":" after these keywords
(it is more flexible to just require a word boundary regardless of what).
The list of diary entries now is not indented according to the vim
`shiftwidth` setting, but gets the indentation from list_margin (as is
the case for `vimwiki#base#generate_links`).
1 tabedit
2 split
3 vsplit
Similar to opening a tab,::
vimwiki#base#goto_index(v:count1, 1)
we can now open a split with::
vimwiki#base#goto_index(v:count1, 2)
and a vertical split with::
vimwiki#base#goto_index(v:count1, 3)
1 tabedit
2 split
3 vsplit
Similar to opening a tab,::
vimwiki#base#goto_index(v:count1, 1)
we can now open a split with::
vimwiki#base#goto_index(v:count1, 2)
and a vertical split with::
vimwiki#base#goto_index(v:count1, 3)
1 tabedit
2 split
3 vsplit
Similar to opening a tab,::
vimwiki#base#goto_index(1, 1)
we can now open a split with::
vimwiki#base#goto_index(1, 2)
and a vertical split with::
vimwiki#base#goto_index(1, 3)
1 tabedit
2 split
3 vsplit
Similar to opening a tab,::
vimwiki#base#goto_index(v:count1, 1)
we can now open a split with::
vimwiki#base#goto_index(v:count1, 2)
and a vertical split with::
vimwiki#base#goto_index(v:count1, 3)
This escapes the `.` preceding an extension (e.g. `.wiki`) so that it doesn't accidentally match any character.
For example: `[vimwiki](vimwiki)` was opening the `vi.wiki` page, because of this rule.