Move through daily notes interactively

Hi everyone,

I would like to create a function that works a bit like text-scale-adjust (C-x C-0). In text-scale-adjust you enter some kind of “mode” where you can press “+” or “-” to adjust the text as many times as you want, until you leave this mode.

I want this kind of behaviour but instead, I want to move through my existing daily notes. I find that I am using “C-c n d f” and “C-c n d b” a lot to move through them, which is exhausting, and I’m trying to find an easier method. I’m guessing it will be using org-roam-dailies-goto-next-note and org-roam-dailies-goto-previous-note. I have looked through the code for text-scale-adjust to try to replicate it but I do not yet understand elisp enough to find how it makes this kind of behaviour work.

So, in practice, it would look like this:

  • M-x move-through-daily-notes
  • echo area reads something like “press n for next daily note, press p for previous daily note”
  • n: call org-roam-dailies-goto-next-note function
  • p: call org-roam-dailies-goto-previous-note function
  • press any other button to exit mode

Thanks in advance!

I don’t think you need a custom function or mode. I suggest you consider the built-in Repeat mode. Refer to the following. I am away and can’t verify exactly how you set it up, but I use Repeat-mode and it works. You should be able to type C-n n d f p f f p f… If you like, you can re-bind it to some other keys, to C-n [ and ] for example.

Have you used speed keys? You can create a speed key customized to the context.

(I do use speedkeys a lot, N and P are available, but I have never created context specific ones

I have also added a hydra to my speed keys, which allows me to run lots of commands with two keystrokes)

1 Like

Thanks a lot! This is exactly what I needed. And its very useful that it works with use-package.

1 Like