Commit Graph

254 Commits

Author SHA1 Message Date
Tinmarino
a51052cbe6 Feature: VimwikiVar to list, get and set variables
Refaction:
- Add g:vimwiki_syntax_list to set syntaxlocal variables
- Delete: syntax/vimwiki_markdown.vim and friends
- Change: vimwiki_syntax_variables -> vimwiki_syntaxlocal_vars for consistency
- Include: some doc in design notes
2020-08-17 23:51:48 -04:00
Tinmarino
5c64ced22d Feature: Utility function: linkify to extract link title from url (PR #982 from @jeromg) 2020-08-14 01:30:04 -04:00
Tinmarino
0b85dd1a7b Feature: Syntax typeface delimiters can end at punctuation 2020-08-13 01:59:21 -04:00
Tinmarino
22d9d012ba Fix: Broken TOC links format when using default syntax (Issue #981)
- Not normalising for default
- SetExt header missed a `^` in the regex so mateched the trailing ===
of === head3 ===
2020-08-12 23:59:45 -04:00
Tinmarino
4b041a606a Refactor: Mutualize messaging (echo) 2020-08-09 16:06:35 -04:00
Tinmarino
188ead55db Config: Permit tag configuration for syntax, search and match (Issue #922 #928)
Affects: (via user configurated regexp)

- VimwikiGenerateTagLinks
- follow_link
- completion
- Syntax Highlighting
2020-08-08 04:06:20 -04:00
Tinmarino
dede5a1eea Change: VimwikiCheckLinks work on current wiki or on given range
Problem: VimwikiCheckLinks can be slow
Solution: Work only on current wiki or accept a range
2020-08-08 04:01:31 -04:00
Tinmarino
659ca62b29 Fix: Accessing other filetypes within vimwiki (Issue #979)
Note: Viwiki no longer rules them all
2020-08-07 13:26:14 -04:00
Tinmarino
4aa3ca5c16 Fix: VimwikiGenerateLinks crash with single quote in filename (Issue #886 #881) 2020-08-07 12:27:05 -04:00
Tinmarino
0693e41132 Fix: VimwikiTOC removes next non-empty line (Issue #910) 2020-08-06 17:04:58 -04:00
Tinmarino
8a50d022b1 Fix: follow_link (suffix) and VimwikiGenerateTagLinks (__FileExtension__) (Issue #914)
Problem:
- follow_link failed with header with number at the end
- VimwikiGenerateTagLinks did not replace the __FileExtension__

Solution:
- follow_link try first 1 time with suffix number n and then n times without
- VimwikiGenerateTagLinks replace the __FileExtension__
2020-08-06 11:21:48 -04:00
Tinmarino
69ead3bf3c Fix: VimwikiTOC is broken against headers with link (Issue #182)
Problem: VimwikiTOC and follow_link do not support header (anchor) with
link in their body

Solution:
- VimwikiTOC (easy): Create function base.vim s:clean_header_text that
converts [DESC](URL) -> DESC
- follow_link (hard):
-- [[URL]]: was already working due to punctuation removal.
-- [DESC](URL): Search for a potential `]([^)]*)` after every character
2020-08-05 22:26:05 -04:00
Tinmarino
8cc99c00c2 Fix VimwikiRenameLink ruins window layout (Issue #592) 2020-08-05 10:22:32 -04:00
Jerome Gay
b1de908f0e Fix: is_diary_file to support whitespaces (Issue #970) 2020-08-04 19:15:30 -04:00
Tinmarino
825870ec1b Fix: Highlight borken with done item rided by code (Issue #971) 2020-08-04 17:44:37 -04:00
Tinmarino
fc056cfeca Feature: Markdown: Support SetExt Heading (Issue #209)
Like these
==========

See: https://spec.commonmark.org/0.29/#setext-headings

Note: work for follow_link and VimwikiTOC
2020-08-04 01:17:34 -04:00
Tinmarino
428c60a45e Feature: Markdown link: VimwikiTOC supports multiple heading with same name (Issue: #968, 666, #664)
Anchor can be suffixed with -1 -2 according to the heading number (in
file) user want to reach.
Implemented with a dictionary for caching anchor names (without sufix)
2020-08-02 23:28:18 -04:00
Tinmarino
a27940a394 Feature: Markdown anchor normalize and unormalize (Issue #664)
Add normalize anchor and unnormalize to get markdown anchor github
compliant. For respectively follow_link and VimwikiTOC

TODO: Treat the potential -12 suffix in anchor-links: ex:
[got to second link](same-link-2)
2020-08-02 22:05:37 -04:00
Tinmarino
787e95b910 Refactor: Vars: Make vimwiki_toc_header wiki local
Also: vimwiki_toc_header_level, vimwiki_toc_link_format
2020-07-30 18:48:15 -04:00
Tinmarino
355c1f76b0 Feature: Follow links: Allow hyphens and case-insensitive (PR #840 from @bratekarate)
Brief: Permits:

```
[Link to heading](#heading-example)
```

Issue: Feature Request: Support GFM anchor links inside wiki files #831
Original PR: Allow hyphens instead of spaces and search case-insensitive in jump_to_anchor function #840
Author: @bratekarate (implementation) @tinmarino (test)

Related: #666
2020-07-30 00:45:28 -04:00
Ryan Winograd
7a4ad2ed95 Fix :VimwikiNextTask
Use the correct function for accessing 'rxListItemWithoutCB'.
`ac4d0a1d46` refactored access to vars and it appears this is one place
where `get_syntaxlocal` should have been renamed to `get_wikilocal` but
was accidentally skipped.
2020-07-29 15:26:33 -04:00
Tinmarino
369a64cdc8 Feature: VimwikiRenameFile 1/ to other dir 2/ take argument (completable) (Issue #926) 2020-07-29 01:18:40 -04:00
Tinmarino
af08e34000 Fix: update_listing_in_buffer is clearing the buffer (Issue #921)
Problem:
        VimwikiGenerateTags and VimwikiDiaryGenerateLinks end up with empty wiki files
        when foldlevel=0 and g:vimwiki_folding='expr'

Solution:
        Set an initial foldlevel to 100 in update_listing in diary

Optionaly: Comment a little the big messy, geeky hack !
2020-07-27 01:35:49 -04:00
Tinmarino
d9d14cc3f7 Feature: Config: Normalize link so that user can choose [[]] or []() (Issue #892)
Main change:
        Create function: normalize_syntax_settings(syntax)

Problem:
        Some user prefer [[]] links more than []().
        As vimwiki know both of them, they should be able to choose
        without regex mastery and with tests

Solution:
        let g:vimwiki_syntax_variables.markdown.Link1 = vimwiki#vars#get_global('WikiLinkTemplate1')
2020-07-26 23:46:35 -04:00
Tinmarino
4672deb44e Config: make vimwiki_markdown_link_ext wikilocal 2020-07-26 23:46:18 -04:00
Tinmarino
c9ba53e204 Refractor: Path Add utility unixify #478
Basically unixify all before workingm then transofom in function os os

Util: Add function sort_len that a list of string according to the lenght of its content
Fix: VimwikiRenameLink doesn't update links in diary #90
Test: VimwikiRenameLink with nested directories
Prettify comments in autoload/path + remove antipattern
Define osxify function helper to solve windows Vs Unix : see #478
Path: remove useless temporary fix convertion before calling relpath (redundant) : see #478
Test: Fix typo
Path corrected (Thanks to test)
2020-07-25 03:51:02 -04:00
Tinmarino
ac38bb2f09 Refactor: normalize_link_v, creating u#get_selection (Fix #382)
* Less hacky selection handling: nomal command hack -> vimscript code
* Some prettifying, antipattern removal
2020-07-24 17:59:54 -04:00
Rajdeep
e3e841f335 Feature: Add handling of absolute path to vimwiki #811 from @justrajdeep
- update vimwiki link handling so that if using env variables it is resolved
- add [[//absolute_path]] to handle absolute path
- updated doc to reflect the changes
2020-07-22 00:25:58 -04:00
Tinmarino
8cf2789840 Prettify 2020-07-21 19:37:05 -04:00
Tinmarino
068a26acec Fix link extension removed 2020-07-21 19:36:14 -04:00
Tinmarino
75a9232fd5 Fix: #913: VimwikiGoto completion aafter <CR> [in input() prompt]
Issue #913:
        :VimwikiGoto tab completion only works when written in-line, not when called from \wn #913
        PR #785 adds completion to :VimwikiGoto, however it works only when you try to type the filename after the command, e.g.
2020-07-21 10:20:06 -04:00
Tinmarino
e1826702b7 Fix: Link substitution of __FileExtension__ #914 2020-06-16 17:47:40 -04:00
Tinmarino
5e564bb10d Comment: code and robustify 2020-06-04 17:29:26 -04:00
Michael F. Schönitzer
afc868929d
Bugfix: file extension for markdown is syntax wide (#895)
populate_extra_markdown_vars() contained uses of the file-extension via vimwiki#vars#get_wikilocal. Since the first is syntax-wide and the second is wikilocal and no wiki is specified or open at the moment of the call, the file extension of the first markdown wiki will be used for all markdown wikis. Further problems will occur when adding new wikilocal options, that depend on the syntax.

This commit is working towards separating wiki and syntax, which is needed for several feature requests.
2020-06-02 01:33:06 +02:00
Tinmarino
36fa81c059 Fix: get_wikilinks arguments: add pattern 2020-05-26 14:06:17 -04:00
Michael F. Schönitzer
1eb74dcf2f
Rename three commands, deprecate their old names (#887)
The following commands have been renamed to better describe their
function and avoid confusion.
:VimwikiDeleteLink → :VimwikiDeletePage
:VimwikiRenameLink → :VimwikiRenamePage
:VimwikiGenerateTags → :VimwikiGenerateTagLinks (was already renamed in 3b5537f)

Calling the old commands still works but displays a warning message.
2020-05-24 23:49:28 +02:00
Tinmarino
f54b94a38f Lint tipo 2020-05-20 14:43:56 -04:00
Tinmarino
972594829e Lazy: Link with only '-' do not work 2020-05-18 21:23:38 -04:00
Tinmarino
f4c983b6b5 Feature: VimwikiGenerateLink take pattern optional argument
Issue #803
2020-05-17 13:14:08 -04:00
Tinmarino
3b5537f15a Fix: Link containing only '-'
Issue #835 #876
2020-05-17 12:31:32 -04:00
Tinmarino
0850ce13ad Fix: retrocompatibility and Vint 2020-05-13 11:35:22 -04:00
Tinmarino
1852c6c542 Fix: clean_url removing Chinese character
Issue: <Enter> create link bug with Chinese characters #849
Thank: @BSDxxxx
2020-05-13 11:35:22 -04:00
flex
76af17a872 fix base#find_files so that it works for filenames with whitespaces 2020-05-11 22:14:35 -04:00
Patrick Stockwell
b96e82d6cc Generate links when diary & wiki dir are the same
When generating links, we first check that the file is not a diary file
as we don't want to include those in the list. That work is delegated to
the `is_diary_file` function. Prior to this change, the function always
returned true if the file was in the diary directory.
This approach gives false positives for a wiki which has a flat structure
and the wiki files and diary files share a directory. eg:

let wiki.diary_rel_path = './'

This change reuses existing diary functions from the diary.vim module to
get an exact list of diary files to check against.
2020-05-11 21:08:54 -04:00
Tinmarino
1020ac51bf Prettify: Special case in diary not so special
Same as generic case within this PR
2020-04-22 11:22:53 -04:00
Stefan Lehmann
c73107dc10 Fix for Issue #807
creating a new link to an existing page in the diary path now uses the full page name instead of just the first word.
2020-04-22 11:22:53 -04:00
Tinmarino
614287a42b Comment: tipo 2020-04-17 19:01:03 -04:00
Clément Bœsch
7ae02bb4e6 Remove unnecessary echom idx cruft
This was introduced in 3396e87db for debugging and probably forgotten.
2020-04-06 16:50:26 +02:00
Rane Brown
78a41b79c6 Merge branch 'multi_ft' into dev
This allows setting multiple filetypes at the same time e.g. 'vimwiki.md'
Closes #817, resolves #830, resolves #461.
2020-04-03 13:31:36 -06:00
Tinmarino
d9412218e3 Fix relative paths for VimwikiRenameLink. Merge PR #787.
Fixes #90 

__Problem__: VimwikiRenameLink does not rename dir1/toto url in dir2/tata
because the dirs (dir2 and .) were well crossed but badly inspected.
__Solution__: `blob(.ext*)` -> `glob(**/*.ext)` + find the relative URL

* Fasten: VimwikiRenameLink goes faster with cache
More: To compute old_url regex, use a cache dict because it is the same
for files in the same directories

* Util DeleteHiddenBuffer -> do not delete Vader buffer

* Test: Prettify: Util: teardown delete defined function

* Remove unnecessary trailing spaces
Note: list_VimwikiReturn.vader has some necessary trailing spaces
2020-01-04 21:21:52 -07:00