Compare commits
75 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 79d6a1a4e2 | |||
| f105819c48 | |||
| 4a9f81c54b | |||
| d3aade7349 | |||
| 62d71b832a | |||
| b90fbc70d9 | |||
| 6766c37ce0 | |||
| 5553cef249 | |||
| 7fbeea2c1e | |||
| 57385b29bb | |||
| d0e14dd11c | |||
| 54d1a997d9 | |||
| 1b2643ea19 | |||
| e16dc41a50 | |||
| 19f1d36229 | |||
| b8d0cf377d | |||
| a7160310c9 | |||
| 0f38192b03 | |||
| 41199e6e3b | |||
| 69aa609941 | |||
| 72bbb1b740 | |||
| 7699967a99 | |||
| 394efe4312 | |||
| ea13b0e848 | |||
| daee3b4796 | |||
| bda3a59f91 | |||
| 1cffbdbf3d | |||
| 28675698ad | |||
| fdc367f725 | |||
| 6257c8fa54 | |||
| 35d1f23b92 | |||
| 05de247f36 | |||
| 54e064f5c4 | |||
| 65b0c97c6d | |||
| 2346b7e299 | |||
| 7ea136dd0b | |||
| 79c295a92f | |||
| 75819ca23a | |||
| f9b8906985 | |||
| 24f33e3e3f | |||
| 599a0e9083 | |||
| 2366523001 | |||
| d9b6d77e90 | |||
| 645ae61dc3 | |||
| a72c14da1c | |||
| c398f5cd81 | |||
| fa36bf3838 | |||
| a653e2d8c2 | |||
| 349d551181 | |||
| dcd1c0a364 | |||
| 2fb0e17adb | |||
| 12349b8cb6 | |||
| 2e523b308f | |||
| 6f6023610c | |||
| bddd644fbb | |||
| 675ff23ed1 | |||
| 90722a4703 | |||
| 6a6aeff013 | |||
| 7969810b49 | |||
| a32a06f3b8 | |||
| a244246641 | |||
| 5f762082d2 | |||
| 7668985b43 | |||
| bd88ea968b | |||
| 76f51f1dba | |||
| e6d0678b54 | |||
| d7d94e2160 | |||
| f639c0a342 | |||
| 5605f285c1 | |||
| 2185815b00 | |||
| 44a1f3a6f3 | |||
| 51017f6b5e | |||
| 786aa470e3 | |||
| 50c95f1bef | |||
| 4d4e88bfa2 |
@@ -0,0 +1,63 @@
|
||||
# Filing a bug
|
||||
|
||||
Before filing a bug or starting to write a patch, check the latest development version from
|
||||
https://github.com/vimwiki/vimwiki/tree/dev to see if your problem is already fixed.
|
||||
|
||||
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.
|
||||
|
||||
## 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 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
|
||||
commit from `dev`, nothing happens on `master`. Never should `master` merge into `dev`. When
|
||||
the users ask, we should recommend this branch for them to use.
|
||||
- Larger changes which require multiple commits are done in feature branches. They are based on
|
||||
`dev` and merge into `dev` when the work is done.
|
||||
|
||||
## Preparing a release
|
||||
|
||||
1. `git checkout dev`
|
||||
2. Update the changelog in the doc, nicely grouped, with a new version number and release date.
|
||||
3. Update the list of contributors.
|
||||
4. Update the version number at the top of the doc file.
|
||||
5. If necessary, update the Readme and the home page.
|
||||
6. `git checkout master && git merge dev`
|
||||
7. Update the version number at the top of plugin/vimwiki.vim.
|
||||
8. Set a tag with the version number in Git: `git tag vX.Y`
|
||||
9. `git push --tags`
|
||||
10. In GitHub, go to _Releases_ -> _Draft a new release_ -> choose the tag, convert the changelog from the
|
||||
doc to markdown and post it there. Make plans to build an automatic converter and immediately
|
||||
forget this plan.
|
||||
11. Tell the world.
|
||||
|
||||
%% vim:tw=99
|
||||
+1
-1
@@ -135,7 +135,7 @@ normal 模式:
|
||||
|
||||
在 `vimrc` 中加入以下插件设置:
|
||||
|
||||
Plug 'vimwiki/vimwiki', { 'branch': 'dev' }
|
||||
Plug 'vimwiki/vimwiki'
|
||||
|
||||
然后运行 `:PlugInstall`。
|
||||
|
||||
|
||||
@@ -1,90 +1,180 @@
|
||||
A Personal Wiki For Vim
|
||||
==============================================================================
|
||||
# VimWiki: A Personal Wiki For Vim
|
||||
|
||||
[中文](README-cn.md)
|
||||
|
||||

|
||||
 *
