Zettelkasten Forum


Feature Request: automatic completion when adding link to zettel

edited February 14 in The Archive

I will be typing along, and realize I want to link to an extant zettel. I have to go to the search field, search, copy the link for the relevant target, clear the search field, find the note I was working on originally, find my place in it, and paste the link. This is a lot of cognitive overhead and always takes me out of the flow.

Nearly every time I use The Archive I miss this feature from @rene 's work. In sublime-zk or sublimeless, I can type [[ while writing and get a pop-up list of all zetteln, which narrows as I type. Then, when I hit return, the correct one is inserted.

The [[ trigger is not necessary, a hotkey to bring up an auto-narrowing list would also work. In emacs with zetteldeft I can do the same thing with a hotkey, and that works fine as well.

Honestly, this is the number one thing that makes me minimize The Archive and open another app.

Comments

  • I completely agree with @mediapathic that this feature would be great, and I would like to see a design solution in which, when one types a character like [ or #, and continues to write a letter directly after this, a list like the following pops up.

  • Keyboard Maestro to the rescue!

    The Archive Macros

    Four macros. The first is triggered by [[ then it does a type ahead search of your notes. Then it places the UID within [[ ]]. The other three are for duplicating the same funtionality with tags. Refresh Tag Varible keeps tract of tags. Refresh Tag Cloud creates a "Tag Cloud" note and finally, Insert Tag is activated by typing the # key with the same type ahead search.

    Thanks for the inspiration to create these. I'm finding them very helpful already.
    I'm really an amateur at this Keyboard Maestro but I'm enjoying it so far.

    Will Simpson
    kestrelcreek.com

  • @Will said:
    Keyboard Maestro to the rescue!

    Oh no.
    I mean, uh, thank you!

  • @mediapathic said:

    @Will said:
    Keyboard Maestro to the rescue!

    Oh no.
    I mean, uh, thank you!

    Thanks, I consider Keyboard Maestro in this use case a crutch till @ctietze's further developments.

    Will Simpson
    kestrelcreek.com

  • Hey Will... I just wanted to thank you for sharing your macros. I've been banging my head against the Keyboard Maestro wiki trying to figure out how to do these things. The macros you've put together helped me immensely (both in terms of getting my stuff done and in terms of learning a bit more how to bend KM to my will).

  • Thank you. Credit is shared amongst my teachers and those who inspired me. @kaidoh, @onlyskin, several people for the Keyboard Maestro users forum. And everyone who was kind enough to share tips on Regex. Testers and onlookers. Special thanks to @ctietze for creating this forum and The Archive. Thanks to all of you.

    Will Simpson
    kestrelcreek.com

  • @Will Sorry for my ignorance but I was only able to get Inline Note Link to work. Are there a few common stumbling blocks in Keyboard Maestro you may be able to identify and help me overcome? I have changed the filepath from yours to mine; that was easy enough to get Inline Note Link working.

  • @nickmilo22, glad you could get the _Inline Note Link _ working. Is there a specific macro you are trying to get to work? I'll try and help.

    1. For some of the macros, there is an expected variable needed that is provided by another macro.
    2. One tip that has helped me tremendously is to test the regex part of the scripts in terminal first to be sure that the output is what you want.
    3. I found it helpful to keep Keyboard Maestro's preferences open to the variables and keep checking that I'm referring to the correct variable.

    Will Simpson
    kestrelcreek.com

  • @nickmilo22, glad you could get the _Inline Note Link _ working. Is there a specific macro you are trying to get to work? I'll try and help.

    1. For some of the macros, there is an expected variable needed that is provided by another macro.
    2. One tip that has helped me tremendously is to test the regex part of the scripts in terminal first to be sure that the output is what you want.
    3. I found it helpful to keep Keyboard Maestro's preferences open to the variables and keep checking that I'm referring to the correct variable.

    Will Simpson
    kestrelcreek.com

  • edited April 21

    Thanks @will . I think some of this is more than a few steps beyond my level of programming at the moment. I'm going to punt for the time being until I level up a bit.

  • Hi @Will -
    I've been using both your tag and zettel autocomplete KM macros and am a huge fan. My only complaint is that I'd like a smoother way of creating new tags and zettels. In action, when hit # and type a tag that does not yet exist in the list, it would be great if I could hit simply hit return and insert "# + what I've typed in the 'Prompt with List' dialog" at my cursor location. I've been trying and can't figure it out. Any ideas?

    Thanks-

  • I ask in Keyboard Maestro's forum about this and consensus there isn't a way to add a tag on the fly. Once you have discovered that a new tag is needed, a double tap on the esc key will end the macro and place the cursor for the new tag.

    My tag strategy is such that I don't have many (maybe 30) and am reluctant to create more. Still, haven't found a use case for tagging. Tagging, as a level of zettel grouping, feels good though.

    A far a smoother way of creating zettels. I'm not sure what you are asking. I use a KM template to create zettels.

    Will Simpson
    kestrelcreek.com

  • @scook, I did discover a workflow that might help with creating a new tag while using the "Insert Tag" KM.
    Add a unique tag like --Create-New-Item-- or similar that would sort at the top of the tag list. Also, set the "Default:" in the KM Action to "-". Now when run you will see the list of tags to choose from (type-ahead search still works) and if you feel the need to create a new one select --Create-New-Item--. Still not ideal but maybe a little smoother.

    Will Simpson
    kestrelcreek.com

  • @will, yes, I had thought of something similar. The trick there is that you'd need to know in advance that you were going to create a new tag. For me, one of the most useful functions of your autocomplete macro is that it suggests options as I type, eliminating the possibility of creating slightly different but redundant tags.

    Another possibility I tried was to tigger another macro that records what I into the "Prompt with List" dialog to a variable when the autocomplete macro initiates. Using and If/Then action, I would have that recorded text variable inserted at the cursor location if the "Prompt with List" fails (by hitting escape, or something). Sadly, I couldn't get it to work.

    Thanks for the feedback!

  • edited July 7

    Instead of creating a new thread, I'm concatenating to this one. I hope that is ok. I basically want to second what has been said already, but also to extend the request for generic tag auto-completion.

    I'm really missing this feature or rather some kind auto-tag-suggestion. When initially tagging Zettels in my preamble I have to check all instances for conformance. For if I fail to do so, the Zettel of course won't show up with applied filters although I would want it to.

    It'd be great if TheArchive would grep all # or [[ - initiated strings, store them in a separate file and generate suggestions from them if one types # or [[. Perhaps with some CoreData/ UserDefaults integration and filter predicate magic.

    A quick search presented me with this blog post. While (of course..) it is for iOS, it may yield some functional insight on how to do it.

    Thanks!~

    -edit
    Maybe the complete(_:) method can be modified to that end?. Here's another possibly helpful source via this stack overflow question. And another, possibly directly pertaining to the problem; suggests to use textView(_:completions:forPartialWordRange:indexOfSelectedItem:).

  • @zeitlings Not sure I understand your request but you might check out this discussion. This creates a zettel that is basically a tag cloud, a listing of previously used tags.

    "It'd be great if TheArchive would grep all # or [[ - initiated strings, store them in a separate file..."

    Bits of help preventing minor spelling or syntax multiples and will jog the memory. (Looks pretty to.)

    Will Simpson
    kestrelcreek.com

  • edited July 9

    @Will thanks for your reply.

    Not sure I understand your request

    Compare it to the built-in MacOS tagging feature in Finder. When assigning tags, you start with typing a letter and as you are typing on, you will be presented with a list of previously used tags relative to the prefix you've already been entering.

    As for how I imagine this to work with TheArchive, you can compare it to most IDEs, e.g. Sublime Text. Once you've defined a variable in your code, you will be presented with an in-line dropdown of already defined variables once you start typing, similar to what you've started typing.

    Bits of help preventing minor spelling or syntax multiples and will jog the memory. (Looks pretty to.)

    While this would be a more convenient overview of available tags, it would still require me to manually check some tags either before I add them to the preamble or after :# I'd like TheArchive to be "smart" about it 🙄

    • -edit

    I just discovered a Keyboard Maestro macro to do just that. That's nice, but, well, Keyboard Maestro. I guess I could convert this to an Alfred workflow 🤷‍♂️

Sign In or Register to comment.