nvim-telekasten / telekasten.nvim

A Neovim (lua) plugin for working with a markdown zettelkasten / wiki and mixing it with a journal, based on telescope.nvim
MIT License
1.42k stars 91 forks source link

[BUG] Find daily notes & find week notes both show all the notes #321

Closed marad closed 7 months ago

marad commented 7 months ago

Please confirm

Describe the bug Both finding daily and weekly notes show all the notes that I have in my notes folder.

To Reproduce Steps to reproduce the behavior:

  1. Start nvim
  2. :Telekasten find_daily_notes (or :Telekasten find_weekly_notes)
  3. Telescope window shows all the notes

Expected behavior I'd like to only see daily/weekly notes

Screenshots If applicable, add screenshots to help explain your problem.

Operating system (please complete the following information):

Additional context Add any other context about the problem here.

Tonitum commented 7 months ago

Do you have the daily/weekly folders set to a different directory than the home directory? As far as I can tell, the pickers launched by find_daily_notes/find_weekly_notes uses the configured folder as the cwd for telescope.

marad commented 7 months ago

@Tonitum No, I have everything laying flat within the ~/notes folder. Should daily/weekly notes be in some specific place? When I create a daily note it also creates it within the ~/notes folder.

lambtho12 commented 7 months ago

Then it is normal.

Basically find_daily/weekly opens a picker in the configured dailies and weeklies directory. If you have not specified anything special, it will always return everything in your home.

The original workflow intended when designing telekasten is to organize everything a bit like this:

zettelkasten/
├─ abc000-note1.md
├─ abc000-note2.md
├─ abc000-note3.md
├─ abc000-note4.md
├
├─ dailies/
│  ├─ 2024-04-10.md
│  ├─ 2024-04-09.md
├─ weeklies/
│  ├─ ...
├─ templates/
│  ├─ regularnote.md
│  ├─ daily.md
├─ images/
│  ├─ myimage.png

and alternative that may work as well would be

notes/
├─ abc000-note1.md
├─ abc000-note2.md
├─ abc000-note3.md
├─ abc000-note4.md
├─ templates/
│  ├─ regularnote.md
│  ├─ daily.md
├─ images/
│  ├─ myimage.png

journal/
├─ dailies/
│  ├─ 2024-04-10.md
│  ├─ 2024-04-09.md
├─ weeklies/
│  ├─ ...
lambtho12 commented 7 months ago

Not sure if there is a fix for that to be honest.

It is probably possible to keep a single directory for everything. We could edit the find_command in the relevant pickers to add a --glob that would pre-filter the results matching the hardcoded convention for dailies (YYYY-MM-DD.md) and weeklies (YYYY-Wxx). @Tonitum , if you can have a shot at it if you want.

Tonitum commented 7 months ago

Yeah, I can take a crack at this!

Tonitum commented 7 months ago

Think this is resolved, PR is here: https://github.com/renerocksai/telekasten.nvim/pull/328