Zettelkasten Forum


[REQUEST] Shortcut for Markdown Headings

edited August 2020 in The Archive

Something you guys might want to consider in the future: a simple keyboard shortcut that adds a heading symbol # to the current line. If hit, twice, that'll become ## .. and so on.

I've seen it in other editors (eg bound to command+) and found it super useful.

Comments?

Post edited by ctietze on

Comments

  • @lambdaman If you use Alfred, I have created a workflow for The Archive that provides this feature.

    https://github.com/pryley/alfred-the-archive/blob/master/README.md#change-heading-levels

  • I would also really like built-in shortcuts for headings.

    In my text editor (LibreOffice) and my other markdown editor (IA Writer), I use the following shortcuts all the time: Cmd-1 for Heading 1, Cmd-2 for Heading 2 etc. It's quick and I would find it useful to have these in the Archive as well.

    Thanks.

  • I'd find this helpful also. But admittedly, anything I get used to in TA I then wish was a feature elsewhere.

  • edited August 2020

    @samueldee said:
    I would also really like built-in shortcuts for headings.

    In my text editor (LibreOffice) and my other markdown editor (IA Writer), I use the following shortcuts all the time: Cmd-1 for Heading 1, Cmd-2 for Heading 2 etc. It's quick and I would find it useful to have these in the Archive as well.

    Thanks.

    I think you can change the keyboard mapping with Alfred, Textexpander, Keyboard Maestro, editing the MAC keybindings, or easy peasy you can add text substitutions in the Keyboard System Preferences. The ⌘ key is unavailable in the replace category but all the letters, numbers, and symbol keys are available. I chose the z key because of its proximity to the ⌘ key. Of course, you could use a different key combination.

    @samueldee this new key mapping will work in LibreOffice alongside Cmd-1 for Heading 1.

    Test 1 `

    Test 2 ##

    Test 3 ###

    Test 4 ####

    @Sociopoetic because this is a system-wide, it works in any application where the "Text Replacements" option is enabled.

    Will Simpson
    “Read Poetry, Listen to Good Music, and Get Exercise”
    kestrelcreek.com

  • @Will thank you for that showing me that possibility.

    The solution you suggested doesn't meet my need for writing notes with the least friction as possible -- in this case, having the same quick shortcuts that I'm used to (my personal preference) for editing the content of a note.

    The way I work with a single note is:

    1. I write a first version of it, which may or may not contain headings.
    2. On a second / third pass, I edit the text, turn some text into bold (cmd-b), turn some text into italic (cmd-i), and turn some paragraphs into headings (cmd-1/2/3). Sometimes, crucially, I also change the heading using the same shortcut -- from a heading 2 to a heading 3 for example. So it's not just about adding a heading at the moment of writing, it's also about turning existing paragraphs to headings, and converting headings to headings of another level (or back to paragraphs).

    I would rather keep the same basic workflow across applications on the level of writing the text itself, even if how the notes are organised is different.

    I have been testing out different note apps, and some apps have that headings shortcut built in (Caret, IA Writer, Lightpaper, Typora - more traditional markdown editors), others do not yet (the Archive, Obsidian, Zettlr).

    So I'm checking if the developers are open to this feature request.

    Thanks

    Samuel

  • I personally often wait for requests like these to gain some traction, because to me, "the shortcut" is Cmd+left_arrow + "#" + " " -- i.e. I type the hashes quickly and by sheer muscle memory. Of course being anywhere in a line and hitting a shortcut to make the line a heading has its value, too. Thanks for reviving the discussion here.

    Author at Zettelkasten.de • https://christiantietze.de/

  • edited August 2020

    I would love to see the IA Writer format shortcuts mapped to The Archive.

  • @pryley For reference, can you list those you are looking for?

    Author at Zettelkasten.de • https://christiantietze.de/

  • edited September 2020

    @ctietze

    ⌘1 Heading 1
    ⌘2 Heading 2
    ⌘3 Heading 3
    ⌘4 Heading 4
    ⌘5 Heading 5
    ⌘6 Heading 6
    ⌘` Fenced Code Block around current line (or selected lines)
    ⌘. Mark Task as Completed (i.e. - [x])

    ⌥⌘` Inline Code
    ⌥⌘- Strikethrough
    ⌥⌘= Highlight
    ⌥⌘↑ Move Line Up
    ⌥⌘↓ Move Line Down

    Additionally, it would be awesome it you added two more list types:

    1. Unordered Task List (i.e. - [ ] This is a task)
    2. Ordered Task List (i.e. 1. [ ] This is a task)
  • With v1.6.2 (on the 'cutting edge' channel since today), shortcuts to move the selected lines or the current line were added. I saw ⌘⌃ instead of ⌘⌥ more often and went with that, though, so you'd have to rebind :)

    Author at Zettelkasten.de • https://christiantietze.de/

  • @ctietze said:
    With v1.6.2 (on the 'cutting edge' channel since today), shortcuts to move the selected lines or the current line were added. I saw ⌘⌃ instead of ⌘⌥ more often and went with that, though, so you'd have to rebind :)

    Thanks. Those keybinding are from IA Writer but I actually prefer ⌃⌘↑ and ⌃⌘↓ as it matches Sublime Text which I use more often.

  • One aspect of shortcuts I discussed with @ctietze is the following: The Archive differs from apps like the iA Writer in its lack of focus on a single document. Optimally, you wouldn't switch files a lot in the iA Writer. But file switching (notes are mostly realized as files) is an essential part of working with The Archive. This is natural as writing is different from thinking writingly. It is a different mode that invokes different behaviors.

    So, it might be difficult to match the short cuts of The Archive and "normal" writing apps.

    I am a Zettler

  • edited April 2021

    I have been enjoying espanso from espanso.org. It is easy to set up text expansions globally or specific to a particular app. It is also free.

    I’ve been using it mostly for markdown related things.

  • The above posts appear to indicate there are some shortcuts? Where do I find them?
    For example for H1, H2 etc?
    There is nothing in the help, or within the search of TA mentioning shortcuts.

  • Hi, @Eskie; check out Best Practices — Zettelkasten Forum

    If you are a Keyboard Maestro or Alfred user, check out The Archive + Keyboard Maestro/Alfred macros - Page 2 — Zettelkasten Forum. I prefer Keyboard Maestro.

    There are no keyboard shortcuts for basic markdown commands, which would be longer than the actual command. There are a few in the "Format" dropdown menu. Specifically for H1, and H2, once you know the commands, that knowledge has a lot of utility when using other applications.

    Here is a link to a detailed reference to MultiMarkdown v6 Syntax Guide. At first, I referred to it often, but now it just hangs out in my bookmarks bar for when I come upon some esoteric formatting question. There is a lot there, but the "Text" section covers all the basics.

    Will Simpson
    “Read Poetry, Listen to Good Music, and Get Exercise”
    kestrelcreek.com

  • Will, would I be able to do it using Text Expander?

  • edited April 12

    Yes! It depends on what you consider "it" to be. Basic markdown syntax is trivial with Text Expander. Text Expander will handle more complicated text replacements with more effort. I've heard great things about Text Expander's capabilities. One upside to using Text Expander is that the expansions created and the knowledge gained will be transferable to all your apps. There are probably others here on the forums that use Text Expander, and who would be willing to share configurations.

    Will Simpson
    “Read Poetry, Listen to Good Music, and Get Exercise”
    kestrelcreek.com

Sign In or Register to comment.