|
||||
- [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)
|
||||
|
||||
Intro
|
||||
------------------------------------------------------------------------------
|
||||
## Intro
|
||||
|
||||
Vimwiki is a personal wiki for Vim -- a number of linked text files that have
|
||||
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 ===
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## 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.
|
||||
@@ -100,76 +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
|
||||
|
||||
Installation
|
||||
==============================================================================
|
||||
VimWiki currently ships with 3 syntaxes: VimWiki (default), Markdown
|
||||
(markdown), and MediaWiki (media)
|
||||
|
||||
Prerequisites
|
||||
------------------------------------------------------------------------------
|
||||
If you would prefer to use either Markdown or MediaWiki syntaxes, set the
|
||||
following option in your .vimrc:
|
||||
|
||||
Make sure you have these settings in your vimrc file:
|
||||
```vim
|
||||
|
||||
set nocompatible
|
||||
filetype plugin on
|
||||
syntax on
|
||||
let g:vimwiki_list = [{'path': '~/vimwiki/',
|
||||
\ 'syntax': 'markdown', 'ext': '.md'}]
|
||||
|
||||
Without them Vimwiki will not work properly.
|
||||
```
|
||||
|
||||
## Getting help
|
||||
|
||||
Installation using [Vim packages](http://vimhelp.appspot.com/repeat.txt.html#packages) (since Vim 7.4.1528)
|
||||
------------------------------------------------------------------------------
|
||||
**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).
|
||||
|
||||
git clone https://github.com/vimwiki/vimwiki.git ~/.vim/pack/plugins/start/vimwiki
|
||||
## Helping VimWiki
|
||||
|
||||
Installation using [Pathogen](http://www.vim.org/scripts/script.php?script_id=2332)
|
||||
------------------------------------------------------------------------------
|
||||
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.
|
||||
|
||||
cd ~/.vim
|
||||
mkdir bundle
|
||||
cd bundle
|
||||
git clone https://github.com/vimwiki/vimwiki.git
|
||||
## License
|
||||
|
||||
Installation using [Vim-Plug](https://github.com/junegunn/vim-plug)
|
||||
------------------------------------------------------------------------------
|
||||
MIT License
|
||||
|
||||
Add the following to the plugin-configuration in your vimrc:
|
||||
Copyright (c) 2008-2010 Maxim Kim
|
||||
2013-2017 Daniel Schemala
|
||||
|
||||
Plug 'vimwiki/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:
|
||||
|
||||
Then run `:PlugInstall`.
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
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), also synced to Matrix/Riot: `#freenode_#vimwiki:matrix.org`) or post to the [mailing list](https://groups.google.com/forum/#!forum/vimwiki).
|
||||
|
||||
Helping Vimwiki
|
||||
==============================================================================
|
||||
|
||||
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.
|
||||
|
||||
|
||||
|
||||
----
|
||||
\* 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.
|
||||
|
||||
+100
-56
@@ -180,6 +180,7 @@ 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.index = -1
|
||||
let link_infos.filename = ''
|
||||
return link_infos
|
||||
endif
|
||||
@@ -225,10 +226,10 @@ endfunction
|
||||
function! vimwiki#base#system_open_link(url)
|
||||
" handlers
|
||||
function! s:win32_handler(url)
|
||||
"http://vim.wikia.com/wiki/Opening_current_Vim_file_in_your_Windows_browser
|
||||
"disable 'shellslash', otherwise the url will be enclosed in single quotes,
|
||||
"which is problematic
|
||||
"see https://github.com/vimwiki/vimwiki/issues/54#issuecomment-48011289
|
||||
"Disable shellslash for cmd and command.com, but enable for all other shells
|
||||
"See Issue #560
|
||||
if (&shell =~? "cmd") || (&shell =~? "command.com")
|
||||
|
||||
if exists('+shellslash')
|
||||
let old_ssl = &shellslash
|
||||
set noshellslash
|
||||
@@ -237,10 +238,20 @@ function! vimwiki#base#system_open_link(url)
|
||||
else
|
||||
let url = shellescape(a:url, 1)
|
||||
endif
|
||||
if &l:shell ==? "powershell"
|
||||
execute 'silent ! start ' . a:url
|
||||
execute 'silent ! start "Title" /B ' . url
|
||||
|
||||
else
|
||||
execute 'silent ! start "Title" /B ' . a:url
|
||||
|
||||
if exists('+shellslash')
|
||||
let old_ssl = &shellslash
|
||||
set shellslash
|
||||
let url = shellescape(a:url, 1)
|
||||
let &shellslash = old_ssl
|
||||
else
|
||||
let url = shellescape(a:url, 1)
|
||||
endif
|
||||
execute 'silent ! start ' . url
|
||||
|
||||
endif
|
||||
endfunction
|
||||
function! s:macunix_handler(url)
|
||||
@@ -274,7 +285,11 @@ function! vimwiki#base#open_link(cmd, link, ...)
|
||||
endif
|
||||
|
||||
if link_infos.filename == ''
|
||||
if link_infos.index == -1
|
||||
echomsg 'Vimwiki Error: No registered wiki ''' . link_infos.scheme . '''.'
|
||||
else
|
||||
echomsg 'Vimwiki Error: Unable to resolve link!'
|
||||
endif
|
||||
return
|
||||
endif
|
||||
|
||||
@@ -726,19 +741,22 @@ function! vimwiki#base#edit_file(command, filename, anchor, ...)
|
||||
" This hack is necessary because apparently Vim messes up the result of
|
||||
" getpos() directly after this command. Strange.
|
||||
if !(a:command ==# ':e ' && vimwiki#path#is_equal(a:filename, expand('%:p')))
|
||||
try
|
||||
if &autowriteall && !&hidden " in this case, the file is saved before switching to the
|
||||
" new buffer. This causes Vim to show two messages in the command line which triggers
|
||||
" the annoying hit-enter prompt. Solution: show no messages at all.
|
||||
silent execute a:command fname
|
||||
else
|
||||
try
|
||||
execute a:command fname
|
||||
endif
|
||||
catch /E37:/
|
||||
echomsg 'Vimwiki: The current file is modified. Hint: Take a look at'
|
||||
echomsg 'Vimwiki: Can''t leave the current buffer, because it is modified. Hint: Take a look at'
|
||||
\ ''':h g:vimwiki_autowriteall'' to see how to save automatically.'
|
||||
return
|
||||
catch /E325:/
|
||||
echom 'Vimwiki: Vim couldn''t open the file, probably because a swapfile already exists. See :h E325.'
|
||||
return
|
||||
endtry
|
||||
endif
|
||||
|
||||
" If the opened file was not already loaded by Vim, an autocommand is
|
||||
" triggered at this point
|
||||
@@ -855,16 +873,17 @@ function! s:update_wiki_link(fname, old, new)
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:update_wiki_links_dir(dir, old_fname, new_fname)
|
||||
function! s:update_wiki_links_dir(wiki_nr, dir, old_fname, new_fname)
|
||||
let old_fname = substitute(a:old_fname, '[/\\]', '[/\\\\]', 'g')
|
||||
let new_fname = a:new_fname
|
||||
|
||||
let old_fname_r = vimwiki#base#apply_template(
|
||||
\ vimwiki#vars#get_syntaxlocal('WikiLinkMatchUrlTemplate'), old_fname, '', '')
|
||||
\ vimwiki#vars#get_syntaxlocal('WikiLinkMatchUrlTemplate',
|
||||
\ vimwiki#vars#get_wikilocal('syntax', a:wiki_nr)), old_fname, '', '')
|
||||
|
||||
let files = split(glob(vimwiki#vars#get_wikilocal('path').a:dir.'*'.
|
||||
\ vimwiki#vars#get_wikilocal('ext')), '\n')
|
||||
for fname in files
|
||||
let files = split(glob(vimwiki#vars#get_wikilocal('path', a:wiki_nr).a:dir.'*'.
|
||||
\ vimwiki#vars#get_wikilocal('ext', a:wiki_nr)), '\n')
|
||||
for fname in l:files
|
||||
call s:update_wiki_link(fname, old_fname_r, new_fname)
|
||||
endfor
|
||||
endfunction
|
||||
@@ -878,11 +897,11 @@ function! s:tail_name(fname)
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:update_wiki_links(old_fname, new_fname)
|
||||
function! s:update_wiki_links(wiki_nr, old_fname, new_fname,old_fname_relpath)
|
||||
let old_fname = a:old_fname
|
||||
let new_fname = a:new_fname
|
||||
|
||||
let subdirs = split(a:old_fname, '[/\\]')[: -2]
|
||||
let subdirs = split(a:old_fname_relpath, '[/\\]')[: -2]
|
||||
|
||||
" TODO: Use Dictionary here...
|
||||
let dirs_keys = ['']
|
||||
@@ -904,7 +923,7 @@ function! s:update_wiki_links(old_fname, new_fname)
|
||||
while idx < len(dirs_keys)
|
||||
let dir = dirs_keys[idx]
|
||||
let new_dir = dirs_vals[idx]
|
||||
call s:update_wiki_links_dir(dir, new_dir.old_fname, new_dir.new_fname)
|
||||
call s:update_wiki_links_dir(a:wiki_nr, dir, new_dir.old_fname, new_dir.new_fname)
|
||||
let idx = idx + 1
|
||||
endwhile
|
||||
endfunction
|
||||
@@ -1004,7 +1023,7 @@ endfunction
|
||||
" will only be updated if it already exists
|
||||
function! vimwiki#base#update_listing_in_buffer(strings, start_header,
|
||||
\ content_regex, default_lnum, create)
|
||||
" apparently, Vim behaves strange when files change while in diff mode
|
||||
" Vim behaves strangely when files change while in diff mode
|
||||
if &diff || &readonly
|
||||
return
|
||||
endif
|
||||
@@ -1050,8 +1069,8 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header,
|
||||
" fold gets deleted. So we temporarily disable folds, and then reenable
|
||||
" them right back.
|
||||
let foldenable_save = &l:foldenable
|
||||
setlo nofoldenable
|
||||
silent exe start_lnum.','.string(end_lnum - 1).'delete _'
|
||||
setlocal nofoldenable
|
||||
silent exe 'keepjumps ' . start_lnum.','.string(end_lnum - 1).'delete _'
|
||||
let &l:foldenable = foldenable_save
|
||||
let lines_diff = 0 - (end_lnum - start_lnum)
|
||||
else
|
||||
@@ -1066,16 +1085,16 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header,
|
||||
let new_header = whitespaces_in_first_line
|
||||
\ . s:safesubstitute(vimwiki#vars#get_syntaxlocal('rxH1_Template'),
|
||||
\ '__Header__', a:start_header, '')
|
||||
call append(start_lnum - 1, new_header)
|
||||
keepjumps call append(start_lnum - 1, new_header)
|
||||
let start_lnum += 1
|
||||
let lines_diff += 1 + len(a:strings)
|
||||
for string in a:strings
|
||||
call append(start_lnum - 1, string)
|
||||
keepjumps call append(start_lnum - 1, string)
|
||||
let start_lnum += 1
|
||||
endfor
|
||||
" append an empty line if there is not one
|
||||
if start_lnum <= line('$') && getline(start_lnum) !~# '\m^\s*$'
|
||||
call append(start_lnum - 1, '')
|
||||
keepjumps call append(start_lnum - 1, '')
|
||||
let lines_diff += 1
|
||||
endif
|
||||
|
||||
@@ -1107,8 +1126,10 @@ function! vimwiki#base#find_prev_link()
|
||||
endfunction
|
||||
|
||||
|
||||
" This is an API function, that is, remappable by the user. Don't change the signature.
|
||||
function! vimwiki#base#follow_link(split, reuse, move_cursor, ...)
|
||||
function! vimwiki#base#follow_link(split, ...)
|
||||
let reuse_other_split_window = a:0 >= 1 ? a:1 : 0
|
||||
let move_cursor_to_new_window = a:0 >= 2 ? a:2 : 1
|
||||
|
||||
" Parse link at cursor and pass to VimwikiLinkHandler, or failing that, the
|
||||
" default open_link handler
|
||||
|
||||
@@ -1144,7 +1165,7 @@ function! vimwiki#base#follow_link(split, reuse, move_cursor, ...)
|
||||
|
||||
" if we want to and can reuse a split window, jump to that window and open
|
||||
" the new file there
|
||||
if (a:split ==# 'hsplit' || a:split ==# 'vsplit') && a:reuse
|
||||
if (a:split ==# 'hsplit' || a:split ==# 'vsplit') && reuse_other_split_window
|
||||
let previous_window_nr = winnr('#')
|
||||
if previous_window_nr > 0 && previous_window_nr != winnr()
|
||||
execute previous_window_nr . 'wincmd w'
|
||||
@@ -1168,7 +1189,7 @@ function! vimwiki#base#follow_link(split, reuse, move_cursor, ...)
|
||||
|
||||
call vimwiki#base#open_link(cmd, lnk)
|
||||
|
||||
if !a:move_cursor
|
||||
if !move_cursor_to_new_window
|
||||
if (a:split ==# 'hsplit' || a:split ==# 'vsplit')
|
||||
execute 'wincmd p'
|
||||
elseif a:split ==# 'tab'
|
||||
@@ -1177,8 +1198,8 @@ function! vimwiki#base#follow_link(split, reuse, move_cursor, ...)
|
||||
endif
|
||||
|
||||
else
|
||||
if a:0 > 0
|
||||
execute "normal! ".a:1
|
||||
if a:0 >= 3
|
||||
execute "normal! ".a:3
|
||||
else
|
||||
call vimwiki#base#normalize_link(0)
|
||||
endif
|
||||
@@ -1277,12 +1298,10 @@ function! vimwiki#base#rename_link()
|
||||
let new_link = input('Enter new name: ')
|
||||
|
||||
if new_link =~# '[/\\]'
|
||||
" It is actually doable but I do not have free time to do it.
|
||||
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 Error: Cannot rename to an empty filename!'
|
||||
return
|
||||
@@ -1294,6 +1313,7 @@ function! vimwiki#base#rename_link()
|
||||
endif
|
||||
|
||||
let new_link = subdir.new_link
|
||||
let wiki_nr = vimwiki#vars#get_bufferlocal("wiki_nr")
|
||||
let new_fname = vimwiki#vars#get_wikilocal('path') . new_link . vimwiki#vars#get_wikilocal('ext')
|
||||
|
||||
" do not rename if file with such name exists
|
||||
@@ -1337,7 +1357,7 @@ function! vimwiki#base#rename_link()
|
||||
setlocal nomore
|
||||
|
||||
" update links
|
||||
call s:update_wiki_links(s:tail_name(old_fname), new_link)
|
||||
call s:update_wiki_links(wiki_nr, s:tail_name(old_fname), s:tail_name(new_link),old_fname)
|
||||
|
||||
" restore wiki buffers
|
||||
for bitem in blist
|
||||
@@ -1790,13 +1810,31 @@ endfunction
|
||||
" a:create == 0: update if TOC exists
|
||||
function! vimwiki#base#table_of_contents(create)
|
||||
let headers = s:collect_headers()
|
||||
let toc_header_text = vimwiki#vars#get_global('toc_header')
|
||||
|
||||
if !a:create
|
||||
" Do nothing if there is no TOC to update. (This is a small performance optimization -- if
|
||||
" auto_toc == 1, but the current buffer has no TOC but is long, saving the buffer could
|
||||
" otherwise take a few seconds for nothing.)
|
||||
let toc_already_present = 0
|
||||
for entry in headers
|
||||
if entry[2] ==# toc_header_text
|
||||
let toc_already_present = 1
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if !toc_already_present
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
let numbering = vimwiki#vars#get_global('html_header_numbering')
|
||||
let headers_levels = [['', 0], ['', 0], ['', 0], ['', 0], ['', 0], ['', 0]]
|
||||
let complete_header_infos = []
|
||||
for header in headers
|
||||
let h_text = header[2]
|
||||
let h_level = header[1]
|
||||
if h_text ==# vimwiki#vars#get_global('toc_header') " don't include the TOC's header itself
|
||||
if h_text ==# toc_header_text " don't include the TOC's header itself
|
||||
continue
|
||||
endif
|
||||
let headers_levels[h_level-1] = [h_text, headers_levels[h_level-1][1]+1]
|
||||
@@ -1824,22 +1862,20 @@ function! vimwiki#base#table_of_contents(create)
|
||||
let indentstring = repeat(' ', vimwiki#u#sw())
|
||||
let bullet = vimwiki#lst#default_symbol().' '
|
||||
for [lvl, link, desc] in complete_header_infos
|
||||
let esc_link = substitute(link, "'", "''", 'g')
|
||||
let esc_desc = substitute(desc, "'", "''", 'g')
|
||||
let link_tpl = vimwiki#vars#get_global('WikiLinkTemplate2')
|
||||
if vimwiki#vars#get_wikilocal('syntax') == 'markdown'
|
||||
let link_tpl = vimwiki#vars#get_syntaxlocal('Weblink1Template')
|
||||
else
|
||||
let link_tpl = vimwiki#vars#get_global('WikiLinkTemplate2')
|
||||
endif
|
||||
let link = s:safesubstitute(link_tpl, '__LinkUrl__',
|
||||
\ '#'.esc_link, '')
|
||||
let link = s:safesubstitute(link, '__LinkDescription__', esc_desc, '')
|
||||
\ '#'.link, '')
|
||||
let link = s:safesubstitute(link, '__LinkDescription__', desc, '')
|
||||
call add(lines, startindent.repeat(indentstring, lvl-1).bullet.link)
|
||||
endfor
|
||||
|
||||
let links_rx = '\m^\s*'.vimwiki#u#escape(vimwiki#lst#default_symbol()).' '
|
||||
|
||||
call vimwiki#base#update_listing_in_buffer(lines,
|
||||
\ vimwiki#vars#get_global('toc_header'), links_rx, 1, a:create)
|
||||
call vimwiki#base#update_listing_in_buffer(lines, toc_header_text, links_rx, 1, a:create)
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1864,17 +1900,21 @@ endfunction
|
||||
|
||||
|
||||
function! s:clean_url(url)
|
||||
let url = split(a:url, '/\|=\|-\|&\|?\|\.')
|
||||
" remove protocol and tld
|
||||
let url = substitute(a:url, '^\a\+\d*:', '', '')
|
||||
let url = substitute(url, '^//', '', '')
|
||||
let url = substitute(url, '^\([^/]\+\)\.\a\{2,4}/', '\1/', '')
|
||||
let url = split(url, '/\|=\|-\|&\|?\|\.')
|
||||
let url = filter(url, 'v:val !=# ""')
|
||||
let url = filter(url, 'v:val !=# "www"')
|
||||
let url = filter(url, 'v:val !=# "com"')
|
||||
let url = filter(url, 'v:val !=# "org"')
|
||||
let url = filter(url, 'v:val !=# "net"')
|
||||
let url = filter(url, 'v:val !=# "edu"')
|
||||
let url = filter(url, 'v:val !=# "http\:"')
|
||||
let url = filter(url, 'v:val !=# "https\:"')
|
||||
let url = filter(url, 'v:val !=# "file\:"')
|
||||
let url = filter(url, 'v:val !=# "xml\:"')
|
||||
if url[0] == "www"
|
||||
let url = url[1:]
|
||||
endif
|
||||
if url[-1] =~ '^\(htm\|html\|php\)$'
|
||||
let url = url[0:-2]
|
||||
endif
|
||||
" remove words consisting of only hexadecimal digits or non-word characters
|
||||
let url = filter(url, 'v:val !~ "^\\A\\{4,}$"')
|
||||
let url = filter(url, 'v:val !~ "^\\x\\{4,}$" || v:val !~ "\\d"')
|
||||
return join(url, " ")
|
||||
endfunction
|
||||
|
||||
@@ -1916,17 +1956,22 @@ function! s:normalize_link_in_diary(lnk)
|
||||
let link_exists_in_wiki = filereadable(link_wiki)
|
||||
let link_is_date = a:lnk =~# '\d\d\d\d-\d\d-\d\d'
|
||||
|
||||
if ! link_exists_in_wiki || link_exists_in_diary || link_is_date
|
||||
if link_exists_in_diary || link_is_date
|
||||
let str = a:lnk
|
||||
let rxUrl = vimwiki#vars#get_global('rxWord')
|
||||
let rxDesc = ''
|
||||
let template = vimwiki#vars#get_global('WikiLinkTemplate1')
|
||||
else
|
||||
elseif link_exists_in_wiki
|
||||
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')
|
||||
else
|
||||
let str = a:lnk
|
||||
let rxUrl = '.*'
|
||||
let rxDesc = ''
|
||||
let template = vimwiki#vars#get_global('WikiLinkTemplate1')
|
||||
endif
|
||||
|
||||
return vimwiki#base#normalize_link_helper(str, rxUrl, rxDesc, template)
|
||||
@@ -1970,9 +2015,8 @@ function! s:normalize_link_syntax_n()
|
||||
if s:is_diary_file(expand("%:p"))
|
||||
let sub = s:normalize_link_in_diary(lnk)
|
||||
else
|
||||
let sub = vimwiki#base#normalize_link_helper(lnk,
|
||||
\ vimwiki#vars#get_global('rxWord'), '',
|
||||
\ vimwiki#vars#get_global('WikiLinkTemplate1'))
|
||||
let sub = s:safesubstitute(
|
||||
\ vimwiki#vars#get_global('WikiLinkTemplate1'), '__LinkUrl__', lnk, '')
|
||||
endif
|
||||
call vimwiki#base#replacestr_at_cursor('\V'.lnk, sub)
|
||||
return
|
||||
|
||||
@@ -231,6 +231,11 @@ function! vimwiki#diary#goto_diary_index(wnum)
|
||||
endif
|
||||
|
||||
call vimwiki#base#edit_file('e', s:diary_index(idx), '')
|
||||
|
||||
if vimwiki#vars#get_wikilocal('auto_diary_index')
|
||||
call vimwiki#diary#generate_diary_section()
|
||||
write! " save changes
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
|
||||
+13
-15
@@ -204,13 +204,6 @@ function! s:subst_func(line, regexp, func, ...)
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:save_vimwiki_buffer()
|
||||
if &filetype ==? 'vimwiki' && filewritable(expand('%'))
|
||||
silent update
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:process_date(placeholders, default_date)
|
||||
if !empty(a:placeholders)
|
||||
for [placeholder, row, idx] in a:placeholders
|
||||
@@ -373,7 +366,7 @@ endfunction
|
||||
|
||||
function! s:linkify_link(src, descr)
|
||||
let src_str = ' href="'.s:escape_html_attribute(a:src).'"'
|
||||
let descr = substitute(a:descr,'^\s*\(.*\)\s*$','\1','')
|
||||
let descr = vimwiki#u#trim(a:descr)
|
||||
let descr = (descr == "" ? a:src : descr)
|
||||
let descr_str = (descr =~# vimwiki#vars#get_global('rxWikiIncl')
|
||||
\ ? s:tag_wikiincl(descr)
|
||||
@@ -445,7 +438,8 @@ function! s:tag_wikilink(value)
|
||||
let str = a:value
|
||||
let url = matchstr(str, vimwiki#vars#get_syntaxlocal('rxWikiLinkMatchUrl'))
|
||||
let descr = matchstr(str, vimwiki#vars#get_syntaxlocal('rxWikiLinkMatchDescr'))
|
||||
let descr = (substitute(descr,'^\s*\(.*\)\s*$','\1','') != '' ? descr : url)
|
||||
let descr = vimwiki#u#trim(descr)
|
||||
let descr = (descr != '' ? descr : url)
|
||||
|
||||
let line = VimwikiLinkConverter(url, s:current_wiki_file, s:current_html_file)
|
||||
if line == ''
|
||||
@@ -843,7 +837,7 @@ function! s:process_tag_math(line, math)
|
||||
" environment properly
|
||||
let s:current_math_env = matchstr(class, '^%\zs\S\+\ze%')
|
||||
if s:current_math_env != ""
|
||||
call add(lines, substitute(class, '^%\(\S\+\)%','\\begin{\1}', ''))
|
||||
call add(lines, substitute(class, '^%\(\S\+\)%', '\\begin{\1}', ''))
|
||||
elseif class != ""
|
||||
call add(lines, "\\\[".class)
|
||||
else
|
||||
@@ -1078,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
|
||||
|
||||
@@ -1094,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
|
||||
@@ -1586,9 +1582,11 @@ function! vimwiki#html#WikiAll2HTML(path_html)
|
||||
echomsg 'Vimwiki: Saving Vimwiki files ...'
|
||||
let save_eventignore = &eventignore
|
||||
let &eventignore = "all"
|
||||
let cur_buf = bufname('%')
|
||||
bufdo call s:save_vimwiki_buffer()
|
||||
exe 'buffer '.cur_buf
|
||||
try
|
||||
wall
|
||||
catch
|
||||
" just ignore errors
|
||||
endtry
|
||||
let &eventignore = save_eventignore
|
||||
|
||||
let path_html = expand(a:path_html)
|
||||
|
||||
+69
-49
@@ -299,6 +299,13 @@ function! s:regexp_of_marker(item)
|
||||
endfunction
|
||||
|
||||
|
||||
" Returns: Whether or not the checkbox of a list item is [X] or [-]
|
||||
function! s:is_closed(item)
|
||||
let state = a:item.cb
|
||||
return state ==# vimwiki#vars#get_syntaxlocal('listsyms_list')[-1]
|
||||
\ || state ==# vimwiki#vars#get_global('listsym_rejected')
|
||||
endfunction
|
||||
|
||||
" ---------------------------------------------------------
|
||||
" functions for navigating between items
|
||||
" ---------------------------------------------------------
|
||||
@@ -756,10 +763,47 @@ function! s:set_state(item, new_rate)
|
||||
endfunction
|
||||
|
||||
|
||||
"Set state of the list item to [ ] or [o] or whatever
|
||||
"Updates the states of its child items
|
||||
function! s:set_state_plus_children(item, new_rate)
|
||||
" Sets the state of the list item to [ ] or [o] or whatever. Updates the states of its child items.
|
||||
" If the new state should be [X] or [-], the state of the current list item is changed to this
|
||||
" state, but if a child item already has [X] or [-] it is left alone.
|
||||
function! s:set_state_plus_children(item, new_rate, ...)
|
||||
let retain_state_if_closed = a:0 > 0 && a:1 > 0
|
||||
|
||||
if !(retain_state_if_closed && (a:new_rate == 100 || a:new_rate == -1) && s:is_closed(a:item))
|
||||
call s:set_state(a:item, a:new_rate)
|
||||
endif
|
||||
|
||||
let all_children_are_done = 1
|
||||
let all_children_are_rejected = 1
|
||||
|
||||
let child_item = s:get_first_child(a:item)
|
||||
while 1
|
||||
if child_item.type == 0
|
||||
break
|
||||
endif
|
||||
if child_item.cb != vimwiki#vars#get_global('listsym_rejected')
|
||||
let all_children_are_rejected = 0
|
||||
endif
|
||||
if child_item.cb != vimwiki#vars#get_syntaxlocal('listsyms_list')[-1]
|
||||
let all_children_are_done = 0
|
||||
endif
|
||||
if !all_children_are_done && !all_children_are_rejected
|
||||
break
|
||||
endif
|
||||
let child_item = s:get_next_child_item(a:item, child_item)
|
||||
endwhile
|
||||
|
||||
if (a:new_rate == 100 && all_children_are_done) ||
|
||||
\ (a:new_rate == -1) && all_children_are_rejected
|
||||
return
|
||||
endif
|
||||
|
||||
if (a:new_rate == -1 && all_children_are_done) ||
|
||||
\ (a:new_rate == 100 && all_children_are_rejected)
|
||||
let retain_closed_children = 0
|
||||
else
|
||||
let retain_closed_children = 1
|
||||
endif
|
||||
|
||||
let child_item = s:get_first_child(a:item)
|
||||
while 1
|
||||
@@ -767,7 +811,7 @@ function! s:set_state_plus_children(item, new_rate)
|
||||
break
|
||||
endif
|
||||
if child_item.cb != ''
|
||||
call s:set_state_plus_children(child_item, a:new_rate)
|
||||
call s:set_state_plus_children(child_item, a:new_rate, retain_closed_children)
|
||||
endif
|
||||
let child_item = s:get_next_child_item(a:item, child_item)
|
||||
endwhile
|
||||
@@ -802,6 +846,7 @@ function! s:update_state(item)
|
||||
|
||||
let sum_children_rate = 0
|
||||
let count_children_with_cb = 0
|
||||
let count_rejected_children = 0
|
||||
|
||||
let child_item = s:get_first_child(a:item)
|
||||
|
||||
@@ -811,16 +856,24 @@ function! s:update_state(item)
|
||||
endif
|
||||
if child_item.cb != ''
|
||||
let rate = s:get_rate(child_item)
|
||||
if rate != -1
|
||||
if rate == -1
|
||||
" for calculating the parent rate, a [-] item counts as much as a [X] item ...
|
||||
let rate = 100
|
||||
" ... with the exception that a parent with *only* [-] items will be [-] too
|
||||
let count_rejected_children += 1
|
||||
endif
|
||||
let count_children_with_cb += 1
|
||||
let sum_children_rate += rate
|
||||
endif
|
||||
endif
|
||||
let child_item = s:get_next_child_item(a:item, child_item)
|
||||
endwhile
|
||||
|
||||
if count_children_with_cb > 0
|
||||
if count_rejected_children == count_children_with_cb
|
||||
let new_rate = -1
|
||||
else
|
||||
let new_rate = sum_children_rate / count_children_with_cb
|
||||
endif
|
||||
call s:set_state_recursively(a:item, new_rate)
|
||||
else
|
||||
let rate = s:get_rate(a:item)
|
||||
@@ -841,13 +894,13 @@ endfunction
|
||||
|
||||
"Creates checkbox in a list item.
|
||||
"Returns: 1 if successful
|
||||
function! s:create_cb(item)
|
||||
function! s:create_cb(item, start_rate)
|
||||
if a:item.type == 0 || a:item.cb != ''
|
||||
return 0
|
||||
endif
|
||||
|
||||
let new_item = a:item
|
||||
let new_item.cb = vimwiki#vars#get_syntaxlocal('listsyms_list')[0]
|
||||
let new_item.cb = s:rate_to_state(a:start_rate)
|
||||
call s:substitute_rx_in_line(new_item.lnum,
|
||||
\ vimwiki#u#escape(new_item.mrkr) . '\zs\ze', ' [' . new_item.cb . ']')
|
||||
|
||||
@@ -866,8 +919,7 @@ function! s:remove_cb(item)
|
||||
endfunction
|
||||
|
||||
|
||||
"Change state of checkbox
|
||||
"in the lines of the given range
|
||||
" Change state of the checkboxes in the lines of the given range
|
||||
function! s:change_cb(from_line, to_line, new_rate)
|
||||
let from_item = s:get_corresponding_item(a:from_line)
|
||||
if from_item.type == 0
|
||||
@@ -894,9 +946,9 @@ function! s:change_cb(from_line, to_line, new_rate)
|
||||
endfunction
|
||||
|
||||
|
||||
"Toggles checkbox between two states in the lines of the given range,
|
||||
"creates chceckboxes if there aren't any.
|
||||
function! s:toggle_create_cb(from_line, to_line, state1, state2)
|
||||
" Toggles checkbox between two states in the lines of the given range, creates checkboxes (with
|
||||
" a:start_rate as state) if there aren't any.
|
||||
function! s:toggle_create_cb(from_line, to_line, state1, state2, start_rate)
|
||||
let from_item = s:get_corresponding_item(a:from_line)
|
||||
if from_item.type == 0
|
||||
return
|
||||
@@ -908,7 +960,7 @@ function! s:toggle_create_cb(from_line, to_line, state1, state2)
|
||||
let parent_items_of_lines = []
|
||||
for cur_ln in range(from_item.lnum, a:to_line)
|
||||
let cur_item = s:get_item(cur_ln)
|
||||
let success = s:create_cb(cur_item)
|
||||
let success = s:create_cb(cur_item, a:start_rate)
|
||||
|
||||
if success
|
||||
let cur_parent_item = s:get_parent(cur_item)
|
||||
@@ -974,46 +1026,14 @@ endfunction
|
||||
"Toggles checkbox between [ ] and [X] or creates one
|
||||
"in the lines of the given range
|
||||
function! vimwiki#lst#toggle_cb(from_line, to_line)
|
||||
return s:toggle_create_cb(a:from_line, a:to_line, 100, 0)
|
||||
return s:toggle_create_cb(a:from_line, a:to_line, 100, 0, 0)
|
||||
endfunction
|
||||
|
||||
|
||||
"Toggles checkbox between [ ] and [-] or creates one
|
||||
"in the lines of the given range
|
||||
function! vimwiki#lst#toggle_rejected_cb(from_line, to_line)
|
||||
return s:toggle_create_cb(a:from_line, a:to_line, -1, 0)
|
||||
endfunction
|
||||
|
||||
|
||||
"Increment checkbox between [ ] and [X]
|
||||
"in the lines of the given range
|
||||
function! vimwiki#lst#increment_cb(from_line, to_line)
|
||||
let from_item = s:get_corresponding_item(a:from_line)
|
||||
if from_item.type == 0
|
||||
return
|
||||
endif
|
||||
|
||||
"if from_line has CB, increment it and set all siblings to the same new state
|
||||
let rate_first_line = s:get_rate(from_item)
|
||||
let n = len(vimwiki#vars#get_syntaxlocal('listsyms_list'))
|
||||
let new_rate = min([rate_first_line + 100/(n-1)+1, 100])
|
||||
|
||||
call s:change_cb(a:from_line, a:to_line, new_rate)
|
||||
|
||||
endfunction
|
||||
|
||||
|
||||
"Toggles checkbox between [ ] and [X] or creates one
|
||||
"in the lines of the given range
|
||||
function! vimwiki#lst#toggle_cb(from_line, to_line)
|
||||
return s:toggle_create_cb(a:from_line, a:to_line, 100, 0)
|
||||
endfunction
|
||||
|
||||
|
||||
"Toggles checkbox between [ ] and [-] or creates one
|
||||
"in the lines of the given range
|
||||
function! vimwiki#lst#toggle_rejected_cb(from_line, to_line)
|
||||
return s:toggle_create_cb(a:from_line, a:to_line, -1, 0)
|
||||
return s:toggle_create_cb(a:from_line, a:to_line, -1, 0, -1)
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1395,7 +1415,7 @@ function! s:clone_marker_from_to(from, to)
|
||||
let new_indent = ( vimwiki#vars#get_syntaxlocal('recurring_bullets') ? 0 : indent(a:from) )
|
||||
call s:set_indent(a:to, new_indent)
|
||||
if item_from.cb != ''
|
||||
call s:create_cb(s:get_item(a:to))
|
||||
call s:create_cb(s:get_item(a:to), 0)
|
||||
call s:update_state(s:get_parent(s:get_item(a:to)))
|
||||
endif
|
||||
if item_from.type == 2
|
||||
|
||||
@@ -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 {
|
||||
|
||||
+213
-74
@@ -13,7 +13,7 @@
|
||||
" global user variables and syntax stuff which is the same for every syntax.
|
||||
"
|
||||
" - wiki-local variables. They are stored in g:vimwiki_wikilocal_vars which is a list of
|
||||
" dictionaries. One dict for every registered wiki. The last dictionary contains default values
|
||||
" dictionaries, one dict for every registered wiki. The last dictionary contains default values
|
||||
" (used for temporary wikis).
|
||||
"
|
||||
" - syntax variables. Stored in the dict g:vimwiki_syntax_variables which holds all the regexes and
|
||||
@@ -28,50 +28,10 @@
|
||||
|
||||
function! s:populate_global_variables()
|
||||
|
||||
let g:vimwiki_global_vars = {
|
||||
\ 'CJK_length': 0,
|
||||
\ 'auto_chdir': 0,
|
||||
\ 'autowriteall': 1,
|
||||
\ 'conceallevel': 2,
|
||||
\ 'diary_months':
|
||||
\ {
|
||||
\ 1: 'January', 2: 'February', 3: 'March',
|
||||
\ 4: 'April', 5: 'May', 6: 'June',
|
||||
\ 7: 'July', 8: 'August', 9: 'September',
|
||||
\ 10: 'October', 11: 'November', 12: 'December'
|
||||
\ },
|
||||
\ 'dir_link': '',
|
||||
\ 'ext2syntax': {},
|
||||
\ 'folding': '',
|
||||
\ 'global_ext': 1,
|
||||
\ 'hl_cb_checked': 0,
|
||||
\ 'hl_headers': 0,
|
||||
\ 'html_header_numbering': 0,
|
||||
\ 'html_header_numbering_sym': '',
|
||||
\ 'list_ignore_newline': 1,
|
||||
\ 'text_ignore_newline': 1,
|
||||
\ 'listsyms': ' .oOX',
|
||||
\ 'listsym_rejected': '-',
|
||||
\ 'map_prefix': '<Leader>w',
|
||||
\ 'menu': 'Vimwiki',
|
||||
\ 'table_auto_fmt': 1,
|
||||
\ 'table_mappings': 1,
|
||||
\ 'toc_header': 'Contents',
|
||||
\ 'url_maxsave': 15,
|
||||
\ 'use_calendar': 1,
|
||||
\ 'use_mouse': 0,
|
||||
\ 'user_htmls': '',
|
||||
\ 'valid_html_tags': 'b,i,s,u,sub,sup,kbd,br,hr,div,center,strong,em',
|
||||
\ 'w32_dir_enc': '',
|
||||
\ }
|
||||
let g:vimwiki_global_vars = {}
|
||||
|
||||
" copy the user's settings from variables of the form g:vimwiki_<option> into the dict
|
||||
" g:vimwiki_global_vars (or set a default value)
|
||||
for key in keys(g:vimwiki_global_vars)
|
||||
if exists('g:vimwiki_'.key)
|
||||
let g:vimwiki_global_vars[key] = g:vimwiki_{key}
|
||||
endif
|
||||
endfor
|
||||
call s:read_global_settings_from_user()
|
||||
call s:normalize_global_settings()
|
||||
|
||||
" non-configurable global variables:
|
||||
|
||||
@@ -179,30 +139,131 @@ function! s:populate_global_variables()
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:read_global_settings_from_user()
|
||||
let global_settings = {
|
||||
\ 'CJK_length': {'type': type(0), 'default': 0, 'min': 0, 'max': 1},
|
||||
\ 'auto_chdir': {'type': type(0), 'default': 0, 'min': 0, 'max': 1},
|
||||
\ 'autowriteall': {'type': type(0), 'default': 1, 'min': 0, 'max': 1},
|
||||
\ 'conceallevel': {'type': type(0), 'default': 2, 'min': 0, 'max': 3},
|
||||
\ 'diary_months': {'type': type({}), 'default':
|
||||
\ {
|
||||
\ 1: 'January', 2: 'February', 3: 'March',
|
||||
\ 4: 'April', 5: 'May', 6: 'June',
|
||||
\ 7: 'July', 8: 'August', 9: 'September',
|
||||
\ 10: 'October', 11: 'November', 12: 'December'
|
||||
\ }},
|
||||
\ 'dir_link': {'type': type(''), 'default': ''},
|
||||
\ 'ext2syntax': {'type': type({}), 'default': {}},
|
||||
\ 'folding': {'type': type(''), 'default': '', 'possible_values': ['', 'expr', 'syntax',
|
||||
\ 'list', 'custom', ':quick', 'expr:quick', 'syntax:quick', 'list:quick',
|
||||
\ 'custom:quick']},
|
||||
\ 'global_ext': {'type': type(0), 'default': 1, 'min': 0, 'max': 1},
|
||||
\ 'hl_cb_checked': {'type': type(0), 'default': 0, 'min': 0, 'max': 2},
|
||||
\ 'hl_headers': {'type': type(0), 'default': 0, 'min': 0, 'max': 1},
|
||||
\ 'html_header_numbering': {'type': type(0), 'default': 0, 'min': 0, 'max': 6},
|
||||
\ 'html_header_numbering_sym': {'type': type(''), 'default': ''},
|
||||
\ 'list_ignore_newline': {'type': type(0), 'default': 1, 'min': 0, 'max': 1},
|
||||
\ 'text_ignore_newline': {'type': type(0), 'default': 1, 'min': 0, 'max': 1},
|
||||
\ 'listsyms': {'type': type(''), 'default': ' .oOX', 'min_length': 2},
|
||||
\ 'listsym_rejected': {'type': type(''), 'default': '-', 'length': 1},
|
||||
\ 'map_prefix': {'type': type(''), 'default': '<Leader>w'},
|
||||
\ 'menu': {'type': type(''), 'default': 'Vimwiki'},
|
||||
\ 'table_auto_fmt': {'type': type(0), 'default': 1, 'min': 0, 'max': 1},
|
||||
\ 'table_mappings': {'type': type(0), 'default': 1, 'min': 0, 'max': 1},
|
||||
\ 'toc_header': {'type': type(''), 'default': 'Contents', 'min_length': 1},
|
||||
\ 'url_maxsave': {'type': type(0), 'default': 15, 'min': 0},
|
||||
\ 'use_calendar': {'type': type(0), 'default': 1, 'min': 0, 'max': 1},
|
||||
\ 'use_mouse': {'type': type(0), 'default': 0, 'min': 0, 'max': 1},
|
||||
\ 'user_htmls': {'type': type(''), 'default': ''},
|
||||
\ 'valid_html_tags': {'type': type(''), 'default':
|
||||
\ 'b,i,s,u,sub,sup,kbd,br,hr,div,center,strong,em'},
|
||||
\ 'w32_dir_enc': {'type': type(''), 'default': ''},
|
||||
\ }
|
||||
|
||||
" copy the user's settings from variables of the form g:vimwiki_<option> into the dict
|
||||
" g:vimwiki_global_vars (or set a default value)
|
||||
for key in keys(global_settings)
|
||||
if exists('g:vimwiki_'.key)
|
||||
let users_value = g:vimwiki_{key}
|
||||
let value_infos = global_settings[key]
|
||||
|
||||
call s:check_users_value(key, users_value, value_infos, 1)
|
||||
|
||||
let g:vimwiki_global_vars[key] = users_value
|
||||
else
|
||||
let g:vimwiki_global_vars[key] = global_settings[key].default
|
||||
endif
|
||||
endfor
|
||||
|
||||
" validate some settings individually
|
||||
|
||||
let key = 'diary_months'
|
||||
let users_value = g:vimwiki_global_vars[key]
|
||||
for month in range(1, 12)
|
||||
if !has_key(users_value, month) || type(users_value[month]) != type('') ||
|
||||
\ empty(users_value[month])
|
||||
echom printf('Vimwiki Error: The provided value ''%s'' of the option ''g:vimwiki_%s'' is'
|
||||
\ . ' invalid. See '':h g:vimwiki_%s''.', string(users_value), key, key)
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
|
||||
let key = 'ext2syntax'
|
||||
let users_value = g:vimwiki_global_vars[key]
|
||||
for ext in keys(users_value)
|
||||
if empty(ext) || index(['markdown', 'media', 'mediawiki', 'default'], users_value[ext]) == -1
|
||||
echom printf('Vimwiki Error: The provided value ''%s'' of the option ''g:vimwiki_%s'' is'
|
||||
\ . ' invalid. See '':h g:vimwiki_%s''.', string(users_value), key, key)
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:normalize_global_settings()
|
||||
let keys = keys(g:vimwiki_global_vars.ext2syntax)
|
||||
for ext in keys
|
||||
" ensure the file extensions in ext2syntax start with a dot
|
||||
if ext[0] != '.'
|
||||
let new_ext = '.' . ext
|
||||
let g:vimwiki_global_vars.ext2syntax[new_ext] = g:vimwiki_global_vars.ext2syntax[ext]
|
||||
call remove(g:vimwiki_global_vars.ext2syntax, ext)
|
||||
endif
|
||||
" for convenience, we also allow the term 'mediawiki'
|
||||
if g:vimwiki_global_vars.ext2syntax[ext] ==# 'mediawiki'
|
||||
let g:vimwiki_global_vars.ext2syntax[ext] = 'media'
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:populate_wikilocal_options()
|
||||
let default_values = {
|
||||
\ 'auto_export': 0,
|
||||
\ 'auto_tags': 0,
|
||||
\ 'auto_toc': 0,
|
||||
\ 'automatic_nested_syntaxes': 1,
|
||||
\ 'css_name': 'style.css',
|
||||
\ 'custom_wiki2html': '',
|
||||
\ 'custom_wiki2html_args': '',
|
||||
\ 'diary_header': 'Diary',
|
||||
\ 'diary_index': 'diary',
|
||||
\ 'diary_rel_path': 'diary/',
|
||||
\ 'diary_sort': 'desc',
|
||||
\ 'ext': '.wiki',
|
||||
\ 'index': 'index',
|
||||
\ 'list_margin': -1,
|
||||
\ 'maxhi': 0,
|
||||
\ 'nested_syntaxes': {},
|
||||
\ 'path': '~/vimwiki/',
|
||||
\ 'path_html': '',
|
||||
\ 'syntax': 'default',
|
||||
\ 'template_default': 'default',
|
||||
\ 'template_ext': '.tpl',
|
||||
\ 'template_path': '~/vimwiki/templates/',
|
||||
\ 'auto_diary_index': {'type': type(0), 'default': 0, 'min': 0, 'max': 1},
|
||||
\ 'auto_export': {'type': type(0), 'default': 0, 'min': 0, 'max': 1},
|
||||
\ 'auto_tags': {'type': type(0), 'default': 0, 'min': 0, 'max': 1},
|
||||
\ 'auto_toc': {'type': type(0), 'default': 0, 'min': 0, 'max': 1},
|
||||
\ 'automatic_nested_syntaxes': {'type': type(0), 'default': 1, 'min': 0, 'max': 1},
|
||||
\ 'css_name': {'type': type(''), 'default': 'style.css', 'min_length': 1},
|
||||
\ 'custom_wiki2html': {'type': type(''), 'default': ''},
|
||||
\ 'custom_wiki2html_args': {'type': type(''), 'default': ''},
|
||||
\ 'diary_header': {'type': type(''), 'default': 'Diary', 'min_length': 1},
|
||||
\ 'diary_index': {'type': type(''), 'default': 'diary', 'min_length': 1},
|
||||
\ 'diary_rel_path': {'type': type(''), 'default': 'diary/', 'min_length': 1},
|
||||
\ 'diary_sort': {'type': type(''), 'default': 'desc', 'possible_values': ['asc', 'desc']},
|
||||
\ 'ext': {'type': type(''), 'default': '.wiki', 'min_length': 1},
|
||||
\ 'index': {'type': type(''), 'default': 'index', 'min_length': 1},
|
||||
\ 'list_margin': {'type': type(0), 'default': -1, 'min': -1},
|
||||
\ 'maxhi': {'type': type(0), 'default': 0, 'min': 0, 'max': 1},
|
||||
\ 'nested_syntaxes': {'type': type({}), 'default': {}},
|
||||
\ 'path': {'type': type(''), 'default': $HOME . '/vimwiki/', 'min_length': 1},
|
||||
\ 'path_html': {'type': type(''), 'default': ''},
|
||||
\ 'syntax': {'type': type(''), 'default': 'default',
|
||||
\ 'possible_values': ['default', 'markdown', 'media', 'mediawiki']},
|
||||
\ 'template_default': {'type': type(''), 'default': 'default', 'min_length': 1},
|
||||
\ 'template_ext': {'type': type(''), 'default': '.tpl'},
|
||||
\ 'template_path': {'type': type(''), 'default': $HOME . '/vimwiki/templates/'},
|
||||
\ }
|
||||
|
||||
let g:vimwiki_wikilocal_vars = []
|
||||
@@ -210,9 +271,10 @@ function! s:populate_wikilocal_options()
|
||||
let default_wiki_settings = {}
|
||||
for key in keys(default_values)
|
||||
if exists('g:vimwiki_'.key)
|
||||
call s:check_users_value(key, g:vimwiki_{key}, default_values[key], 1)
|
||||
let default_wiki_settings[key] = g:vimwiki_{key}
|
||||
else
|
||||
let default_wiki_settings[key] = default_values[key]
|
||||
let default_wiki_settings[key] = default_values[key].default
|
||||
endif
|
||||
endfor
|
||||
|
||||
@@ -222,11 +284,10 @@ function! s:populate_wikilocal_options()
|
||||
let new_wiki_settings = {}
|
||||
for key in keys(default_values)
|
||||
if has_key(users_wiki_settings, key)
|
||||
call s:check_users_value(key, users_wiki_settings[key], default_values[key], 0)
|
||||
let new_wiki_settings[key] = users_wiki_settings[key]
|
||||
elseif exists('g:vimwiki_'.key)
|
||||
let new_wiki_settings[key] = g:vimwiki_{key}
|
||||
else
|
||||
let new_wiki_settings[key] = default_values[key]
|
||||
let new_wiki_settings[key] = default_wiki_settings[key]
|
||||
endif
|
||||
endfor
|
||||
|
||||
@@ -246,11 +307,79 @@ function! s:populate_wikilocal_options()
|
||||
let temporary_wiki_settings.is_temporary_wiki = 1
|
||||
call add(g:vimwiki_wikilocal_vars, temporary_wiki_settings)
|
||||
|
||||
call s:validate_settings()
|
||||
" check some values individually
|
||||
let key = 'nested_syntaxes'
|
||||
for wiki_settings in g:vimwiki_wikilocal_vars
|
||||
let users_value = wiki_settings[key]
|
||||
for keyword in keys(users_value)
|
||||
if type(keyword) != type('') || empty(keyword) || type(users_value[keyword]) != type('') ||
|
||||
\ empty(users_value[keyword])
|
||||
echom printf('Vimwiki Error: The provided value ''%s'' of the option ''g:vimwiki_%s'' is'
|
||||
\ . ' invalid. See '':h g:vimwiki_%s''.', string(users_value), key, key)
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
|
||||
call s:normalize_wikilocal_settings()
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:validate_settings()
|
||||
function! s:check_users_value(key, users_value, value_infos, comes_from_global_variable)
|
||||
let type_code_to_name = {
|
||||
\ type(0): 'number',
|
||||
\ type(''): 'string',
|
||||
\ type([]): 'list',
|
||||
\ type({}): 'dictionary'}
|
||||
|
||||
let setting_origin = a:comes_from_global_variable ?
|
||||
\ printf('''g:vimwiki_%s''', a:key) :
|
||||
\ printf('''%s'' in g:vimwiki_list', a:key)
|
||||
|
||||
if has_key(a:value_infos, 'type') && type(a:users_value) != a:value_infos.type
|
||||
echom printf('Vimwiki Error: The provided value of the option %s is a %s, ' .
|
||||
\ 'but expected is a %s. See '':h g:vimwiki_%s''.', setting_origin,
|
||||
\ type_code_to_name[type(a:users_value)], type_code_to_name[a:value_infos.type], a:key)
|
||||
endif
|
||||
|
||||
if a:value_infos.type == type(0) && has_key(a:value_infos, 'min') &&
|
||||
\ a:users_value < a:value_infos.min
|
||||
echom printf('Vimwiki Error: The provided value ''%i'' of the option %s is'
|
||||
\ . ' too small. The minimum value is %i. See '':h g:vimwiki_%s''.', a:users_value,
|
||||
\ setting_origin, a:value_infos.min, a:key)
|
||||
endif
|
||||
|
||||
if a:value_infos.type == type(0) && has_key(a:value_infos, 'max') &&
|
||||
\ a:users_value > a:value_infos.max
|
||||
echom printf('Vimwiki Error: The provided value ''%i'' of the option %s is'
|
||||
\ . ' too large. The maximum value is %i. See '':h g:vimwiki_%s''.', a:users_value,
|
||||
\ setting_origin, a:value_infos.max, a:key)
|
||||
endif
|
||||
|
||||
if has_key(a:value_infos, 'possible_values') &&
|
||||
\ index(a:value_infos.possible_values, a:users_value) == -1
|
||||
echom printf('Vimwiki Error: The provided value ''%s'' of the option %s is'
|
||||
\ . ' invalid. Allowed values are %s. See ''g:vimwiki_%s''.', a:users_value,
|
||||
\ setting_origin, string(a:value_infos.possible_values), a:key)
|
||||
endif
|
||||
|
||||
if a:value_infos.type == type('') && has_key(a:value_infos, 'length') &&
|
||||
\ strwidth(a:users_value) != a:value_infos.length
|
||||
echom printf('Vimwiki Error: The provided value ''%s'' of the option %s must'
|
||||
\ . ' contain exactly %i character(s) but has %i. See '':h g:vimwiki_%s''.',
|
||||
\ a:users_value, setting_origin, a:value_infos.length, strwidth(a:users_value), a:key)
|
||||
endif
|
||||
|
||||
if a:value_infos.type == type('') && has_key(a:value_infos, 'min_length') &&
|
||||
\ strwidth(a:users_value) < a:value_infos.min_length
|
||||
echom printf('Vimwiki Error: The provided value ''%s'' of the option %s must'
|
||||
\ . ' have at least %d character(s) but has %d. See '':h g:vimwiki_%s''.', a:users_value,
|
||||
\ setting_origin, a:value_infos.min_length, strwidth(a:users_value), a:key)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:normalize_wikilocal_settings()
|
||||
for wiki_settings in g:vimwiki_wikilocal_vars
|
||||
let wiki_settings['path'] = s:normalize_path(wiki_settings['path'])
|
||||
|
||||
@@ -264,6 +393,16 @@ function! s:validate_settings()
|
||||
|
||||
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] != '.'
|
||||
let wiki_settings['ext'] = '.' . ext
|
||||
endif
|
||||
|
||||
" for convenience, we also allow the term 'mediawiki'
|
||||
if wiki_settings.syntax ==# 'mediawiki'
|
||||
let wiki_settings.syntax = 'media'
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
@@ -358,7 +497,7 @@ function! vimwiki#vars#populate_syntax_vars(syntax)
|
||||
"create regexp for bulleted list items
|
||||
if !empty(g:vimwiki_syntax_variables[a:syntax].bullet_types)
|
||||
let g:vimwiki_syntax_variables[a:syntax].rxListBullet =
|
||||
\ join( map(g:vimwiki_syntax_variables[a:syntax].bullet_types,
|
||||
\ join( map(copy(g:vimwiki_syntax_variables[a:syntax].bullet_types),
|
||||
\'vimwiki#u#escape(v:val).'
|
||||
\ .'repeat("\\+", g:vimwiki_syntax_variables[a:syntax].recurring_bullets)'
|
||||
\ ) , '\|')
|
||||
@@ -700,7 +839,7 @@ function! vimwiki#vars#add_temporary_wiki(settings)
|
||||
let new_temp_wiki_settings[key] = value
|
||||
endfor
|
||||
call insert(g:vimwiki_wikilocal_vars, new_temp_wiki_settings, -1)
|
||||
call s:validate_settings()
|
||||
call s:normalize_wikilocal_settings()
|
||||
endfunction
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 177 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 276 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 249 KiB |
+137
-51
@@ -9,7 +9,7 @@
|
||||
|___| |___| |_| |_||__| |__||___| |___| |_||___| ~
|
||||
|
||||
|
||||
Version: 2.3
|
||||
Version: 2.4.1
|
||||
|
||||
==============================================================================
|
||||
CONTENTS *vimwiki*
|
||||
@@ -677,12 +677,24 @@ Vimwiki file.
|
||||
*:VimwikiGoBackLink*
|
||||
Go back to the wiki page you came from.
|
||||
|
||||
*:VimwikiSplitLink*
|
||||
*:VimwikiSplitLink* [reuse] [move_cursor]
|
||||
Split and follow wiki link (create target wiki page if needed).
|
||||
|
||||
*:VimwikiVSplitLink*
|
||||
If the argument 'reuse' is given and nonzero, the link is opened in a
|
||||
possibly existing split window instead of making a new split.
|
||||
|
||||
If 'move_cursor' is given and nonzero, the cursor moves to the window with
|
||||
the opened link, otherwise, it stays in the window with the link.
|
||||
|
||||
*:VimwikiVSplitLink* [reuse] [move_cursor]
|
||||
Vertical split and follow wiki link (create target wiki page if needed).
|
||||
|
||||
If the argument 'reuse' is given and nonzero, the link is opened in a
|
||||
possibly existing split window instead of making a new split.
|
||||
|
||||
If 'move_cursor' is given and nonzero, the cursor moves to the window with
|
||||
the opened link, otherwise, it stays in the window with the link.
|
||||
|
||||
*:VimwikiTabnewLink*
|
||||
Follow wiki link in a new tab (create target wiki page if needed).
|
||||
|
||||
@@ -829,35 +841,6 @@ Vimwiki file.
|
||||
are specified, outputs all tags. To make this command work properly, make
|
||||
sure the tags have been built (see |vimwiki-build-tags|).
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
4.3. Functions *vimwiki-functions*
|
||||
|
||||
Functions to interact with Vimwiki. (It's intended that most commands will be
|
||||
replaced with corresponding function calls in the future.)
|
||||
Warning: this is currently unstable and likely to change.
|
||||
|
||||
|
||||
To map them to a key, use >
|
||||
nnoremap <C-K> :call vimwiki#base#function_name(arg1, arg2)<CR>
|
||||
<
|
||||
|
||||
*vimwiki-follow_link*
|
||||
vimwiki#base#follow_link({split}, {reuse}, {move_cursor})
|
||||
Open the link under the cursor. {split} can have the following values:
|
||||
'nosplit' open the link in the current window
|
||||
'vsplit' open in a vertically split window
|
||||
'hsplit' open in a horizontally split window
|
||||
'tab' open in a new tab
|
||||
|
||||
If {reuse} is 1 and {split} one of 'vsplit' or 'hsplit', open the link in
|
||||
a possibly existing split window instead of making a new split.
|
||||
|
||||
If {move_cursor} is 1 the cursor moves to the window or tab with the
|
||||
opened link, otherwise, it stays in the window or tab with the link.
|
||||
|
||||
For example, <CR> is per default mapped to
|
||||
vimwiki#base#follow_link('nosplit', 0, 1)
|
||||
|
||||
|
||||
==============================================================================
|
||||
5. Wiki syntax *vimwiki-syntax*
|
||||
@@ -894,6 +877,8 @@ is decorated: >
|
||||
super^script^
|
||||
sub,,script,,
|
||||
|
||||
Furthermore, there are a number of words which are highlighted extra flashy:
|
||||
TODO, DONE, STARTED, FIXME, FIXED, XXX.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
5.2. Links *vimwiki-syntax-links*
|
||||
@@ -1683,7 +1668,7 @@ checkbox without a childitem.
|
||||
|
||||
It is possible to toggle several list items using visual mode. But note that
|
||||
instead of toggling every item individually, all items get checked if the
|
||||
first item is unchecked and all items get unchecked if the first item is
|
||||
first item was unchecked and all items get unchecked if the first item was
|
||||
checked.
|
||||
|
||||
Use gl<Space> (see |vimwiki_gl<Space>|) to remove a single checkbox and
|
||||
@@ -1769,7 +1754,7 @@ See |g:vimwiki_use_calendar| option to turn it off/on.
|
||||
|
||||
|
||||
==============================================================================
|
||||
12. Anchors *vimwiki-anchors*
|
||||
11. Anchors *vimwiki-anchors*
|
||||
|
||||
Every header, tag, and bold text can be used as an anchor. To jump to it, use
|
||||
a wikilink of the form >
|
||||
@@ -1856,6 +1841,12 @@ as described in |vimwiki-register-wiki|, or may be registered on the fly as
|
||||
described in |vimwiki-temporary-wiki|. For a list of per-wiki options, see
|
||||
|vimwiki-local-options|.
|
||||
|
||||
A note for Vim power users:
|
||||
If you have an elaborated Vim setup, where you e.g. load plugins
|
||||
conditionally, make sure the settings are set before Vimwiki loads (that is,
|
||||
before plugin/vimwiki.vim is sourced). If this is not possible, try this
|
||||
command after the Vimwiki settings are (re-) set: >
|
||||
:call vimwiki#vars#init()
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
12.1 Registered Wiki *g:vimwiki_list* *vimwiki-register-wiki*
|
||||
@@ -2264,15 +2255,15 @@ be located at https://github.com/vimwiki-backup/vimwiki/issues/384
|
||||
To use the internal wiki2html converter, use an empty string (the default).
|
||||
|
||||
|
||||
vimwiki-option-custom_wiki2html_args
|
||||
*vimwiki-option-custom_wiki2html_args*
|
||||
-----------------------------------------------------------------------------
|
||||
Key Default value~
|
||||
custom_wiki2html_args ''
|
||||
|
||||
Description
|
||||
Description~
|
||||
If a custom script is called with |vimwiki-option-custom_wiki2html|, additional
|
||||
parameters can be passed by setting them using 'custom_wiki2html_args' in
|
||||
|g:vimwiki_list|.
|
||||
parameters can be passed using this option: >
|
||||
let g:vimwiki_list = [{'path': '~/path/', 'custom_wiki2html_args': 'stuff'}]
|
||||
|
||||
|
||||
*vimwiki-option-list_margin*
|
||||
@@ -2304,6 +2295,17 @@ current wiki page is saved: >
|
||||
let g:vimwiki_list = [{'path': '~/my_site/', 'auto_tags': 1}]
|
||||
|
||||
|
||||
*vimwiki-option-auto_diary_index*
|
||||
------------------------------------------------------------------------------
|
||||
Key Default value Values~
|
||||
auto_diary_index 0 0, 1
|
||||
|
||||
Description~
|
||||
Set this option to 1 to automatically update the diary index when opened.
|
||||
See |:VimwikiDiaryGenerateLinks|: >
|
||||
let g:vimwiki_list = [{'path': '~/my_site/', 'auto_diary_index': 1}]
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
12.4 Global Options *vimwiki-global-options*
|
||||
|
||||
@@ -2319,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
|
||||
@@ -2336,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.
|
||||
@@ -2908,14 +2912,7 @@ Your help in making Vimwiki better is really appreciated!
|
||||
Any help, whether it is a spelling correction or a code snippet to patch --
|
||||
everything is welcomed.
|
||||
|
||||
Before filing a bug or starting to write a patch, check the latest development
|
||||
version from https://github.com/vimwiki/vimwiki/tree/dev to see if your
|
||||
problem is already fixed.
|
||||
|
||||
Issues can be filed at https://github.com/vimwiki/vimwiki/issues/.
|
||||
|
||||
If you want to provide a pull request on GitHub, please start from the dev
|
||||
branch, not from the master branch.
|
||||
See CONTRIBUTING.md for info about how to file bugs etc.
|
||||
|
||||
==============================================================================
|
||||
15. Development *vimwiki-development*
|
||||
@@ -2962,6 +2959,36 @@ Contributors and their Github usernames in roughly chronological order:
|
||||
- Daniel Trnka (@trnila)
|
||||
- Yuchen Pei (@ycpei)
|
||||
- @maqiv
|
||||
- Dawid Ciężarkiewicz (@dpc)
|
||||
- Drew Hays (@Dru89)
|
||||
- Daniel Etrata (@danetrata)
|
||||
- Keith Haber (@kjhaber)
|
||||
- @beuerle
|
||||
- Silvio Ricardo Cordeiro (@silvioricardoc)
|
||||
- @blyoa
|
||||
- Jonathan McElroy (@jonathanmcelroy)
|
||||
- @PetrusZ
|
||||
- Brian Gianforcaro (@bgianfo)
|
||||
- Ben Burrill (@benburrill)
|
||||
- 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
|
||||
|
||||
|
||||
==============================================================================
|
||||
@@ -2974,14 +3001,73 @@ http://code.google.com/p/vimwiki/issues/list. They may be accessible from
|
||||
https://github.com/vimwiki-backup/vimwiki/issues.
|
||||
|
||||
|
||||
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|.
|
||||
* |g:vimwiki_listsyms| can have fewer or more than 5 symbols.
|
||||
* glx on a list item marks a checkbox as won't do, see |vimwiki_glx|.
|
||||
* Add the option |g:vimwiki_listsym_rejected| to set the character used
|
||||
for won't-do list items.
|
||||
* gln and glp change the "done" status of a checkbox, see |vimwiki_gln|.
|
||||
* |:VimwikiSplitLink| and |:VimwikiVSplitLink| can now reuse an existing
|
||||
split window and not move the cursor.
|
||||
* Add 'aH' and 'iH' text objects, see |vimwiki-text-objects|.
|
||||
* Add the keys |vimwiki_[[|, |vimwiki_]]|, |vimwiki_[=|, |vimwiki_]=| and
|
||||
|vimwiki_]u| for navigating between headers.
|
||||
* Add the command |:VimwikiMakeTomorrowDiaryNote|.
|
||||
* |g:vimwiki_folding| has a new option 'custom'.
|
||||
* Add the ':quick' option for faster folding, see |g:vimwiki_folding|.
|
||||
* 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
|
||||
which allowed to store Vimwiki related settings in a local file.
|
||||
* Remove the undocumented command :VimwikiPrintWikiState.
|
||||
* For complicated reasons, Vimwiki doesn't clean up its settings anymore
|
||||
if you change the filetype of a wiki buffer.
|
||||
|
||||
Fixed:~
|
||||
* Make |vimwiki-option-automatic_nested_syntaxes| work also for markdown.
|
||||
* Issue #236: Highlight math blocks as TeX math, not TeX.
|
||||
* Issue #264: Don't overwrite mappings to i_<CR> from other plugins.
|
||||
* Fix an error where <BS> sometimes didn't work under Windows.
|
||||
* Issue #302: |:VimwikiDiaryGenerateLinks| had issues with markdown.
|
||||
* Issue #445: Better handling of |'autowriteall'| and |'hidden'|.
|
||||
* Improve 'ah' and 'ih' text objects, see |vimwiki-text-objects|.
|
||||
* Allow opening of links using Powershell.
|
||||
* Allow any visual mode to be used with |vimwiki_+|.
|
||||
* Markdown syntax for |vimwiki-toc| is used, when appropriate.
|
||||
* Wikis can now be in subfolders of other wikis.
|
||||
* Issue #482: |:VimwikiMakeDiaryNote| now uses the diary of the current wiki.
|
||||
* 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.
|
||||
|
||||
|
||||
2.3 (2016-03-31)~
|
||||
|
||||
New:
|
||||
New:~
|
||||
* Add |:VimwikiMakeYesterdayDiaryNote| command
|
||||
* Issue #128: add option |vimwiki-option-automatic_nested_syntaxes|
|
||||
* Issue #192: Sort links in the list generated by |:VimwikiGenerateTags|
|
||||
|
||||
Fixed:
|
||||
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
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 305 KiB |
@@ -63,13 +63,13 @@ function! Complete_wikifiles(findstart, base)
|
||||
elseif a:base !~# '#'
|
||||
" we look for wiki files
|
||||
|
||||
if a:base =~# '^wiki\d:'
|
||||
let wikinumber = eval(matchstr(a:base, '^wiki\zs\d'))
|
||||
if a:base =~# '\m^wiki\d\+:'
|
||||
let wikinumber = eval(matchstr(a:base, '\m^wiki\zs\d\+'))
|
||||
if wikinumber >= vimwiki#vars#number_of_wikis()
|
||||
return []
|
||||
endif
|
||||
let prefix = matchstr(a:base, '^wiki\d:\zs.*')
|
||||
let scheme = matchstr(a:base, '^wiki\d:\ze')
|
||||
let prefix = matchstr(a:base, '\m^wiki\d\+:\zs.*')
|
||||
let scheme = matchstr(a:base, '\m^wiki\d\+:\ze')
|
||||
elseif a:base =~# '^diary:'
|
||||
let wikinumber = -1
|
||||
let prefix = matchstr(a:base, '^diary:\zs.*')
|
||||
@@ -259,8 +259,8 @@ command! -buffer VimwikiDeleteLink call vimwiki#base#delete_link()
|
||||
command! -buffer VimwikiRenameLink call vimwiki#base#rename_link()
|
||||
command! -buffer VimwikiFollowLink call vimwiki#base#follow_link('nosplit', 0, 1)
|
||||
command! -buffer VimwikiGoBackLink call vimwiki#base#go_back_link()
|
||||
command! -buffer VimwikiSplitLink call vimwiki#base#follow_link('hsplit', 0, 1)
|
||||
command! -buffer VimwikiVSplitLink call vimwiki#base#follow_link('vsplit', 0, 1)
|
||||
command! -buffer -nargs=* VimwikiSplitLink call vimwiki#base#follow_link('hsplit', <f-args>)
|
||||
command! -buffer -nargs=* VimwikiVSplitLink call vimwiki#base#follow_link('vsplit', <f-args>)
|
||||
|
||||
command! -buffer -nargs=? VimwikiNormalizeLink call vimwiki#base#normalize_link(<f-args>)
|
||||
|
||||
|
||||
+13
-11
@@ -10,7 +10,7 @@ endif
|
||||
let g:loaded_vimwiki = 1
|
||||
|
||||
" Set to version number for release, otherwise -1 for dev-branch
|
||||
let s:plugin_vers = -1
|
||||
let s:plugin_vers = "2.4.1"
|
||||
|
||||
" Get the directory the script is installed in
|
||||
let s:plugin_dir = expand('<sfile>:p:h:h')
|
||||
@@ -36,7 +36,7 @@ function! s:setup_buffer_leave()
|
||||
|
||||
let &autowriteall = s:vimwiki_autowriteall_saved
|
||||
|
||||
if vimwiki#vars#get_global('menu') != ""
|
||||
if !empty(vimwiki#vars#get_global('menu'))
|
||||
exe 'nmenu disable '.vimwiki#vars#get_global('menu').'.Table'
|
||||
endif
|
||||
endfunction
|
||||
@@ -152,7 +152,7 @@ function! s:set_global_options()
|
||||
let s:vimwiki_autowriteall_saved = &autowriteall
|
||||
let &autowriteall = vimwiki#vars#get_global('autowriteall')
|
||||
|
||||
if vimwiki#vars#get_global('menu') !=# ''
|
||||
if !empty(vimwiki#vars#get_global('menu'))
|
||||
exe 'nmenu enable '.vimwiki#vars#get_global('menu').'.Table'
|
||||
endif
|
||||
endfunction
|
||||
@@ -162,6 +162,7 @@ endfunction
|
||||
" Vim defaults. So we enforce our settings here when the cursor enters a
|
||||
" Vimwiki buffer.
|
||||
function! s:set_windowlocal_options()
|
||||
if !&diff " if Vim is currently in diff mode, don't interfere with its folding
|
||||
let foldmethod = vimwiki#vars#get_global('folding')
|
||||
if foldmethod =~? '^expr.*'
|
||||
setlocal foldmethod=expr
|
||||
@@ -180,6 +181,7 @@ function! s:set_windowlocal_options()
|
||||
setlocal foldmethod=manual
|
||||
normal! zE
|
||||
endif
|
||||
endif
|
||||
|
||||
if vimwiki#vars#get_global('conceallevel') && exists("+conceallevel")
|
||||
let &conceallevel = vimwiki#vars#get_global('conceallevel')
|
||||
@@ -193,15 +195,15 @@ endfunction
|
||||
|
||||
function! s:get_version()
|
||||
if s:plugin_vers != -1
|
||||
echo "Stable version: " . s:plugin_vers
|
||||
echo "Stable version: " . string(s:plugin_vers)
|
||||
else
|
||||
let a:plugin_rev = system("git --git-dir " . s:plugin_dir . "/.git rev-parse --short HEAD")
|
||||
let a:plugin_branch = system("git --git-dir " . s:plugin_dir . "/.git rev-parse --abbrev-ref HEAD")
|
||||
let a:plugin_date = system("git --git-dir " . s:plugin_dir . "/.git show -s --format=%ci")
|
||||
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: " . a:plugin_branch
|
||||
echo "Revision: " . a:plugin_rev
|
||||
echo "Date: " . a:plugin_date
|
||||
echo "Branch: " . l:plugin_branch
|
||||
echo "Revision: " . l:plugin_rev
|
||||
echo "Date: " . l:plugin_date
|
||||
else
|
||||
echo "Unknown version"
|
||||
endif
|
||||
@@ -251,11 +253,11 @@ endif
|
||||
|
||||
augroup vimwiki
|
||||
autocmd!
|
||||
autocmd ColorScheme * call s:setup_cleared_syntax()
|
||||
for s:ext in s:known_extensions
|
||||
exe 'autocmd BufNewFile,BufRead *'.s:ext.' call s:setup_new_wiki_buffer()'
|
||||
exe 'autocmd BufEnter *'.s:ext.' call s:setup_buffer_enter()'
|
||||
exe 'autocmd BufLeave *'.s:ext.' call s:setup_buffer_leave()'
|
||||
exe 'autocmd ColorScheme *'.s:ext.' call s:setup_cleared_syntax()'
|
||||
" Format tables when exit from insert mode. Do not use textwidth to
|
||||
" autowrap tables.
|
||||
if vimwiki#vars#get_global('table_auto_fmt')
|
||||
|
||||
+1
-1
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user