Skip to main content

Extension-less Autocomplete for Wikilinks

Completed

Comments

13 comments

  • Fletcher Penney

    They work without extensions as long as you don't have multiple conflicting files, aside from the extensions (e.g. foo.txt and foo.md).  And if, for example, you changed the default file extension between the creation of WikiLinks and trying to use them, they would break.

    0
  • Anthony Agbay

    I see that they work without extensions -- [[foo]] would map to foo.md without the extension, which is perfect (thanks for implementing the links like this!). I also see that changing the extension will break the wikilink.

    For cases in which we know that the extension will always be ".md" (and thus there shouldn't be any conflicts with .md and .txt files, would there be a way to generate the autocompleted wiki link without the ".md", or is this to help prevent the problems with the potential extension conflicts?

    Right now, trying to generate [[foo]] via autocomplete is a two-step process:

    1. Use autocomplete to generate [[foo.md]]

    2. Delete the extension manually to leave [[foo]]

    Potentially would like to generate [[foo]] using autocomplete in a single-step by bypassing the need to manually delete the included extension.

     

    1
  • Craig Eley

    Came here to report on this same issue. Using autocomplete is so amazingly fast here—it would be great to be able to save a step and not have to delete the file extension, especially since nvALT works this way.

    2
  • Bernardo CDA Vasconcelos

    I was about to create another topic to request the precisely the same thing (removing the extension from wiki link/transclusion suggestion).

    Fletcher, could you please consider it? Thanks!

    0
  • Fletcher Penney

    The more I think about this, the more I don't think it is a good idea.  And now there is a "bug report" to suggest I may be right (https://multimarkdown.zendesk.com/hc/en-us/community/posts/360038386693/comments/360009987534)

    First, you must remember that we are working with a file system, not a controlled database where we limit what others can do (e.g. we cannot prevent people from using different file extensions for their text files, like we can in the Wikipedia database).

    Given this:

    1. I agree that *IF* you are consistent in your naming conventions and preferences, WikiLinks *can* work just fine without file extensions, but...

    2. If you change your default file extension preference, *ALL* of your extension-less WikiLinks will now be broken.

    3. If you share your documents with another user who has a different default file extension, *ALL* of the WikiLinks you created will be broken for them, and any they create will be broken for you.

    I realize that many users will be in situations where these limitations don't apply to them, but many users will run into these issues periodically with at least some of their files.  And this users will be really confused.

    I believe the default behavior should be something that "just works" (whenever possible at least), and in this case leaving out the extension doesn't just work under all circumstances.  You are certainly welcome to delete file extensions if you know what you are doing, but I don't think it should be the default behavior.

    What I *did* do was add a hidden preference `NVSuppressWikiLinkCompletionExtensions` to allow you to turn this off in the next release.  As long as you understand the limitations and potential problems of this, feel free to remove the extensions.  Just don't say I didn't warn you....  ;) 

    0
  • Bernardo CDA Vasconcelos

    Thank for you the hidden preference :)

    How do I activate it once the next release is out? I mean, is this the full command `NVSuppressWikiLinkCompletionExtensions`?

    0
  • Fletcher Penney

    The other (existing) hidden preferences are described here -- https://nvultra.com/help/advanced-features#hiddenpreferences

     

    This will work the same way.

    0
  • Joe Buhlig

    Just wanted to say thank you for the hidden preference. For those of us who have private notes repos this is gold. Thanks!

    0
  • Fletcher Penney

    You're welcome!!

    0
  • Feek

    Thx for adding this hidden option!

     

    0
  • Sean Akahane-Bryen

    Thank you for this. Is there any chance the preference will be a checkbox in the GUI in the final release (not that it's a matter of high priority to anyone who notices the relevant line in the docs)?

    0
  • Feek

    Hi,

    I've set NVSuppressWikiLinkCompletionExtension to True, but since one of the latest versions wikilinks without file extension does not work anymore.

    So clicking on [[test]] in the nvUltra editor not opens a new file "test" (without extension). Early the file test.md was opened.  

    I'am using the latest version of nvUltra (beta 73)

    0
  • Wayne Henriques

    Hi,

    Just an FYI that I am successfully using both nvUltra and vimwiki.  I can create and edit in either.  WikiiLnks are created without the .md extension and files are created wth the .md extension, nvUltra wikiLlinks do not autocomplete with the .md extension after I set:

    defaults write com.multimarkdown.nvUltra NVSuppressWikiLinkCompletionExtensions YES

    NOTE:

    I have set g:vimwiki_list wikis with these attributes:

         'syntax': 'markdown',

          'ext': '.md'

    I am using nvUltra Version 1.0.0 (2021.07.28.15.20)

     

    The ability to use both on the same wikis is just right for me.

    Thanks for adding this feature, I will be a future customer :)

    0

Please sign in to leave a comment.

Powered by Zendesk