39 Commits

Author SHA1 Message Date
Michael F. Schönitzer 79d6a1a4e2 Update version number to 2.4.1 2019-04-20 14:01:11 +02:00
Michael F. Schönitzer f105819c48 Add screen shots provided by @monkinco in PR #670
I cut the screen shots to only show features of vimwiki.
2019-04-20 13:51:15 +02:00
Rane Brown 4a9f81c54b Add info to include in help file. Issue #652 2019-04-10 21:31:23 +02:00
Rane Brown d3aade7349 Fix VimwikiShowVersion function. Closes #654.
Change a:xxx variable to l:xxx since argument variables are immutable as
of Vim patch 888. Convert the stable version number to a string prior to
printing.
2019-04-10 21:31:15 +02:00
Monkin 62d71b832a Update and format README.md 2019-04-10 21:31:02 +02:00
Rane Brown b90fbc70d9 Fix missing 'T' in syntax definition of VimwikiDelTextT
The missing 'T' character was causing strikethrough ~ characters to be
hidden within tables which is not the desired behavior. Closes #404.
2019-04-10 21:28:47 +02:00
Michael F. Schönitzer 6766c37ce0 Set release date for 2.4 2019-03-24 15:06:50 +01:00
Michael F. Schönitzer 5553cef249 Update version number 2019-03-21 23:09:36 +01:00
Michael F. Schönitzer 7fbeea2c1e Update the changelog 2019-03-21 23:06:01 +01:00
Michael F. Schönitzer 57385b29bb Update list of contributors 2019-03-21 21:52:59 +01:00
Michael F. Schönitzer d0e14dd11c Merge branch 'master' into rel-2.4-pre 2019-03-21 21:12:44 +01:00
Rane Brown a5ef478750 Improverize issue template per #513 2019-03-20 06:24:16 -06:00
Rane Brown 605604fc23 Create an issue template 2019-03-17 22:24:51 -06:00
Rane Brown 7f98bfbe4b Create a pull request template. 2019-03-17 22:06:10 -06:00
EinfachToll 54d1a997d9 Update Contributing.md 2019-03-11 21:24:19 +01:00
Michael F. Schönitzer 5ab8f8672e Add call for help and note about Riot 2019-03-09 14:49:01 +01:00
EinfachToll 1b2643ea19 Clarify the description of hl_cb_checked in the doc
Ref #605
2019-02-04 21:48:18 +01:00
EinfachToll e16dc41a50 The recommended branch to use is master, not dev 2019-02-01 17:51:41 +01:00
EinfachToll 19f1d36229 Revert "Initial commit"
This reverts commit 7699967a99.
Reason: It's wrong. In markdown, opposed to mediawiki, list items can be indented, e.g. when a
list contains a list.
2019-02-01 17:48:48 +01:00
Stefan Huber b8d0cf377d doc: Fix spelling for <Leader> 2019-02-01 17:43:05 +01:00
Nico a7160310c9 Patch for issue #585 - implement suggested improvements 2019-02-01 17:43:05 +01:00
Nicolas Brailovsky 0f38192b03 Patch for issue #585, fix anchor links for multiple extensions 2019-02-01 17:43:05 +01:00
CUI Hao (Lab) 41199e6e3b Update Chinese readme & add links to each readme 2019-02-01 17:43:05 +01:00
Fredrik Arnerup 69aa609941 Don't include trailing period in link 2019-02-01 17:43:05 +01:00
Daniel Quomsieh 72bbb1b740 fixed writing error 2019-02-01 17:43:05 +01:00
Steven Stallion 7699967a99 Initial commit 2019-02-01 17:43:05 +01:00
Michael F. Schönitzer 394efe4312 Add a command that shows the version or commit
Ref #512
2019-02-01 17:43:05 +01:00
EinfachToll ea13b0e848 Make master the recommended branch to use
Discussed in #505
2019-02-01 17:43:05 +01:00
EinfachToll daee3b4796 Fix a typo 2019-01-30 21:46:03 +01:00
Hugo Hörnquist bda3a59f91 Made headings link to themselves.
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.
2019-01-30 21:13:29 +01:00
Stefan Huber 417490f30b doc: Fix spelling for <Leader> 2019-01-29 21:49:28 +01:00
Nico 4e6db92d2c Patch for issue #585 - implement suggested improvements 2019-01-20 19:10:10 +01:00
Nicolas Brailovsky aca8c2b8cc Patch for issue #585, fix anchor links for multiple extensions 2019-01-20 19:10:10 +01:00
CUI Hao (Lab) 7ffc295094 Update Chinese readme & add links to each readme 2018-10-12 23:44:36 +02:00
Fredrik Arnerup f882cf0152 Don't include trailing period in link 2018-09-17 15:22:04 +02:00
Daniel Quomsieh f55ec31675 fixed writing error 2018-09-03 18:42:27 +02:00
Steven Stallion 9f797f6ad9 Initial commit 2018-07-21 02:04:13 +02:00
Michael F. Schönitzer 9f8b0082db Add a command that shows the version or commit
Ref #512
2018-06-12 20:55:56 +02:00
EinfachToll f60923eaa3 Make master the recommended branch to use
Discussed in #505
2018-06-06 21:27:25 +02:00
22 changed files with 753 additions and 762 deletions
+11
View File
@@ -0,0 +1,11 @@
# Issue Checks
Prior to submitting a new issue make sure to complete these steps:
1. Checkout the `dev` branch and confirm the issue is present there as well.
The `dev` branch contains fixes that may not have been merged to `master` yet.
2. Post the syntax you are using (default/mediawiki/markdown) **and** your vimwiki settings from your `.vimrc`
3. Provide a detailed description of the problem including **steps to reproduce the issue**.
4. Include the output of `:VimwikiShowVersion`.
**DELETE THIS TEMPLATE TEXT PRIOR TO SUBMITTING THE ISSUE**
+9
View File
@@ -0,0 +1,9 @@
# Pull Request Checks
1. **ALL** pull requests should be made against the `dev` branch!
2. Take a look at [CONTRIBUTING.MD](https://github.com/vimwiki/vimwiki/blob/dev/CONTRIBUTING.md)
3. Reference any related issues.
4. Provide a description of the proposed changes and any testing that was done.
5. Make sure to update the documentation in `doc/vimwiki.txt` if applicable.
**DELETE THIS TEMPLATE TEXT PRIOR TO SUBMITTING YOUR PULL REQUEST**
+20 -3
View File
@@ -6,18 +6,36 @@ https://github.com/vimwiki/vimwiki/tree/dev to see if your problem is already fi
Issues can be filed at https://github.com/vimwiki/vimwiki/issues/ .
# Creating a pull request
If you want to provide a pull request on GitHub, please start from the `dev` branch, not from the
`master` branch. (Caution, GitHub shows `master` as the default branch from which to start a PR.)
Make sure to update `doc/vimwiki.txt` with the following information:
1. Update the changelog to include information on the new feature the PR introduces or the bug it
is fixing.
2. Add a help section to describe any new features or options.
2. If you are a first time contributor add your name to the list of contributors.
# More info and advice for (aspiring) core developers
- Before implementing a non-trivial feature, think twice what it means for the user. We should
always try to keep backward compatibility. If you are not sure, discuss it on GitHub.
- Also, when thinking about adding a new feature, it should be something which fits into the
overall design of Vimwiki and which a significant portion of the users may like. Keep in mind
that everybody has their own way to use Vimwiki.
- Keep the coding style consistent.
- Test your changes. Keep in mind that Vim has a ton of options and the users tons of different
setups. Take a little time to think about under which circumstances your changes could break.
# More info for (aspiring) core developers
## Git branching model
- there are two branches with eternal lifetime:
- `dev`: This is where the main development happens. Tasks which are done in one or only a few
commits go here directly. Always try to keep this branch in a working state, that is, if the
task you work on requires multiple commits, make sure intermediate commits don't make Vimwiki
unusable (or at least push these commits at one go).
- `master`: This branches is for released states only. Whenever a reasonable set of changes has
- `master`: This branch is for released states only. Whenever a reasonable set of changes has
piled up in the `dev` branch, a [release is done](#Preparing a release). After a release,
`dev` has been merged into `master` and `master` got exactly one additional commit in which
the version number in `plugin/vimwiki.vim` is updated. Apart from these commits and the merge
@@ -42,5 +60,4 @@ If you want to provide a pull request on GitHub, please start from the `dev` bra
forget this plan.
11. Tell the world.
%% vim:tw=99
View File
+85 -55
View File
@@ -1,63 +1,62 @@
一个私人的维基——vim插件
VimWiki —— Vim 个人 Wiki 插件
==============================================================================
[English](README.md)
![screenshot1](doc/screenshot_1.png)
![screenshot2](doc/screenshot_2.png)
![screenshot2](doc/screenshot_2.png) *
介绍
------------------------------------------------------------------------------
Vimwiki是私人维基的vim插件 -- 许多有自己代码高亮的text文件。
Vimwiki 是 Vim 中的个人 Wiki —— 一组链接起来的、有独特语法高亮的文本文件。
通过Vimwiki,你可以:
通过 Vimwiki,你可以:
* 组织笔记和想法
* 制作代办事项
* 写文档
* 管理待办事项
* 写文档
* 坚持写日记
* 将这一切导出成 HTML 网页
一个快速的开始,通常使用`<Leader>ww`(一般是`\ww`),然后创建你的index wiki文件
通常,它在:
马上开始!按下 `<Leader>ww`(通常是 `\ww`)进入作为目录页的 wiki 文件,这个文件默认存放在 `~/vimwiki/index.wiki`
~/vimwiki/index.wiki
在该文件中输入以下示例:
在这个文件,输入如下的例子:
= 我的个人知识库 =
* 任务列表 -- _昨天_ 就该完成的事!!!
* Gutenberg 计划 -- 好书给我力量。
* 草稿 -- 临时记录一些东西。
= My knowledge base =
* Tasks -- things to be done _yesterday_!!!
* Project Gutenberg -- good books are power.
* Scratchpad -- various temporary stuff.
把光标移到 `任务` 二字上,按 Enter(回车)创建链接。按下后,`任务`二字会变成 `[[任务]]` —— 这是一个 Vimwiki 链接。再次按 Enter 即可进入这个链接(打开新的 wiki 文件)。编辑这个新文件,保存,然后按 Backspace(退格)就能回到目录页。
将你的光标放到`Tasks`(任务)上,并且按回车键去创建一个链接。一旦按下,`Task`将会
变成`[[Tasks]]` -- 一个vimwiki的链接。再按一次回车去打开它。编辑文件,保存它,
然后按backspace来返回你的index。
如果 Vimwiki 链接长度不止一个单词(指的是英文单词),只需在 Visual 模式选择这段文本后按 Enter 即可。用上面的 `Gutenberg 计划` 试试吧。最终结果是这样:
一个vimwiki链接可以一句话创建。只需要通过选择visual模式选择这个句子,然后按回车。
你可以通过选择`Project Gutenberg`来尝试。结果像是这个样子:
= My knowledge base =
* [[Tasks]] -- things to be done _yesterday_!!!
* [[Project Gutenberg]] -- good books are power.
* Scratchpad -- various temporary stuff.
= 我的个人知识库 =
* [[任务列表]] -- _昨天_ 就该完成的事!!!
* [[Gutenberg 计划]] -- 好书给我力量。
* 草稿 -- 临时记录一些东西。
基本标记
------------------------------------------------------------------------------
= Header1 =
== Header2 ==
=== Header3 ===
= 一级标题 =
== 二级标题 ==
=== 三级标题 ===
*bold* -- bold text
_italic_ -- italic text
*bold* -- 粗体文本
_italic_ -- 斜体文本
(应用于句中的汉字文本时,必须在标记前后加空格,例如:一段 *中文* 文本)
[[wiki link]] -- wiki link
[[wiki link|description]] -- wiki link with description
[[wiki link]] -- wiki 链接
[[wiki link|description]] -- 带有描述文本的 wiki 链接
列表:
列表
* bullet list item 1
* bullet list item 1(无编号列表)
- bullet list item 2
- bullet list item 3
* bullet list item 4
@@ -67,13 +66,13 @@ Vimwiki是私人维基的vim插件 -- 许多有自己代码高亮的text文件
- bullet list item 8
- bullet list item 9
1. numbered list item 1
1. numbered list item 1(有编号列表)
2. numbered list item 2
a) numbered list item 3
b) numbered list item 4
查看`:h vimwiki-syntax`
更多格式说明,请阅 `:h vimwiki-syntax`
键位绑定
@@ -81,46 +80,49 @@ Vimwiki是私人维基的vim插件 -- 许多有自己代码高亮的text文件
normal 模式:
* `<Leader>ww` -- 打开默认的wiki index文件
* `<Leader>wt` -- 通过tab实现上一个功能
* `<Leader>ws` -- 选择并打开index文件
* `<Leader>wd` -- 删除进入的wiki文件
* `<Leader>wr` -- 重命名你进入的wiki文件
* `<Enter>` -- 进入/创建 wiki 链接
* `<Shift-Enter>` -- 通过分屏模式sp,进入/创建wiki链接
* `<Ctrl-Enter>` -- 通过分屏模式vs,进入/创建wiki链接
* `<Backspace>` -- 返回父节点
* `<Tab>` -- 寻找下一个wiki链接
* `<Shift-Tab>` -- 寻找上一个wiki链接
* `<Leader>ww` -- 打开默认的 wiki 目录文件
* `<Leader>wt` -- 在新标签(Tab)中打开 wiki 目录文件
* `<Leader>ws` -- 在多个 wiki 中选择并打开该 wiki 的目录文件
* `<Leader>wd` -- 删除当前 wiki 文件
* `<Leader>wr` -- 重命名当前 wiki 文件
* `<Enter>` -- 创建或打开 wiki 链接
* `<Shift-Enter>` -- 先上下分屏再打开 wiki 链接(若非链接则先创建)
* `<Ctrl-Enter>` -- 先左右分屏再打开 wiki 链接(若非链接则先创建)
* `<Backspace>` -- 返回之前浏览的 wiki 文件
* `<Tab>` -- 跳到本文件中下一个 wiki 链接
* `<Shift-Tab>` -- 跳到本文件中上一个 wiki 链接
查看`:h vimwiki-mappings`
更多快捷键说明,请阅 `:h vimwiki-mappings`
命令
------------------------------------------------------------------------------
* `:Vimwiki2HTML` -- 转换当前wiki成为html
* `:VimwikiAll2HTML` -- 转化你的全部wiki到html
* `:Vimwiki2HTML` -- 当前 wiki 文件转换成 HTML 网页
* `:VimwikiAll2HTML` -- 把所有 wiki 文件转换成 HTML 网页
* `:help vimwiki-commands` -- 显示全部命令
安装细节
安装
==============================================================================
在安装之前,你需要做的
准备工作
------------------------------------------------------------------------------
定在`vimrc`中,你的设置是这样的。
保在 `vimrc` 中加入了以下设置:
set nocompatible
filetype plugin on
syntax on
如果没有他们Vimwiki将无法正常工作。
没有这些设置Vimwiki 将无法正常工作。
通过 [Vim packages](http://vimhelp.appspot.com/repeat.txt.html#packages) 安装(Vim 7.4.1528 后)
------------------------------------------------------------------------------
git clone https://github.com/vimwiki/vimwiki.git ~/.vim/pack/plugins/start/vimwiki
使用 pathogen (译者注:一个插件) (http://www.vim.org/scripts/script.php?script_id=2332 )
通过 [Pathogen](http://www.vim.org/scripts/script.php?script_id=2332) 安装
------------------------------------------------------------------------------
cd ~/.vim
@@ -128,4 +130,32 @@ normal 模式:
cd bundle
git clone https://github.com/vimwiki/vimwiki.git
然后启动vim,使用`:Helptags` 然后 `:help vimwiki`来确保他已经被安装了。
通过 [Vim-Plug](https://github.com/junegunn/vim-plug) 安装
------------------------------------------------------------------------------
`vimrc` 中加入以下插件设置:
Plug 'vimwiki/vimwiki'
然后运行 `:PlugInstall`
通过 [Vundle](https://github.com/VundleVim/Vundle.vim) 安装
------------------------------------------------------------------------------
`vimrc` 中加入 `Plugin 'vimwiki/vimwiki'`,然后执行:
vim +PluginInstall +qall
或者下载 [zip 压缩包](https://github.com/vimwiki/vimwiki/archive/master.zip)然后解压到 `~/.vim/bundle/` 目录下。
安装后,启动 Vim 并执行 `:Helptags` 以及 `:help vimwiki`,检查安装是否成功。
获取帮助
==============================================================================
遇到问题?在 Freenode 的 IRC 频道 `#vimwiki`[网页聊天](https://webchat.freenode.net/?channels=#vimwiki))提问,或者发送问题到[邮件列表](https://groups.google.com/forum/#!forum/vimwiki)上吧。
----
\* 前面截图中用的是 [solarized 配色方案](https://github.com/altercation/vim-colors-solarized)以及 [lightline](https://github.com/itchyny/lightline.vim) 插件。
+170 -101
View File
@@ -1,88 +1,180 @@
A Personal Wiki For Vim
==============================================================================
# VimWiki: A Personal Wiki For Vim
![screenshot1](doc/screenshot_1.png)
![screenshot2](doc/screenshot_2.png) *
[中文](README-cn.md)
Intro
------------------------------------------------------------------------------
- [Intro](#intro)
- [Installation](#installation)
- [Prerequisites](#prerequisites)
- [VIM Packages](#installation-using-vim-packages-since-vim-741528)
- [Pathogen](#installation-using-pathogen)
- [Vim-Plug](#installation-using-vim-plug)
- [Vundle](#installation-using-vundle)
- [Basic Markup](#basic-markup)
- [Lists](#lists)
- [Key Bindings](#key-bindings)
- [Commands](#commands)
- [Changing Wiki Syntax](#changing-wiki-syntax)
- [Getting Help](#getting-help)
- [Helping VimWiki](#helping-vimwiki)
- [Wiki](https://github.com/vimwiki/vimwiki/wiki)
- [License](#license)
Vimwiki is a personal wiki for Vim -- a number of linked text files that have
## Intro
VimWiki is a personal wiki for Vim -- a number of linked text files that have
their own syntax highlighting.
With Vimwiki you can:
With VimWiki you can:
* organize notes and ideas
* manage todo-lists
* write documentation
* maintain a diary
* export everything to HTML
* Organize notes and ideas
* Manage to-do lists
* Write documentation
* Maintain a diary
* Export everything to HTML
To do a quick start press `<Leader>ww` (this is usually `\ww`) to go to your index
wiki file. By default it is located in `~/vimwiki/index.wiki`.
To do a quick start press `<Leader>ww` (this is usually `\ww`) to go to your
index wiki file. By default it is located in `~/vimwiki/index.wiki`.
Feed it with the following example:
= My knowledge base =
```
= My knowledge base =
* Tasks -- things to be done _yesterday_!!!
* Project Gutenberg -- good books are power.
* Scratchpad -- various temporary stuff.
```
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
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 Gutenberg`.
The result should look something like:
= My knowledge base =
```
= My knowledge base =
* [[Tasks]] -- things to be done _yesterday_!!!
* [[Project Gutenberg]] -- good books are power.
* Scratchpad -- various temporary stuff.
```
Basic Markup
------------------------------------------------------------------------------
## Screenshots
= Header1 =
== Header2 ==
=== Header3 ===
![Lists View](doc/lists.png)
![Entries View](doc/entries.png)
![Todos View](doc/todos.png)
![Wiki View](doc/wiki.png)
## Installation
### Prerequisites
Make sure you have these settings in your vimrc file:
```vim
set nocompatible
filetype plugin on
syntax on
```
Without them VimWiki will not work properly.
*bold* -- bold text
_italic_ -- italic text
#### Installation using [Vim packages](http://vimhelp.appspot.com/repeat.txt.html#packages) (since Vim 7.4.1528)
[[wiki link]] -- wiki link
[[wiki link|description]] -- wiki link with description
```sh
git clone https://github.com/vimwiki/vimwiki.git ~/.vim/pack/plugins/start/vimwiki
```
#### Installation using [Pathogen](http://www.vim.org/scripts/script.php?script_id=2332)
```sh
cd ~/.vim
mkdir bundle
cd bundle
git clone https://github.com/vimwiki/vimwiki.git
```
#### Installation using [Vim-Plug](https://github.com/junegunn/vim-plug)
Add the following to the plugin-configuration in your vimrc:
```vim
Plug 'vimwiki/vimwiki'
```
Then run `:PlugInstall`.
#### Installation using [Vundle](https://github.com/VundleVim/Vundle.vim)
Add `Plugin 'vimwiki/vimwiki'` to your vimrc file and run
```sh
vim +PluginInstall +qall
```
Or download the [zip
archive](https://github.com/vimwiki/vimwiki/archive/master.zip) and extract it
in `~/.vim/bundle/`
Then launch Vim, run `:Helptags` and then `:help vimwiki` to verify it was
installed.
## Basic Markup
```
= Header1 =
== Header2 ==
=== Header3 ===
Lists:
*bold* -- bold text
_italic_ -- italic text
* bullet list item 1
[[wiki link]] -- wiki link
[[wiki link|description]] -- wiki link with description
```
### Lists:
```
* bullet list item 1
- bullet list item 2
- bullet list item 3
* bullet list item 4
* bullet list item 5
* bullet list item 6
* bullet list item 7
* bullet list item 6
* bullet list item 7
- bullet list item 8
- bullet list item 9
1. numbered list item 1
2. numbered list item 2
1. numbered list item 1
2. numbered list item 2
a) numbered list item 3
b) numbered list item 4
```
For other syntax elements, see `:h vimwiki-syntax`
## Key bindings
Key bindings
------------------------------------------------------------------------------
normal mode:
Normal mode:
* `<Leader>ww` -- Open default wiki index file.
* `<Leader>wt` -- Open default wiki index file in a new tab.
@@ -98,84 +190,61 @@ normal mode:
For more keys, see `:h vimwiki-mappings`
## Commands
Commands
------------------------------------------------------------------------------
* `:Vimwiki2HTML` -- Convert current wiki link to HTML
* `:VimwikiAll2HTML` -- Convert all your wiki links to HTML
* `:VimWiki2HTML` -- Convert current wiki link to HTML
* `:VimWikiAll2HTML` -- Convert all your wiki links to HTML
* `:help vimwiki-commands` -- list all commands
* `:help vimwiki` -- General vimwiki help docs
## Changing Wiki Syntax
Changing Wiki Syntax
------------------------------------------------------------------------------
VimWiki currently ships with 3 syntaxes: VimWiki (default), Markdown
(markdown), and MediaWiki (media)
Vimwiki currently ships with 3 syntaxes: Vimwiki (default), Markdown (markdown), and MediaWiki (media)
If you would prefer to use either Markdown or MediaWiki syntaxes, set the
following option in your .vimrc:
If you would prefer to use either Markdown or MediaWiki syntaxes, set the following option in your .vimrc:
```
let g:vimwiki_list = [{'path': '~/vimwiki/',
```vim
let g:vimwiki_list = [{'path': '~/vimwiki/',
\ 'syntax': 'markdown', 'ext': '.md'}]
```
```
Installation
==============================================================================
## Getting help
Prerequisites
------------------------------------------------------------------------------
**Have a question?**
Visit the IRC channel [`#vimwiki`](https://webchat.freenode.net/?channels=#vimwiki) on Freenode ([webchat](https://webchat.freenode.net/?channels=#vimwiki), also synced to Matrix/Riot: `#freenode_#vimwiki:matrix.org`) or post to the [mailing list](https://groups.google.com/forum/#!forum/vimwiki).
Make sure you have these settings in your vimrc file:
## Helping VimWiki
set nocompatible
filetype plugin on
syntax on
VimWiki has a lot of users but only very few recurring developers or people
helping the community. Your help is therefore appreciated. Everyone can help!
See [#625](https://github.com/vimwiki/vimwiki/issues/625) for information on
how you can help.
Without them Vimwiki will not work properly.
## License
MIT License
Installation using [Vim packages](http://vimhelp.appspot.com/repeat.txt.html#packages) (since Vim 7.4.1528)
------------------------------------------------------------------------------
Copyright (c) 2008-2010 Maxim Kim
2013-2017 Daniel Schemala
git clone https://github.com/vimwiki/vimwiki.git ~/.vim/pack/plugins/start/vimwiki
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Installation using [Pathogen](http://www.vim.org/scripts/script.php?script_id=2332)
------------------------------------------------------------------------------
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
cd ~/.vim
mkdir bundle
cd bundle
git clone https://github.com/vimwiki/vimwiki.git
Installation using [Vim-Plug](https://github.com/junegunn/vim-plug)
------------------------------------------------------------------------------
Add the following to the plugin-configuration in your vimrc:
Plug 'vimwiki/vimwiki', { 'branch': 'dev' }
Then run `:PlugInstall`.
Installation using [Vundle](https://github.com/VundleVim/Vundle.vim)
------------------------------------------------------------------------------
Add `Plugin 'vimwiki/vimwiki'` to your vimrc file and run
vim +PluginInstall +qall
Or download the [zip archive](https://github.com/vimwiki/vimwiki/archive/master.zip) and extract it in `~/.vim/bundle/`
Then launch Vim, run `:Helptags` and then `:help vimwiki` to verify it was installed.
Getting help
==============================================================================
Have a question? Visit the IRC channel `#vimwiki` on Freenode ([webchat](https://webchat.freenode.net/?channels=#vimwiki))
or post to the [mailing list](https://groups.google.com/forum/#!forum/vimwiki).
----
\* Screenshots made with the [solarized colorscheme](https://github.com/altercation/vim-colors-solarized)
and [lightline](https://github.com/itchyny/lightline.vim)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+105 -82
View File
@@ -43,17 +43,55 @@ function! vimwiki#base#file_pattern(files)
endfunction
"FIXME TODO slow and faulty
function! vimwiki#base#subdir(path, filename)
let path = a:path
" ensure that we are not fooled by a symbolic link
"FIXME if we are not "fooled", we end up in a completely different wiki?
if a:filename !~# '^scp:'
let filename = resolve(a:filename)
else
let filename = a:filename
endif
let idx = 0
"FIXME this can terminate in the middle of a path component!
while path[idx] ==? filename[idx]
let idx = idx + 1
endwhile
let p = split(strpart(filename, idx), '[/\\]')
let res = join(p[:-2], '/')
if len(res) > 0
let res = res.'/'
endif
return res
endfunction
function! vimwiki#base#current_subdir()
return vimwiki#base#subdir(vimwiki#vars#get_wikilocal('path'), expand('%:p'))
endfunction
function! vimwiki#base#invsubdir(subdir)
return substitute(a:subdir, '[^/\.]\+/', '../', 'g')
endfunction
" Returns: the number of the wiki a file belongs to or -1 if it doesn't belong
" to any registered wiki.
function! vimwiki#base#find_wiki(file)
" The path can be the full path or just the directory of the file
function! vimwiki#base#find_wiki(path)
let bestmatch = -1
let bestlen = 0
let path = vimwiki#path#path_norm(vimwiki#path#chomp_slash(a:path))
for idx in range(vimwiki#vars#number_of_wikis())
let wiki_path = expand(vimwiki#vars#get_wikilocal('path', idx))
let common_prefix = vimwiki#path#path_common_pfx(wiki_path, a:file)
if vimwiki#path#is_equal(common_prefix, wiki_path)
if len(common_prefix) > bestlen
let bestlen = len(common_prefix)
let idx_path = expand(vimwiki#vars#get_wikilocal('path', idx))
let idx_path = vimwiki#path#path_norm(vimwiki#path#chomp_slash(idx_path))
let common_pfx = vimwiki#path#path_common_pfx(idx_path, path)
if vimwiki#path#is_equal(common_pfx, idx_path)
if len(common_pfx) > bestlen
let bestlen = len(common_pfx)
let bestmatch = idx
endif
endif
@@ -63,9 +101,10 @@ function! vimwiki#base#find_wiki(file)
endfunction
" Extract infos about the target from a link. If the second parameter is present, which should be a
" file object, it is assumed that the link appears in that file. Without it, the current file is
" used.
" THE central function of Vimwiki. Extract infos about the target from a link.
" If the second parameter is present, which should be an absolute file path, it
" is assumed that the link appears in that file. Without it, the current file
" is used.
function! vimwiki#base#resolve_link(link_text, ...)
if a:0
let source_wiki = vimwiki#base#find_wiki(a:1)
@@ -79,16 +118,13 @@ function! vimwiki#base#resolve_link(link_text, ...)
let link_infos = {
\ 'index': 0,
\ 'index': -1,
\ 'scheme': '',
\ 'is_file': 0, " 1 for a file, 0 for a URL (e.g. when the link was [[http://foo.bar]]),
\ " -1 if the whole link was malformed
\ 'target': '', " this is a file or dir object if is_file == 1, otherwise a string
\ 'filename': '',
\ 'anchor': '',
\ }
if link_text == ''
let link_infos.is_file = -1
return link_infos
endif
@@ -99,14 +135,10 @@ function! vimwiki#base#resolve_link(link_text, ...)
let link_infos.scheme = scheme
if link_infos.scheme !~# '\mwiki\d\+\|diary\|local\|file'
" unknown scheme, may be a weblink
let link_infos.is_file = 0
let link_infos.target = link_text
let link_infos.filename = link_text " unknown scheme, may be a weblink
return link_infos
endif
let link_infos.is_file = 1
let link_text = matchstr(link_text, '^'.vimwiki#vars#get_global('rxSchemes').':\zs.*\ze')
endif
@@ -120,11 +152,15 @@ function! vimwiki#base#resolve_link(link_text, ...)
let link_infos.anchor = join(split_lnk[1:], '#')
endif
if link_text == '' " because the link was of the form '#anchor'
let link_text = vimwiki#path#filename_without_extension(source_file)
endif
let expected_ext = vimwiki#u#escape(vimwiki#vars#get_wikilocal('ext')).'$'
if source_file =~# expected_ext
" Source file has expected extension. Remove it, it will be added later on
let ext_len = strlen(vimwiki#vars#get_wikilocal('ext'))
let link_text = fnamemodify(source_file, ':p:t')[:-ext_len-1]
endif
let link_tail = vimwiki#path#file_segment(link_text)
endif
endif
" check if absolute or relative path
if is_wiki_link && link_text[0] == '/'
@@ -136,7 +172,7 @@ function! vimwiki#base#resolve_link(link_text, ...)
let is_relative = 0
else
let is_relative = 1
let root_dir = vimwiki#path#directory_of_file(source_file)
let root_dir = fnamemodify(source_file, ':p:h') . '/'
endif
@@ -144,52 +180,45 @@ function! vimwiki#base#resolve_link(link_text, ...)
if link_infos.scheme =~# '\mwiki\d\+'
let link_infos.index = eval(matchstr(link_infos.scheme, '\D\+\zs\d\+\ze'))
if link_infos.index < 0 || link_infos.index >= vimwiki#vars#number_of_wikis()
let link_infos.is_file = -1
let link_infos.index = -1
let link_infos.filename = ''
return link_infos
endif
if link_text[0] == '/' || link_infos.index != source_wiki
if !is_relative || link_infos.index != source_wiki
let root_dir = vimwiki#vars#get_wikilocal('path', link_infos.index)
if link_text != '/'
let link_text = link_text[1:]
endif
else
let root_dir = vimwiki#path#directory_of_file(source_file)
endif
if link_text =~# '\m[/\\]$'
if vimwiki#vars#get_global('dir_link') == ''
let target_dir = vimwiki#path#dir_segment(link_text)
let link_infos.target = vimwiki#path#join_dir(root_dir, target_dir)
else
let link_text .= vimwiki#vars#get_global('dir_link') .
let link_infos.filename = root_dir . link_text
if vimwiki#path#is_link_to_dir(link_text)
if vimwiki#vars#get_global('dir_link') != ''
let link_infos.filename .= vimwiki#vars#get_global('dir_link') .
\ vimwiki#vars#get_wikilocal('ext', link_infos.index)
let target_file = vimwiki#path#file_segment(link_text)
let link_infos.target = vimwiki#path#join(root_dir, target_file)
endif
else
let link_text .= vimwiki#vars#get_wikilocal('ext', link_infos.index)
let target_file = vimwiki#path#file_segment(link_text)
let link_infos.target = vimwiki#path#join(root_dir, target_file)
let link_infos.filename .= vimwiki#vars#get_wikilocal('ext', link_infos.index)
endif
elseif link_infos.scheme ==# 'diary'
let link_infos.index = source_wiki
let root_dir = vimwiki#vars#get_wikilocal('diary_path', link_infos.index)
let target_file = vimwiki#path#file_segment(link_text .
\ vimwiki#vars#get_wikilocal('ext', link_infos.index))
let link_infos.target = vimwiki#path#join(root_dir, target_file)
elseif (link_infos.scheme ==# 'file' || link_infos.scheme ==# 'local') &&
\ vimwiki#path#is_absolute(link_text)
let link_infos.target = vimwiki#path#file_obj(link_text)
else " relative file link
let root_dir = vimwiki#path#directory_of_file(source_file)
let target_file = vimwiki#path#file_segment(link_text)
let link_infos.target = vimwiki#path#join(root_dir, target_file)
let link_infos.filename =
\ vimwiki#vars#get_wikilocal('path', link_infos.index) .
\ vimwiki#vars#get_wikilocal('diary_rel_path', link_infos.index) .
\ link_text .
\ vimwiki#vars#get_wikilocal('ext', link_infos.index)
elseif (link_infos.scheme ==# 'file' || link_infos.scheme ==# 'local') && is_relative
let link_infos.filename = simplify(root_dir . link_text)
else " absolute file link
" collapse repeated leading "/"'s within a link
let link_text = substitute(link_text, '\m^/\+', '/', '')
" expand ~/
let link_text = fnamemodify(link_text, ':p')
let link_infos.filename = simplify(link_text)
endif
let link_infos.filename = vimwiki#path#normalize(link_infos.filename)
return link_infos
endfunction
@@ -255,7 +284,7 @@ function! vimwiki#base#open_link(cmd, link, ...)
let link_infos = vimwiki#base#resolve_link(a:link)
endif
if link_infos.is_file == -1
if link_infos.filename == ''
if link_infos.index == -1
echomsg 'Vimwiki Error: No registered wiki ''' . link_infos.scheme . '''.'
else
@@ -267,7 +296,7 @@ function! vimwiki#base#open_link(cmd, link, ...)
let is_wiki_link = link_infos.scheme =~# '\mwiki\d\+' || link_infos.scheme =~# 'diary'
let update_prev_link = is_wiki_link &&
\ !vimwiki#path#is_equal(link_infos.target, vimwiki#path#current_wiki_file())
\ !vimwiki#path#is_equal(link_infos.filename, vimwiki#path#current_wiki_file())
let vimwiki_prev_link = []
" update previous link for wiki pages
@@ -281,10 +310,10 @@ function! vimwiki#base#open_link(cmd, link, ...)
" open/edit
if is_wiki_link
call vimwiki#base#edit_file(a:cmd, link_infos.target, link_infos.anchor,
call vimwiki#base#edit_file(a:cmd, link_infos.filename, link_infos.anchor,
\ vimwiki_prev_link, update_prev_link)
else
call vimwiki#base#system_open_link(link_infos.target)
call vimwiki#base#system_open_link(link_infos.filename)
endif
endfunction
@@ -314,7 +343,7 @@ endfunction
function! vimwiki#base#generate_links()
let lines = []
let links = vimwiki#base#get_wikilinks(vimwiki#vars#get_bufferlocal('wiki_nr'), 0, 0)
let links = vimwiki#base#get_wikilinks(vimwiki#vars#get_bufferlocal('wiki_nr'), 0)
call sort(links)
let bullet = repeat(' ', vimwiki#lst#get_list_margin()) . vimwiki#lst#default_symbol().' '
@@ -370,9 +399,7 @@ function! vimwiki#base#backlinks()
endfunction
" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX kann das weg?
" Returns: a list containing all files of the given wiki as file objects.
" Returns: a list containing all files of the given wiki as absolute file path.
" If the given wiki number is negative, the diary of the current wiki is used
" If the second argument is not zero, only directories are found
function! vimwiki#base#find_files(wiki_nr, directories_only)
@@ -380,7 +407,8 @@ function! vimwiki#base#find_files(wiki_nr, directories_only)
if wiki_nr >= 0
let root_directory = vimwiki#vars#get_wikilocal('path', wiki_nr)
else
let root_directory = vimwiki#vars#get_wikilocal('diary_path')
let root_directory = vimwiki#vars#get_wikilocal('path') .
\ vimwiki#vars#get_wikilocal('diary_rel_path')
let wiki_nr = vimwiki#vars#get_bufferlocal('wiki_nr')
endif
if a:directories_only
@@ -402,18 +430,14 @@ endfunction
" Returns: a list containing the links to get from the current file to all wiki
" files in the given wiki.
" If a:diary_only is nonzero, the diary of the wiki is used.
" If a:also_absolute_links is nonzero, also return links of the form /file.
function! vimwiki#base#get_wikilinks(wiki_nr, diary_only, also_absolute_links)
if a:diary_only
let files = vimwiki#path#files_in_dir_recursive(vimwiki#vars#get_wikilocal('diary_path'))
else
let files = vimwiki#path#files_in_dir_recursive(vimwiki#vars#get_wikilocal('path'))
endif
" If the given wiki number is negative, the diary of the current wiki is used.
" If also_absolute_links is nonzero, also return links of the form /file
function! vimwiki#base#get_wikilinks(wiki_nr, also_absolute_links)
let files = vimwiki#base#find_files(a:wiki_nr, 0)
if a:wiki_nr == vimwiki#vars#get_bufferlocal('wiki_nr')
let cwd = vimwiki#path#wikify_path(expand('%:p:h'))
elseif a:wiki_nr < 0
let cwd = vimwiki#vars#get_wikilocal('diary_path')
let cwd = vimwiki#vars#get_wikilocal('path') . vimwiki#vars#get_wikilocal('diary_rel_path')
else
let cwd = vimwiki#vars#get_wikilocal('path', a:wiki_nr)
endif
@@ -428,7 +452,7 @@ function! vimwiki#base#get_wikilinks(wiki_nr, diary_only, also_absolute_links)
if a:wiki_nr == vimwiki#vars#get_bufferlocal('wiki_nr')
let cwd = vimwiki#vars#get_wikilocal('path')
elseif a:wiki_nr < 0
let cwd = vimwiki#vars#get_wikilocal('diary_path')
let cwd = vimwiki#vars#get_wikilocal('path') . vimwiki#vars#get_wikilocal('diary_rel_path')
endif
let wikifile = fnamemodify(wikifile, ':r') " strip extension
let wikifile = '/'.vimwiki#path#relpath(cwd, wikifile)
@@ -590,7 +614,7 @@ function! s:get_links(wikifile, idx)
endif
let link_count += 1
let target = vimwiki#base#resolve_link(link_text, a:wikifile)
if target.is_file != -1 && target.scheme =~# '\mwiki\d\+\|diary\|file\|local'
if target.filename != '' && target.scheme =~# '\mwiki\d\+\|diary\|file\|local'
call add(links, [target.filename, target.anchor, lnum, col])
endif
endwhile
@@ -1897,11 +1921,11 @@ endfunction
function! s:is_diary_file(filename)
let file_path = vimwiki#path#path_norm(a:filename)
let diary_path = vimwiki#path#path_norm(vimwiki#vars#get_wikilocal('diary_path'))
return !vimwiki#path#equal(vimwiki#vars#get_wikilocal('path'),
\ vimwiki#vars#get_wikilocal('diary_path'))
\ && file_path =~# '^'.vimwiki#u#escape(diary_path)
endfunction " }}}
let rel_path = vimwiki#vars#get_wikilocal('diary_rel_path')
let diary_path = vimwiki#path#path_norm(vimwiki#vars#get_wikilocal('path') . rel_path)
return rel_path != '' && file_path =~# '^'.vimwiki#u#escape(diary_path)
endfunction
function! vimwiki#base#normalize_link_helper(str, rxUrl, rxDesc, template)
let url = matchstr(a:str, a:rxUrl)
@@ -1926,7 +1950,8 @@ endfunction
function! s:normalize_link_in_diary(lnk)
let link = a:lnk . vimwiki#vars#get_wikilocal('ext')
let link_wiki = vimwiki#vars#get_wikilocal('path') . '/' . link
let link_diary = vimwiki#vars#get_wikilocal('diary_path') . '/' . link
let link_diary = vimwiki#vars#get_wikilocal('path') . '/'
\ . vimwiki#vars#get_wikilocal('diary_rel_path') . '/' . link
let link_exists_in_diary = filereadable(link_diary)
let link_exists_in_wiki = filereadable(link_wiki)
let link_is_date = a:lnk =~# '\d\d\d\d-\d\d-\d\d'
@@ -1937,10 +1962,8 @@ function! s:normalize_link_in_diary(lnk)
let rxDesc = ''
let template = vimwiki#vars#get_global('WikiLinkTemplate1')
elseif link_exists_in_wiki
let relative_link =
\ vimwiki#path#relpath(vimwiki#vars#get_wikilocal('diary_path'),
\ vimwiki#vars#get_wikilocal('path'))
let str = relative_link . a:lnk . '|' . a:lnk
let depth = len(split(vimwiki#vars#get_wikilocal('diary_rel_path'), '/'))
let str = repeat('../', depth) . a:lnk . '|' . a:lnk
let rxUrl = '^.*\ze|'
let rxDesc = '|\zs.*$'
let template = vimwiki#vars#get_global('WikiLinkTemplate2')
+6 -4
View File
@@ -23,7 +23,7 @@ endfunction
function! s:diary_path(...)
let idx = a:0 == 0 ? vimwiki#vars#get_bufferlocal('wiki_nr') : a:1
return vimwiki#vars#get_wikilocal('diary_path', idx)
return vimwiki#vars#get_wikilocal('path', idx).vimwiki#vars#get_wikilocal('diary_rel_path', idx)
endfunction
@@ -90,7 +90,8 @@ endfunction
function! s:get_diary_files()
let rx = '^\d\{4}-\d\d-\d\d'
let s_files = glob(vimwiki#vars#get_wikilocal('diary_path') . '*' . vimwiki#vars#get_wikilocal('ext'))
let s_files = glob(vimwiki#vars#get_wikilocal('path').
\ vimwiki#vars#get_wikilocal('diary_rel_path').'*'.vimwiki#vars#get_wikilocal('ext'))
let files = split(s_files, '\n')
call filter(files, 'fnamemodify(v:val, ":t") =~# "'.escape(rx, '\').'"')
@@ -193,7 +194,8 @@ function! vimwiki#diary#make_note(wnum, ...)
" TODO: refactor it. base#goto_index uses the same
call vimwiki#path#mkdir(vimwiki#vars#get_wikilocal('diary_path', wiki_nr))
call vimwiki#path#mkdir(vimwiki#vars#get_wikilocal('path', wiki_nr).
\ vimwiki#vars#get_wikilocal('diary_rel_path', wiki_nr))
let cmd = 'edit'
if a:0
@@ -318,7 +320,7 @@ endfunction
function vimwiki#diary#calendar_sign(day, month, year)
let day = s:prefix_zero(a:day)
let month = s:prefix_zero(a:month)
let sfile = vimwiki#vars#get_wikilocal('diary_path') .
let sfile = vimwiki#vars#get_wikilocal('path').vimwiki#vars#get_wikilocal('diary_rel_path').
\ a:year.'-'.month.'-'.day.vimwiki#vars#get_wikilocal('ext')
return filereadable(expand(sfile))
endfunction
+194 -135
View File
@@ -10,8 +10,8 @@ endif
let g:loaded_vimwiki_html_auto = 1
function! s:path_from_subdir_to_root(subdir)
return vimwiki#path#relpath(a:subdir, vimwiki#vars#get_wikilocal('path_html'))
function! s:root_path(subdir)
return repeat('../', len(split(a:subdir, '[/\\]')))
endfunction
@@ -43,67 +43,87 @@ function! s:is_img_link(lnk)
endfunction
function! s:corresponding_html_file(wiki_file)
let relative_wiki_path = vimwiki#path#subtract(vimwiki#vars#get_wikilocal('path'), a:wiki_file)
let html_file = vimwiki#path#join(vimwiki#vars#get_wikilocal('path_html'), relative_wiki_path)
let html_file = vimwiki#path#set_extension(html_file, 'html')
return html_file
endfunction
function! s:corresponding_wiki_file(html_file)
let html_path = vimwiki#path#subtract(vimwiki#vars#get_wikilocal('path_html'), a:html_file)
let wiki_file = vimwiki#path#join(vimwiki#vars#get_wikilocal('path'), html_path)
let wiki_file = vimwiki#path#set_extension(wiki_file, vimwiki#vars#get_wikilocal('ext'))
return wiki_file
endfunction
function! s:default_CSS_full_name()
return vimwiki#path#join(vimwiki#vars#get_wikilocal('path_html'),
\ vimwiki#vars#get_wikilocal('css_name'))
endfunction
" Returns: 1 if it was created, 0 if it already existed
function! s:create_default_CSS()
let css_full_name = s:default_CSS_full_name()
if vimwiki#path#exists(css_full_name)
return 0
else
let default_css = vimwiki#path#find_autoload_file('style.css')
call vimwiki#path#copy_file(default_css, css_full_name)
function! s:has_abs_path(fname)
if a:fname =~# '\(^.:\)\|\(^/\)'
return 1
endif
return 0
endfunction
function! s:find_autoload_file(name)
for path in split(&runtimepath, ',')
let fname = path.'/autoload/vimwiki/'.a:name
if glob(fname) != ''
return fname
endif
endfor
return ''
endfunction
function! s:default_CSS_full_name(path)
let path = expand(a:path)
let css_full_name = path . vimwiki#vars#get_wikilocal('css_name')
return css_full_name
endfunction
function! s:create_default_CSS(path)
let css_full_name = s:default_CSS_full_name(a:path)
if glob(css_full_name) == ""
call vimwiki#path#mkdir(fnamemodify(css_full_name, ':p:h'))
let default_css = s:find_autoload_file('style.css')
if default_css != ''
let lines = readfile(default_css)
call writefile(lines, css_full_name)
return 1
endif
endif
return 0
endfunction
function! s:template_full_name(name)
let filename = vimwiki#path#file_segment(name . vimwiki#vars#get_wikilocal('template_ext'))
let template_file = vimwiki#path#join(vimwiki#vars#get_wikilocal('template_path'), filename)
return template_file
if a:name == ''
let name = vimwiki#vars#get_wikilocal('template_default')
else
let name = a:name
endif
let fname = expand(vimwiki#vars#get_wikilocal('template_path').
\ name . vimwiki#vars#get_wikilocal('template_ext'))
if filereadable(fname)
return fname
else
return ''
endif
endfunction
function! s:get_html_template(template_name)
if a:template_name != ''
let template_file = s:template_full_name(a:template)
function! s:get_html_template(template)
" TODO: refactor it!!!
let lines=[]
if a:template != ''
let template_name = s:template_full_name(a:template)
try
let lines = readfile(vimwiki#path#to_string(template_file))
let lines = readfile(template_name)
return lines
catch /E484/
echomsg 'Vimwiki: HTML template '.vimwiki#path#to_string(template_file). ' does not exist!'
echomsg 'Vimwiki: HTML template '.template_name. ' does not exist!'
endtry
return []
else
let default_template_file =
\ s:template_full_name(vimwiki#vars#get_wikilocal('template_default'))
if !vimwiki#path#exists(default_template_file)
let default_template_file = vimwiki#path#find_autoload_file('default.tpl')
endif
let default_tpl = s:template_full_name('')
if default_tpl == ''
let default_tpl = s:find_autoload_file('default.tpl')
endif
let lines = readfile(default_tpl)
return lines
endif
endfunction
@@ -131,25 +151,26 @@ function! s:safe_html_line(line)
endfunction
function! s:delete_html_files()
let htmlfiles =
\ vimwiki#path#files_in_dir_recursive(vimwiki#vars#get_wikilocal('path_html'), 'html')
for html_file in htmlfiles
function! s:delete_html_files(path)
let htmlfiles = split(glob(a:path.'**/*.html'), '\n')
for fname in htmlfiles
" ignore user html files, e.g. search.html,404.html
if index(vimwiki#vars#get_global('user_htmls'), vimwiki#path#filename(html_file)) >= 0
if stridx(vimwiki#vars#get_global('user_htmls'), fnamemodify(fname, ":t")) >= 0
continue
endif
" delete if there is no corresponding wiki file
if vimwiki#path#exists(s:corresponding_wiki_file(html_file))
let subdir = vimwiki#base#subdir(vimwiki#vars#get_wikilocal('path_html'), fname)
let wikifile = vimwiki#vars#get_wikilocal('path').subdir.
\fnamemodify(fname, ":t:r").vimwiki#vars#get_wikilocal('ext')
if filereadable(wikifile)
continue
endif
try
call delete(vimwiki#path#to_string(html_file))
call delete(fname)
catch
echomsg 'Vimwiki Error: Cannot delete '.vimwiki#path#to_string(html_file)
echomsg 'Vimwiki Error: Cannot delete '.fname
endtry
endfor
endfunction
@@ -210,15 +231,21 @@ endfunction
function! s:is_html_uptodate(wikifile)
let htmlfile_ftime = getftime(vimwiki#path#to_string(s:corresponding_html_file(a:wikifile)))
let tpl_time = -1
" The HTML file should also be considered out of date if the default template has been changed in
" the meantime. This is not completely correct, because the wiki file could use a template which
" is not the default one. But it's better than nothing.
let tpl_file = s:template_full_name(vimwiki#vars#get_wikilocal('template_default'))
let tpl_file = s:template_full_name('')
if tpl_file != ''
let tpl_time = getftime(tpl_file)
endif
return getftime(wikifile) <= htmlfile_ftime && tpl_time <= htmlfile_ftime
let wikifile = fnamemodify(a:wikifile, ":p")
let htmlfile = expand(vimwiki#vars#get_wikilocal('path_html') .
\ vimwiki#vars#get_bufferlocal('subdir') . fnamemodify(wikifile, ":t:r").".html")
if getftime(wikifile) <= getftime(htmlfile) && tpl_time <= getftime(htmlfile)
return 1
endif
return 0
endfunction
@@ -383,18 +410,17 @@ function! s:tag_wikiincl(value)
let link_infos = vimwiki#base#resolve_link(url_0)
if link_infos.scheme =~# '\mlocal\|wiki\d\+\|diary'
let url = vimwiki#path#relpath(vimwiki#path#directory_of_file(s:current_html_file),
\ link_infos.target)
let url = vimwiki#path#relpath(fnamemodify(s:current_html_file, ':h'), link_infos.filename)
" strip the .html extension when we have wiki links, so that the user can
" simply write {{image.png}} to include an image from the wiki directory
if link_infos.scheme =~# '\mwiki\d\+\|diary'
let url = vimwiki#path#filename_without_extension(url)
let url = fnamemodify(url, ':r')
endif
else
let url = link_infos.target
let url = link_infos.filename
endif
let url = escape(vimwiki#path#to_string(url), '#')
let url = escape(url, '#')
let line = s:linkify_image(url, descr, verbatim_str)
endif
return line
@@ -421,17 +447,20 @@ function! s:tag_wikilink(value)
if link_infos.scheme ==# 'file'
" external file links are always absolute
let html_link = vimwiki#path#to_string(link_infos.target)
let html_link = link_infos.filename
elseif link_infos.scheme ==# 'local'
let html_link = vimwiki#path#to_string(vimwiki#path#relpath(
\ vimwiki#path#directory_of_file(s:current_html_file), link_infos.target))
let html_link = vimwiki#path#relpath(fnamemodify(s:current_html_file, ':h'),
\ link_infos.filename)
elseif link_infos.scheme =~# '\mwiki\d\+\|diary'
" wiki links are always relative to the current file
let target_html_file = s:corresponding_html_file(link_infos.target)
let html_link = vimwiki#path#to_string(vimwiki#path#relpath(
\ vimwiki#path#directory_of_file(s:current_html_file), target_html_file))
let html_link = vimwiki#path#relpath(
\ fnamemodify(s:current_wiki_file, ':h'),
\ fnamemodify(link_infos.filename, ':r'))
if html_link !~ '\m/$'
let html_link .= '.html'
endif
else " other schemes, like http, are left untouched
let html_link = link_infos.target
let html_link = link_infos.filename
endif
if link_infos.anchor != ''
@@ -1043,7 +1072,9 @@ function! s:process_tag_h(line, id)
let h_text = num.' '.h_text
endif
let h_complete_id = s:escape_html_attribute(h_complete_id)
let h_part = '<div id="'.h_complete_id.'"><h'.h_level.' id="'.h_id.'"'
let h_part = '<div id="'.h_complete_id.'">'
let h_part .= '<h'.h_level.' id="'.h_id.'" class="header">'
let h_part .= '<a href="#'.h_complete_id.'"'
else
@@ -1059,7 +1090,7 @@ function! s:process_tag_h(line, id)
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.'</a></h'.h_level.'></div>'
let processed = 1
endif
@@ -1363,61 +1394,57 @@ endfunction
function! s:use_custom_wiki2html()
let custom_wiki2html = vimwiki#vars#get_wikilocal('custom_wiki2html')
return vimwiki#path#is_executable(custom_wiki2html)
return !empty(custom_wiki2html) &&
\ (s:file_exists(custom_wiki2html) || s:binary_exists(custom_wiki2html))
endfunction
function! s:call_custom_wiki2HTML(output_dir, wikifile, force)
call vimwiki#path#mkdir(a:output_dir)
let arguments = [
\ a:force,
\ vimwiki#vars#get_wikilocal('syntax'),
\ strpart(vimwiki#vars#get_wikilocal('ext'), 1),
\ vimwiki#path#to_string(a:output_dir),
\ vimwiki#path#to_string(a:wikifile),
\ vimwiki#path#to_string(s:default_CSS_full_name()),
\ vimwiki#path#to_string(vimwiki#vars#get_wikilocal('template_path')),
\ vimwiki#vars#get_wikilocal('template_default'),
\ vimwiki#vars#get_wikilocal('template_ext'),
\ vimwiki#path#to_string(s:path_from_subdir_to_root(a:output_dir)),
\ vimwiki#vars#get_wikilocal('custom_wiki2html_args')
\ ]
for i in range(len(arguments))
if arguments[i] =~# '\m^\s*$'
let arguments[i] = '-'
endif
let arguments[i] = shellescape(arguments[i])
endfor
echomsg system(vimwiki#vars#get_wikilocal('custom_wiki2html'). ' '. join(arguments, ' '))
function! vimwiki#html#CustomWiki2HTML(path, wikifile, force)
call vimwiki#path#mkdir(a:path)
echomsg system(vimwiki#vars#get_wikilocal('custom_wiki2html'). ' '.
\ a:force. ' '.
\ vimwiki#vars#get_wikilocal('syntax'). ' '.
\ strpart(vimwiki#vars#get_wikilocal('ext'), 1). ' '.
\ shellescape(a:path). ' '.
\ shellescape(a:wikifile). ' '.
\ shellescape(s:default_CSS_full_name(a:path)). ' '.
\ (len(vimwiki#vars#get_wikilocal('template_path')) > 1 ?
\ shellescape(expand(vimwiki#vars#get_wikilocal('template_path'))) : '-'). ' '.
\ (len(vimwiki#vars#get_wikilocal('template_default')) > 0 ?
\ vimwiki#vars#get_wikilocal('template_default') : '-'). ' '.
\ (len(vimwiki#vars#get_wikilocal('template_ext')) > 0 ?
\ vimwiki#vars#get_wikilocal('template_ext') : '-'). ' '.
\ (len(vimwiki#vars#get_bufferlocal('subdir')) > 0 ?
\ shellescape(s:root_path(vimwiki#vars#get_bufferlocal('subdir'))) : '-'). ' '.
\ (len(vimwiki#vars#get_wikilocal('custom_wiki2html_args')) > 0 ?
\ vimwiki#vars#get_wikilocal('custom_wiki2html_args') : '-'))
endfunction
function! s:convert_file(wikifile)
function! s:convert_file(path_html, wikifile)
let done = 0
let html_file = s:corresponding_html_file(a:wikifile)
let wikifile = fnamemodify(a:wikifile, ":p")
let path_html = expand(a:path_html).vimwiki#vars#get_bufferlocal('subdir')
let htmlfile = fnamemodify(wikifile, ":t:r").'.html'
" the currently processed file name is needed when processing links
" yeah yeah, shame on me for using (quasi-) global variables
let s:current_wiki_file = a:wikifile
let s:current_html_file = html_file
let output_dir = vimwiki#path#directory_of_file(html_file)
let s:current_wiki_file = wikifile
let s:current_html_file = path_html . htmlfile
if s:use_custom_wiki2html()
let force = 1
call s:call_custom_wiki2HTML(output_dir, wikifile, force)
call vimwiki#html#CustomWiki2HTML(path_html, wikifile, force)
let done = 1
endif
if s:syntax_supported() && done == 0
let lsource = readfile(vimwiki#path#to_string(a:wikifile))
let lsource = readfile(wikifile)
let ldest = []
call vimwiki#path#mkdir(output_dir)
call vimwiki#path#mkdir(path_html)
" nohtml placeholder -- to skip html generation.
let nohtml = 0
@@ -1483,7 +1510,7 @@ function! s:convert_file(wikifile)
if nohtml
echon "\r"."%nohtml placeholder found"
return vimwiki#path#null_file()
return ''
endif
call s:remove_blank_lines(ldest)
@@ -1500,7 +1527,7 @@ function! s:convert_file(wikifile)
call s:close_tag_table(state.table, lines, state.header_ids)
call extend(ldest, lines)
let title = s:process_title(placeholders, vimwiki#path#filename(a:wikifile))
let title = s:process_title(placeholders, fnamemodify(a:wikifile, ":t:r"))
let date = s:process_date(placeholders, strftime('%Y-%m-%d'))
let html_lines = s:get_html_template(template_name)
@@ -1509,9 +1536,10 @@ function! s:convert_file(wikifile)
call map(html_lines, 'substitute(v:val, "%title%", "'. title .'", "g")')
call map(html_lines, 'substitute(v:val, "%date%", "'. date .'", "g")')
call map(html_lines, 'substitute(v:val, "%root_path%", "'.
\ s:path_from_subdir_to_root(output_dir) .'", "g")')
\ s:root_path(vimwiki#vars#get_bufferlocal('subdir')) .'", "g")')
let css_name = vimwiki#path#to_string(vimwiki#vars#get_wikilocal('css_name'))
let css_name = expand(vimwiki#vars#get_wikilocal('css_name'))
let css_name = substitute(css_name, '\', '/', 'g')
call map(html_lines, 'substitute(v:val, "%css%", "'. css_name .'", "g")')
let enc = &fileencoding
@@ -1522,30 +1550,30 @@ function! s:convert_file(wikifile)
let html_lines = s:html_insert_contents(html_lines, ldest) " %contents%
call writefile(html_lines, vimwiki#path#to_string(html_file))
call writefile(html_lines, path_html.htmlfile)
let done = 1
endif
if done == 0
echomsg 'Vimwiki Error: Conversion to HTML is not supported for this syntax'
return vimwiki#path#null_file()
return ''
endif
return html_file
return path_html.htmlfile
endfunction
function! vimwiki#html#Wiki2HTML(wikifile)
let result = s:convert_file(a:wikifile)
if !vimwiki#path#is_null(result)
call s:create_default_CSS()
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()
function! vimwiki#html#WikiAll2HTML(path_html)
if !s:syntax_supported() && !s:use_custom_wiki2html()
echomsg 'Vimwiki Error: Conversion to HTML is not supported for this syntax'
return
@@ -1561,45 +1589,76 @@ function! vimwiki#html#WikiAll2HTML()
endtry
let &eventignore = save_eventignore
let path_html = vimwiki#vars#get_wikilocal('path_html')
let path_html = expand(a:path_html)
call vimwiki#path#mkdir(path_html)
echomsg 'Vimwiki: Deleting non-wiki html files ...'
call s:delete_html_files()
call s:delete_html_files(path_html)
echomsg 'Vimwiki: Converting wiki to html files ...'
let setting_more = &more
setlocal nomore
let wikifiles = vimwiki#path#files_in_dir_recursive(vimwiki#vars#get_wikilocal('path'),
\ vimwiki#vars#get_wikilocal('ext'))
" temporarily adjust current_subdir global state variable
let current_subdir = vimwiki#vars#get_bufferlocal('subdir')
let current_invsubdir = vimwiki#vars#get_bufferlocal('invsubdir')
let wikifiles = split(glob(vimwiki#vars#get_wikilocal('path').'**/*'.
\ vimwiki#vars#get_wikilocal('ext')), '\n')
for wikifile in wikifiles
let wikifile = fnamemodify(wikifile, ":p")
" temporarily adjust 'subdir' and 'invsubdir' state variables
let subdir = vimwiki#base#subdir(vimwiki#vars#get_wikilocal('path'), wikifile)
call vimwiki#vars#set_bufferlocal('subdir', subdir)
call vimwiki#vars#set_bufferlocal('invsubdir', vimwiki#base#invsubdir(subdir))
if !s:is_html_uptodate(wikifile)
echomsg 'Vimwiki: Processing '.vimwiki#path#to_string(wikifile)
call s:convert_file(wikifile)
echomsg 'Vimwiki: Processing '.wikifile
call s:convert_file(path_html, wikifile)
else
echomsg 'Vimwiki: Skipping '.vimwiki#path#to_string(wikifile)
echomsg 'Vimwiki: Skipping '.wikifile
endif
endfor
" reset 'subdir' state variable
call vimwiki#vars#set_bufferlocal('subdir', current_subdir)
call vimwiki#vars#set_bufferlocal('invsubdir', current_invsubdir)
let created = s:create_default_CSS()
let created = s:create_default_CSS(path_html)
if created
echomsg 'Vimwiki: Default style.css has been created'
endif
echomsg 'Vimwiki: HTML exported to '.vimwiki#path#to_string(path_html)
echomsg 'Vimwiki: HTML exported to '.path_html
echomsg 'Vimwiki: Done!'
let &more = setting_more
endfunction
function! s:file_exists(fname)
return !empty(getftype(expand(a:fname)))
endfunction
function! s:binary_exists(fname)
return executable(expand(a:fname))
endfunction
function! s:get_wikifile_url(wikifile)
return vimwiki#vars#get_wikilocal('path_html') .
\ vimwiki#base#subdir(vimwiki#vars#get_wikilocal('path'), a:wikifile).
\ fnamemodify(a:wikifile, ":t:r").'.html'
endfunction
function! vimwiki#html#PasteUrl(wikifile)
execute 'r !echo file://'.s:corresponding_html_file(a:wikifile)
execute 'r !echo file://'.s:get_wikifile_url(a:wikifile)
endfunction
function! vimwiki#html#CatUrl(wikifile)
execute '!echo file://'.s:corresponding_html_file(a:wikifile)
execute '!echo file://'.s:get_wikifile_url(a:wikifile)
endfunction
+15 -275
View File
@@ -49,6 +49,13 @@ function! vimwiki#path#path_norm(path)
endfunction
function! vimwiki#path#is_link_to_dir(link)
" Check if link is to a directory.
" It should be ended with \ or /.
return a:link =~# '\m[/\\]$'
endfunction
function! vimwiki#path#abs_path_of_link(link)
return vimwiki#path#normalize(expand("%:p:h").'/'.a:link)
endfunction
@@ -117,21 +124,22 @@ endfunction
" If the optional argument provided and nonzero,
" it will ask before creating a directory
" Returns: 1 iff directory exists or successfully created
function! vimwiki#path#mkdir(dir_obj, ...)
function! vimwiki#path#mkdir(path, ...)
let path = expand(a:path)
if a:dir_obj.protocoll ==# 'scp'
if path =~# '^scp:'
" we can not do much, so let's pretend everything is ok
return 1
endif
if vimwiki#path#exists(a:dir_obj)
if isdirectory(path)
return 1
else
if !exists("*mkdir")
return 0
endif
let path = vimwiki#path#to_string(a:dir_obj)
let path = vimwiki#path#chomp_slash(path)
if vimwiki#u#is_windows() && !empty(vimwiki#vars#get_global('w32_dir_enc'))
let path = iconv(path, &enc, vimwiki#vars#get_global('w32_dir_enc'))
endif
@@ -146,11 +154,11 @@ function! vimwiki#path#mkdir(dir_obj, ...)
endfunction
function! vimwiki#path#is_absolute(path_string)
function! vimwiki#path#is_absolute(path)
if vimwiki#u#is_windows()
return a:path_string =~? '\m^\a:'
return a:path =~? '\m^\a:'
else
return a:path_string =~# '\m^/\|\~/'
return a:path =~# '\m^/\|\~/'
endif
endfunction
@@ -173,271 +181,3 @@ else
endfunction
endif
"----------------------------------------------------------
" Path manipulation, i.e. functions which do stuff with the paths of (not necessarily existing) files
"----------------------------------------------------------
" The used data types are
"
" - directory object:
" - used for an absolute path to a directory
" - internally, it is a dictionary with the following entries:
" - 'protocoll' -- how to access the file. Supported are 'scp' or 'file'
" - 'is_unix' -- 1 if it's supposed to be a unix-like path
" - 'path' -- a list containing the directory names starting at the root
" - file object:
" - for an absolute path to a file
" - internally a list [dir_obj, file name]
" - file segment:
" - for a relative path to a file or a part of an absolute path
" - internally a list where the first element is a list of directory names and the second the
" file name
" - directory segment:
" - for a relative path to a directory or a part of an absolute path
" - internally a list of directory names
" create and return a file object from a string. It is assumed that the given
" path is absolute and points to a file (not a directory)
function! vimwiki#path#file_obj(filepath)
if a:filepath == ''
return vimwiki#path#null_file()
else
let filename = fnamemodify(a:filepath, ':p:t')
let path = fnamemodify(a:filepath, ':p:h')
return [vimwiki#path#dir_obj(path), filename]
endif
endfunction
function! vimwiki#path#null_file()
return []
endfunction
function! vimwiki#path#is_null(file)
return empty(a:file)
endfunction
" create and return a dir object from a string. The given path should be
" absolute and point to a directory.
function! vimwiki#path#dir_obj(dirpath)
if a:dirpath =~# '^scp:'
let dirpath = a:dirpath[4:]
let protocoll = 'scp'
else
let dirpath = resolve(fnamemodify(a:dirpath, ':p'))
let protocoll = 'file'
endif
let path = split(vimwiki#path#chomp_slash(dirpath), '\m[/\\]', 1)
let is_unix = dirpath[0] ==# '/'
let result = {
\ 'is_unix' : is_unix,
\ 'protocoll' : protocoll,
\ 'path' : path,
\}
return result
endfunction
" Assume it is not an absolute path
function! vimwiki#path#file_segment(path_segment)
let filename = fnamemodify(a:path_segment, ':t')
let path = fnamemodify(a:path_segment, ':h')
let path_list = (path ==# '.' ? [] : split(path, '\m[/\\]', 1))
return [path_list, filename]
endfunction
" Assume it is not an absolute path
function! vimwiki#path#dir_segment(path_segment)
return split(a:path_segment, '\m[/\\]', 1)
endfunction
function! vimwiki#path#extension(file_object)
return fnamemodify(a:file_object[1], ':e')
endfunction
function! vimwiki#path#set_extension(file_obj, new_ext)
let new_filename = vimwiki#path#filename_without_extension(a:file_obj) . '.' . a:new_ext
let a:file_obj[1] = new_filename
return a:file_obj
endfunction
function! vimwiki#path#filename_without_extension(file_object)
return fnamemodify(a:file_object[1], ':r')
endfunction
" Returns: the dir of the file object as dir object
function! vimwiki#path#directory_of_file(file_object)
return copy(a:file_object[0])
endfunction
" Returns: the file_obj's file name as a string
function! vimwiki#path#filename(file_object)
return a:file_object[1]
endfunction
" Returns: the dir_obj, file_obj, file segment or dir segment as string, ready
" to be used with the regular path handling functions in Vim
function! vimwiki#path#to_string(obj)
if type(a:obj) == 4 " dir object
let separator = a:obj.is_unix ? '/' : '\'
let address = join(dir_obj.path, separator) . separator
return address
elseif type(a:obj[0]) == 4 " file object
let dir_obj = type(a:obj) == 4 ? a:obj : a:obj[0]
let separator = a:obj[0].is_unix ? '/' : '\'
let address = join(a:obj[0].path, separator) . separator . a:obj[1]
return address
elseif type(a:obj[0]) == 3 " file segment
" XXX: what about the separator?
return join(a:obj[0], '/') . '/' . a:obj[1]
elseif type(a:obj[0]) == 1 " directory segment
return join(a:obj, '/') . '/'
else
call vimwiki#u#error('Invalid argument ' . string(a:obj))
endif
endfunction
" Returns: the given a:dir_obj with a:str appended to the dir name
function! vimwiki#path#append_to_dirname(dir_obj, str)
let a:dir_obj.path[-1] .= a:str
return a:dir_obj
endfunction
" Returns a file object made from a dir object plus a file semgent
function! vimwiki#path#join(dir_obj, file_segment)
let new_dir_object = copy(a:dir_obj)
let new_dir_object.path += a:file_segment[0]
return [new_dir_object, a:file_segment[1]]
endfunction
" Returns a dir object made from a dir object plus a dir semgent
function! vimwiki#path#join_dir(dir_path, dir_segment)
let new_dir_object = copy(a:dir_path)
let new_dir_object.path += a:dir_segment
return new_dir_object
endfunction
" returns the file segment fs, so that join(dir, fs) == file
" we just assume the file is somewhere in dir
function! vimwiki#path#subtract(dir_object, file_object)
let path_rest = a:file_object[0].path[len(a:dir_object.path):]
return [path_rest, file_object[1]]
endfunction
" Returns: the relative path from a:dir to a:file
" XXX wenn die beiden identisch sind, sollte . rauskommen
function! vimwiki#path#relpath(dir1_object, dir2_object)
let dir1_path = copy(a:dir1_object.path)
let dir2_path = copy(a:dir2_object.path)
let result_path = []
while (len(dir) > 0 && len(file) > 0) && vimwiki#path#is_equal(dir1_path[0], dir2_path[0])
call remove(dir1_path, 0)
call remove(dir2_path, 0)
endwhile
for segment in dir1_path
let result += ['..']
endfor
for segment in dir2_path
let result += [segment]
endfor
let result = {
\ 'is_unix' : a:dir1_object.is_unix,
\ 'protocoll' : a:dir1_object.protocoll,
\ 'path' : result_path,
\}
return result
endfunction
function! vimwiki#path#is_file_in_dir(file, dir)
let file_path_segments = a:file[0].path
let dir_path_segments = a:dir.path
if len(dir_path_segments) > len(file_path_segments)
return 0
endif
for i in range(len(a:dir.path))
if !vimwiki#path#is_equal(a:dir.path[i], file_path_segments[i])
return 0
endif
endfor
return 1
endfunction
"-----------------
" File manipulation, i.e. do stuff with actually existing files
"-----------------
function! vimwiki#path#current_file()
return vimwiki#path#file_obj(expand('%:p'))
endfunction
function! vimwiki#path#exists(object)
if type(a:object) == 4
return isdirectory(vimwiki#path#to_string(a:object))
else
if vimwiki#path#is_null(a:object)
return 0
endif
" glob() checks whether or not a file exists (readable or writable)
return glob(vimwiki#path#to_string(a:object)) != ''
endif
endfunction
function! vimwiki#path#is_executable(file)
return vimwiki#path#exists(a:file) && executable(vimwiki#path#to_string(a:file))
endfunction
" this must be outside a function, because only outside a function <sfile> expands
" to the directory where this file is in
let s:vimwiki_autoload_dir = expand('<sfile>:p:h')
function! vimwiki#path#find_autoload_file(filename)
let autoload_dir = vimwiki#path#dir_obj(s:vimwiki_autoload_dir)
let filename_obj = vimwiki#path#file_segment(a:filename)
let file = vimwiki#path#join(autoload_dir, filename_obj)
if !vimwiki#path#exists(file)
echom 'Vimwiki Error: ' . vimwiki#path#to_string(file) . ' not found'
endif
return file
endfunction
function! vimwiki#path#copy_file(file_obj, dir_obj)
call vimwiki#path#mkdir(a:dir_obj)
let new_file = deepcopy(a:file_obj)
let new_file[0] = copy(a:dir_obj)
let lines = readfile(vimwiki#path#to_string(a:file_obj))
let ok = writefile(lines, vimwiki#path#to_string(new_file))
if ok < 0
call vimwiki#u#error('Could not write ' . vimwiki#path#to_string(new_file))
endif
endfunction
" Returns: a list of all files somewhere in a:dir_obj with extension a:ext
function! vimwiki#path#files_in_dir_recursive(dir_obj, ext)
let separator = a:dir_obj.is_unix ? '/' : '\'
let glob_expression = vimwiki#path#to_string(a:dir_obj) . '**' . separator . '*.' . a:ext
let file_strings = split(glob(glob_expression), '\n')
return map(file_strings, 'vimwiki#path#file_obj(v:val)')
endfunction
+1
View File
@@ -25,6 +25,7 @@ del {text-decoration: line-through; color: #777777;}
.justcenter {text-align: center;}
.center {margin-left: auto; margin-right: auto;}
.tag {background-color: #eeeeee; font-family: monospace; padding: 2px;}
.header a {text-decoration: none; color: inherit;}
/* classes for items of todo lists */
.rejected {
+8 -14
View File
@@ -31,7 +31,7 @@ function! vimwiki#tags#update_tags(full_rebuild, all_files)
let all_files = a:all_files != ''
if !a:full_rebuild
" Updating for one page (current)
let page_name = s:page_name(vimwiki#path#current_file())
let page_name = vimwiki#vars#get_bufferlocal('subdir') . expand('%:t:r')
" Collect tags in current file
let tags = s:scan_tags(getline(1, '$'), page_name)
" Load metadata file
@@ -44,12 +44,13 @@ function! vimwiki#tags#update_tags(full_rebuild, all_files)
call s:write_tags_metadata(metadata)
else " full rebuild
let files = vimwiki#base#find_files(vimwiki#vars#get_bufferlocal('wiki_nr'), 0)
let tags_file_last_modification =
\ getftime(vimwiki#path#to_string(vimwiki#tags#metadata_file_path()))
let wiki_base_dir = vimwiki#vars#get_wikilocal('path')
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(vimwiki#path#to_string(file)) >= tags_file_last_modification
let page_name = s:page_name(file)
if all_files || getftime(file) >= tags_file_last_modification
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)
@@ -60,13 +61,6 @@ function! vimwiki#tags#update_tags(full_rebuild, all_files)
endfunction
function! s:page_name(file_obj)
let wiki_base_dir = vimwiki#vars#get_wikilocal('path')
let segment = vimwiki#path#subtract(wiki_base_dir, a:file_obj)
return vimwiki#path#to_string(segment)
endfunction
" Scans the list of text lines (argument) and produces tags metadata as a list of tag entries.
function! s:scan_tags(lines, page_name)
@@ -148,8 +142,8 @@ endfunction
" Returns tags metadata file path
function! vimwiki#tags#metadata_file_path() abort
return vimwiki#path#join(vimwiki#vars#get_wikilocal('path'),
\ vimwiki#path#file_segment(s:TAGS_METADATA_FILE_NAME))
return fnamemodify(vimwiki#path#join_path(vimwiki#vars#get_wikilocal('path'),
\ s:TAGS_METADATA_FILE_NAME), ':p')
endfunction
-4
View File
@@ -70,7 +70,3 @@ else
endfunc
endif
function vimwiki#u#error(message)
echom 'Vimwiki Error: ' . a:message
endfunction
+15 -25
View File
@@ -85,8 +85,8 @@ function! s:populate_global_variables()
" this regexp defines what can form a link when the user presses <CR> in the
" buffer (and not on a link) to create a link
" basically, it's Ascii alphanumeric characters plus #|./@-_~ plus all
" non-Ascii characters
let g:vimwiki_global_vars.rxWord = '[^[:blank:]!"$%&''()*+,:;<=>?\[\]\\^`{}]\+'
" non-Ascii characters, except that . is not accepted as the last character
let g:vimwiki_global_vars.rxWord = '[^[:blank:]!"$%&''()*+,:;<=>?\[\]\\^`{}]*[^[:blank:]!"$%&''()*+.,:;<=>?\[\]\\^`{}]'
let g:vimwiki_global_vars.rx_wikilink_prefix1 = g:vimwiki_global_vars.rx_wikilink_prefix .
\ g:vimwiki_global_vars.rxWikiLinkUrl . g:vimwiki_global_vars.rx_wikilink_separator
@@ -222,9 +222,6 @@ endfunction
function! s:normalize_global_settings()
let g:vimwiki_global_vars.dir_link =
\ vimwiki#path#file_segment(g:vimwiki_global_vars.dir_link)
let keys = keys(g:vimwiki_global_vars.ext2syntax)
for ext in keys
" ensure the file extensions in ext2syntax start with a dot
@@ -238,13 +235,6 @@ function! s:normalize_global_settings()
let g:vimwiki_global_vars.ext2syntax[ext] = 'media'
endif
endfor
let new_user_htmls = []
for file_name in split(g:vimwiki_global_vars.user_htmls, ',')
let trimmed = vimwiki#u#trim(file_name)
call add(new_user_htmls, vimwiki#path#file_segment(trimmed))
endfor
let g:vimwiki_global_vars.user_htmls = new_user_htmls
endfunction
@@ -391,23 +381,18 @@ endfunction
function! s:normalize_wikilocal_settings()
for wiki_settings in g:vimwiki_wikilocal_vars
let wiki_settings.css_name = vimwiki#path#file_segment(wiki_settings.css_name)
let wiki_settings.custom_wiki2html = vimwiki#path#file_object(wiki_settings.custom_wiki2html)
let wiki_settings['path'] = vimwiki#path#dir_obj(wiki_settings['path'])
let wiki_settings['path'] = s:normalize_path(wiki_settings['path'])
let path_html = wiki_settings['path_html']
if !empty(path_html)
let wiki_settings['path_html'] = vimwiki#path#dir_obj(path_html)
let wiki_settings['path_html'] = s:normalize_path(path_html)
else
let wiki_settings['path_html'] = vimwiki#path#append_to_dirname(wiki_settings['path'],
\ '_html')
let wiki_settings['path_html'] = s:normalize_path(
\ substitute(wiki_settings['path'], '[/\\]\+$', '', '').'_html/')
endif
let wiki_settings['template_path'] = vimwiki#path#dir_obj(wiki_settings['template_path'])
let wiki_settings['diary_path'] = vimwiki#path#join_dir(wiki_settings['path'],
\ vimwiki#path#dir_segment(wiki_settings['diary_rel_path']))
let wiki_settings['template_path'] = s:normalize_path(wiki_settings['template_path'])
let wiki_settings['diary_rel_path'] = s:normalize_path(wiki_settings['diary_rel_path'])
let ext = wiki_settings['ext']
if !empty(ext) && ext[0] != '.'
@@ -789,10 +774,15 @@ function! vimwiki#vars#get_bufferlocal(key, ...)
if type(value) != 1 || value !=# '/\/\'
return value
elseif a:key ==# 'wiki_nr'
call setbufvar(buffer, 'vimwiki_wiki_nr', vimwiki#base#find_wiki(vimwiki#path#current_file()))
call setbufvar(buffer, 'vimwiki_wiki_nr', vimwiki#base#find_wiki(expand('%:p')))
elseif a:key ==# 'subdir'
call setbufvar(buffer, 'vimwiki_subdir', vimwiki#base#current_subdir())
elseif a:key ==# 'invsubdir'
let subdir = vimwiki#vars#get_bufferlocal('subdir')
call setbufvar(buffer, 'vimwiki_invsubdir', vimwiki#base#invsubdir(subdir))
elseif a:key ==# 'existing_wikifiles'
call setbufvar(buffer, 'vimwiki_existing_wikifiles',
\ vimwiki#base#get_wikilinks(vimwiki#vars#get_bufferlocal('wiki_nr'), 0, 1))
\ vimwiki#base#get_wikilinks(vimwiki#vars#get_bufferlocal('wiki_nr'), 1))
elseif a:key ==# 'existing_wikidirs'
call setbufvar(buffer, 'vimwiki_existing_wikidirs',
\ vimwiki#base#get_wiki_directories(vimwiki#vars#get_bufferlocal('wiki_nr')))
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 276 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 249 KiB

+45 -16
View File
@@ -9,7 +9,7 @@
|___| |___| |_| |_||__| |__||___| |___| |_||___| ~
Version: 2.4
Version: 2.4.1
==============================================================================
CONTENTS *vimwiki*
@@ -707,7 +707,7 @@ Vimwiki file.
*:VimwikiGoto*
Goto link provided by an argument. For example: >
:VimwikiGoto HelloWorld
< opens opens/creates HelloWorld wiki page.
< opens/creates HelloWorld wiki page.
Supports |cmdline-completion| for link name.
@@ -1423,7 +1423,7 @@ Hit |zr| one more time :
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'.
For MediaWiki syntax, * or # should be in the first column.
For Markdown and MediaWiki syntax, * or # should be in the first column.
To turn folding on/off check |g:vimwiki_folding|.
@@ -2280,8 +2280,8 @@ local mappings |vimwiki_glstar|, |vimwiki_gl#| |vimwiki_gl-|, |vimwiki_gl-|,
|vimwiki_gl1|, |vimwiki_gla|, |vimwiki_glA|, |vimwiki_gli|, |vimwiki_glI| and
|vimwiki_i_<C-L>_<C-M>|.
Note: if you use MediaWiki syntax, you probably would like to set this option
to 0, because every indented line is considered verbatim text.
Note: if you use Markdown or MediaWiki syntax, you probably would like to set
this option to 0, because every indented line is considered verbatim text.
*vimwiki-option-auto_tags*
@@ -2321,7 +2321,7 @@ Global options are configured using the following pattern: >
Highlight headers with =Reddish=, ==Greenish==, ===Blueish=== colors.
Value Description~
1 Use VimwikiHeader1-VimwikiHeader6 group colors to highlight
1 Use VimwikiHeader1 - VimwikiHeader6 group colors to highlight
different header levels.
0 Use |hl-Title| color for headers.
Default: 0
@@ -2338,11 +2338,13 @@ Highlight checked list items with a special color:
Value Description~
0 Don't highlight anything.
1 Highlight checked [X] list item with |group-name| "Comment".
2 Highlight checked [X] list item and all its child items.
1 Highlight only the first line of a checked [X] list item.
2 Highlight a complete checked list item and all its child items.
Default: 0
The |group-name| "Comment" is used for highlighting.
Note: Option 2 does not work perfectly. Specifically, it might break if the
list item contains preformatted text or if you mix tabs and spaces for
indenting. Also, indented headers can be highlighted erroneously.
@@ -2548,11 +2550,11 @@ A second example handles a new scheme, "vfile:", which behaves similar to
return 0
endif
let link_infos = vimwiki#base#resolve_link(link)
if link_infos.is_file == -1
if link_infos.filename == ''
echomsg 'Vimwiki Error: Unable to resolve link!'
return 0
else
exe 'tabnew ' . fnameescape(vimwiki#path#to_string(link_infos.target))
exe 'tabnew ' . fnameescape(link_infos.filename)
return 1
endif
endfunction
@@ -2577,12 +2579,11 @@ right place. >
function! VimwikiLinkConverter(link, source_wiki_file, target_html_file)
if a:link =~# '^local:'
let link_infos = vimwiki#base#resolve_link(a:link)
let target_file = vimwiki#path#to_string(link_infos.target)
let html_link = vimwiki#path#relpath(
\ fnamemodify(a:source_wiki_file, ':h'), target_file)
\ fnamemodify(a:source_wiki_file, ':h'), link_infos.filename)
let relative_link =
\ fnamemodify(a:target_html_file, ':h') . '/' . html_link
call system('cp ' . fnameescape(target_file) .
call system('cp ' . fnameescape(link_infos.filename) .
\ ' ' . fnameescape(relative_link))
return html_link
endif
@@ -2958,7 +2959,7 @@ Contributors and their Github usernames in roughly chronological order:
- Daniel Trnka (@trnila)
- Yuchen Pei (@ycpei)
- @maqiv
- @dpc
- Dawid Ciężarkiewicz (@dpc)
- Drew Hays (@Dru89)
- Daniel Etrata (@danetrata)
- Keith Haber (@kjhaber)
@@ -2972,6 +2973,22 @@ Contributors and their Github usernames in roughly chronological order:
- Zhuang Ma (@mzlogin)
- Huy Le (@huynle)
- Nick Borden (@hcwndbyw)
- John Campbell (@johnmarcampbell)
- Petrus (@PetrusZ)
- Steven Stallion (@sstallion)
- Daniel Quomsieh (@DQuomsieh)
- Fredrik Arnerup (@farnerup)
- CUI Hao (@cuihaoleo)
- Benjamin Brandtner (@BenjaminBrandtner)
- @sreejith994
- Raphael Feng (@raphaelfeng)
- Kasper Socha (@fte10kso)
- Nicolas Brailovsky (@nicolasbrailo)
- @BenMcH
- Stefan Huber (@shuber2)
- Hugo Hörnquist (@HugoNikanor)
- Rane Brown (@ranebrown)
- @monkinco
==============================================================================
@@ -2984,7 +3001,13 @@ http://code.google.com/p/vimwiki/issues/list. They may be accessible from
https://github.com/vimwiki-backup/vimwiki/issues.
2.4 (not yet released)~
2.4.1 (2019-02-20)~
Fixed:
* Fix VimwikiShowVersion function.
* strikethrough `~` characters were not hidden within tables
* Update and format README.md and update screen shots
2.4 (2019-03-24)~
New:~
* Add the option |g:vimwiki_text_ignore_newline|.
@@ -3004,6 +3027,8 @@ New:~
* Add the %date placeholder, see |vimwiki-date|.
* Add the option |vimwiki-option-custom_wiki2html_args|.
* Add support for HTML-style comments when using markdown syntax.
* Made headings link to themselves in HTML output.
* Add |:VimwikiShowVersion| to check the version
Removed:~
* Remove the undocumented and buggy command :VimwikiReadLocalOptions
@@ -3028,6 +3053,10 @@ Fixed:~
* Opening the diary and wikis from the menu works correctly now.
* Issue #497: Make |:VimwikiMakeDiaryNote| work outside a wiki buffer.
* Use markdown syntax in the diary when appropriate.
* Improve handling of errors on opening files.
* Update links when renaming a page with |:VimwikiRenameLink|.
* Fix losing the highlighting in various situations.
* Improved link normalisation.
* Various other minor fixes.
@@ -3250,7 +3279,7 @@ http://code.google.com/p/vimwiki/issues/list
* Issue 210: HTML: para enclose header.
* Issue 214: External links containing Chinese characters get trimmed.
* Issue 218: Command to generate HTML file and open it in webbrowser. See
|:Vimwiki2HTMLBrowse|(bind to <leader>whh)
|:Vimwiki2HTMLBrowse|(bind to <Leader>whh)
* NEW: Added <Leader>wh mapping to call |:Vimwiki2HTML|
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB

+18 -20
View File
@@ -19,7 +19,7 @@ endif
execute 'setlocal suffixesadd='.vimwiki#vars#get_wikilocal('ext')
setlocal isfname-=[,]
exe "setlocal tags+=" . escape(vimwiki#path#to_string(vimwiki#tags#metadata_file_path()), ' \|"')
exe "setlocal tags+=" . escape(vimwiki#tags#metadata_file_path(), ' \|"')
@@ -68,22 +68,19 @@ function! Complete_wikifiles(findstart, base)
if wikinumber >= vimwiki#vars#number_of_wikis()
return []
endif
let diary = 0
let prefix = matchstr(a:base, '\m^wiki\d\+:\zs.*')
let scheme = matchstr(a:base, '\m^wiki\d\+:\ze')
elseif a:base =~# '^diary:'
let wikinumber = vimwiki#vars#get_bufferlocal('wiki_nr')
let diary = 1
let wikinumber = -1
let prefix = matchstr(a:base, '^diary:\zs.*')
let scheme = matchstr(a:base, '^diary:\ze')
else " current wiki
let wikinumber = vimwiki#vars#get_bufferlocal('wiki_nr')
let diary = 0
let prefix = a:base
let scheme = ''
endif
let links = vimwiki#base#get_wikilinks(wikinumber, diary, 1)
let links = vimwiki#base#get_wikilinks(wikinumber, 1)
let result = []
for wikifile in links
if wikifile =~ '^'.vimwiki#u#escape(prefix)
@@ -96,11 +93,9 @@ function! Complete_wikifiles(findstart, base)
" we look for anchors in the given wikifile
let segments = split(a:base, '#', 1)
let given_wikifile = segments[0] == '' ?
\ vimwiki#path#filename_without_extension(vimwiki#path#current_file())
\ : segments[0]
let given_wikifile = segments[0] == '' ? expand('%:t:r') : segments[0]
let link_infos = vimwiki#base#resolve_link(given_wikifile.'#')
let wikifile = link_infos.target
let wikifile = link_infos.filename
let syntax = vimwiki#vars#get_wikilocal('syntax', link_infos.index)
let anchors = vimwiki#base#get_anchors(wikifile, syntax)
@@ -242,18 +237,19 @@ endfunction
command! -buffer Vimwiki2HTML
\ if filewritable(expand('%')) | silent noautocmd w | endif
\ <bar>
\ let res = vimwiki#html#Wiki2HTML(vimwiki#path#current_file())
\ let res = vimwiki#html#Wiki2HTML(expand(vimwiki#vars#get_wikilocal('path_html')),
\ expand('%'))
\ <bar>
\ if !vimwiki#path#is_null(res) | echo 'Vimwiki: HTML conversion is done, output: '
\ . vimwiki#path#to_string(vimwiki#vars#get_wikilocal('path_html')) | endif
\ if res != '' | echo 'Vimwiki: HTML conversion is done, output: '
\ . expand(vimwiki#vars#get_wikilocal('path_html')) | endif
command! -buffer Vimwiki2HTMLBrowse
\ if filewritable(expand('%')) | silent noautocmd w | endif
\ <bar>
\ let result = vimwiki#html#Wiki2HTML(vimwiki#path#current_file())
\ <bar>
\ if !vimwiki#path#is_null(result) | call vimwiki#base#system_open_link(result) | endif
\ call vimwiki#base#system_open_link(vimwiki#html#Wiki2HTML(
\ expand(vimwiki#vars#get_wikilocal('path_html')),
\ expand('%')))
command! -buffer VimwikiAll2HTML
\ call vimwiki#html#WikiAll2HTML()
\ call vimwiki#html#WikiAll2HTML(expand(vimwiki#vars#get_wikilocal('path_html')))
command! -buffer VimwikiTOC call vimwiki#base#table_of_contents(1)
@@ -276,10 +272,10 @@ command! -buffer -nargs=0 VimwikiBacklinks call vimwiki#base#backlinks()
command! -buffer -nargs=0 VWB call vimwiki#base#backlinks()
exe 'command! -buffer -nargs=* VimwikiSearch lvimgrep <args> '.
\ escape(vimwiki#path#to_string(vimwiki#vars#get_wikilocal('path')).'**/*'.vimwiki#vars#get_wikilocal('ext'), ' ')
\ escape(vimwiki#vars#get_wikilocal('path').'**/*'.vimwiki#vars#get_wikilocal('ext'), ' ')
exe 'command! -buffer -nargs=* VWS lvimgrep <args> '.
\ escape(vimwiki#path#to_string(vimwiki#vars#get_wikilocal('path')).'**/*'.vimwiki#vars#get_wikilocal('ext'), ' ')
\ escape(vimwiki#vars#get_wikilocal('path').'**/*'.vimwiki#vars#get_wikilocal('ext'), ' ')
command! -buffer -nargs=+ -complete=custom,vimwiki#base#complete_links_escaped
\ VimwikiGoto call vimwiki#base#goto(<f-args>)
@@ -681,7 +677,9 @@ nnoremap <silent><buffer> <Plug>VimwikiGoToPrevSiblingHeader :
if vimwiki#vars#get_wikilocal('auto_export')
" Automatically generate HTML on page write.
augroup vimwiki
au BufWritePost <buffer> call vimwiki#html#Wiki2HTML(vimwiki#path#current_file())
au BufWritePost <buffer>
\ call vimwiki#html#Wiki2HTML(expand(vimwiki#vars#get_wikilocal('path_html')),
\ expand('%'))
augroup END
endif
+29 -6
View File
@@ -9,6 +9,11 @@ if exists("g:loaded_vimwiki") || &cp
endif
let g:loaded_vimwiki = 1
" Set to version number for release, otherwise -1 for dev-branch
let s:plugin_vers = "2.4.1"
" Get the directory the script is installed in
let s:plugin_dir = expand('<sfile>:p:h:h')
let s:old_cpo = &cpo
set cpo&vim
@@ -39,9 +44,8 @@ endfunction
" create a new temporary wiki for the current buffer
function! s:create_temporary_wiki()
let current_file = vimwiki#path#current_file()
let path = vimwiki#path#directory_of_file(current_file)
let ext = '.'.vimwiki#path#extension(current_file)
let path = expand('%:p:h')
let ext = '.'.expand('%:e')
let syntax_mapping = vimwiki#vars#get_global('ext2syntax')
if has_key(syntax_mapping, ext)
@@ -184,11 +188,28 @@ function! s:set_windowlocal_options()
endif
if vimwiki#vars#get_global('auto_chdir')
exe 'lcd' vimwiki#path#to_string(vimwiki#vars#get_wikilocal('path'))
exe 'lcd' vimwiki#vars#get_wikilocal('path')
endif
endfunction
function! s:get_version()
if s:plugin_vers != -1
echo "Stable version: " . string(s:plugin_vers)
else
let l:plugin_rev = system("git --git-dir " . s:plugin_dir . "/.git rev-parse --short HEAD")
let l:plugin_branch = system("git --git-dir " . s:plugin_dir . "/.git rev-parse --abbrev-ref HEAD")
let l:plugin_date = system("git --git-dir " . s:plugin_dir . "/.git show -s --format=%ci")
if v:shell_error == 0
echo "Branch: " . l:plugin_branch
echo "Revision: " . l:plugin_rev
echo "Date: " . l:plugin_date
else
echo "Unknown version"
endif
endif
endfunction
" Initialization of Vimwiki starts here. Make sure everything below does not
@@ -282,6 +303,8 @@ command! -count=1 VimwikiMakeTomorrowDiaryNote
command! VimwikiDiaryGenerateLinks
\ call vimwiki#diary#generate_diary_section()
command! VimwikiShowVersion call s:get_version()
let s:map_prefix = vimwiki#vars#get_global('map_prefix')
@@ -339,8 +362,8 @@ nnoremap <unique><script> <Plug>VimwikiMakeTomorrowDiaryNote
function! s:build_menu(topmenu)
for idx in range(vimwiki#vars#number_of_wikis())
let norm_path = vimwiki#path#to_string(vimwiki#vars#get_wikilocal('path', idx))
let norm_path = escape(norm_path, '\ .')
let norm_path = fnamemodify(vimwiki#vars#get_wikilocal('path', idx), ':h:t')
let norm_path = escape(norm_path, '\ \.')
execute 'menu '.a:topmenu.'.Open\ index.'.norm_path.
\ ' :call vimwiki#base#goto_index('.(idx+1).')<CR>'
execute 'menu '.a:topmenu.'.Open/Create\ diary\ note.'.norm_path.
+1 -1
View File
@@ -297,7 +297,7 @@ execute 'syntax match VimwikiItalicBoldT /'.vimwiki#vars#get_syntaxlocal('rxItal
execute 'syntax match VimwikiDelText /'.vimwiki#vars#get_syntaxlocal('rxDelText').
\ '/ contains=VimwikiDelTextChar,@Spell'
execute 'syntax match VimwikiDelTextT /'.vimwiki#vars#get_syntaxlocal('rxDelText').
\ '/ contained contains=VimwikiDelTextChar,@Spell'
\ '/ contained contains=VimwikiDelTextCharT,@Spell'
execute 'syntax match VimwikiSuperScript /'.vimwiki#vars#get_syntaxlocal('rxSuperScript').
\ '/ contains=VimwikiSuperScriptChar,@Spell'