Breadcrumbs is a great idea. Below is the version for Windows, written in PowerShell:

  # Breadcrumb
  - trigger: ":bc"
    word: true
    replace: "{{output}}"
    vars:
      - name: output
        type: shell
        params:
          cmd: (echo "[[$((Get-Date).AddDays(-1) | Get-Date -UFormat "%Y-%m-%d")|<< Yesterday]] | [[$((Get-Date).AddDays(+1) | Get-Date -UFormat "%Y-%m-%d")|Tomorrow >>]]")
14 Likes

Here’s a breadcrumb for Keyboard Maestro.

  • My custom version includes a separate link to a file named after the week number (at the beginning of the line, since I keep a weekly to-do list that includes the daily lists), but you can just delete that first segment.
  • I also like having the day of the week, but you can just remove the %EEEE% to get rid of it. Thought I’d save others the unicode date math in case it’s helpful.

[[2020w%ICUDateTime%ww%]] | %ICUDateTimeMinus%1%Days%EEEE% [[%ICUDateTimeMinus%1%Days%yyy-MM-dd% ]] | %ICUDateTime%EEEE yyy-MM-dd% | %ICUDateTimePlus%1%Days%EEEE% [[%ICUDateTimePlus%1%Days%yyy-MM-dd%]]

  • I have it triggered with a typed string of 3 letters. The result looks like this:

[[2020w28]] | Friday [[2020-07-10 ]] | Saturday 2020-07-11 | Sunday [[2020-07-12]]

3 Likes

Recreated OP’s in Keyboard Maestro, like the minimalistic look. Added the current date as a header to make it stand out when reminiscing.

[[%ICUDateTimeMinus%1%Days%yyy-MM-dd%|<< Yesterday]] | 
[[%ICUDateTimePlus%1%Days%yyy-MM-dd%|Tommorrow >>]]

---
#  %ICUDateTime%EEE, MMM d, yyyy%
1 Like

Thanks for the ideas in this thread.

I’ve been using fastkeys (skin for autohotkey) for a few years and taken these ideas and implemented them in fastkeys

1 Like

Thank you for this one!

Breadcrumbs for daily notes in Autohotkey for Windows:

; To run: CTRL + SHIFT + D

^+d:: 
	yesterday := a_now
	yesterday += -1, days

	tomorrow := a_now
	tomorrow += 1, days

	FormatTime, tomorrow, %tomorrow%, yyyy-MM-dd
	FormatTime, yesterday, %yesterday%, yyyy-MM-dd
	
	SendInput, << Yesterday [[Daily notes/%yesterday%|%yesterday%]] | [[Daily notes/%tomorrow%|%tomorrow%]] Tomorrow >> 
	
	Send, {Enter} {Enter} ---
Return

Depending on where your daily notes are stored you have to modify the folder indication (Daily notes/) of the backlink.

4 Likes

@chopivy, thank you so much for this - I had no idea I could combine Windows PowerShell and espanso in this way until I saw your post. Adding a day of the week calculation for Windows users, following @mitzimbj suggestions above:

 # This Monday
 - trigger: ":>mon"
   word: true
   replace: "{{output}}"
   vars:
   - name: output
     type: shell
     params:
       cmd: (echo "[[$(if([Int] (Get-Date).DayOfWeek.value__ -gt [Int] [DayOfWeek] 'Monday') {(((Get-Date).AddDays(7- ([Int] (Get-Date).DayOfWeek.value__ - [Int] [DayOfWeek] 'Monday'))) | Get-Date -UFormat "%Y-%m-%d")} Else {((Get-Date).AddDays(([Int] [DayOfWeek] 'Monday') - (Get-Date).DayOfWeek.value__) | Get-Date -UFormat "%Y-%m-%d")})]]")   

This will return [[2020-07-20]]

Limitations: I wasn’t able to find the equivalent of @mitzimbj’s -v command for Windows, so I used an if statement instead. This means that you can’t do a properly formatted link [[2020-07-20 | Monday 20 July, 2020]] as PowerShell throws an error when you try and open a second pipe | (Get-Date) inside the if and else curly { } braces. If anyone knows of a more elegant solution, I would love to hear it.

In situations where today is Monday and I want to fast-forward by a week instead (i.e. Monday > Monday) I use the # Next Week script:

# Next Week
- trigger: ":>w"
  word: true
  replace: "{{output}}"
  vars:
  - name: output
    type: shell
    params:
      cmd: (echo "[[$((Get-Date).AddDays(+7) | Get-Date -UFormat "%Y-%m-%d") | $((Get-Date).AddDays(+7) | Get-Date -UFormat "%A %d %B, %Y")]]")

Please feel free to amend and improve.

1 Like

Hi, I tried using your script in Windows and I changed it to include week name abbreviated:

