Syntax highlighting for code blocks

I use Dynalist to store code snippets and notes about code. Currently, a code block like this:

```fun add(x: Int, y: Int): Int {
    return x + y
}

add(2, 4) // 6```

Is displayed like this:

00

My preferred scenario would be to support language names like in MarkDown and have this:

```kotlin
fun add(x: Int, y: Int): Int {
    return x + y
}

add(2, 4) // 6
```

Look a little more like this:

42

17 Likes

I always wonder why this is forgotten, I mean this is build by developers right?
We could use a bit more developers love :slight_smile:

4 Likes

+1, need code highlighting very much.

1 Like

How do you get that code block to work? I can’t even get that to work.

1 Like

Look in your keymap: :slightly_smiling_face:

image
It is a weird shortcut for non english keyboard. You could just type two times `` as well.

Code highlighting has now arrived, and it’s great, but the back-tick character really is inaccessible on non-English keyboards. I’d welcome an option to customize a Dynalist keyboard shortcut that would insert three back-ticks that are now needed for multi-line code blocks. As it is, I have set up an AutoHotKey keyboard shortcut on Windows to insert the three back-ticks for me.

In my humble opinion, this responsibility doesn’t belong to the program but the OS.

I’m a US International keyboard layout user which has the ‘inaccessible’ behaviour I think you might be referring to. Simply pressing “`” (top left most character right under the escape button for me) followed by a space for one single back tick or three presses followed by a space for three has always worked perfectly for me.

Your AHK solution sounds perfect and like the perfect way and place to solve an issue that you don’t have with the app but with the OS you’re running the app on.

Well, I would still welcome the opportunity to set up my own keyboard shortcut for inserting three back-ticks, just like it’s possible to set up your own keyboard shortcuts for many other things in Dynalist, such as for inserting the bold or italic markdown – or a single back-tick!

But this is brand-new Dynalist functionality, just introduced a few days ago, so perhaps the option to set up a customized keyboard shortcut for inserting three back-ticks will be added to Dynalist a bit later on. :slightly_smiling_face:

2 Likes

+1 i need a shortcut too. thanks.

1 Like