Nithin Bekal About

Logseq: How to write custom slash commands

10 Feb 2023

Writing a custom slash command for Logseq is pretty easy. You can a “Review” slash command by adding an entry to the :commands setting in config.edn:

:commands
[
  ["Review", "TODO: [[Code Review]] "]
]

This lets you start typing /review to get “Review” as one of the options in the command palette like this:

Logseq custom slash command example

This autocompletes to TODO [[Code Review]], and you can add a link after that.

I add these kinds of TODO tasks in my journal multiple times a day. The slash command only saves a couple of seconds, but it’s so satisfying not to have to manually type that out every time I copy a link to a PR to review.

Hi, I’m Nithin! This is my blog about programming. Ruby is my programming language of choice and the topic of most of my articles here, but I occasionally also write about Elixir, and sometimes about the books I read. You can use the atom feed if you wish to subscribe to this blog or follow me on Mastodon.