Commit Graph

472 Commits

Author SHA1 Message Date
Rane Brown 5ce7c14a3d Properly handle lists with hard wraps. Fixes #443.
This change modifies the behavior of VimwikiReturn to not insert a new
list marker if not within a list. Mostly useful when mapping <CR> to
VimwikiReturn 3 5 or similar. The behavior of 'o' was also modified to
properly insert a marker in a list with hard line wraps.
2019-08-22 05:52:54 -06:00
Lionel Flandrin dcd68a6781 Fix off-by-one error in get_next_line and get_prev_line
The functions stopped at the end/start block marker (respectively)
instead of returning the following line. This caused issues when the
function was subsequently called in markdown mode since the start and
end block markers are the same.

This fixes #407
2019-07-31 17:56:08 +01:00
Rane Brown 0678df38e9 Support getbufvar for vim < v7.3.831 2019-07-20 22:13:48 -06:00
Rane Brown fbec80b7d9 Remove control characters. Fixes #598 2019-07-17 07:15:06 -06:00
Rane Brown 86cad979e5 Better handling of extensions when normalizing links.
For markdown syntax the extension was added to the url multiple times if
the option g:vimwiki_markdown_link_ext was set which is now fixed.
Normalizing links no longer adds the extension to the description field.
2019-07-17 07:10:47 -06:00
Rane Brown 466bdcd4e8 Don't reuse variable in s:clean_url (sticky type checking)
Versions of Vim prior to 7.4.1546 had sticky type checking which
prevented a variables type from changing. Fixes #715.
2019-07-12 13:52:23 -06:00
Rane Brown c58268df3f Make normalized links in diary pages use relative path.
A previous PR added this feature to the default syntax. This add the
same functionality to markdown syntax. Fixes #729
2019-07-10 21:06:33 -06:00
James Moriarty 8914b14e24 Remove awa check triggering silent file edits. 2019-06-04 21:30:52 -04:00
Rane Brown 6ec85cd0e8 Allow buffer local mappings to overwrite existing mappings.
If the fileype is vimwiki then the vimwiki mappings take precedence.
Global mappings will not be overwritten. Closes #699
2019-05-24 20:41:12 -06:00
Rane Brown 68233c51eb Handle markdown image links '![]()'. 2019-05-23 21:23:53 -06:00
Greg Anders ddf7e5e0ff Allow forcing VimwikiAll2HTML with ! 2019-05-20 08:22:15 -06:00
Rane Brown efe5f648de Convert path to use '\' for windows in backlinks function.
Fixes #413
2019-05-16 20:47:17 -06:00
Steve Dondley cf8a16c5c7 Fix list folding bug (PR #705)
Closes #680
2019-05-11 14:01:45 -06:00
Rane Brown c05037a490 Allow escaped characters in markdown links.
Fixes #619
2019-05-08 21:30:06 -06:00
Rane Brown cde4703354 Modify regex pattern for markdown links.
Fixes #240. Also fixes a related issue where markdown links where not
correctly highlighted in todo lists. Adds concealment for markdown links
in todo lists.
2019-05-08 20:55:56 -06:00
Rane Brown 0d8fbebcb8 Print the correct help message for global or wikilocal options.
Fixes #685
2019-05-04 06:31:13 -06:00
Rane Brown fd8832cfa1 Fixes #237 VimwikiRenameLink now works for markdown syntax. 2019-05-03 21:19:05 -06:00
Rane Brown 61d93fde7f Exclude '>' from url regex, including tables. Issue #481 2019-04-30 06:11:51 -06:00
Rane Brown 50a3c78c87 Ensure key mappings defined in ftplugin are buffer specific.
The changes made with #686 did not ensure the ftplugin mappings were
specific to the buffer containing a Vimwiki file. This resulted in
undesired keymappings with no defined behavior since the <Plug>
definition was buffer specific.
2019-04-29 23:03:00 -06:00
Rane Brown bb15cd1aff Exclude '>' from url regex.
Fixes #481
2019-04-29 22:09:38 -06:00
Steven Stallion ad4d43abfe Add :VimwikiGoto key maping 2019-04-27 11:10:32 -05:00
Rane Brown 4106cb7bc7 New option g:vimwiki_key_mappings to enable/disable key mappings.
All key mappings have the option of being disabled but the <Plug>
definitions are still available for user customization. Key sequences
are no longer overwritten if a mapping already exists. Fixes #671,
fixes #425.
2019-04-26 21:17:35 -06:00
Jonny Bylsma e84dcbfa25 Prevent sticky type checking (E706) errors with older Vims (#681)
Vim used to throw the E706 error if you tried to change a variable's
type. This error can be triggered by vimwiki if, during the user
settings loop in `read_global_settings_from_user()`, the variable type
for `users_value` changes.

The vim error was removed in v7.4.1546 as part of
f6f32c38bf.
2019-04-26 11:06:09 -06:00
Alexander Gude 6787e0fb7e Change diary_rel_path minimum length to 0 (#689)
Changing this option to allow empty strings places the diary files in the same directory as the main wiki files. This is more backwards compatible with previous releases.
2019-04-26 06:23:45 -06:00
Rane Brown 510c149512 Add wikilocal option to assign a name to each wiki.
Names can be used for interwiki links in the format wn.name:link.
Additionally, :VimwikiUISelect and the menu created in GVim utilize the
wiki name. Fixes #612, closes #477.
2019-04-21 13:05:01 -06:00
Rane Brown 37f020d21a Omnicompletion fix for Windows (#660)
* Temporary fix for omnicomplete of vimwiki links - #456.

This fixes the omnicomplete of wiki links under Windows which were
not working since paths on Windows use '\' instead of '/'. This is
a temporary fix until path refactoring is done.

* Update changelog with description of fix for #456
2019-04-20 17:28:32 +02:00
Monkin 3d076f01c8
New Logo and Screenshots
Update CSS Styles

Add Splash Image

Compress PNG

Remove header

Change headings sizes

Add background colors to code blocks and use HEX

Update fonts and put back old screenshots

Change font-size in code blocks
2019-04-19 21:01:02 +02:00
Rane Brown 9d10610c4a Add option g:vimwiki_auto_header to automatically generate H1.
A level 1 header will automatically be generated for new files. The
title used in the header is based on the filename. Closes #245.
2019-04-13 07:00:06 -06:00
Patrick Davey 5f01182468 Add html_filename_parameterization option.
This adds the vimwiki_local `html_filename_parameterization` option (0|1)
which performs the same sanitization of filenames as does the
vimwiki_markdown gem.

For example, if your file is called "My File.md" it will be written out
as "my-file.html".

If the html_filename_parameterization options is enabled, we also _do
not delete_ non-matching html files when the VimwikiAllToHtml command is
run.

Closes #129
2019-04-13 10:07:51 +12:00
Rane Brown 1e74443b5a Allow additional filetypes to be registered to vimwiki files.
This options allow third party plugins to register and enable additonal
functionality by setting the filetype to vimwiki.other_ft.other_ft2 etc.
This option should be used with care since vimwiki functionality can be
overwritten by other plugins. See Issue #461 for an example use case.
2019-04-12 07:42:49 -06:00
Rane Brown ae67790ad5
Merge pull request #663 from padowi/vimwiki_315
Add option to not conceal one-character markers
2019-04-11 21:32:49 -06:00
Henry Qin 048f2eb34a Remove redundant layer of branching in get_cell_aligns_fast 2019-04-10 11:06:05 -07:00
Henry Qin 63985a52e8 Rename get_cell_fast_aligns --> get_cell_aligns_fast 2019-04-10 11:02:13 -07:00
Henry Qin 08dcae9630 Merge branch 'dev' of https://github.com/lyokha/vimwiki into lyokha-dev 2019-04-10 10:48:42 -07:00
Patrik Willard a5bda652d0
Add option to not conceal one-character markers
Adds new configuration variable, "conceal_onechar_markers", defaulting
to on (preserving default behaviour)

Adds if-statement around relevant parts of code (as suggested in the
issue), which uses the new configuration variable.

Fix #315 - Don't conceal one-character markers
2019-04-09 08:17:56 +02:00
Rane Brown 82ba1e99bf Move variable declaration outside of for loop 2019-04-08 22:18:07 -06:00
Rane Brown 3bf389bf99 Don't replace spaces in link description for markdown syntax.
The option 'links_space_char' replaces spaces with the specified
character when creating a link from a visual selection. This modifies
the behavior to not replace spaces in the link description but to still
replace spaces in the filename.
2019-04-08 20:54:21 -06:00
Rane e7f5ce6046 Fix VimwikiBackLinks on Windows. See Issue #413.
This is a temporary fix until refactoring of path handling is complete.
2019-04-06 10:43:09 -06:00
lyokha 0303021abd Fast aligns check
The optimized table formatting algorithm was still O(n) because
calculating aligns required traversal to the separator line on the top
of a table. This heuristic algorithm calculates aligns in O(1) in the
best case by looking at cells in two rows above.

Say, if two above rows are

|      uau | uauyaya         | ya      |
|       ua | uaua            | uaaua   |
| <cursor> |                 |         |

then the aligns can be figured out without need to find the separator
line. If aligns cannot be figured out after this fast check then the
algorithm falls back to O(n) with searching for the separator line.
2019-04-04 21:30:14 +03:00
Лёха ae3db7a079 Do not format current table line directly in get_rows()
This formatting is needed in the optimized table formatting algorithm
for shrinking the current table line to try the best to avoid
re-formatting the whole table. However, this breaks cursor motion and
may also affect other table related behaviors. The fix is to move this
formatting to get_aligned_rows(). Now table rows are not affected by any
means, because the current row is only replaced temporarily for the
formatting purpose only and gets reverted as soon as the check is
finished.

Fixes #656.
2019-04-04 00:13:00 -07:00
Henry Qin 3c0ae2ff97 Revert "table alignment: break out of loop when separator found"
This reverts commit 23d273d547, which
fixes #655.

Description of fixed problem:
1. When looping through rows, if a separator was found, all subsequent
   rows would not get an assigned alignment.
2. This breaks `s:get_aligned_rows` because it calls `s:fmt_sep` and
   `s:fmt_row`, both of which expect `aligns` to have a value for every
   row number.
2019-04-03 11:44:36 -07:00
Rane Brown 4928132e5f Use shiftwidth to calculate diary index header indentation 2019-04-03 11:58:27 -06:00
Rane Brown 80a94cd8c7 Correctly indent diary section links when list_margin is 0 2019-04-03 10:48:23 -06:00
Alexey Radkov e0fffb470a Separator line in a table requires special treatment (#651)
Fix #650 – horizontal table delimiter treated wrong
2019-04-01 23:13:24 +02:00
Rane Brown 4f5d4c9400 Change the tagfile name.
This changes the tags file used by vimwiki to '.vimwiki_tags' to prevent
conflicts with other tools that may generate a tags file using the same
name such as gutentags.
2019-04-01 09:46:41 -06:00
Rane Brown 41aa647aba Add option to set a character which replaces spaces when creating links.
The wikilocal option links_space_char will be used to replace any spaces
when creating a new wiki link and page. This only affects link creation
with a visual selection.
2019-03-31 21:19:50 -06:00
Rane Brown 3396e87dbe Fix problems with commands not taking a count and mapping behavior.
Commands such as :VimwikiIndex and :VimwikiDiaryIndex did not previously
take a count and the doucmentation was inconsistent/incorrect for the
behavior of these commands. Fixes #543.
2019-03-31 20:00:37 -07:00
Steven Stallion 3b9aa6b162 Support file exclusion in link generation 2019-03-30 21:10:14 -05:00
Rane Brown 047947cbbe
Merge pull request #635 from sstallion/sstallion/autogenerate-tags
Support automatic generation of links and tags
2019-03-30 19:56:57 -06:00
Steven Stallion 0e664a6230 Merge branch 'dev' of git://github.com/vimwiki/vimwiki into sstallion/autogenerate-tags 2019-03-30 20:34:57 -05:00
Henry Qin 3f7f85cfc6 Add command and map to jump to the next unfinished task.
Introduce the command `VimwikiNextTask` and the mapping `gnt` to jump to
the next unfinished task.
2019-03-30 12:45:19 -07:00
Michal Cizmazia b849a411e3
Add toc_link_format option
Add an option for setting the format of the links in the Table of Contents:
- Extended (the current and default)
- Brief (new format for the Vimwiki markup)
2019-03-29 21:28:11 +01:00
Steven Stallion fc158ba744 Support automatic generation of links and tags 2019-03-28 20:11:47 -05:00
Greg Anders e56c26c7ba Add an option to conceal preformatted text blocks
This merges PR #641.
2019-03-28 14:50:25 -07:00
Rane Brown f5cf991115
Merge pull request #634 from sstallion/sstallion/headers
Adjust generated header behavior for TOC, links, tags, and diary (oh my!)
2019-03-26 11:57:24 -06:00
Steven Stallion 6c2f9f999d Adjust generated header behavior for TOC, etc. 2019-03-26 12:03:09 -05:00
tinmarino dfccfb1951 Add option : g:vimwiki_table_reduce_last_col. Used to not expand table last cells in order to avoid large, useless wraps 2019-03-23 11:23:58 -03:00
Eric Langlois 8f5d38365b Added optional extra caption levels to diary index.
Added the option 'diary_caption_level', which controls the presence of
captions in the diary index linking to headers within the diary pages.

Possible values:
-1:  No headers are read from the diary page.
 0:  The first header from the diary page is used as the caption.
       There are no sub-captions.
 1:  Captions are created for headers of level 1 in the diary page.
 2:  Captions are created for headers up to level 2 in the diary page.
 etc.

When the value is >= 1, the primary caption of each diary page is set to
the first header read from that page if it is the unique lowest-level
header.
2019-03-20 14:09:57 -07:00
Steven Stallion eb00d30d9b Initial commit 2019-03-19 10:33:08 -05:00
Rane Brown c8d09d7c9e
Merge pull request #629 from gpanders/dev
Allow customization of header level of TOC
2019-03-18 17:20:30 -06:00
Лёха e0f4ab8c5e Revert implementation of function s:get_cell_aligns()
This commit reverses a change to s:get_cell_aligns introduced by
bdcfca1e5c.
2019-03-18 14:43:43 -07:00
Steven Stallion ad8e1d30bf Add g:vimwiki_create_link option to prevent link creation.
Adds a new global option named create_link, which allows the user to
control :VimwikiFollowLink behavior when attempting to follow a
non-existent link. The original behavior of creating a new link is
preserved. However, by setting this option to 0, new links will not be
created when pressing return over regular text. Closes #528.
2019-03-18 14:37:12 -07:00
lyokha ad6a3bceb6 the cause of the linear slowing down was fixed 2019-03-18 17:49:13 +03:00
lyokha 0c82d9dcb8 Merge remote-tracking branch 'upstream/dev' into dev 2019-03-18 13:13:30 +03:00
Henry Qin efcc3f1fa5 Merge branch 'wiki-path' into 'dev'. Closes #573.
Introduce a `%wiki_path%` variable which can be used in HTML template
files to output the path of the wiki file being converted to HTML.
2019-03-17 18:19:49 -07:00
Henry Qin e6d6830db7 Merge branch 'colorcodes' into 'dev'. Closes PR #616.
This colors all CSS color codes found alone in inline code blocks to the
color they mention.
2019-03-17 18:09:06 -07:00
Hugo Hörnquist 2f87f92060 Better foreground for colorcodes. 2019-03-17 22:40:34 +01:00
Henry Qin 8941508e35 Allow AddHeaderLevel and RemoveHeaderLevel to take counts 2019-03-17 10:43:42 -07:00
lyokha 88a6820e9e updated for the new aligns feature 2019-03-15 16:07:52 +03:00
Alexey Radkov fa6342c454
Merge branch 'dev' into dev 2019-03-15 15:38:22 +03:00
lyokha 5e4a89c898 faster table format on InsertLeave; faster s:get_rows() 2019-03-15 15:31:28 +03:00
Henry Qin abd12d4479 Merge PR #377 from https://github.com/schmeisers/vimwiki 2019-03-14 18:08:27 -07:00
Greg Anders bb40826def Allow customization of header level of TOC
Instead of forcing the TOC to always be at header level 1, allow the
user to specify via the option g:vimwiki_toc_header_level what level
they want.

This defaults to 1, so if the user does nothing then the old behavior
will remain the same.
2019-03-14 08:34:52 -06:00
Alexey Radkov af8cdc4d62
Merge branch 'dev' into dev 2019-03-14 14:09:30 +03:00
lyokha a74e0821b0 resolved conflicts in tbl.vim 2019-03-14 13:36:51 +03:00
Hugo Hörnquist 08ec02a755 Alternative where text color is inverse of background. 2019-02-19 21:04:57 +01:00
Hugo Hörnquist 21f5069e48 Code-blocks auto-color. 2019-02-19 20:45:10 +01:00
Nico a7160310c9 Patch for issue #585 - implement suggested improvements 2019-02-01 17:43:05 +01:00
Nicolas Brailovsky 0f38192b03 Patch for issue #585, fix anchor links for multiple extensions 2019-02-01 17:43:05 +01:00
Fredrik Arnerup 69aa609941 Don't include trailing period in link 2019-02-01 17:43:05 +01:00
Hugo Hörnquist bda3a59f91 Made headings link to themselves.
Made each heading link to itself, by placing an <a> tag inside each
<h[1-6]> tag.

Also adds class="header" to each header, allowing for the CSS rule
    .header a { ...  }
to remove all styling from the inner links, allowing the outputed
document to look like before.
2019-01-30 21:13:29 +01:00
EinfachToll 1cffbdbf3d Fix: Don't double a ' character in header in TOC
When building the TOC, every ' in a header got doubled. According to git blame, I did this doubling explicitely, but I have no idea why I did this.
2019-01-25 16:45:11 +01:00
EinfachToll fdc367f725 Check all user settings for correct type, range etc. 2019-01-19 21:05:27 +01:00
EinfachToll 6257c8fa54 Revert "Allow to specify additional chars for lists"
This reverts commit 75819ca23a.
2019-01-17 21:57:42 +01:00
EinfachToll 35d1f23b92 Revert "Allow list symbols to be configured per wiki"
This reverts commit 79c295a92f.
2019-01-17 21:57:40 +01:00
EinfachToll 54e064f5c4 Revert "Fix bug"
This reverts commit 2346b7e299.
2019-01-17 21:57:28 +01:00
EinfachToll 65b0c97c6d Revert "Update the links when renaming markdown wikis"
This reverts commit 599a0e9083.

Sorry, we can't simply change the syntax of something as basic as a
link, even if the old syntax is wrong. We need to keep Vimwiki
reasonably backwards compatible.
2019-01-16 20:56:49 +01:00
Michael F. Schönitzer 2346b7e299 Fix bug 2019-01-04 01:19:26 +01:00
Michael F. Schönitzer 79c295a92f Allow list symbols to be configured per wiki 2019-01-03 21:02:21 +01:00
Michael F. Schönitzer 75819ca23a Allow to specify additional chars for lists
See also #390 and #479 for earlier attempts
2019-01-03 21:02:21 +01:00
Raphael Feng 599a0e9083 Update the links when renaming markdown wikis
Two reasons whey the links in markdown wikis are not updated:
1. The markdown link pattern is wrong, should be []() rather than [][];
2. The logic of getting wiki local var cannot get correct wiki index as:
    a. the renamed file's buffer is removed and %:p would return empty
    b. the function that gets the wiki local var depends on buffer's %:p
    value to find the wiki it belongs to and it would always return -1
    and result in the default option values instead the user's option

The fix is
1. fix the markdown link pattern regex;
2. keep the renamed file's buffer open during the period of updating the link
2019-01-03 13:00:19 +01:00
sreejith994 2366523001 Fixed updation of links when renaming wiki files in subdirectories 2018-12-21 11:08:14 +01:00
EinfachToll d9b6d77e90 Accept '.foo' and 'foo' as value for the ext option 2018-12-17 20:27:15 +01:00
EinfachToll 645ae61dc3 Fix error when trying to make a link out of '-'
Fix #582
2018-12-14 21:03:46 +01:00
EinfachToll a72c14da1c More reasonable behavior for [-] and [X] list items
A parent [-] list item should have only [-] items as children.
2018-12-08 21:13:04 +01:00
EinfachToll c398f5cd81 Remove code duplicate 2018-12-08 21:06:30 +01:00
EinfachToll fa36bf3838 Don't check a [-] list item when its parent is [X] checked 2018-11-30 17:02:38 +01:00
EinfachToll a653e2d8c2 HTML converter: trim strings correctly
The old version didn't remove trailing spaces.
2018-11-25 17:56:43 +01:00
EinfachToll 349d551181 Diary: make + in visual mode work correctly 2018-11-25 17:55:43 +01:00
EinfachToll dcd1c0a364 Make gl* work again
The problem was that map() also changed the given list in-place, that's
not what was intended.
2018-11-19 21:02:37 +01:00