Skip to content

Commit

Permalink
🔧 (obsidian): make the config more general
Browse files Browse the repository at this point in the history
  • Loading branch information
elythh committed Oct 2, 2024
1 parent 5ff206f commit 64884a9
Showing 1 changed file with 3 additions and 92 deletions.
95 changes: 3 additions & 92 deletions config/plug/utils/obsidian.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ lib, ... }:
{
plugins.obsidian = {
enable = lib.mkDefault false;
enable = true;
settings = {
completion = {
min_chars = 2;
Expand All @@ -10,18 +9,10 @@
new_notes_location = "current_dir";
workspaces = [
{
name = "work";
path = "~/obsidian/work";
}
{
name = "home";
path = "~/obsidian/home";
name = "default";
path = "~/Documents";
}
];
daily_notes = {
template = "~/obsidian/templates/daily_note_template.md";
folder = "~/obsidian/work/daily_notes";
};
mappings = {
gf = {
action = "require('obsidian').util.gf_passthrough";
Expand All @@ -36,86 +27,6 @@
opts.buffer = true;
};
};
templates = {
subdir = "~/obsidian/templates";
substitutions = {
monday.__raw = ''
function()
-- Get the current date
local currentDate = os.date("*t")
-- Calculate the difference in days to the first day of the week (Monday)
local diff = (currentDate.wday + 5) % 7
-- Subtract the difference to get the date of the first day of the week
currentDate.day = currentDate.day - diff
-- Return the date of the first day of the week
return os.date("%Y-%m-%d", os.time(currentDate))
end
'';
tuesday.__raw = ''
function()
-- Get the current date
local currentDate = os.date("*t")
-- Calculate the difference in days to the first day of the week (Monday)
local diff = (currentDate.wday + 4) % 7
-- Subtract the difference to get the date of the first day of the week
currentDate.day = currentDate.day - diff
-- Return the date of the first day of the week
return os.date("%Y-%m-%d", os.time(currentDate))
end
'';
wednesday.__raw = ''
function()
-- Get the current date
local currentDate = os.date("*t")
-- Calculate the difference in days to the first day of the week (Monday)
local diff = (currentDate.wday + 3) % 7
-- Subtract the difference to get the date of the first day of the week
currentDate.day = currentDate.day - diff
-- Return the date of the first day of the week
return os.date("%Y-%m-%d", os.time(currentDate))
end
'';
thursday.__raw = ''
function()
-- Get the current date
local currentDate = os.date("*t")
-- Calculate the difference in days to the first day of the week (Monday)
local diff = (currentDate.wday + 2) % 7
-- Subtract the difference to get the date of the first day of the week
currentDate.day = currentDate.day - diff
-- Return the date of the first day of the week
return os.date("%Y-%m-%d", os.time(currentDate))
end
'';
friday.__raw = ''
function()
-- Get the current date
local currentDate = os.date("*t")
-- Calculate the difference in days to the first day of the week (Monday)
local diff = (currentDate.wday + 1) % 7
-- Subtract the difference to get the date of the first day of the week
currentDate.day = currentDate.day - diff
-- Return the date of the first day of the week
return os.date("%Y-%m-%d", os.time(currentDate))
end
'';
};
};
};
};
}

0 comments on commit 64884a9

Please sign in to comment.