recollect
Recollect.lua#
ย
TUI for your notes/daily-notes.
I use it as a personal “wayback” machine.
It integrates into Obsidian.md /obsidian.nvim syntax.
ย
Features:#
ย
Tag-Tracker
Track your Tags (deadlines/birthdays etc.) You have several options to
filter for expired/upcoming/all tags and or specify what tags you want
to see. This will also show a preview of the note to the right.
ย
Install:#
ย
Check Github, or
Configure with Lazy:
return {
"jbuck95/recollect.nvim",
name = "recollect.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("recollect").setup({
-- The path where .json files (recurring events etc.) get stored
data_dir = vim.fn.expand("~") .. "/Documents/recollect-data",
-- Set where you want to have the info bar
bar_position = "bottom", -- or "top"
bar_offset = -1, -- move bar lines up/down
-- The start date for your grid.
birthday = "1993-03-03",
tracked_tags = {
deadline = { label = "Deadlines", icon = "โ", order = 1 },
birthday = { label = "Birthdays", icon = "๐", order = 2 },
},
-- The path to your daily notes folder. (sync this with obsidian.nvim)
daily_notes_path = vim.fn.expand("~") .. "/Documents/dailies",
-- A function to generate the content for a new daily note.
note_template = function(date_str)
local year, month, day = date_str:match("(%d+)-(%d+)-(%d+)")
local date_obj = os.time({year=tonumber(year), month=tonumber(month), day=tonumber(day)})
local weekdays = {"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"}
local months = {"Januar", "Februar", "Mรคrz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"}
local wday = tonumber(os.date("%w", date_obj)) + 1
local formatted_date = string.format("%s, %d %s %s", weekdays[wday], tonumber(day), months[tonumber(month)], year)
return string.format([[---
date: %s
---
## %s
]], date_str, formatted_date)
end,
-- You can define custom time periods that get highlighted in the grid.
-- periods = {
-- {
-- start = "2020-03-11",
-- finish = "2022-05-01",
-- color = "red",
-- label = "Pandemic"
-- },
-- },
-- Symbols used for notes that have a specific tag in their YAML frontmatter.
tag_symbols = {
birthday = "๐",
event = "๐",
gym = "๐ช๐ผ",
trip = "โ๏ธ",
holiday = "โ",
party = "๐ป",
work = "๐ผ",
project = "๐ ๏ธ",
deadline = "โ",
health = "โค๏ธ",
special = "โญ",
},
-- Customize the colors of the grid.
colors = {
background = "#1e1e2e",
default_dot = "#45475a",
today_dot = "#f38ba8",
note_exists = "#a6e3a1",
grid_lines = "#313244",
text = "#cdd6f4",
year_header = "#89b4fa",
yellow = "#f9e2af",
blue = "#89b4fa",
green = "#a6e3a1",
red = "#f38ba8",
purple = "#cba6f7",
orange = "#fab387",
},
})
-- Entry point
vim.keymap.set("n", "<leader>rc", "<cmd>Recollect<cr>", { desc = "Open Recollect" })
vim.api.nvim_create_autocmd("FileType", {
pattern = "recollect",
callback = function()
local map = function(lhs, plug, desc)
vim.keymap.set("n", lhs, plug, { buffer = true, remap = true, silent = true, desc = desc })
end
-- Navigation
map("t", "<Plug>(recollect-today)", "Jump to today")
map("/", "<Plug>(recollect-search-date)", "Jump to date")
map("[", "<Plug>(recollect-prev-note)", "Previous note")
map("]", "<Plug>(recollect-next-note)", "Next note")
map("f", "<Plug>(recollect-search-content)", "Fuzzy search notes")
-- Actions
map("<CR>", "<Plug>(recollect-open-note)", "Open / create note")
map("D", "<Plug>(recollect-delete-note)", "Delete note")
map("r", "<Plug>(recollect-refresh)", "Refresh cache")
map("x", "<Plug>(recollect-close-splits)", "Close splits")
map("X", "<Plug>(recollect-write-splits)", "Save & close splits")
map("m", "<Plug>(recollect-manage-periods)", "Manage periods")
-- Toggles
map("s", "<Plug>(recollect-toggle-split)", "Toggle split mode")
map("p", "<Plug>(recollect-preview)", "Toggle preview")
map("P", "<Plug>(recollect-toggle-periods)", "Toggle period colors")
map("R", "<Plug>(recollect-filter-periods)", "Toggle period filter")
map("g", "<Plug>(recollect-toggle-grid)", "Toggle life/calendar grid")
map("Y", "<Plug>(recollect-year-view)", "Year view")
-- Other
map("q", "<Plug>(recollect-quit)", "Close Recollect")
map("?", "<Plug>(recollect-help)", "Show help")
end,
})
-- Periods window keymaps (buffer-local, active inside the Periods popup)
vim.api.nvim_create_autocmd("FileType", {
pattern = "recollect_periods",
callback = function()
local map = function(lhs, plug, desc)
vim.keymap.set("n", lhs, plug, { buffer = true, remap = true, silent = true, desc = desc })
end
map("j", "<Plug>(recollect-periods-next)", "Next period")
map("k", "<Plug>(recollect-periods-prev)", "Previous period")
map("a", "<Plug>(recollect-periods-add)", "Add period")
map("e", "<Plug>(recollect-periods-edit)", "Edit period")
map("<CR>", "<Plug>(recollect-periods-edit)", "Edit period")
map("d", "<Plug>(recollect-periods-delete)", "Delete period")
map("q", "<Plug>(recollect-periods-quit)", "Close periods")
end,
})
end,
}
