Skip to content

wiki.vim v0.8

Compare
Choose a tag to compare
@lervag lervag released this 16 Jul 21:29
· 141 commits to master since this release

This is a significant update that brings several breaking changes! I'm quite proud of the updates and I believe they both very much improves wiki.vim as a plugin for users, and also makes it easier to continue future maintenance and improvement. I've tried to highlight the most important changes below, but the gist, in short:

  • Much more flexible handling of links and URLs with new options:
    • g:wiki_link_creation
    • g:wiki_link_schemes
    • g:wiki_link_default_schemes
  • Better UI for Neovim with popups for actions to input, confirm or select stuff.
  • Better docs!
  • Lots of other changes and improvements!

Also, wiki.vim is no longer considered "simple". That is, the slogan A simple wiki plugin for Vim is now A wiki plugin for Vim. πŸš€

Features

  • Breaking changes
    • Added new option g:wiki_link_creation (#296, #299)
      This option provides a more flexible filetype dependent behaviour. It also deprecates four other options and thus makes configuring wiki.vim easier for most people. And since the new option provides sensible defaults, it also means most people will require less customization.

      The following options are deprecated:

      • g:wiki_map_text_to_link
      • g:wiki_map_create_page
      • g:wiki_link_extension
      • g:wiki_link_target_type
    • Changed the word toggle to transform, e.g. <plug>(wiki-link-toggle) is now <plug>(wiki-link-transform).
      The word "toggle" is not a good word for the act of changing a link from one type to another. Transform may not be perfect, but at least it is much better.

      This changes two options:

      • g:wiki_link_toggles β†’ g:wiki_link_transforms
      • g:wiki_link_toggle_on_follow β†’ g:wiki_link_transform_on_follow
    • Changed default of g:wiki_write_on_nav to 1

    • Refactored significant parts of the code. These are mostly hygienic changes that makes it easier to continue development and perform other improvements. But I believe they make things simpler to reason about. Highlights:

      • Changed how URL handlers/resolvers are implemented (#302, #304)
        The old style was somewhat convoluted in that the URLs were unnecessarily entwined with the link concept. The new implementation more properly separates the concepts. This is a major step towards allowing more flexibility for users to define their own URL resolvers and handlers.

        In the process, the g:wiki_resolver and g:wiki_file_handler options were removed! The new option g:wiki_link_schemes replaces both of these. Also, g:wiki_month_names was renamed to g:wiki_template_month_names.

        The documentation has also been revised and there are a couple of advanced configuration examples that should be helpful for users who want to customize things.

      • The concept of a "link matcher" is changed to "link definition" and the matcher is converted to a "pure" function. All link definitions are gather in autoload/wiki/link/def.vim.

      • All link templates (for inserting a link) are gathered in the corresponding autoload/wiki/link/template.vim.

      • The link templates must now accept three arguments, the third argument is the origin link itself. This allows to use templates in a more functional way and makes the data flow clearer. Note: This means that anyone who used their own g:wiki_link_transforms functions will need to adjust them to accept the third argument.

  • Added new option g:wiki_link_default_schemes (#301, #303)
    This allows a flexible way to specify default schemes for each link, per filetype if desired.
  • Added Neovim-specific UI elements with a floating window popup for input, confirm and select actions.
  • Added visual mode version of :WikiLinkExtractHeader (#280)
  • Added :WikiGraphCheckOrphans (#311)
  • Added wiki#buffer#refresh_incoming_links (#313)
  • Use scratch buffer to show link data (#301)
  • Other minor things:
    • Changed name wiki#complete#link β†’ wiki#complete#url
    • Allow argument for :WikiOpen
    • Added wiki#link#get_all_from_range
    • Added wiki#graph#get_backlinks_enriched
    • Added :wiki#u#associate_by

Performance

  • Improve performance of wiki#graph#check_orphans
  • Improve graph cache_links_in refresh mechanism

Bug Fixes

  • Use fd -I to respect .gitignore for completion (#307)
  • Complete links for all chosen filetypes (#312)
  • Ensure the cache_links_in graph is properly read before refreshing the graph data
  • Use inputlist() for ui#select when buffered
  • Use silent! to ignore potential errors in url#follow
  • A few other minor fixes

Documentation

  • Large improvements to the documentation
    • Improved descriptions of links and urls (#301)
    • Improved the structure and flow of sections
    • Added some advanced configuration examples
  • Fixed typo in example (#314)

Acknowledgements

As always, I much appreciate contribution from the community, and I would like to thank in particular those who contributed PRs: @jiz40h (#314).