`:Neorg journal previous`
Issues
- [x] I have checked existing issues and there are no existing ones with the same request.
Feature description
I use neorg journal exclusively to document wtf I'm doing at work. There is a convenient shortcut :Neorg journal yesterday that opens journal entry from previous day. However it doesn't work on monday after weekend since last entry was on friday.
I'd like to to have a :Neorg journal previous shortcut that opens most recent entry from the past.
Help
No
Implementation help
No response
I have created a workaround for this in the form of a custom keybind. Unfortunately it's only on my work machine. I will make a reminder to email it to myself on monday!
(If my employer is reading this, don't worry, it's like maybe 10 lines of lua, and it's not sensitive IP, and I'll ask for approval anyway)
local function yesterweekday()
local day = os.date("*t", os.time()) --[[@as osdate]]
if day.wday == 2 then
day.day = day.day - 3
elseif day.wday == 1 then
day.day = day.day - 2
else
day.day = day.day - 1
end
return os.date("%Y-%m-%d", os.time(day))
end
{ "<leader>jy", function() return (":Neorg journal custom %s<CR>"):format(yesterweekday()) end, desc = "Journal Yesterday", silent = true, expr = true }
That's neat, but not quite what OP asked for since yesterday's (or yesterweekday's) journal entry might not exist. In vimwiki you could go back and forth between the previous and next journal entries even if you skipped a few days, that's more like what OP is looking for.