FormatTime, tomorrow, %tomorrow%, yyyy-MM-dd_ddd
FormatTime, yesterday, %yesterday%, yyyy-MM-dd_ddd

So it matches by Odisidian daily notes pattern. However, when I run the script, the weekday is in lowercase, so instead of Mon I get mon, different from Obisidian behavior.

Do you know how to fix it?

1 Like

_ddd is short day, try _dddd

Thanks so much for sharing! This breadcrumb is really useful for daily notes.

I was able to re-create it using Alfred, in case anyone is interested.

[[{date -1d:yyyy-MM-dd}|<< Yesterday]] | [[{date +1d:yyyy-MM-dd}|Tommorrow >>]]
---
2 Likes

I tried to the code with breadcrumb (bc) - powershell started, then nothing happens, breadcrumb is not appearing, just blank page. Any ideas why could it happen?

Hey @trickykid, Bash and (Windows) PowerShell are similar in ways but not identical, thus you should use different syntax (?)/functions. The following espanso command works for me on Windows 10:

  # Breadcrumb
  - trigger: ":bc"
    word: true
    replace: "{{output}}"
    vars:
      - name: output
        type: shell
        params:
          cmd: (echo "[[$((Get-Date).AddDays(-1) | Get-Date -UFormat "%Y-%m-%d (%a)")|<< Yesterday]] | [[$((Get-Date).AddDays(+1) | Get-Date -UFormat "%Y-%m-%d (%a)")|Tomorrow >>]]")
5 Likes

Hey guys, is anyone aware of how to achieve this in linux (I’m using manjaro)

Neither the Windows nor Mac version of this seemed to work for me.

I found the following in the espanso documentation

Other possible values for the shell parameter are:
On Windows: cmd, powershell, wsl
On macOS: sh, bash
On Linux: sh, bash

https://espanso.org/docs/matches/

I thought the mac bash set up would work for linux, but after setting it up correctly in espanso, it doesn’t work.

with the original code specified by @mitzimbj
after writing :bc after the text expansion all I get is this symbol |


with the windows code by @psyguy I get [[|<< Yesterday]] | [[|Tomorrow >>]] without the actual dates.


not sure what I’m missing, appreciate any help, or links to documentation to figure this out

Try this for breadcrumbs in Linux:

  - trigger: ":bc"
    replace: "[[{{yesterdaybc}}|<< Yesterday]] | [[{{tomorrowbc}}|Tomorrow >>]]"
    vars:
      - name: yesterdaybc
        type: shell
        params:
          cmd: "bash -c 'date +%Y-%m-%d -d -1day'"
      - name: tomorrowbc
        type: shell
        params:
          cmd: "bash -c 'date +%Y-%m-%d -d +1day'"

This is what I get when I press :bc :

[[2020-10-19|<< Yesterday]] | [[2020-10-21|Tomorrow >>]]

My espanso file is pretty big, because I use Windows and Linux, so I need one script for each system.

  • edit: I’m on Linux Mint.
4 Likes

This works perfect! Thank you so much for the help. That’s very simple and elegant code. I Appreciate the help!

1 Like

Or in one line

echo "$(date  --date='1 day ago' '+[[%d-%m-%Y_%a|<< Yesterday']]) | $(date --date='next day' '+[[%d-%m-%Y_%a|Tommorrow >>']])"
2 Likes

Thank you @psyguy !!! I could not get this to work in windows but I used this command and voila! :smiley:

1 Like

Thank you for sharing this, just wanted to share an updated meeting snippet that replaces the 0000 with current time using a variable!

  # Meeting
  - trigger: ":meet"
    word: true
    replace: |
      ## {{meet_time}} Meeting
      - Tags:
      Meeting Link:
      Attendees:
      Tasks:
      Notes:
    vars:
      - name: meet_time
        type: date
        params:
          format: "%H%M"
2 Likes

Thanks very much for this @mitzimbj. I’m new to espanso (and to YAML and using the Terminal, frankly) but I wanted to implement the breadcrumb for my daily notes like you have. Espanso is now installed and I’ve figured out how to configure the YAML file to include the breadcrumb trail shortcut, which is great.

However, when I cmd+click on the link (produced by the breadcrumb expansion) for the previous or next day’s daily note, I notice that the as-yet-uncreated note gets created in my general vault rather than in the Daily Notes folder. Do you or anyone else know how to adjust settings or the expansion to keep the linked files in the Daily Notes folder automatically when created from the link?

I appreciate any help on this.

@NonAuraticBlue - Check your setting for ‘Default location for new notes’ - you should have ‘Same folder as current file’ selected. I’m guessing you have ‘vault folder’ or something else set there.

It is possible to give a link a file path, but if all your daily notes are in the same place (which is how most are set up, I would think) then the link from one day to the next should be in the same folder.

1 Like