From 9db5febf96295d22ac1812d864f9af297a411dec Mon Sep 17 00:00:00 2001 From: Maxim Kim Date: Fri, 12 Jun 2009 00:00:00 +0000 Subject: [PATCH] Version 0.9.3 * NEW: g:vimwiki_menu option is a string which is menu path. So one can use let g:vimwiki_menu = 'Plugin.Vimwiki' to set the menu to the right place. * NEW: g:vimwiki_fold_empty_lines -- don't or do fold in empty lines between headers. See :h g:vimwiki_fold_empty_lines * FIX: Encoding error when running vimwiki in Windows XP Japanese. Thanks KarasAya. --- vimwiki_0_9_2c.vba => vimwiki_0_9_3.vba | 3708 ++++++++++++----------- 1 file changed, 1874 insertions(+), 1834 deletions(-) rename vimwiki_0_9_2c.vba => vimwiki_0_9_3.vba (98%) diff --git a/vimwiki_0_9_2c.vba b/vimwiki_0_9_3.vba similarity index 98% rename from vimwiki_0_9_2c.vba rename to vimwiki_0_9_3.vba index f603e51..863a061 100644 --- a/vimwiki_0_9_2c.vba +++ b/vimwiki_0_9_3.vba @@ -1,1363 +1,470 @@ " Vimball Archiver by Charles E. Campbell, Jr., Ph.D. UseVimball finish -doc\vimwiki.txt [[[1 -1076 -*vimwiki.txt* A Personal Wiki for Vim - - __ __ ______ __ __ ______ __ __ ______ ~ - /\ \/\ \/\__ _\ /'\_/`\/\ \ __/\ \/\__ _\ /\ \/\ \ /\__ _\ ~ - \ \ \ \ \/_/\ \/ /\ \ \ \/\ \ \ \/_/\ \/ \ \ \/'/'\/_/\ \/ ~ - \ \ \ \ \ \ \ \ \ \ \__\ \ \ \ \ \ \ \ \ \ \ \ \ , < \ \ \ ~ - \ \ \_/ \ \_\ \__\ \ \_/\ \ \ \_/ \_\ \ \_\ \__\ \ \\`\ \_\ \__ ~ - \ `\___/ /\_____\\ \_\\ \_\ `\___x___/ /\_____\\ \_\ \_\ /\_____\~ - `\/__/ \/_____/ \/_/ \/_/'\/__//__/ \/_____/ \/_/\/_/ \/_____/~ - - Version: 0.9.2c ~ - -============================================================================== -CONTENTS *vimwiki-contents* - - 1. Intro ...................................|vimwiki| - 2. Prerequisites ...........................|vimwiki-prerequisites| - 3. Mappings ................................|vimwiki-mappings| - 3.1. Global mappings .....................|vimwiki-global-mappings| - 3.2. Local mappings ......................|vimwiki-local-mappings| - 3.3. Text objects ........................|vimwiki-text-objects| - 4. Commands ................................|vimwiki-commands| - 4.1. Global commands .....................|vimwiki-global-commands| - 4.2. Local commands ......................|vimwiki-local-commands| - 5. Wiki syntax .............................|vimwiki-syntax| - 5.1. Typefaces ...........................|vimwiki-syntax-typefaces| - 5.2. Links ...............................|vimwiki-syntax-links| - 5.3. Headers .............................|vimwiki-syntax-headers| - 5.4. Paragraphs...........................|vimwiki-syntax-paragraphs| - 5.5. Lists ...............................|vimwiki-syntax-lists| - 5.6. Tables ..............................|vimwiki-syntax-tables| - 5.7. Preformatted text ...................|vimwiki-syntax-preformatted| - 5.8. Comments ............................|vimwiki-syntax-comment| - 6. Folding/Outline .........................|vimwiki-folding| - 7. Todo lists...............................|vimwiki-todo-lists| - 8. Options .................................|vimwiki-options| - 9. Help ....................................|vimwiki-help| - 10. Author .................................|vimwiki-author| - 11. Changelog ..............................|vimwiki-changelog| - 12. License ................................|vimwiki-license| - - -============================================================================== -1. Intro *vimwiki* - -Vimwiki is a personal wiki for Vim. Using it you can organize text files with -hyperlinks. To do a quick start press ww (this is usually \ww) to go -to your index wiki file. By default it is located in: > - ~/vimwiki/index.wiki -You do not have to create it manually -- vimwiki can make it for you. - -Feed it with the following example: -= My knowledge base = - * MyUrgentTasks -- things to be done _yesterday_!!! - * ProjectGutenberg -- good books are power. - * MusicILike, MusicIHate. - -Notice that ProjectGutenberg, MyUrgentTasks, MusicILike and MusicIHate -highlighted as errors. These WikiWords (WikiWord or WikiPage -- capitalized -word connected with other capitalized words) do not exist yet. - -Place cursor on ProjectGutenberg and press Enter. Now you are in -ProjectGutenberg. Edit and save it, then press Backspace to return to previous -WikiPage. You should see the difference in highlighting now. - -Now it is your turn... - -============================================================================== -2. Prerequisites *vimwiki-prerequisites* - -Make sure you have these settings in your vimrc file: > - set nocompatible - filetype plugin on - syntax on - -Without them Vimwiki will not work properly. - - -============================================================================== -3. Mappings *vimwiki-mappings* - -There are global and local mappings in vimwiki. - ------------------------------------------------------------------------------- -3.1. Global mappings *vimwiki-global-mappings* - -ww or VimwikiGoHome - Open index file of the [count]'s wiki. - ww opens first wiki from |g:vimwiki_list|. - 1ww as above opens first wiki from |g:vimwiki_list|. - 2ww opens second wiki from |g:vimwiki_list|. - 3ww opens third wiki from |g:vimwiki_list|. - etc. - To remap: > - :map w VimwikiGoHome -< -See also|:VimwikiGoHome| - -wt or VimwikiTabGoHome - Open index file of the [count]'s wiki in a new tab. - ww tabopens first wiki from |g:vimwiki_list|. - 1ww as above tabopens first wiki from |g:vimwiki_list|. - 2ww tabopens second wiki from |g:vimwiki_list|. - 3ww tabopens third wiki from |g:vimwiki_list|. - etc. - To remap: > - :map t VimwikiTabGoHome -< -See also|:VimwikiTabGoHome| - -ws or VimwikiUISelect - List and select available wikies. - To remap: > - :map wq VimwikiUISelect -< -See also|:VimwikiUISelect| - - ------------------------------------------------------------------------------- -3.2. Local mappings *vimwiki-local-mappings* - -Normal mode (Keyboard):~ - *vimwiki_* - Follow/Create WikiWord. - Maps to|:VimwikiFollowWord|. - To remap: > - :map wf VimwikiFollowWord -< - *vimwiki_* - Split and follow/create WikiWord - Maps to|:VimwikiSplitWord|. - To remap: > - :map we VimwikiSplitWord -< - *vimwiki_* - Vertical split and follow/create WikiWord - Maps to|:VimwikiVSplitWord|. - To remap: > - :map wq VimwikiVSplitWord -< - *vimwiki_* - Go back to previous WikiWord - Maps to|:VimwikiGoBackWord|. - To remap: > - :map wb VimwikiGoBackWord -< - *vimwiki_* - Find next WikiWord - Maps to|:VimwikiNextWord|. - To remap: > - :map wn VimwikiNextWord -< - *vimwiki_* - Find previous WikiWord - Maps to|:VimwikiPrevWord|. - To remap: > - :map wp VimwikiPrevWord -< - *vimwiki_wd* -wd Delete WikiWord you are in. - Maps to|:VimwikiDeleteWord|. - To remap: > - :map dd VimwikiDeleteWord -< - *vimwiki_wr* -wr Rename WikiWord you are in. - Maps to|:VimwikiRenameWord|. - To remap: > - :map rr VimwikiRenameWord -< - *vimwiki_* - Toggle list item on/off (checked/unchecked) - Maps to|:VimwikiToggleListItem|. - To remap: > - :map tt VimwikiToggleListItem -< See |vimwiki-todo-lists|. - - *vimwiki_=* -= Add header level. Create if needed. - There is nothing to indent with '==' command in - vimwiki, so it should be ok to use '=' here. - - *vimwiki_-* -- Remove header level. - -Normal mode (Mouse): ~ -Works only if |g:vimwiki_use_mouse| is set to 1. -<2-LeftMouse> Follow/Create WikiWord - Split and follow/create WikiWord - Vertical split and follow/create WikiWord - Go back to previous WikiWord - -Note: <2-LeftMouse> is just left double click. - ------------------------------------------------------------------------------- -3.3. Text objects *vimwiki-text-objects* - -ah A Header with leading empty lines. -ih Inner Header without leading empty lines. - -You can 'vah' to select a header with its contents or 'dah' to delete it or -'yah' to yank it or 'cah' to change it. ;) - - -============================================================================== -4. Commands *vimwiki-commands* - ------------------------------------------------------------------------------- -4.1. Global Commands *vimwiki-global-commands* - -*:VimwikiGoHome* - Open index file of the current wiki. - -*:VimwikiTabGoHome* - Open index file of the current wiki in a new tab. - -*:VimwikiUISelect* - Open index file of the selected wiki. - ------------------------------------------------------------------------------- -4.2. Local commands *vimwiki-local-commands* - -*:VimwikiFollowWord* - Follow/create WikiWord. - -*:VimwikiGoBackWord* - Go back to previous WikiWord you come from. - -*:VimwikiSplitWord* - Split and follow/create WikiWord. - -*:VimwikiVSplitWord* - Vertical split and follow/create WikiWord. - -*:VimwikiNextWord* - Find next WikiWord. - -*:VimwikiPrevWord* - Find previous WikiWord. - -*:VimwikiDeleteWord* - Delete WikiWord you are in. - -*:VimwikiRenameWord* - Rename WikiWord you are in. - -*:Vimwiki2HTML* - Convert current WikiPage to HTML. - -*:VimwikiAll2HTML* - Convert all WikiPages to HTML. - -*:VimwikiToggleListItem* - Toggle list item on/off (checked/unchecked) - See |vimwiki-todo-lists|. - - - -============================================================================== -5. Wiki syntax *vimwiki-syntax* - -There are a lot of different wikies out there. Most of them have their own -syntax and vimwiki is not an exception here. Default vimwiki's syntax is a -subset of google's wiki syntax markup. - -As for MediaWiki's syntax -- it is not that convenient for non English -(Russian in my case :)) keyboard layouts to emphasize text as it uses a lot -of '''''' to do it. You have to switch layouts every time you want some bold -non English text. This is the answer to "Why not MediaWiki?" - -Nevertheless, there is MediaWiki syntax file included in the distribution (it -doesn't have all the fancy stuff original MediaWiki syntax has though). -See |vimwiki-option-syntax|. - - ------------------------------------------------------------------------------- -5.1. Typefaces *vimwiki-syntax-typefaces* - -There are a few typefaces that gives you a bit of control on how your -text should be decorated: > - *bold text* - _italic text_ - ~~strikeout text~~ - `code (no syntax) text` - super^script^ - sub,,script,, - ------------------------------------------------------------------------------- -5.2. Links *vimwiki-syntax-links* - -Internal links~ -WikiWords: > - CapitalizedWordsConnected - -You can limit linking of WikiWords by adding an exclamation mark in front of -it: > - !CapitalizedWordsConnected - -Link with spaces in it: > - [[This is a link]] -or: > - [[This is a link source|Description of the link]] - - -External links~ -Plain link: > - http://code.google.com/p/vimwiki - -Link with description: > - [http://habamax.ru/blog habamax home page] - - -Images and image links~ -Image link is the link with one of jpg, png or gif endings. -Plain image link: > - http://someaddr.com/picture.jpg -in html: > - - -Link to a local image: > - [[images/pabloymoira.jpg]] -in html: > - -Path to image (ie. images/pabloymoira.jpg) is relative to -|vimwiki-option-path_html|. - -Double bracketed link to an image: > - [[http://habamax.ru/blog/wp-content/uploads/2009/01/2740254sm.jpg]] -in html: > - - -Double bracketed link to an image with description text: > - [[http://habamax.ru/blog/wp-content/uploads/2009/01/2740254sm.jpg|dance]] -in html: > - dance - -Double bracketed link to an image with alternate text: > - [[http://habamax.ru/blog/wp-content/uploads/2009/01/2740254sm.jpg|dance|]] -in html: > - dance - -Double bracketed link to an image with alternate text and some style: > - [[http://helloworld.com/blabla.jpg|cool stuff|width:150px; height: 120px;]] -in html: > - cool stuff - -Double bracketed link to an image without alternate text and some style: > - [[http://helloworld.com/blabla.jpg||width:150px; height: 120px;]] -in html: > - - -Thumbnail link: > - [http://someaddr.com/bigpicture.jpg http://someaddr.com/thumbnail.jpg] -or > - [[http://someaddr.com/bigpicture.jpg|http://someaddr.com/thumbnail.jpg]] -in html: > - - - - Tyger! Tyger! burning bright - In the forests of the night, - What immortal hand or eye - Could frame thy fearful symmetry? - In what distant deeps or skies - Burnt the fire of thine eyes? - On what wings dare he aspire? - What the hand dare sieze the fire? - ... - ... - -Or use {{{ and }}} to define pre: -{{{ > - Tyger! Tyger! burning bright - In the forests of the night, - What immortal hand or eye - Could frame thy fearful symmetry? - In what distant deeps or skies - Burnt the fire of thine eyes? - On what wings dare he aspire? - What the hand dare sieze the fire? -}}} - - -You can add optional information to {{{ tag: > -{{{class="brush: python" > - def hello(world): - for x in range(10): - print("Hello {0} number {1}".format(world, x)) -}}} - -Result of HTML export: > -
- def hello(world):
-     for x in range(10):
-         print("Hello {0} number {1}".format(world, x))
- 
- -This might be useful for coloring some programming code with external js tools -like google syntax highlighter. - - ------------------------------------------------------------------------------- -5.8. Comments *vimwiki-syntax-comments* - -Text between is a comment. -Ex: > - -< - -============================================================================== -6. Folding/Outline *vimwiki-folding* - -Vimwiki can fold or outline headers and list items. - -Example: -= My current task = - * [ ] Do stuff 1 - * [ ] Do substuff 1.1 - * [ ] Do substuff 1.2 - * [ ] Do substuff 1.2.1 - * [ ] Do substuff 1.2.2 - * [ ] Do substuff 1.3 - * [ ] Do stuff 2 - * [ ] Do stuff 3 - -Hit |zM| : -= My current task = [8] --------------------------------------~ - -Hit |zr| : -= My current task =~ - * [ ] Do stuff 1 [5] --------------------------------------~ - * [ ] Do stuff 2~ - * [ ] Do stuff 3~ - -Hit |zr| one more time: -= My current task =~ - * [ ] Do stuff 1~ - * [ ] Do substuff 1.1~ - * [ ] Do substuff 1.2 [2] -------------------------------~ - * [ ] Do substuff 1.3~ - * [ ] Do stuff 2~ - * [ ] Do stuff 3~ - -NOTE: Whether you use default syntax, folding on list items should work -properly only if all of them are indented using current |shiftwidth|. -For MediaWiki * or # should be in the first column. - -To turn folding on/off checkout |vimwiki-option-folding|. - -============================================================================== -7. Todo lists *vimwiki-todo-lists* - -You can have todo lists -- lists of items you can check/uncheck. - -Consider the following example: -= Toggleable list of items = - * [x] Toggle list item on/off. - * [x] Simple toggling between [ ] and [x]. - * [x] All list's subitems should be toggled on/off appropriately. - * [x] Toggle child subitems only if current line is list item - * [x] Parent list item should be toggled depending on it's child items. - * [x] Make numbered list items toggleable too - * [x] Add highlighting to list item boxes - * [x] Add [ ] to the next created with o, O and list item. - -Pressing on the first list item will toggle it and all of it's child -items. - -============================================================================== -8. Options *vimwiki-options* - ------------------------------------------------------------------------------- -*g:vimwiki_list* *vimwiki-multiple-wikies* - -Each item in g:vimwiki_list is a |Dictionary| that holds all customization -available for a wiki represented by that item. It is in form of > - {'option1': 'value1', 'option2: 'value2', ...} - -Consider the following example: > - let g:vimwiki_list = [{'path': '~/my_site/', 'path_html': '~/public_html/'}] - -It gives us one wiki located at ~/my_site/ that could be htmlized to -~/public_html/ - -The next example: > - let g:vimwiki_list = [{'path': '~/my_site/', 'path_html': '~/public_html/'}, - \ {'path': '~/my_docs/', 'ext': '.mdox'}] -gives us 2 wikies, first wiki as in previous example, second one is located in -~/my_docs/ and its files have .mdox extension. - -Empty |Dictionary| in the g:vimwiki_list is the wiki with default options: > - let g:vimwiki_list = [{}, - \ {'path': '~/my_docs/', 'ext': '.mdox'}] - -< -*vimwiki-option-path* -Key Default value~ -path ~/vimwiki/ -Description~ -Wiki files location: > - let g:vimwiki_list = [{'path': '~/my_site/'}] -< - -*vimwiki-option-path_html* -Key Default value~ -path_html ~/vimwiki_html/ -Description~ -HTML files converted from wiki files location: > - let g:vimwiki_list = [{'path': '~/my_site/', - \ 'path_html': '~/my_site_html/'}] - -If you omit this option path_html would be path - '/' + '_html/': > - let g:vimwiki_list = [{'path': '~/okidoki/'}] - -ie, path_html = '~/okidoki_html/' - - -*vimwiki-option-index* -Key Default value~ -index index -Description~ -Name of wiki index file: > - let g:vimwiki_list = [{'path': '~/my_site/', 'index': 'main'}] - -NOTE: Do not add extension. - - -*vimwiki-option-ext* -Key Default value~ -ext .wiki -Description~ -Extension of wiki files: > - let g:vimwiki_list = [{'path': '~/my_site/', - \ 'index': 'main', 'ext': '.document'}] - -< -*vimwiki-option-folding* -Key Default value Values~ -folding 1 0, 1 -Description~ -Enable/disable vimwiki's folding/outline. Folding in vimwiki is using 'expr' -foldmethod which is very flexible but really slow. -To turn it off set it to 0 as in example below: > - let g:vimwiki_list = [{'path': '~/articles/', 'folding': 0}] -< - -*vimwiki-option-syntax* -Key Default value Values~ -syntax default default, media -Description~ -Wiki syntax. -You can use different markup languages (currently default vimwiki and -MediaWiki) but only vimwiki's default markup could be converted to HTML at the -moment. -To use MediaWiki's wiki markup: > - let g:vimwiki_list = [{'path': '~/my_site/', 'syntax': 'media'}] -< - -*vimwiki-option-html_header* -Key Default value~ -html_header -Description~ -Set up file name for html header template: > - let g:vimwiki_list = [{'path': '~/my_site/', - \ 'html_header': '~/public_html/header.tpl'}] - -This header.tpl could look like: > - - - - %title% - - - -
- -where %title% is replaced by a wiki page name. - - -*vimwiki-option-html_footer* -Key Default value~ -html_footer -Description~ -Set up file name for html footer template: > - let g:vimwiki_list = [{'path': '~/my_site/', - \ 'html_footer': '~/public_html/footer.tpl'}] - -This footer.tpl could look like: > -
- - -< - -*vimwiki-option-css_name* -Key Default value~ -css_name style.css -Description~ -Set up css file name: > - let g:vimwiki_list = [{'path': '~/my_pages/', - \ 'css_name': 'main.css'}] -< -or even > - let g:vimwiki_list = [{'path': '~/my_pages/', - \ 'css_name': 'css/main.css'}] -< - -*vimwiki-option-gohome* -Key Default value Values~ -gohome split split, vsplit, tabe -Description~ -This option controls the way |:VimwikiGoHome| command works. -For instance you have 'No write since last change' buffer. After ww -(or :VimwikiGoHome) vimwiki index file will be splitted with it. Or vertically -splitted. Or opened in a new tab. -Ex: > - let g:vimwiki_list = [{'path': '~/my_site/', 'gohome': 'vsplit'}] -< - -*vimwiki-option-maxhi* -Key Default value Values~ -maxhi 1 0, 1 -Description~ -Non-existent WikiWord highlighting could be quite slow and if you don't want -it set maxhi to 0: > - let g:vimwiki_list = [{'path': '~/my_site/', 'maxhi': 0}] - -This disables filesystem checks for WikiWords. - - ------------------------------------------------------------------------------- -*g:vimwiki_upper* *g:vimwiki_lower* - -This affects WikiWord detection. -By default WikiWord detection uses English and Russian letters. -You can set up your own: > - let g:vimwiki_upper = "A-Z\u0410-\u042f" - let g:vimwiki_lower = "a-z\u0430-\u044f" - - ------------------------------------------------------------------------------- -*g:vimwiki_auto_checkbox* - -if on, creates checkbox while toggling list item. - -Value Description~ -0 Do not create checkbox. -1 Create checkbox. - -Default: 1 - -Ex: -Press (|:VimwikiToggleListItem|) on a list item without checkbox to -create it: > - * List item -result: > - * [ ] List item - - ------------------------------------------------------------------------------- -*g:vimwiki_menu* -GUI menu of available wikies to select. - -Value Description~ -0 No menu -1 Top level menu "Vimwiki" -2 Submenu of top level menu "Plugin" - -Default: 1 - ------------------------------------------------------------------------------- -*g:vimwiki_stripsym* - -Change strip symbol -- in Windows you cannot use /*?<>:" in file names so -vimwiki replaces them with neutral symbol (_ is default): > - let g:vimwiki_stripsym = ' ' - ------------------------------------------------------------------------------- -*g:vimwiki_use_mouse* - -Use local mouse mappings from|vimwiki-local-mappings|. - -Value Description~ -0 Do not use mouse mappings. -1 Use mouse mappings. - -Default: 0 - -============================================================================== -9. Help *vimwiki-help* - -As you could see I am not native English speaker (not a writer as well). -Please send me correct phrases instead of that incorrect stuff I have used -here. - -Any help is really appreciated! - -============================================================================== -10. Author *vimwiki-author* - -I live in Moscow and you may believe me -- there are no polar bears (no brown -too) here in the streets. - -I do not do programming for a living. So don't blame me for an ugly -ineffective code. - -Many thanks to all of you for voting vimwiki up on www.vim.org. I do vimwiki -in my spare time I could use to dance argentine tango with beautiful women. -Your votes are kind of a good replacement. ;) - -Sincerely yours, -Maxim Kim . - -Vimwiki's website: http://code.google.com/p/vimwiki/ -Vim plugins website: http://www.vim.org/scripts/script.php?script_id=2226 - -============================================================================== -11. Changelog *vimwiki-changelog* - -0.9.2c - * [fix] Regression: Export HTML link error with [[Link|Text]]. - -0.9.2b - * [fix] Installation on Linux doesn't work. (Dos line endings in Vimball - archive file). - * [fix] Clear out FlexWiki ftplugin's setup. Now you don't have to hack - filetype.vim to get rid of unexpected ':setlocal bomb' from FlexWiki's - ftplugin. - * [fix] When write done: it will show another done: in html file. - -0.9.2a - * [fix] Installation on Linux doesn't work. (Dos line endings in - autoload/vimwiki_lst.vim and indent/vimwiki.vim). - -0.9.2 - * [new] Option 'folding' added to turn folding on/off. - * [new] Header text object. See |vimwiki-text-objects|. - * [new] Add/remove Header levels with '=' and '-'. See |vimwiki_=|. - * [new] Vimwiki GUI menu to select available wikies. See |g:vimwiki_menu|. - * [new] You can specify the name of your css file now. See - |vimwiki-option-css_name| - * [new] You can add styles to image links, see |vimwiki-syntax-links|. - * [fix] History doesn't work after |VimwikiRenameWord|. - * [fix] Some of wikipedia links are not correctly highlighted. Links with - parentheses. - * [misc] Renamed vimwiki_gtd to vimwiki_lst. - -0.9.1 - * [new] HTML Table cell text alignment, see |vimwiki-syntax-tables| - * [new] Wikipage history simplified. Each vimwiki buffer now holds - b:vimwiki_prev_word which is list of [PrevWord, getpos()]. - * [new] If highlight for groups wikiHeader1..wikiHeader6 exist (defined in - a colorscheme) -- use it. Otherwise use Title highlight for all Headers. - * [fix] Warn only once if 'html_header' or 'html_footer' does not exist. - * [fix] Wrong folding for the text after the last nested list item. - * [fix] Bold and Italic aren't highlighted in tables without spaces - between || and * or _. ||*bold*||_asdf_ || (Thanks Brett Stahlman) - -0.9.0 - * [new] You can add classes to 'pre' tag -- |vimwiki-syntax-preformatted|. - This might be useful for coloring some programming code with external js - tools like google syntax highlighter. - * [new] !WikiPage is not highlighted. It is just a plain word WikiPage in - HTML, without exclamation mark - * [new] Definition lists, see |vimwiki-syntax-lists|. - * [new] New implementation of |:VimwikiRenameWord|. CAUTION: It was tested - on 2 computers only, backup your wiki before use it. Email me if it - doesn't work for you. - * [fix] Less than 3 symbols are not highlighted in Bold and Italic. - * [fix] Added vimwiki autocmd group to avoid clashes with user defined - autocmds. - * [fix] Pressing ESC while |:VimwikiUISelect| opens current wiki index file. - Should cancel wiki selection. - -0.8.3 - * [new] on a list item creates checkbox. - * [fix] With * in the first column, shouldn't insert more * (default - syntax). - * [fix] With MediaWiki's ** [ ], should insert it on the next line. - * [fix] HTML export should use 'fileencoding' instead of 'encoding'. - * [fix] Code cleanup. - -0.8.2 - * [del] Removed google syntax file. - * [new] Default vimwiki syntax is a subset of google's one. Header's has - been changed from !Header to =Header=. It is easier to maintain only 2 - syntaxes. See |vimwiki-syntax-headers|. - * [new] Multiline paragraphs -- less longlines. - * [new] Comments. See |vimwiki-syntax-comments|. - * [del] Removed setlocal textwidth = 0 from ftplugin. - * [fix] New regexps for bold, italic, bolditalic. - * [fix] The last item in List sometimes fold-in incorrectly. - * [fix] Minor tweaks on default css. - -0.8.1 - * [new] Vimwiki's foldmethod changed from syntax to expr. Foldtext is - changed to be nicer with folded list items. - * [new] Fold/outline list items. - * [new] It is possible now to edit wiki files in arbitrary directories which - is not in g:vimwiki_list's paths. New WikiWords are created in the path of - the current WikiWord. - * [new] User can remap Vimwiki's built in mappings. - * [new] Added |g:vimwiki_use_mouse|. It is off by default. - * [fix] Removed mapping. - -0.8.0 - * [new] Multiple wikies support. A lot of options have been changed, see - |vimwiki-options| - * [new] Auto create directories. - * [new] Checked list item highlighted as comment. - * [fix] Multiple 'set ft=vimwiki' for each buffer disabled. Vimwiki should - load its buffers a bit faster now. - -0.7.1 - * [new] VimwikiToggleListItem added to be able to remap to - anything user prefers more. - * [fix] Toggleable list items do not work with MediaWiki markup. - * [fix] Changing g:vimwiki_home_html to path with ~ while vimwiki is - loaded gives errors for HTML export. - * [del] Command :VimwikiExploreHome. - -0.7.0 - * [new] GTD stuff -- toggleable list items. See |vimwiki-todo-lists|. - * [fix] Headers do not fold inner headers. (Thanks Brett Stahlman) - * [fix] Remove last blank lines from preformatted text at the end of file. - * [del] Removed g:vimwiki_smartCR option. - -0.6.2 - * [new] [[link|description]] is available now. - * [fix] Barebone links (ie: http://bla-bla-bla.org/h.pl?id=98) get extra - escaping of ? and friends so they become invalid in HTML. - * [fix] In linux going to [[wiki with whitespaces]] and then pressing BS - to go back to prev wikipage produce error. (Thanks Brendon Bensel for - the fix) - * [fix] Remove setlocal encoding and fileformat from vimwiki ftplugin. - * [fix] Some tweaks on default style.css - -0.6.1 - * [fix] [blablabla bla] shouldn't be converted to a link. - * [fix] Remove extra annoing empty strings from PRE tag made from - whitespaces in HTML export. - * [fix] Moved functions related to HTML converting to new autoload module - to increase a bit vimwiki startup time. - -0.6 - * [new] Header and footer templates. See|g:vimwiki_html_header| and - |g:vimwiki_html_footer|. - * [fix] |:Vimwiki2HTML| does not recognize ~ as part of a valid path. - -0.5.3 - * [fix] Fixed |:VimwikiRenameWord|. Error when g:vimwiki_home had - whitespaces in path. - * [fix] |:VimwikiSplitWord| and |:VimwikiVSplitWord| didn't work. - -0.5.2 - * [new] Added |:VimwikiGoHome|, |:VimwikiTabGoHome| and - |:VimwikiExploreHome| commands. - * [new] Added wt mapping to open vimwiki index file in a new tab. - * [new] Added g:vimwiki_gohome option that controls how|:VimwikiGoHome| - works when current buffer is changed. (Thanks Timur Zaripov) - * [fix] Fixed |:VimwikiRenameWord|. Very bad behaviour when autochdir - isn't set up. - * [fix] Fixed commands :Wiki2HTML and :WikiAll2HTML to be available only - for vimwiki buffers. - * [fix] Renamed :Wiki2HTML and :WikiAll2HTML to |:Vimwiki2HTML| and - |:VimwikiAll2HTML| commands. - * [fix] Help file corrections. - -0.5.1 - * [new] This help is created. - * [new] Now you can fold headers. - * [new] VimwikiGoHome and VimwikiExploreHome were added. - * [fix] Bug with {{{HelloWikiWord}}} export to HTML is fixed. - * [del] Sync option removed from: Syntax highlighting for preformatted - text {{{ }}}. - -0.5 - * [new] vimwiki default markup to HTML conversion improved. - * [new] Added basic GoogleWiki and MediaWiki markup languages. - * [new] Chinese [[complex wiki words]]. - -0.4 - * [new] vimwiki=>HTML converter in plain Vim language. - * [new] Plugin autoload. - -0.3.4 - * [fix] Backup files (.wiki~) caused a bunch of errors while opening wiki - files. - -0.3.3 - * FIXED: [[wiki word with dots at the end...]] didn't work. - * [new] Added error handling for delete wiki word function. - * [new] Added keybindings o and O for list items when g:vimwiki_smartCR=1. - * [new] Added keybinding wh to visit wiki home directory. - -0.3.2 - * [fix] Renaming -- error if complex wiki word contains %. - * [fix] Syntax highlighting for preformatted text {{{ }}}. Sync option - added. - * [fix] smartCR bug fix. - -0.3.1 - * [fix] Renaming -- [[hello world?]] to [[hello? world]] links are not - updated. - * [fix] Buffers menu is a bit awkward after renaming. - * [new] Use mouse to follow links. Left double-click to follow WikiWord, - Rightclick then Leftclick to go back. - -0.3 - * [new] Highlight non-existent WikiWords. - * [new] Delete current WikiWord (wd). - * [new] g:vimwiki_smartCR=2 => use Vim comments (see :h comments :h - formatoptions) feature to deal with list items. (thx -- Dmitry - Alexandrov) - * [new] Highlight TODO:, DONE:, FIXED:, FIXME:. - * [new] Rename current WikiWord -- be careful on Windows you cannot rename - wikiword to WikiWord. After renaming update all links to that renamed - WikiWord. - * [fix] Bug -- do not duplicate WikiWords in wiki history. - * [fix] After renaming [[wiki word]] twice buffers are not deleted. - * [fix] Renaming from [[wiki word]] to WikiWord result is [[WikiWord]] - * [fix] More than one complex words on one line is bugging each other when - try go to one of them. [[bla bla bla]] [[dodo dodo dodo]] becomes - bla bla bla]] [[dodo dodo dodo. - - -0.2.2 - * [new] Added keybinding -- split WikiWord - * [new] Added keybinding -- vertical split WikiWord - -0.2.1 - * [new] Install on Linux now works. - -0.2 - * [new] Added part of Google's Wiki syntax. - * [new] Added auto insert # with ENTER. - * [new] On/Off auto insert bullet with ENTER. - * [new] Strip [[complex wiki name]] from symbols that cannot be used in - file names. - * [new] Links to non-wiki files. Non wiki files are files with extensions - ie [[hello world.txt]] or [[my homesite.html]] - -0.1 - * First public version. - -============================================================================== -12. License *vimwiki-license* - -GNU General Public License v2 -http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - -To be frank I didn't read it myself. It is not that easy reading. But I hope -it's free enough to suit your needs. - - - vim:tw=78:ts=8:ft=help -syntax\vimwiki.vim [[[1 -132 -" Vimwiki syntax file +autoload\vimwiki.vim [[[1 +462 +" Vimwiki autoload plugin file " Author: Maxim Kim " Home: http://code.google.com/p/vimwiki/ -" vim:tw=79: -" Quit if syntax file is already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +if exists("g:loaded_vimwiki_auto") || &cp finish endif +let g:loaded_vimwiki_auto = 1 -"" use max highlighting - could be quite slow if there are too many wikifiles -if VimwikiGet('maxhi') - " Every WikiWord is nonexistent - execute 'syntax match wikiNoExistsWord /\%(^\|[^!]\)\zs'.g:vimwiki_word1.'/' - execute 'syntax match wikiNoExistsWord /'.g:vimwiki_word2.'/' - " till we find them in vimwiki's path - call vimwiki#WikiHighlightWords() -else - " A WikiWord (unqualifiedWikiName) - execute 'syntax match wikiWord /\%(^\|[^!]\)\zs\<'.g:vimwiki_word1.'\>/' - " A [[bracketed wiki word]] - execute 'syntax match wikiWord /'.g:vimwiki_word2.'/' -endif +let s:wiki_badsymbols = '[<>|?*/\:"]' -let g:vimwiki_rxWeblink = '\%("[^"(]\+\((\([^)]\+\))\)\?":\)\?'. - \'\%(https\?\|ftp\|gopher\|telnet\|file\|notes\|ms-help\):'. - \'\%(\%(\%(//\)\|\%(\\\\\)\)\+[A-Za-z0-9:#@%/;$~()_?+=.&\\\-]*\)' -execute 'syntax match wikiLink `'.g:vimwiki_rxWeblink.'`' +" MISC helper functions {{{ +function! s:msg(message) "{{{ + echohl WarningMsg + echomsg 'vimwiki: '.a:message + echohl None +endfunction +" }}} +function! s:get_file_name_only(filename) "{{{ + let word = substitute(a:filename, '\'.VimwikiGet('ext'), "", "g") + let word = substitute(word, '.*[/\\]', "", "g") + return word +endfunction +" }}} +function! s:edit_file(command, filename) "{{{ + let fname = escape(a:filename, '% ') + execute a:command.' '.fname +endfunction +" }}} +function! s:search_word(wikiRx, cmd) "{{{ + let match_line = search(a:wikiRx, 's'.a:cmd) + if match_line == 0 + call s:msg('WikiWord not found') + endif +endfunction +" }}} +function! s:get_word_at_cursor(wikiRX) "{{{ + let col = col('.') - 1 + let line = getline('.') + let ebeg = -1 + let cont = match(line, a:wikiRX, 0) + while (ebeg >= 0 || (0 <= cont) && (cont <= col)) + let contn = matchend(line, a:wikiRX, cont) + if (cont <= col) && (col < contn) + let ebeg = match(line, a:wikiRX, cont) + let elen = contn - ebeg + break + else + let cont = match(line, a:wikiRX, contn) + endif + endwh + if ebeg >= 0 + return strpart(line, ebeg, elen) + else + return "" + endif +endf "}}} +function! s:strip_word(word, sym) "{{{ + function! s:strip_word_helper(word, sym) + return substitute(a:word, s:wiki_badsymbols, a:sym, 'g') + endfunction -" Emoticons: must come after the Textilisms, as later rules take precedence -" over earlier ones. This match is an approximation for the ~70 distinct -syntax match wikiEmoticons /\%((.)\|:[()|$@]\|:-[DOPS()\]|$@]\|;)\|:'(\)/ + let result = a:word + if strpart(a:word, 0, 2) == "[[" + " get rid of [[ and ]] + let w = strpart(a:word, 2, strlen(a:word)-4) + " we want "link" from [[link|link desc]] + let w = split(w, "|")[0] + let result = s:strip_word_helper(w, a:sym) + endif + return result +endfunction +" }}} +function! s:is_link_to_non_wiki_file(word) "{{{ + " Check if word is link to a non-wiki file. + " The easiest way is to check if it has extension like .txt or .html + if a:word =~ '\.\w\{1,4}$' + return 1 + endif + return 0 +endfunction +" }}} +function! s:print_wiki_list() "{{{ + let idx = 0 + while idx < len(g:vimwiki_list) + if idx == g:vimwiki_current_idx + let sep = ' * ' + echohl TablineSel + else + let sep = ' ' + echohl None + endif + echo (idx + 1).sep.VimwikiGet('path', idx) + let idx += 1 + endwhile + echohl None +endfunction +" }}} +function! s:wiki_select(wnum)"{{{ + if a:wnum < 1 || a:wnum > len(g:vimwiki_list) + return + endif + let b:vimwiki_idx = g:vimwiki_current_idx + let g:vimwiki_current_idx = a:wnum - 1 +endfunction +" }}} +function! vimwiki#mkdir(path) "{{{ + " TODO: add exception handling... + let path = expand(a:path) + if !isdirectory(path) && exists("*mkdir") + if path[-1:] == '/' || path[-1:] == '\' + let path = path[:-2] + endif + call mkdir(path, "p") + endif +endfunction +" }}} +function! s:update_wiki_link(fname, old, new) " {{{ + echo "Updating links in ".a:fname + let has_updates = 0 + let dest = [] + for line in readfile(a:fname) + if !has_updates && match(line, a:old) != -1 + let has_updates = 1 + endif + call add(dest, substitute(line, a:old, escape(a:new, "&"), "g")) + endfor + " add exception handling... + if has_updates + call rename(a:fname, a:fname.'#vimwiki_upd#') + call writefile(dest, a:fname) + call delete(a:fname.'#vimwiki_upd#') + endif +endfunction +" }}} +function! s:update_wiki_links(old, new) " {{{ + let files = split(glob(VimwikiGet('path').'*'.VimwikiGet('ext')), '\n') + for fname in files + call s:update_wiki_link(fname, a:old, a:new) + endfor +endfunction +" }}} +function! s:get_wiki_buffers() "{{{ + let blist = [] + let bcount = 1 + while bcount<=bufnr("$") + if bufexists(bcount) + let bname = fnamemodify(bufname(bcount), ":p") + if bname =~ VimwikiGet('ext')."$" + let bitem = [bname, getbufvar(bname, "vimwiki_prev_word")] + call add(blist, bitem) + endif + endif + let bcount = bcount + 1 + endwhile + return blist +endfunction +" }}} +function! s:open_wiki_buffer(item) "{{{ + call s:edit_file('e', a:item[0]) + if !empty(a:item[1]) + call setbufvar(a:item[0], "vimwiki_prev_word", a:item[1]) + endif +endfunction +" }}} +" }}} +" SYNTAX highlight {{{ +function! vimwiki#WikiHighlightWords() "{{{ + let wikies = glob(VimwikiGet('path').'*'.VimwikiGet('ext')) + "" remove .wiki extensions + let wikies = substitute(wikies, '\'.VimwikiGet('ext'), "", "g") + let g:vimwiki_wikiwords = split(wikies, '\n') + "" remove paths + call map(g:vimwiki_wikiwords, 'substitute(v:val, ''.*[/\\]'', "", "g")') + "" remove backup files (.wiki~) + call filter(g:vimwiki_wikiwords, 'v:val !~ ''.*\~$''') -let g:vimwiki_rxTodo = '\C\%(TODO:\|DONE:\|FIXME:\|FIXED:\|XXX:\)' -execute 'syntax match wikiTodo /'. g:vimwiki_rxTodo .'/' + for word in g:vimwiki_wikiwords + if word =~ g:vimwiki_word1 && !s:is_link_to_non_wiki_file(word) + execute 'syntax match wikiWord /\%(^\|[^!]\)\zs\<'.word.'\>/' + endif + execute 'syntax match wikiWord /\[\[\<'. + \ substitute(word, g:vimwiki_stripsym, s:wiki_badsymbols, "g"). + \ '\>\%(|\+.*\)*\]\]/' + endfor + execute 'syntax match wikiWord /\[\[.\+\.\%(jpg\|png\|gif\)\%(|\+.*\)*\]\]/' +endfunction +" }}} +function! vimwiki#hl_exists(hl)"{{{ + if !hlexists(a:hl) + return 0 + endif + redir => hlstatus + exe "silent hi" a:hl + redir END + return (hlstatus !~ "cleared") +endfunction +"}}} -" Load concrete Wiki syntax -execute 'runtime! syntax/vimwiki_'.VimwikiGet('syntax').'.vim' +"}}} +" WIKI functions {{{ +function! vimwiki#WikiNextWord() "{{{ + call s:search_word(g:vimwiki_rxWikiWord, '') +endfunction +" }}} +function! vimwiki#WikiPrevWord() "{{{ + call s:search_word(g:vimwiki_rxWikiWord, 'b') +endfunction +" }}} +function! vimwiki#WikiFollowWord(split) "{{{ + if a:split == "split" + let cmd = ":split " + elseif a:split == "vsplit" + let cmd = ":vsplit " + else + let cmd = ":e " + endif + let word = s:strip_word(s:get_word_at_cursor(g:vimwiki_rxWikiWord), + \ g:vimwiki_stripsym) + " insert doesn't work properly inside :if. Check :help :if. + if word == "" + execute "normal! \n" + return + endif + if s:is_link_to_non_wiki_file(word) + call s:edit_file(cmd, word) + else + let vimwiki_prev_word = [expand('%:p'), getpos('.')] + call s:edit_file(cmd, VimwikiGet('path').word.VimwikiGet('ext')) + let b:vimwiki_prev_word = vimwiki_prev_word + endif +endfunction +" }}} +function! vimwiki#WikiGoBackWord() "{{{ + if exists("b:vimwiki_prev_word") + " go back to saved WikiWord + let prev_word = b:vimwiki_prev_word + execute ":e ".substitute(prev_word[0], '\s', '\\\0', 'g') + call setpos('.', prev_word[1]) + endif +endfunction +" }}} +function! vimwiki#WikiGoHome(index) "{{{ + call s:wiki_select(a:index) + call vimwiki#mkdir(VimwikiGet('path')) -" Tables -execute 'syntax match wikiTable /'.g:vimwiki_rxTable.'/' + try + execute ':e '.VimwikiGet('path').VimwikiGet('index').VimwikiGet('ext') + catch /E37/ " catch 'No write since last change' error + " this is really unsecure!!! + execute ':'.VimwikiGet('gohome').' '. + \ VimwikiGet('path'). + \ VimwikiGet('index'). + \ VimwikiGet('ext') + catch /E325/ " catch 'ATTENTION' error + " TODO: Hmmm, if open already opened index.wiki there is an error... + " Find out what is the reason and how to avoid it. Is it dangerous? + echomsg "Unknown error!" + endtry +endfunction +"}}} +function! vimwiki#WikiDeleteWord() "{{{ + "" file system funcs + "" Delete WikiWord you are in from filesystem + let val = input('Delete ['.expand('%').'] (y/n)? ', "") + if val != 'y' + return + endif + let fname = expand('%:p') + try + call delete(fname) + catch /.*/ + call s:msg('Cannot delete "'.expand('%:t:r').'"!') + return + endtry + execute "bdelete! ".escape(fname, " ") -execute 'syntax match wikiBold /'.g:vimwiki_rxBold.'/' + " reread buffer => deleted WikiWord should appear as non-existent + if expand('%:p') != "" + execute "e" + endif +endfunction +"}}} +function! vimwiki#WikiRenameWord() "{{{ + "" Rename WikiWord, update all links to renamed WikiWord + let wwtorename = expand('%:t:r') + let isOldWordComplex = 0 + if wwtorename !~ g:vimwiki_word1 + let wwtorename = substitute(wwtorename, g:vimwiki_stripsym, + \ s:wiki_badsymbols, "g") + let isOldWordComplex = 1 + endif -execute 'syntax match wikiItalic /'.g:vimwiki_rxItalic.'/' + " there is no file (new one maybe) + if glob(expand('%:p')) == '' + call s:msg('Cannot rename "'.expand('%:p'). + \ '". It does not exist! (New file? Save it before renaming.)') + return + endif -execute 'syntax match wikiBoldItalic /'.g:vimwiki_rxBoldItalic.'/' + let val = input('Rename "'.expand('%:t:r').'" (y/n)? ', "") + if val!='y' + return + endif + let newWord = input('Enter new name: ', "") + " check newWord - it should be 'good', not empty + if substitute(newWord, '\s', '', 'g') == '' + call s:msg('Cannot rename to an empty filename!') + return + endif + if s:is_link_to_non_wiki_file(newWord) + call s:msg('Cannot rename to a filename with extension (ie .txt .html)!') + return + endif -execute 'syntax match wikiItalicBold /'.g:vimwiki_rxItalicBold.'/' + if newWord !~ g:vimwiki_word1 + " if newWord is 'complex wiki word' then add [[]] + let newWord = '[['.newWord.']]' + endif + let newFileName = s:strip_word(newWord, g:vimwiki_stripsym).VimwikiGet('ext') -execute 'syntax match wikiDelText /'.g:vimwiki_rxDelText.'/' + " do not rename if word with such name exists + let fname = glob(VimwikiGet('path').newFileName) + if fname != '' + call s:msg('Cannot rename to "'.newFileName. + \ '". File with that name exist!') + return + endif + " rename WikiWord file + try + echomsg "Renaming ".expand('%:t:r')." to ".newFileName + let res = rename(expand('%:p'), expand(VimwikiGet('path').newFileName)) + if res != 0 + throw "Cannot rename!" + end + catch /.*/ + call s:msg('Cannot rename "'.expand('%:t:r').'" to "'.newFileName.'"') + return + endtry -execute 'syntax match wikiSuperScript /'.g:vimwiki_rxSuperScript.'/' + let &buftype="nofile" -execute 'syntax match wikiSubScript /'.g:vimwiki_rxSubScript.'/' + let cur_buffer = [expand('%:p'), + \getbufvar(expand('%:p'), "vimwiki_prev_word")] -execute 'syntax match wikiCode /'.g:vimwiki_rxCode.'/' + let blist = s:get_wiki_buffers() -" Aggregate all the regular text highlighting into wikiText -" syntax cluster wikiText contains=wikiItalic,wikiBold,wikiCode, - " \wikiDelText,wikiSuperScript,wikiSubScript,wikiWord,wikiEmoticons + " save wiki buffers + for bitem in blist + execute ':b '.escape(bitem[0], ' ') + execute ':update' + endfor -"
horizontal rule -execute 'syntax match wikiHR /'.g:vimwiki_rxHR.'/' + execute ':b '.escape(cur_buffer[0], ' ') -" List items -execute 'syntax match wikiList /'.g:vimwiki_rxListBullet.'/' -execute 'syntax match wikiList /'.g:vimwiki_rxListNumber.'/' -execute 'syntax match wikiList /'.g:vimwiki_rxListDefine.'/' + " remove wiki buffers + for bitem in blist + execute 'bwipeout '.escape(bitem[0], ' ') + endfor -" Treat all other lines that start with spaces as PRE-formatted text. -execute 'syntax match wikiPre /'.g:vimwiki_rxPre1.'/ contains=wikiComment' + let setting_more = &more + setlocal nomore -execute 'syntax region wikiPre start=/'.g:vimwiki_rxPreStart. - \ '/ end=/'.g:vimwiki_rxPreEnd.'/ contains=wikiComment' + " update links + if isOldWordComplex + call s:update_wiki_links('\[\['.wwtorename.'\]\]', newWord) + else + call s:update_wiki_links('\<'.wwtorename.'\>', newWord) + endif -" List item checkbox -syntax match wikiCheckBox /\[.\?\]/ -execute 'syntax match wikiCheckBoxDone /'.g:vimwiki_rxListBullet.'\s*\[x\].*$/' -execute 'syntax match wikiCheckBoxDone /'.g:vimwiki_rxListNumber.'\s*\[x\].*$/' + " restore wiki buffers + for bitem in blist + if bitem[0] != cur_buffer[0] + call s:open_wiki_buffer(bitem) + endif + endfor -syntax region wikiComment start='' + call s:open_wiki_buffer([VimwikiGet('path').newFileName, cur_buffer[1]]) + " execute 'bwipeout '.escape(cur_buffer[0], ' ') -if !vimwiki#hl_exists("wikiHeader1") - execute 'syntax match wikiHeader /'.g:vimwiki_rxHeader.'/' -else - " Header levels, 1-6 - execute 'syntax match wikiHeader1 /'.g:vimwiki_rxH1.'/' - execute 'syntax match wikiHeader2 /'.g:vimwiki_rxH2.'/' - execute 'syntax match wikiHeader3 /'.g:vimwiki_rxH3.'/' - execute 'syntax match wikiHeader4 /'.g:vimwiki_rxH4.'/' - execute 'syntax match wikiHeader5 /'.g:vimwiki_rxH5.'/' - execute 'syntax match wikiHeader6 /'.g:vimwiki_rxH6.'/' -endif + echomsg wwtorename." is renamed to ".newWord -if !vimwiki#hl_exists("wikiHeader1") - hi def link wikiHeader Title -else - hi def link wikiHeader1 Title - hi def link wikiHeader2 Title - hi def link wikiHeader3 Title - hi def link wikiHeader4 Title - hi def link wikiHeader5 Title - hi def link wikiHeader6 Title -endif + let &more = setting_more +endfunction +" }}} +function! vimwiki#WikiUISelect()"{{{ + call s:print_wiki_list() + let idx = input("Select Wiki (specify number): ") + if idx == "" + return + endif + call vimwiki#WikiGoHome(idx) +endfunction +"}}} +" }}} +" TEXT OBJECTS functions {{{ -hi def wikiBold term=bold cterm=bold gui=bold -hi def wikiItalic term=italic cterm=italic gui=italic -hi def wikiBoldItalic term=bold cterm=bold gui=bold,italic -hi def link wikiItalicBold wikiBoldItalic +function! vimwiki#TO_header(inner) "{{{ + if !search('^\(=\+\)[^=]\+\1\s*$', 'bcW') + return + endif + let level = vimwiki#count_first_sym(getline(line('.'))) + normal V + if search('^\(=\{1,'.level.'}\)[^=]\+\1\s*$', 'W') + call cursor(line('.') - 1, 0) + else + call cursor(line('$'), 0) + endif + if a:inner && getline(line('.')) =~ '^\s*$' + let lnum = prevnonblank(line('.') - 1) + call cursor(lnum, 0) + endif +endfunction +"}}} +function! vimwiki#count_first_sym(line) "{{{ + let idx = 0 + while a:line[idx] == a:line[0] && idx < len(a:line) + let idx += 1 + endwhile + return idx +endfunction "}}} -hi def link wikiCode PreProc -hi def link wikiWord Underlined -hi def link wikiNoExistsWord Error +function! vimwiki#AddHeaderLevel() "{{{ + let lnum = line('.') + let line = getline(lnum) -hi def link wikiPre PreProc -hi def link wikiLink Underlined -hi def link wikiList Operator -hi def link wikiCheckBox wikiList -hi def link wikiCheckBoxDone Comment -hi def link wikiTable PreProc -hi def link wikiEmoticons Constant -hi def link wikiDelText Constant -hi def link wikiInsText Constant -hi def link wikiSuperScript Constant -hi def link wikiSubScript Constant -hi def link wikiTodo Todo -hi def link wikiComment Comment + if line =~ '^\s*$' + return + endif -let b:current_syntax="vimwiki" -syntax\vimwiki_default.vim [[[1 -80 -" Vimwiki syntax file -" Default syntax -" Author: Maxim Kim -" Home: http://code.google.com/p/vimwiki/ -" vim:tw=78: + if line !~ '^\(=\+\).\+\1\s*$' + let line = substitute(line, '^\s*', ' ', '') + let line = substitute(line, '\s*$', ' ', '') + endif + let level = vimwiki#count_first_sym(line) + if level < 6 + call setline(lnum, '='.line.'=') + endif +endfunction +"}}} +function! vimwiki#RemoveHeaderLevel() "{{{ + let lnum = line('.') + let line = getline(lnum) -" text: *strong* -" let g:vimwiki_rxBold = '\*[^*]\+\*' -let g:vimwiki_rxBold = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'\*'. - \'\([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`]\)'. - \'\*'. - \'\%([[:punct:]]\|\s\|$\)\@=' + if line =~ '^\s*$' + return + endif -" text: _emphasis_ -" let g:vimwiki_rxItalic = '_[^_]\+_' -let g:vimwiki_rxItalic = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'_'. - \'\([^_`[:space:]][^_`]*[^_`[:space:]]\|[^_`]\)'. - \'_'. - \'\%([[:punct:]]\|\s\|$\)\@=' + if line =~ '^\(=\+\).\+\1\s*$' + let line = strpart(line, 1, len(line) - 2) + if line =~ '^\s' + let line = strpart(line, 1, len(line)) + endif + if line =~ '\s$' + let line = strpart(line, 0, len(line) - 1) + endif + call setline(lnum, line) + endif +endfunction +" }}} -" text: *_bold italic_* or _*italic bold*_ -let g:vimwiki_rxBoldItalic = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'\*_'. - \'\([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`]\)'. - \'_\*'. - \'\%([[:punct:]]\|\s\|$\)\@=' - -let g:vimwiki_rxItalicBold = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'_\*'. - \'\([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`]\)'. - \'\*_'. - \'\%([[:punct:]]\|\s\|$\)\@=' - -" text: `code` -let g:vimwiki_rxCode = '`[^`]\+`' - -" text: ~~deleted text~~ -let g:vimwiki_rxDelText = '\~\~[^~`]\+\~\~' - -" text: ^superscript^ -let g:vimwiki_rxSuperScript = '\^[^^`]\+\^' - -" text: ,,subscript,, -let g:vimwiki_rxSubScript = ',,[^,`]\+,,' - -" Header levels, 1-6 -let g:vimwiki_rxH1 = '^\s*=\{1}[^=]\+.*[^=]\+=\{1}\s*$' -let g:vimwiki_rxH2 = '^\s*=\{2}[^=]\+.*[^=]\+=\{2}\s*$' -let g:vimwiki_rxH3 = '^\s*=\{3}[^=]\+.*[^=]\+=\{3}\s*$' -let g:vimwiki_rxH4 = '^\s*=\{4}[^=]\+.*[^=]\+=\{4}\s*$' -let g:vimwiki_rxH5 = '^\s*=\{5}[^=]\+.*[^=]\+=\{5}\s*$' -let g:vimwiki_rxH6 = '^\s*=\{6}[^=]\+.*[^=]\+=\{6}\s*$' -let g:vimwiki_rxHeader = '\%('.g:vimwiki_rxH1.'\)\|'. - \ '\%('.g:vimwiki_rxH2.'\)\|'. - \ '\%('.g:vimwiki_rxH3.'\)\|'. - \ '\%('.g:vimwiki_rxH4.'\)\|'. - \ '\%('.g:vimwiki_rxH5.'\)\|'. - \ '\%('.g:vimwiki_rxH6.'\)' - -"
, horizontal rule -let g:vimwiki_rxHR = '^----.*$' - -" Tables. Each line starts and ends with '||'; each cell is separated by '||' -let g:vimwiki_rxTable = '||' - -" List items start with whitespace(s) then '*' or '#' -let g:vimwiki_rxListBullet = '^\s\+\*' -let g:vimwiki_rxListNumber = '^\s\+#' - -let g:vimwiki_rxListDefine = '::\(\s\|$\)' - - -" Treat all other lines that start with spaces as PRE-formatted text. -let g:vimwiki_rxPre1 = '^\s\+[^[:blank:]*#].*$' - -" Preformatted text -let g:vimwiki_rxPreStart = '{{{' -let g:vimwiki_rxPreEnd = '}}}' -syntax\vimwiki_media.vim [[[1 -61 -" Vimwiki syntax file -" MediaWiki syntax -" Author: Maxim Kim -" Home: http://code.google.com/p/vimwiki/ -" vim:tw=78: - -" text: '''strong''' -let g:vimwiki_rxBold = "'''[^']\\+'''" - -" text: ''emphasis'' -let g:vimwiki_rxItalic = "''[^']\\+''" - -" text: '''''strong italic''''' -let g:vimwiki_rxBoldItalic = "'''''[^']\\+'''''" -let g:vimwiki_rxItalicBold = g:vimwiki_rxBoldItalic - -" text: `code` -let g:vimwiki_rxCode = '`[^`]\+`' - -" text: ~~deleted text~~ -let g:vimwiki_rxDelText = '\~\~[^~]\+\~\~' - -" text: ^superscript^ -let g:vimwiki_rxSuperScript = '\^[^^]\+\^' - -" text: ,,subscript,, -let g:vimwiki_rxSubScript = ',,[^,]\+,,' - -" Header levels, 1-6 -let g:vimwiki_rxH1 = '^\s*=\{1}[^=]\+.*[^=]\+=\{1}\s*$' -let g:vimwiki_rxH2 = '^\s*=\{2}[^=]\+.*[^=]\+=\{2}\s*$' -let g:vimwiki_rxH3 = '^\s*=\{3}[^=]\+.*[^=]\+=\{3}\s*$' -let g:vimwiki_rxH4 = '^\s*=\{4}[^=]\+.*[^=]\+=\{4}\s*$' -let g:vimwiki_rxH5 = '^\s*=\{5}[^=]\+.*[^=]\+=\{5}\s*$' -let g:vimwiki_rxH6 = '^\s*=\{6}[^=]\+.*[^=]\+=\{6}\s*$' -let g:vimwiki_rxHeader = '\%('.g:vimwiki_rxH1.'\)\|'. - \ '\%('.g:vimwiki_rxH2.'\)\|'. - \ '\%('.g:vimwiki_rxH3.'\)\|'. - \ '\%('.g:vimwiki_rxH4.'\)\|'. - \ '\%('.g:vimwiki_rxH5.'\)\|'. - \ '\%('.g:vimwiki_rxH6.'\)' - -"
, horizontal rule -let g:vimwiki_rxHR = '^----.*$' - -" Tables. Each line starts and ends with '||'; each cell is separated by '||' -let g:vimwiki_rxTable = '||' - -" Bulleted list items start with whitespace(s), then '*' -" highlight only bullets and digits. -let g:vimwiki_rxListBullet = '^\s*\*\+\([^*]*$\)\@=' -let g:vimwiki_rxListNumber = '^\s*#\+' - -let g:vimwiki_rxListDefine = '^\%(;\|:\)\s' - -" Treat all other lines that start with spaces as PRE-formatted text. -let g:vimwiki_rxPre1 = '^\s\+[^[:blank:]*#].*$' - -" Preformatted text -let g:vimwiki_rxPreStart = '
'
-let g:vimwiki_rxPreEnd = '<\/pre>'
+" }}}
 autoload\vimwiki_html.vim	[[[1
 894
 " Vimwiki autoload plugin file
@@ -2254,470 +1361,6 @@ function! vimwiki_html#WikiAll2HTML(path) "{{{
 
   let &more = setting_more
 endfunction "}}}
-autoload\vimwiki.vim	[[[1
-462
-" Vimwiki autoload plugin file
-" Author: Maxim Kim 
-" Home: http://code.google.com/p/vimwiki/
-
-if exists("g:loaded_vimwiki_auto") || &cp
-  finish
-endif
-let g:loaded_vimwiki_auto = 1
-
-let s:wiki_badsymbols = '[<>|?*/\:"]'
-
-" MISC helper functions {{{
-function! s:msg(message) "{{{
-  echohl WarningMsg
-  echomsg 'vimwiki: '.a:message
-  echohl None
-endfunction
-" }}}
-function! s:get_file_name_only(filename) "{{{
-  let word = substitute(a:filename, '\'.VimwikiGet('ext'), "", "g")
-  let word = substitute(word, '.*[/\\]', "", "g")
-  return word
-endfunction
-" }}}
-function! s:edit_file(command, filename) "{{{
-  let fname = escape(a:filename, '% ')
-  execute a:command.' '.fname
-endfunction
-" }}}
-function! s:search_word(wikiRx, cmd) "{{{
-  let match_line = search(a:wikiRx, 's'.a:cmd)
-  if match_line == 0
-    call s:msg('WikiWord not found')
-  endif
-endfunction
-" }}}
-function! s:get_word_at_cursor(wikiRX) "{{{
-  let col = col('.') - 1
-  let line = getline('.')
-  let ebeg = -1
-  let cont = match(line, a:wikiRX, 0)
-  while (ebeg >= 0 || (0 <= cont) && (cont <= col))
-    let contn = matchend(line, a:wikiRX, cont)
-    if (cont <= col) && (col < contn)
-      let ebeg = match(line, a:wikiRX, cont)
-      let elen = contn - ebeg
-      break
-    else
-      let cont = match(line, a:wikiRX, contn)
-    endif
-  endwh
-  if ebeg >= 0
-    return strpart(line, ebeg, elen)
-  else
-    return ""
-  endif
-endf "}}}
-function! s:strip_word(word, sym) "{{{
-  function! s:strip_word_helper(word, sym)
-    return substitute(a:word, s:wiki_badsymbols, a:sym, 'g')
-  endfunction
-
-  let result = a:word
-  if strpart(a:word, 0, 2) == "[["
-    " get rid of [[ and ]]
-    let w = strpart(a:word, 2, strlen(a:word)-4)
-    " we want "link" from [[link|link desc]]
-    let w = split(w, "|")[0]
-    let result = s:strip_word_helper(w, a:sym)
-  endif
-  return result
-endfunction
-" }}}
-function! s:is_link_to_non_wiki_file(word) "{{{
-  " Check if word is link to a non-wiki file.
-  " The easiest way is to check if it has extension like .txt or .html
-  if a:word =~ '\.\w\{1,4}$'
-    return 1
-  endif
-  return 0
-endfunction
-" }}}
-function! s:print_wiki_list() "{{{
-  let idx = 0
-  while idx < len(g:vimwiki_list)
-    if idx == g:vimwiki_current_idx
-      let sep = ' * '
-      echohl TablineSel
-    else
-      let sep = '   '
-      echohl None
-    endif
-    echo (idx + 1).sep.VimwikiGet('path', idx)
-    let idx += 1
-  endwhile
-  echohl None
-endfunction
-" }}}
-function! s:wiki_select(wnum)"{{{
-  if a:wnum < 1 || a:wnum > len(g:vimwiki_list)
-    return
-  endif
-  let b:vimwiki_idx = g:vimwiki_current_idx
-  let g:vimwiki_current_idx = a:wnum - 1
-endfunction
-" }}}
-function! vimwiki#mkdir(path) "{{{
-  " TODO: add exception handling...
-  let path = expand(a:path)
-  if !isdirectory(path) && exists("*mkdir")
-    if path[-1:] == '/' || path[-1:] == '\'
-      let path = path[:-2]
-    endif
-    call mkdir(path, "p")
-  endif
-endfunction
-" }}}
-function! s:update_wiki_link(fname, old, new) " {{{
-  echo "Updating links in ".a:fname
-  let has_updates = 0
-  let dest = []
-  for line in readfile(a:fname)
-    if !has_updates && match(line, a:old) != -1
-      let has_updates = 1
-    endif
-    call add(dest, substitute(line, a:old, escape(a:new, "&"), "g"))
-  endfor
-  " add exception handling...
-  if has_updates
-    call rename(a:fname, a:fname.'#vimwiki_upd#')
-    call writefile(dest, a:fname)
-    call delete(a:fname.'#vimwiki_upd#')
-  endif
-endfunction
-" }}}
-function! s:update_wiki_links(old, new) " {{{
-  let files = split(glob(VimwikiGet('path').'*'.VimwikiGet('ext')), '\n')
-  for fname in files
-    call s:update_wiki_link(fname, a:old, a:new)
-  endfor
-endfunction
-" }}}
-function! s:get_wiki_buffers() "{{{
-  let blist = []
-  let bcount = 1
-  while bcount<=bufnr("$")
-    if bufexists(bcount)
-      let bname = fnamemodify(bufname(bcount), ":p")
-      if bname =~ VimwikiGet('ext')."$"
-        let bitem = [bname, getbufvar(bname, "vimwiki_prev_word")]
-        call add(blist, bitem)
-      endif
-    endif
-    let bcount = bcount + 1
-  endwhile
-  return blist
-endfunction
-" }}}
-function! s:open_wiki_buffer(item) "{{{
-  call s:edit_file('e', a:item[0])
-  if !empty(a:item[1])
-    call setbufvar(a:item[0], "vimwiki_prev_word", a:item[1])
-  endif
-endfunction
-" }}}
-" }}}
-" SYNTAX highlight {{{
-function! vimwiki#WikiHighlightWords() "{{{
-  let wikies = glob(VimwikiGet('path').'*'.VimwikiGet('ext'))
-  "" remove .wiki extensions
-  let wikies = substitute(wikies, '\'.VimwikiGet('ext'), "", "g")
-  let g:vimwiki_wikiwords = split(wikies, '\n')
-  "" remove paths
-  call map(g:vimwiki_wikiwords, 'substitute(v:val, ''.*[/\\]'', "", "g")')
-  "" remove backup files (.wiki~)
-  call filter(g:vimwiki_wikiwords, 'v:val !~ ''.*\~$''')
-
-  for word in g:vimwiki_wikiwords
-    if word =~ g:vimwiki_word1 && !s:is_link_to_non_wiki_file(word)
-      execute 'syntax match wikiWord /\%(^\|[^!]\)\zs\<'.word.'\>/'
-    endif
-    execute 'syntax match wikiWord /\[\[\<'.
-          \ substitute(word, g:vimwiki_stripsym, s:wiki_badsymbols, "g").
-          \ '\>\%(|\+.*\)*\]\]/'
-  endfor
-  execute 'syntax match wikiWord /\[\[.\+\.\%(jpg\|png\|gif\)\%(|\+.*\)*\]\]/'
-endfunction
-" }}}
-function! vimwiki#hl_exists(hl)"{{{
-  if !hlexists(a:hl)
-    return 0
-  endif
-  redir => hlstatus
-  exe "silent hi" a:hl
-  redir END
-  return (hlstatus !~ "cleared")
-endfunction
-"}}}
-
-"}}}
-" WIKI functions {{{
-function! vimwiki#WikiNextWord() "{{{
-  call s:search_word(g:vimwiki_rxWikiWord, '')
-endfunction
-" }}}
-function! vimwiki#WikiPrevWord() "{{{
-  call s:search_word(g:vimwiki_rxWikiWord, 'b')
-endfunction
-" }}}
-function! vimwiki#WikiFollowWord(split) "{{{
-  if a:split == "split"
-    let cmd = ":split "
-  elseif a:split == "vsplit"
-    let cmd = ":vsplit "
-  else
-    let cmd = ":e "
-  endif
-  let word = s:strip_word(s:get_word_at_cursor(g:vimwiki_rxWikiWord),
-        \                                      g:vimwiki_stripsym)
-  " insert doesn't work properly inside :if. Check :help :if.
-  if word == ""
-    execute "normal! \n"
-    return
-  endif
-  if s:is_link_to_non_wiki_file(word)
-    call s:edit_file(cmd, word)
-  else
-    let vimwiki_prev_word = [expand('%:p'), getpos('.')]
-    call s:edit_file(cmd, VimwikiGet('path').word.VimwikiGet('ext'))
-    let b:vimwiki_prev_word = vimwiki_prev_word
-  endif
-endfunction
-" }}}
-function! vimwiki#WikiGoBackWord() "{{{
-  if exists("b:vimwiki_prev_word")
-    " go back to saved WikiWord
-    let prev_word = b:vimwiki_prev_word
-    execute ":e ".substitute(prev_word[0], '\s', '\\\0', 'g')
-    call setpos('.', prev_word[1])
-  endif
-endfunction
-" }}}
-function! vimwiki#WikiGoHome(index) "{{{
-  call s:wiki_select(a:index)
-  call vimwiki#mkdir(VimwikiGet('path'))
-
-  try
-    execute ':e '.VimwikiGet('path').VimwikiGet('index').VimwikiGet('ext')
-  catch /E37/ " catch 'No write since last change' error
-    " this is really unsecure!!!
-    execute ':'.VimwikiGet('gohome').' '.
-          \ VimwikiGet('path').
-          \ VimwikiGet('index').
-          \ VimwikiGet('ext')
-  catch /E325/ " catch 'ATTENTION' error
-    " TODO: Hmmm, if open already opened index.wiki there is an error...
-    " Find out what is the reason and how to avoid it. Is it dangerous?
-    echomsg "Unknown error!"
-  endtry
-endfunction
-"}}}
-function! vimwiki#WikiDeleteWord() "{{{
-  "" file system funcs
-  "" Delete WikiWord you are in from filesystem
-  let val = input('Delete ['.expand('%').'] (y/n)? ', "")
-  if val != 'y'
-    return
-  endif
-  let fname = expand('%:p')
-  try
-    call delete(fname)
-  catch /.*/
-    call s:msg('Cannot delete "'.expand('%:t:r').'"!')
-    return
-  endtry
-  execute "bdelete! ".escape(fname, " ")
-
-  " reread buffer => deleted WikiWord should appear as non-existent
-  if expand('%:p') != ""
-    execute "e"
-  endif
-endfunction
-"}}}
-function! vimwiki#WikiRenameWord() "{{{
-  "" Rename WikiWord, update all links to renamed WikiWord
-  let wwtorename = expand('%:t:r')
-  let isOldWordComplex = 0
-  if wwtorename !~ g:vimwiki_word1
-    let wwtorename = substitute(wwtorename, g:vimwiki_stripsym,
-          \ s:wiki_badsymbols, "g")
-    let isOldWordComplex = 1
-  endif
-
-  " there is no file (new one maybe)
-  if glob(expand('%:p')) == ''
-    call s:msg('Cannot rename "'.expand('%:p').
-          \ '". It does not exist! (New file? Save it before renaming.)')
-    return
-  endif
-
-  let val = input('Rename "'.expand('%:t:r').'" (y/n)? ', "")
-  if val!='y'
-    return
-  endif
-  let newWord = input('Enter new name: ', "")
-  " check newWord - it should be 'good', not empty
-  if substitute(newWord, '\s', '', 'g') == ''
-    call s:msg('Cannot rename to an empty filename!')
-    return
-  endif
-  if s:is_link_to_non_wiki_file(newWord)
-    call s:msg('Cannot rename to a filename with extension (ie .txt .html)!')
-    return
-  endif
-
-  if newWord !~ g:vimwiki_word1
-    " if newWord is 'complex wiki word' then add [[]]
-    let newWord = '[['.newWord.']]'
-  endif
-  let newFileName = s:strip_word(newWord, g:vimwiki_stripsym).VimwikiGet('ext')
-
-  " do not rename if word with such name exists
-  let fname = glob(VimwikiGet('path').newFileName)
-  if fname != ''
-    call s:msg('Cannot rename to "'.newFileName.
-          \ '". File with that name exist!')
-    return
-  endif
-  " rename WikiWord file
-  try
-    echomsg "Renaming ".expand('%:t:r')." to ".newFileName
-    let res = rename(expand('%:p'), expand(VimwikiGet('path').newFileName))
-    if res != 0
-      throw "Cannot rename!"
-    end
-  catch /.*/
-    call s:msg('Cannot rename "'.expand('%:t:r').'" to "'.newFileName.'"')
-    return
-  endtry
-
-  let &buftype="nofile"
-
-  let cur_buffer = [expand('%:p'),
-        \getbufvar(expand('%:p'), "vimwiki_prev_word")]
-
-  let blist = s:get_wiki_buffers()
-
-  " save wiki buffers
-  for bitem in blist
-    execute ':b '.escape(bitem[0], ' ')
-    execute ':update'
-  endfor
-
-  execute ':b '.escape(cur_buffer[0], ' ')
-
-  " remove wiki buffers
-  for bitem in blist
-    execute 'bwipeout '.escape(bitem[0], ' ')
-  endfor
-
-  let setting_more = &more
-  setlocal nomore
-
-  " update links
-  if isOldWordComplex
-    call s:update_wiki_links('\[\['.wwtorename.'\]\]', newWord)
-  else
-    call s:update_wiki_links('\<'.wwtorename.'\>', newWord)
-  endif
-
-  " restore wiki buffers
-  for bitem in blist
-    if bitem[0] != cur_buffer[0]
-      call s:open_wiki_buffer(bitem)
-    endif
-  endfor
-
-  call s:open_wiki_buffer([VimwikiGet('path').newFileName, cur_buffer[1]])
-  " execute 'bwipeout '.escape(cur_buffer[0], ' ')
-
-  echomsg wwtorename." is renamed to ".newWord
-
-  let &more = setting_more
-endfunction
-" }}}
-function! vimwiki#WikiUISelect()"{{{
-  call s:print_wiki_list()
-  let idx = input("Select Wiki (specify number): ")
-  if idx == ""
-    return
-  endif
-  call vimwiki#WikiGoHome(idx)
-endfunction
-"}}}
-" }}}
-" TEXT OBJECTS functions {{{
-
-function! vimwiki#TO_header(inner) "{{{
-  if !search('^\(=\+\)[^=]\+\1\s*$', 'bcW')
-    return
-  endif
-  let level = vimwiki#count_first_sym(getline(line('.')))
-  normal V
-  if search('^\(=\{1,'.level.'}\)[^=]\+\1\s*$', 'W')
-    call cursor(line('.') - 1, 0)
-  else
-    call cursor(line('$'), 0)
-  endif
-  if a:inner && getline(line('.')) =~ '^\s*$'
-    let lnum = prevnonblank(line('.') - 1)
-    call cursor(lnum, 0)
-  endif
-endfunction
-"}}}
-function! vimwiki#count_first_sym(line) "{{{
-  let idx = 0
-  while a:line[idx] == a:line[0] && idx < len(a:line)
-    let idx += 1
-  endwhile
-  return idx
-endfunction "}}}
-
-function! vimwiki#AddHeaderLevel() "{{{
-  let lnum = line('.')
-  let line = getline(lnum)
-
-  if line =~ '^\s*$'
-    return
-  endif
-
-  if line !~ '^\(=\+\).\+\1\s*$'
-    let line = substitute(line, '^\s*', ' ', '')
-    let line = substitute(line, '\s*$', ' ', '')
-  endif
-  let level = vimwiki#count_first_sym(line)
-  if level < 6
-    call setline(lnum, '='.line.'=')
-  endif
-endfunction
-"}}}
-function! vimwiki#RemoveHeaderLevel() "{{{
-  let lnum = line('.')
-  let line = getline(lnum)
-
-  if line =~ '^\s*$'
-    return
-  endif
-
-  if line =~ '^\(=\+\).\+\1\s*$'
-    let line = strpart(line, 1, len(line) - 2)
-    if line =~ '^\s'
-      let line = strpart(line, 1, len(line))
-    endif
-    if line =~ '\s$'
-      let line = strpart(line, 0, len(line) - 1)
-    endif
-    call setline(lnum, line)
-  endif
-endfunction
-" }}}
-
-" }}}
 autoload\vimwiki_lst.vim	[[[1
 187
 " Vimwiki autoload plugin file
@@ -2907,8 +1550,1107 @@ function! vimwiki_lst#ToggleListItem()"{{{
     let c_lnum = parent_lnum
   endwhile
 endfunction"}}}
+doc\vimwiki.txt	[[[1
+1097
+*vimwiki.txt*  A Personal Wiki for Vim
+
+     __  __  ______            __      __  ______   __  __   ______     ~
+    /\ \/\ \/\__  _\   /'\_/`\/\ \  __/\ \/\__  _\ /\ \/\ \ /\__  _\    ~
+    \ \ \ \ \/_/\ \/  /\      \ \ \/\ \ \ \/_/\ \/ \ \ \/'/'\/_/\ \/    ~
+     \ \ \ \ \ \ \ \  \ \ \__\ \ \ \ \ \ \ \ \ \ \  \ \ , <    \ \ \    ~
+      \ \ \_/ \ \_\ \__\ \ \_/\ \ \ \_/ \_\ \ \_\ \__\ \ \\`\   \_\ \__ ~
+       \ `\___/ /\_____\\ \_\\ \_\ `\___x___/ /\_____\\ \_\ \_\ /\_____\~
+        `\/__/  \/_____/ \/_/ \/_/'\/__//__/  \/_____/ \/_/\/_/ \/_____/~
+
+                               Version: 0.9.3 ~
+
+==============================================================================
+CONTENTS                                                    *vimwiki-contents*
+
+  1. Intro ...................................|vimwiki|
+  2. Prerequisites ...........................|vimwiki-prerequisites|
+  3. Mappings ................................|vimwiki-mappings|
+    3.1. Global mappings .....................|vimwiki-global-mappings|
+    3.2. Local mappings ......................|vimwiki-local-mappings|
+    3.3. Text objects ........................|vimwiki-text-objects|
+  4. Commands ................................|vimwiki-commands|
+    4.1. Global commands .....................|vimwiki-global-commands|
+    4.2. Local commands ......................|vimwiki-local-commands|
+  5. Wiki syntax .............................|vimwiki-syntax|
+    5.1. Typefaces ...........................|vimwiki-syntax-typefaces|
+    5.2. Links ...............................|vimwiki-syntax-links|
+    5.3. Headers .............................|vimwiki-syntax-headers|
+    5.4. Paragraphs...........................|vimwiki-syntax-paragraphs|
+    5.5. Lists ...............................|vimwiki-syntax-lists|
+    5.6. Tables ..............................|vimwiki-syntax-tables|
+    5.7. Preformatted text ...................|vimwiki-syntax-preformatted|
+    5.8. Comments ............................|vimwiki-syntax-comment|
+  6. Folding/Outline .........................|vimwiki-folding|
+  7. Todo lists...............................|vimwiki-todo-lists|
+  8. Options .................................|vimwiki-options|
+  9. Help ....................................|vimwiki-help|
+  10. Author .................................|vimwiki-author|
+  11. Changelog ..............................|vimwiki-changelog|
+  12. License ................................|vimwiki-license|
+
+
+==============================================================================
+1. Intro                                                             *vimwiki*
+
+Vimwiki is a personal wiki for Vim. Using it you can organize text files with
+hyperlinks. To do a quick start press ww (this is usually \ww) to go
+to your index wiki file. By default it is located in: >
+  ~/vimwiki/index.wiki
+You do not have to create it manually -- vimwiki can make it for you.
+
+Feed it with the following example:
+= My knowledge base =
+  * MyUrgentTasks -- things to be done _yesterday_!!!
+  * ProjectGutenberg -- good books are power.
+  * MusicILike, MusicIHate.
+
+Notice that ProjectGutenberg, MyUrgentTasks, MusicILike and MusicIHate
+highlighted as errors. These WikiWords (WikiWord or WikiPage -- capitalized
+word connected with other capitalized words) do not exist yet.
+
+Place cursor on ProjectGutenberg and press Enter. Now you are in
+ProjectGutenberg. Edit and save it, then press Backspace to return to previous
+WikiPage. You should see the difference in highlighting now.
+
+Now it is your turn...
+
+==============================================================================
+2. Prerequisites                                       *vimwiki-prerequisites*
+
+Make sure you have these settings in your vimrc file: >
+    set nocompatible
+    filetype plugin on
+    syntax on
+
+Without them Vimwiki will not work properly.
+
+
+==============================================================================
+3. Mappings                                                 *vimwiki-mappings*
+
+There are global and local mappings in vimwiki.
+
+------------------------------------------------------------------------------
+3.1. Global mappings                                 *vimwiki-global-mappings*
+
+ww or VimwikiGoHome
+        Open index file of the [count]'s wiki.
+        ww opens first wiki from |g:vimwiki_list|.
+        1ww as above opens first wiki from |g:vimwiki_list|.
+        2ww opens second wiki from |g:vimwiki_list|.
+        3ww opens third wiki from |g:vimwiki_list|.
+        etc.
+        To remap: >
+        :map w VimwikiGoHome
+<
+See also|:VimwikiGoHome|
+
+wt or VimwikiTabGoHome
+        Open index file of the [count]'s wiki in a new tab.
+        ww tabopens first wiki from |g:vimwiki_list|.
+        1ww as above tabopens first wiki from |g:vimwiki_list|.
+        2ww tabopens second wiki from |g:vimwiki_list|.
+        3ww tabopens third wiki from |g:vimwiki_list|.
+        etc.
+        To remap: >
+        :map t VimwikiTabGoHome
+<
+See also|:VimwikiTabGoHome|
+
+ws or VimwikiUISelect
+        List and select available wikies.
+        To remap: >
+        :map wq VimwikiUISelect
+<
+See also|:VimwikiUISelect|
+
+
+------------------------------------------------------------------------------
+3.2. Local mappings                                   *vimwiki-local-mappings*
+
+Normal mode (Keyboard):~
+                        *vimwiki_*
+                    Follow/Create WikiWord.
+                        Maps to|:VimwikiFollowWord|.
+                        To remap: >
+                        :map wf VimwikiFollowWord
+<
+                        *vimwiki_*
+                  Split and follow/create WikiWord
+                        Maps to|:VimwikiSplitWord|.
+                        To remap: >
+                        :map we VimwikiSplitWord
+<
+                        *vimwiki_*
+                  Vertical split and follow/create WikiWord
+                        Maps to|:VimwikiVSplitWord|.
+                        To remap: >
+                        :map wq VimwikiVSplitWord
+<
+                        *vimwiki_*
+             Go back to previous WikiWord
+                        Maps to|:VimwikiGoBackWord|.
+                        To remap: >
+                        :map wb VimwikiGoBackWord
+<
+                        *vimwiki_*
+                   Find next WikiWord
+                        Maps to|:VimwikiNextWord|.
+                        To remap: >
+                        :map wn VimwikiNextWord
+<
+                        *vimwiki_*
+                 Find previous WikiWord
+                        Maps to|:VimwikiPrevWord|.
+                        To remap: >
+                        :map wp VimwikiPrevWord
+<
+                        *vimwiki_wd*
+wd              Delete WikiWord you are in.
+                        Maps to|:VimwikiDeleteWord|.
+                        To remap: >
+                        :map dd VimwikiDeleteWord
+<
+                        *vimwiki_wr*
+wr              Rename WikiWord you are in.
+                        Maps to|:VimwikiRenameWord|.
+                        To remap: >
+                        :map rr VimwikiRenameWord
+<
+                        *vimwiki_*
+               Toggle list item on/off (checked/unchecked)
+                        Maps to|:VimwikiToggleListItem|.
+                        To remap: >
+                        :map tt VimwikiToggleListItem
+<                       See |vimwiki-todo-lists|.
+
+                        *vimwiki_=*
+=                       Add header level. Create if needed.
+                        There is nothing to indent with '==' command in
+                        vimwiki, so it should be ok to use '=' here.
+
+                        *vimwiki_-*
+-                       Remove header level.
+
+Normal mode (Mouse): ~
+Works only if |g:vimwiki_use_mouse| is set to 1.
+<2-LeftMouse>           Follow/Create WikiWord
+         Split and follow/create WikiWord
+         Vertical split and follow/create WikiWord
+ Go back to previous WikiWord
+
+Note: <2-LeftMouse> is just left double click.
+
+------------------------------------------------------------------------------
+3.3. Text objects                                       *vimwiki-text-objects*
+
+ah                      A Header with leading empty lines.
+ih                      Inner Header without leading empty lines.
+
+You can 'vah' to select a header with its contents or 'dah' to delete it or
+'yah' to yank it or 'cah' to change it. ;)
+
+
+==============================================================================
+4. Commands                                                 *vimwiki-commands*
+
+------------------------------------------------------------------------------
+4.1. Global Commands                                 *vimwiki-global-commands*
+
+*:VimwikiGoHome*
+    Open index file of the current wiki.
+
+*:VimwikiTabGoHome*
+    Open index file of the current wiki in a new tab.
+
+*:VimwikiUISelect*
+    Open index file of the selected wiki.
+
+------------------------------------------------------------------------------
+4.2. Local commands                                   *vimwiki-local-commands*
+
+*:VimwikiFollowWord*
+    Follow/create WikiWord.
+
+*:VimwikiGoBackWord*
+    Go back to previous WikiWord you come from.
+
+*:VimwikiSplitWord*
+    Split and follow/create WikiWord.
+
+*:VimwikiVSplitWord*
+    Vertical split and follow/create WikiWord.
+
+*:VimwikiNextWord*
+    Find next WikiWord.
+
+*:VimwikiPrevWord*
+    Find previous WikiWord.
+
+*:VimwikiDeleteWord*
+    Delete WikiWord you are in.
+
+*:VimwikiRenameWord*
+    Rename WikiWord you are in.
+
+*:Vimwiki2HTML*
+    Convert current WikiPage to HTML.
+
+*:VimwikiAll2HTML*
+    Convert all WikiPages to HTML.
+
+*:VimwikiToggleListItem*
+    Toggle list item on/off (checked/unchecked)
+    See |vimwiki-todo-lists|.
+
+
+
+==============================================================================
+5. Wiki syntax                                                *vimwiki-syntax*
+
+There are a lot of different wikies out there. Most of them have their own
+syntax and vimwiki is not an exception here. Default vimwiki's syntax is a
+subset of google's wiki syntax markup.
+
+As for MediaWiki's syntax -- it is not that convenient for non English
+(Russian in my case :)) keyboard layouts to emphasize text as it uses a lot
+of '''''' to do it. You have to switch layouts every time you want some bold
+non English text. This is the answer to "Why not MediaWiki?"
+
+Nevertheless, there is MediaWiki syntax file included in the distribution (it
+doesn't have all the fancy stuff original MediaWiki syntax has though).
+See |vimwiki-option-syntax|.
+
+
+------------------------------------------------------------------------------
+5.1. Typefaces                                      *vimwiki-syntax-typefaces*
+
+There are a few typefaces that gives you a bit of control on how your
+text should be decorated: >
+  *bold text*
+  _italic text_
+  ~~strikeout text~~
+  `code (no syntax) text`
+  super^script^
+  sub,,script,,
+
+------------------------------------------------------------------------------
+5.2. Links                                              *vimwiki-syntax-links*
+
+Internal links~
+WikiWords: >
+  CapitalizedWordsConnected
+
+You can limit linking of WikiWords by adding an exclamation mark in front of
+it: >
+  !CapitalizedWordsConnected
+
+Link with spaces in it: >
+  [[This is a link]]
+or: >
+  [[This is a link source|Description of the link]]
+
+
+External links~
+Plain link: >
+ http://code.google.com/p/vimwiki
+
+Link with description: >
+ [http://habamax.ru/blog habamax home page]
+
+
+Images and image links~
+Image link is the link with one of jpg, png or gif endings.
+Plain image link: >
+ http://someaddr.com/picture.jpg
+in html: >
+ 
+
+Link to a local image: >
+ [[images/pabloymoira.jpg]]
+in html: >
+ 
+Path to image (ie. images/pabloymoira.jpg) is relative to
+|vimwiki-option-path_html|.
+
+Double bracketed link to an image: >
+ [[http://habamax.ru/blog/wp-content/uploads/2009/01/2740254sm.jpg]]
+in html: >
+ 
+
+Double bracketed link to an image with description text: >
+ [[http://habamax.ru/blog/wp-content/uploads/2009/01/2740254sm.jpg|dance]]
+in html: >
+ dance
+
+Double bracketed link to an image with alternate text: >
+ [[http://habamax.ru/blog/wp-content/uploads/2009/01/2740254sm.jpg|dance|]]
+in html: >
+ dance
+
+Double bracketed link to an image with alternate text and some style: >
+ [[http://helloworld.com/blabla.jpg|cool stuff|width:150px; height: 120px;]]
+in html: >
+ cool stuff
+
+Double bracketed link to an image without alternate text and some style: >
+ [[http://helloworld.com/blabla.jpg||width:150px; height: 120px;]]
+in html: >
+ 
+
+Thumbnail link: >
+ [http://someaddr.com/bigpicture.jpg http://someaddr.com/thumbnail.jpg]
+or >
+ [[http://someaddr.com/bigpicture.jpg|http://someaddr.com/thumbnail.jpg]]
+in html: >
+ 
+  
+
+  Tyger! Tyger! burning bright
+   In the forests of the night,
+    What immortal hand or eye
+     Could frame thy fearful symmetry?
+  In what distant deeps or skies
+   Burnt the fire of thine eyes?
+    On what wings dare he aspire?
+     What the hand dare sieze the fire?
+  ...
+  ...
+
+Or use {{{ and }}} to define pre:
+{{{ >
+  Tyger! Tyger! burning bright
+   In the forests of the night,
+    What immortal hand or eye
+     Could frame thy fearful symmetry?
+  In what distant deeps or skies
+   Burnt the fire of thine eyes?
+    On what wings dare he aspire?
+     What the hand dare sieze the fire?
+}}}
+
+
+You can add optional information to {{{ tag: >
+{{{class="brush: python" >
+ def hello(world):
+     for x in range(10):
+         print("Hello {0} number {1}".format(world, x))
+}}}
+
+Result of HTML export: >
+ 
+ def hello(world):
+     for x in range(10):
+         print("Hello {0} number {1}".format(world, x))
+ 
+ +This might be useful for coloring some programming code with external js tools +like google syntax highlighter. + + +------------------------------------------------------------------------------ +5.8. Comments *vimwiki-syntax-comments* + +Text between is a comment. +Ex: > + +< + +============================================================================== +6. Folding/Outline *vimwiki-folding* + +Vimwiki can fold or outline headers and list items. + +Example: += My current task = + * [ ] Do stuff 1 + * [ ] Do substuff 1.1 + * [ ] Do substuff 1.2 + * [ ] Do substuff 1.2.1 + * [ ] Do substuff 1.2.2 + * [ ] Do substuff 1.3 + * [ ] Do stuff 2 + * [ ] Do stuff 3 + +Hit |zM| : += My current task = [8] --------------------------------------~ + +Hit |zr| : += My current task =~ + * [ ] Do stuff 1 [5] --------------------------------------~ + * [ ] Do stuff 2~ + * [ ] Do stuff 3~ + +Hit |zr| one more time: += My current task =~ + * [ ] Do stuff 1~ + * [ ] Do substuff 1.1~ + * [ ] Do substuff 1.2 [2] -------------------------------~ + * [ ] Do substuff 1.3~ + * [ ] Do stuff 2~ + * [ ] Do stuff 3~ + +NOTE: Whether you use default syntax, folding on list items should work +properly only if all of them are indented using current |shiftwidth|. +For MediaWiki * or # should be in the first column. + +To turn folding on/off checkout |vimwiki-option-folding|. + +============================================================================== +7. Todo lists *vimwiki-todo-lists* + +You can have todo lists -- lists of items you can check/uncheck. + +Consider the following example: += Toggleable list of items = + * [x] Toggle list item on/off. + * [x] Simple toggling between [ ] and [x]. + * [x] All list's subitems should be toggled on/off appropriately. + * [x] Toggle child subitems only if current line is list item + * [x] Parent list item should be toggled depending on it's child items. + * [x] Make numbered list items toggleable too + * [x] Add highlighting to list item boxes + * [x] Add [ ] to the next created with o, O and list item. + +Pressing on the first list item will toggle it and all of it's child +items. + +============================================================================== +8. Options *vimwiki-options* + +------------------------------------------------------------------------------ +*g:vimwiki_list* *vimwiki-multiple-wikies* + +Each item in g:vimwiki_list is a |Dictionary| that holds all customization +available for a wiki represented by that item. It is in form of > + {'option1': 'value1', 'option2: 'value2', ...} + +Consider the following example: > + let g:vimwiki_list = [{'path': '~/my_site/', 'path_html': '~/public_html/'}] + +It gives us one wiki located at ~/my_site/ that could be htmlized to +~/public_html/ + +The next example: > + let g:vimwiki_list = [{'path': '~/my_site/', 'path_html': '~/public_html/'}, + \ {'path': '~/my_docs/', 'ext': '.mdox'}] +gives us 2 wikies, first wiki as in previous example, second one is located in +~/my_docs/ and its files have .mdox extension. + +Empty |Dictionary| in the g:vimwiki_list is the wiki with default options: > + let g:vimwiki_list = [{}, + \ {'path': '~/my_docs/', 'ext': '.mdox'}] + +< +*vimwiki-option-path* +Key Default value~ +path ~/vimwiki/ +Description~ +Wiki files location: > + let g:vimwiki_list = [{'path': '~/my_site/'}] +< + +*vimwiki-option-path_html* +Key Default value~ +path_html ~/vimwiki_html/ +Description~ +HTML files converted from wiki files location: > + let g:vimwiki_list = [{'path': '~/my_site/', + \ 'path_html': '~/my_site_html/'}] + +If you omit this option path_html would be path - '/' + '_html/': > + let g:vimwiki_list = [{'path': '~/okidoki/'}] + +ie, path_html = '~/okidoki_html/' + + +*vimwiki-option-index* +Key Default value~ +index index +Description~ +Name of wiki index file: > + let g:vimwiki_list = [{'path': '~/my_site/', 'index': 'main'}] + +NOTE: Do not add extension. + + +*vimwiki-option-ext* +Key Default value~ +ext .wiki +Description~ +Extension of wiki files: > + let g:vimwiki_list = [{'path': '~/my_site/', + \ 'index': 'main', 'ext': '.document'}] + +< +*vimwiki-option-folding* +Key Default value Values~ +folding 1 0, 1 +Description~ +Enable/disable vimwiki's folding/outline. Folding in vimwiki is using 'expr' +foldmethod which is very flexible but really slow. +To turn it off set it to 0 as in example below: > + let g:vimwiki_list = [{'path': '~/articles/', 'folding': 0}] +< + +*vimwiki-option-syntax* +Key Default value Values~ +syntax default default, media +Description~ +Wiki syntax. +You can use different markup languages (currently default vimwiki and +MediaWiki) but only vimwiki's default markup could be converted to HTML at the +moment. +To use MediaWiki's wiki markup: > + let g:vimwiki_list = [{'path': '~/my_site/', 'syntax': 'media'}] +< + +*vimwiki-option-html_header* +Key Default value~ +html_header +Description~ +Set up file name for html header template: > + let g:vimwiki_list = [{'path': '~/my_site/', + \ 'html_header': '~/public_html/header.tpl'}] + +This header.tpl could look like: > + + + + %title% + + + +
+ +where %title% is replaced by a wiki page name. + + +*vimwiki-option-html_footer* +Key Default value~ +html_footer +Description~ +Set up file name for html footer template: > + let g:vimwiki_list = [{'path': '~/my_site/', + \ 'html_footer': '~/public_html/footer.tpl'}] + +This footer.tpl could look like: > +
+ + +< + +*vimwiki-option-css_name* +Key Default value~ +css_name style.css +Description~ +Set up css file name: > + let g:vimwiki_list = [{'path': '~/my_pages/', + \ 'css_name': 'main.css'}] +< +or even > + let g:vimwiki_list = [{'path': '~/my_pages/', + \ 'css_name': 'css/main.css'}] +< + +*vimwiki-option-gohome* +Key Default value Values~ +gohome split split, vsplit, tabe +Description~ +This option controls the way |:VimwikiGoHome| command works. +For instance you have 'No write since last change' buffer. After ww +(or :VimwikiGoHome) vimwiki index file will be splitted with it. Or vertically +splitted. Or opened in a new tab. +Ex: > + let g:vimwiki_list = [{'path': '~/my_site/', 'gohome': 'vsplit'}] +< + +*vimwiki-option-maxhi* +Key Default value Values~ +maxhi 1 0, 1 +Description~ +Non-existent WikiWord highlighting could be quite slow and if you don't want +it set maxhi to 0: > + let g:vimwiki_list = [{'path': '~/my_site/', 'maxhi': 0}] + +This disables filesystem checks for WikiWords. + + +------------------------------------------------------------------------------ +*g:vimwiki_upper* *g:vimwiki_lower* + +This affects WikiWord detection. +By default WikiWord detection uses English and Russian letters. +You can set up your own: > + let g:vimwiki_upper = "A-Z\u0410-\u042f" + let g:vimwiki_lower = "a-z\u0430-\u044f" + + +------------------------------------------------------------------------------ +*g:vimwiki_auto_checkbox* + +if on, creates checkbox while toggling list item. + +Value Description~ +0 Do not create checkbox. +1 Create checkbox. + +Default: 1 + +Ex: +Press (|:VimwikiToggleListItem|) on a list item without checkbox to +create it: > + * List item +result: > + * [ ] List item + + +------------------------------------------------------------------------------ +*g:vimwiki_menu* + +GUI menu of available wikies to select. + +Value Description~ +'' No menu +'Vimwiki' Top level menu "Vimwiki" +'Plugin.Vimwiki' "Vimwiki" submenu of top level menu "Plugin" +etc. + +Default: 'Vimwiki' + +------------------------------------------------------------------------------ +*g:vimwiki_stripsym* + +Change strip symbol -- in Windows you cannot use /*?<>:" in file names so +vimwiki replaces them with neutral symbol (_ is default): > + let g:vimwiki_stripsym = ' ' + +------------------------------------------------------------------------------ +*g:vimwiki_use_mouse* + +Use local mouse mappings from |vimwiki-local-mappings|. + +Value Description~ +0 Do not use mouse mappings. +1 Use mouse mappings. + +Default: 0 + +------------------------------------------------------------------------------ +*g:vimwiki_fold_empty_lines* + +Fold or not empty lines between folded headers. + +Value Description~ +0 Do not fold in empty lines. +1 Fold in empty lines. + +Default: 0 + +============================================================================== +9. Help *vimwiki-help* + +As you could see I am not native English speaker (not a writer as well). +Please send me correct phrases instead of that incorrect stuff I have used +here. + +Any help is really appreciated! + +============================================================================== +10. Author *vimwiki-author* + +I live in Moscow and you may believe me -- there are no polar bears (no brown +too) here in the streets. + +I do not do programming for a living. So don't blame me for an ugly +ineffective code. + +Many thanks to all of you for voting vimwiki up on www.vim.org. I do vimwiki +in my spare time I could use to dance argentine tango with beautiful women. +Your votes are kind of a good replacement. ;) + +Sincerely yours, +Maxim Kim . + +Vimwiki's website: http://code.google.com/p/vimwiki/ +Vim plugins website: http://www.vim.org/scripts/script.php?script_id=2226 + +============================================================================== +11. Changelog *vimwiki-changelog* + +0.9.3 + * [new] g:vimwiki_menu option is a string which is menu path. So one can use + let g:vimwiki_menu = 'Plugin.Vimwiki' to set the menu to the right place. + * [new] g:vimwiki_fold_empty_lines -- don't or do fold in empty lines + between headers. See |g:vimwiki_fold_empty_lines| + * [fix] Encoding error when running vimwiki in Windows XP Japanese. + Thanks KarasAya. + +0.9.2c + * [fix] Regression: Export HTML link error with [[Link|Text]]. + +0.9.2b + * [fix] Installation on Linux doesn't work. (Dos line endings in Vimball + archive file). + * [fix] Clear out FlexWiki ftplugin's setup. Now you don't have to hack + filetype.vim to get rid of unexpected ':setlocal bomb' from FlexWiki's + ftplugin. + * [fix] When write done: it will show another done: in html file. + +0.9.2a + * [fix] Installation on Linux doesn't work. (Dos line endings in + autoload/vimwiki_lst.vim and indent/vimwiki.vim). + +0.9.2 + * [new] Option 'folding' added to turn folding on/off. + * [new] Header text object. See |vimwiki-text-objects|. + * [new] Add/remove Header levels with '=' and '-'. See |vimwiki_=|. + * [new] Vimwiki GUI menu to select available wikies. See |g:vimwiki_menu|. + * [new] You can specify the name of your css file now. See + |vimwiki-option-css_name| + * [new] You can add styles to image links, see |vimwiki-syntax-links|. + * [fix] History doesn't work after |VimwikiRenameWord|. + * [fix] Some of wikipedia links are not correctly highlighted. Links with + parentheses. + * [misc] Renamed vimwiki_gtd to vimwiki_lst. + +0.9.1 + * [new] HTML Table cell text alignment, see |vimwiki-syntax-tables| + * [new] Wikipage history simplified. Each vimwiki buffer now holds + b:vimwiki_prev_word which is list of [PrevWord, getpos()]. + * [new] If highlight for groups wikiHeader1..wikiHeader6 exist (defined in + a colorscheme) -- use it. Otherwise use Title highlight for all Headers. + * [fix] Warn only once if 'html_header' or 'html_footer' does not exist. + * [fix] Wrong folding for the text after the last nested list item. + * [fix] Bold and Italic aren't highlighted in tables without spaces + between || and * or _. ||*bold*||_asdf_ || (Thanks Brett Stahlman) + +0.9.0 + * [new] You can add classes to 'pre' tag -- |vimwiki-syntax-preformatted|. + This might be useful for coloring some programming code with external js + tools like google syntax highlighter. + * [new] !WikiPage is not highlighted. It is just a plain word WikiPage in + HTML, without exclamation mark + * [new] Definition lists, see |vimwiki-syntax-lists|. + * [new] New implementation of |:VimwikiRenameWord|. CAUTION: It was tested + on 2 computers only, backup your wiki before use it. Email me if it + doesn't work for you. + * [fix] Less than 3 symbols are not highlighted in Bold and Italic. + * [fix] Added vimwiki autocmd group to avoid clashes with user defined + autocmds. + * [fix] Pressing ESC while |:VimwikiUISelect| opens current wiki index file. + Should cancel wiki selection. + +0.8.3 + * [new] on a list item creates checkbox. + * [fix] With * in the first column, shouldn't insert more * (default + syntax). + * [fix] With MediaWiki's ** [ ], should insert it on the next line. + * [fix] HTML export should use 'fileencoding' instead of 'encoding'. + * [fix] Code cleanup. + +0.8.2 + * [del] Removed google syntax file. + * [new] Default vimwiki syntax is a subset of google's one. Header's has + been changed from !Header to =Header=. It is easier to maintain only 2 + syntaxes. See |vimwiki-syntax-headers|. + * [new] Multiline paragraphs -- less longlines. + * [new] Comments. See |vimwiki-syntax-comments|. + * [del] Removed setlocal textwidth = 0 from ftplugin. + * [fix] New regexps for bold, italic, bolditalic. + * [fix] The last item in List sometimes fold-in incorrectly. + * [fix] Minor tweaks on default css. + +0.8.1 + * [new] Vimwiki's foldmethod changed from syntax to expr. Foldtext is + changed to be nicer with folded list items. + * [new] Fold/outline list items. + * [new] It is possible now to edit wiki files in arbitrary directories which + is not in g:vimwiki_list's paths. New WikiWords are created in the path of + the current WikiWord. + * [new] User can remap Vimwiki's built in mappings. + * [new] Added |g:vimwiki_use_mouse|. It is off by default. + * [fix] Removed mapping. + +0.8.0 + * [new] Multiple wikies support. A lot of options have been changed, see + |vimwiki-options| + * [new] Auto create directories. + * [new] Checked list item highlighted as comment. + * [fix] Multiple 'set ft=vimwiki' for each buffer disabled. Vimwiki should + load its buffers a bit faster now. + +0.7.1 + * [new] VimwikiToggleListItem added to be able to remap to + anything user prefers more. + * [fix] Toggleable list items do not work with MediaWiki markup. + * [fix] Changing g:vimwiki_home_html to path with ~ while vimwiki is + loaded gives errors for HTML export. + * [del] Command :VimwikiExploreHome. + +0.7.0 + * [new] GTD stuff -- toggleable list items. See |vimwiki-todo-lists|. + * [fix] Headers do not fold inner headers. (Thanks Brett Stahlman) + * [fix] Remove last blank lines from preformatted text at the end of file. + * [del] Removed g:vimwiki_smartCR option. + +0.6.2 + * [new] [[link|description]] is available now. + * [fix] Barebone links (ie: http://bla-bla-bla.org/h.pl?id=98) get extra + escaping of ? and friends so they become invalid in HTML. + * [fix] In linux going to [[wiki with whitespaces]] and then pressing BS + to go back to prev wikipage produce error. (Thanks Brendon Bensel for + the fix) + * [fix] Remove setlocal encoding and fileformat from vimwiki ftplugin. + * [fix] Some tweaks on default style.css + +0.6.1 + * [fix] [blablabla bla] shouldn't be converted to a link. + * [fix] Remove extra annoing empty strings from PRE tag made from + whitespaces in HTML export. + * [fix] Moved functions related to HTML converting to new autoload module + to increase a bit vimwiki startup time. + +0.6 + * [new] Header and footer templates. See|g:vimwiki_html_header| and + |g:vimwiki_html_footer|. + * [fix] |:Vimwiki2HTML| does not recognize ~ as part of a valid path. + +0.5.3 + * [fix] Fixed |:VimwikiRenameWord|. Error when g:vimwiki_home had + whitespaces in path. + * [fix] |:VimwikiSplitWord| and |:VimwikiVSplitWord| didn't work. + +0.5.2 + * [new] Added |:VimwikiGoHome|, |:VimwikiTabGoHome| and + |:VimwikiExploreHome| commands. + * [new] Added wt mapping to open vimwiki index file in a new tab. + * [new] Added g:vimwiki_gohome option that controls how|:VimwikiGoHome| + works when current buffer is changed. (Thanks Timur Zaripov) + * [fix] Fixed |:VimwikiRenameWord|. Very bad behaviour when autochdir + isn't set up. + * [fix] Fixed commands :Wiki2HTML and :WikiAll2HTML to be available only + for vimwiki buffers. + * [fix] Renamed :Wiki2HTML and :WikiAll2HTML to |:Vimwiki2HTML| and + |:VimwikiAll2HTML| commands. + * [fix] Help file corrections. + +0.5.1 + * [new] This help is created. + * [new] Now you can fold headers. + * [new] VimwikiGoHome and VimwikiExploreHome were added. + * [fix] Bug with {{{HelloWikiWord}}} export to HTML is fixed. + * [del] Sync option removed from: Syntax highlighting for preformatted + text {{{ }}}. + +0.5 + * [new] vimwiki default markup to HTML conversion improved. + * [new] Added basic GoogleWiki and MediaWiki markup languages. + * [new] Chinese [[complex wiki words]]. + +0.4 + * [new] vimwiki=>HTML converter in plain Vim language. + * [new] Plugin autoload. + +0.3.4 + * [fix] Backup files (.wiki~) caused a bunch of errors while opening wiki + files. + +0.3.3 + * FIXED: [[wiki word with dots at the end...]] didn't work. + * [new] Added error handling for delete wiki word function. + * [new] Added keybindings o and O for list items when g:vimwiki_smartCR=1. + * [new] Added keybinding wh to visit wiki home directory. + +0.3.2 + * [fix] Renaming -- error if complex wiki word contains %. + * [fix] Syntax highlighting for preformatted text {{{ }}}. Sync option + added. + * [fix] smartCR bug fix. + +0.3.1 + * [fix] Renaming -- [[hello world?]] to [[hello? world]] links are not + updated. + * [fix] Buffers menu is a bit awkward after renaming. + * [new] Use mouse to follow links. Left double-click to follow WikiWord, + Rightclick then Leftclick to go back. + +0.3 + * [new] Highlight non-existent WikiWords. + * [new] Delete current WikiWord (wd). + * [new] g:vimwiki_smartCR=2 => use Vim comments (see :h comments :h + formatoptions) feature to deal with list items. (thx -- Dmitry + Alexandrov) + * [new] Highlight TODO:, DONE:, FIXED:, FIXME:. + * [new] Rename current WikiWord -- be careful on Windows you cannot rename + wikiword to WikiWord. After renaming update all links to that renamed + WikiWord. + * [fix] Bug -- do not duplicate WikiWords in wiki history. + * [fix] After renaming [[wiki word]] twice buffers are not deleted. + * [fix] Renaming from [[wiki word]] to WikiWord result is [[WikiWord]] + * [fix] More than one complex words on one line is bugging each other when + try go to one of them. [[bla bla bla]] [[dodo dodo dodo]] becomes + bla bla bla]] [[dodo dodo dodo. + + +0.2.2 + * [new] Added keybinding -- split WikiWord + * [new] Added keybinding -- vertical split WikiWord + +0.2.1 + * [new] Install on Linux now works. + +0.2 + * [new] Added part of Google's Wiki syntax. + * [new] Added auto insert # with ENTER. + * [new] On/Off auto insert bullet with ENTER. + * [new] Strip [[complex wiki name]] from symbols that cannot be used in + file names. + * [new] Links to non-wiki files. Non wiki files are files with extensions + ie [[hello world.txt]] or [[my homesite.html]] + +0.1 + * First public version. + +============================================================================== +12. License *vimwiki-license* + +GNU General Public License v2 +http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + +To be frank I didn't read it myself. It is not that easy reading. But I hope +it's free enough to suit your needs. + + + vim:tw=78:ts=8:ft=help ftplugin\vimwiki.vim [[[1 -204 +212 " Vimwiki filetype plugin file " Author: Maxim Kim " Home: http://code.google.com/p/vimwiki/ @@ -2964,6 +2706,14 @@ function! VimwikiFoldLevel(lnum) "{{{ return '>' . n endif + if g:vimwiki_fold_empty_lines == 0 + let nnline = getline(nextnonblank(a:lnum + 1)) + if nnline =~ g:vimwiki_rxHeader + let n = vimwiki#count_first_sym(nnline) + return '<' . n + endif + endif + " List item folding... let nnum = a:lnum + 1 @@ -3113,8 +2863,59 @@ nmap - :call vimwiki#RemoveHeaderLevel() " }}} " KEYBINDINGS }}} +indent\vimwiki.vim [[[1 +49 +" Vimwiki indent file +" Author: Maxim Kim +" Home: http://code.google.com/p/vimwiki/ + +" Only load this indent file when no other was loaded. +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +" Some preliminary settings +setlocal nolisp " Make sure lisp indenting doesn't supersede us +setlocal autoindent " indentexpr isn't much help otherwise + +setlocal indentexpr=GetVimwikiIndent(v:lnum) +setlocal indentkeys+=<:> + +" Only define the function once. +if exists("*GetVimwikiIndent") + finish +endif + +" Come here when loading the script the first time. + +function GetVimwikiIndent(lnum) + " Search backwards for the previous non-empty line. + let plnum = prevnonblank(v:lnum - 1) + if plnum == 0 + " This is the first non-empty line, use zero indent. + return 0 + endif + + " TODO: use g:vimwiki_rxList here + let lst_indent = len(matchstr(getline(a:lnum), '^\s\+\ze\(\*\|#\)')) + if lst_indent > 0 + if lst_indent < &sw + return &sw + endif + + let mul = round(lst_indent*1.0/&sw) + let ind = float2nr(mul * &sw) + return ind + endif + + + return -1 +endfunction + +" vim:sw=2 plugin\vimwiki.vim [[[1 -216 +227 " Vimwiki plugin file " Author: Maxim Kim " Home: http://code.google.com/p/vimwiki/ @@ -3180,6 +2981,7 @@ function! s:setup_buffer_enter() "{{{ endif endfunction "}}} " }}} + " DEFAULT wiki {{{ let s:vimwiki_defaults = {} let s:vimwiki_defaults.path = '~/vimwiki/' @@ -3194,15 +2996,22 @@ let s:vimwiki_defaults.gohome = 'split' let s:vimwiki_defaults.html_header = '' let s:vimwiki_defaults.html_footer = '' "}}} + " DEFAULT options {{{ -call s:default('upper', 'A-ZА-Я') -call s:default('lower', 'a-zа-я') +if &encoding == 'utf-8' + call s:default('upper', 'A-Z\u0410-\u042f') + call s:default('lower', 'a-z\u0430-\u044f') +else + call s:default('upper', 'A-Z') + call s:default('lower', 'a-z') +endif call s:default('other', '0-9') call s:default('stripsym', '_') call s:default('auto_listitem', 1) call s:default('auto_checkbox', 1) call s:default('use_mouse', 0) -call s:default('menu', 1) +call s:default('fold_empty_lines', 0) +call s:default('menu', 'Vimwiki') call s:default('current_idx', 0) call s:default('list', [s:vimwiki_defaults]) @@ -3218,6 +3027,7 @@ let g:vimwiki_word1 = '\C\<['.upp.']['.nlo.']*['. let g:vimwiki_word2 = '\[\[[^\]]\+\]\]' let g:vimwiki_rxWikiWord = g:vimwiki_word1.'\|'.g:vimwiki_word2 "}}} + " OPTION get/set functions {{{ " return value of option for current wiki or if second parameter exists for " wiki with a given index. @@ -3261,6 +3071,7 @@ function! VimwikiSet(option, value, ...) "{{{ let g:vimwiki_list[idx][a:option] = a:value endfunction "}}} " }}} + " FILETYPE setup for all known wiki extensions {{{ " Getting all extensions that different wikies could have let extensions = {} @@ -3289,6 +3100,7 @@ augroup vimwiki endfor augroup END "}}} + " COMMANDS {{{ command! VimwikiUISelect call vimwiki#WikiUISelect() command! -count VimwikiGoHome @@ -3296,6 +3108,7 @@ command! -count VimwikiGoHome command! -count VimwikiTabGoHome tabedit \ call vimwiki#WikiGoHome(v:count1) "}}} + " MAPPINGS {{{ if !hasmapto('VimwikiGoHome') map ww VimwikiGoHome @@ -3313,6 +3126,7 @@ endif noremap