2023-02-27 20:26:16 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-07 01:50:27 +01:00
|
|
|
}: let
|
2024-02-26 04:52:21 +01:00
|
|
|
inherit (lib) mkIf nvim pushDownDefault;
|
2023-11-07 01:50:27 +01:00
|
|
|
|
2023-02-27 20:26:16 +01:00
|
|
|
cfg = config.vim.notes.obsidian;
|
|
|
|
auto = config.vim.autocomplete;
|
|
|
|
in {
|
|
|
|
config = mkIf (cfg.enable) {
|
|
|
|
vim.startPlugins = [
|
|
|
|
"obsidian-nvim"
|
|
|
|
"vim-markdown"
|
|
|
|
"tabular"
|
|
|
|
];
|
|
|
|
|
2024-02-26 04:52:21 +01:00
|
|
|
vim.binds.whichKey.register = pushDownDefault {
|
2024-02-25 17:39:05 +01:00
|
|
|
"<leader>o" = "+Notes";
|
|
|
|
};
|
|
|
|
|
2023-02-27 20:26:16 +01:00
|
|
|
vim.luaConfigRC.obsidian = nvim.dag.entryAnywhere ''
|
|
|
|
require("obsidian").setup({
|
|
|
|
dir = "${cfg.dir}",
|
|
|
|
completion = {
|
|
|
|
nvim_cmp = ${
|
|
|
|
if (auto.type == "nvim-cmp")
|
|
|
|
then "true"
|
|
|
|
else "false"
|
2023-07-20 18:49:27 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
daily_notes = {
|
|
|
|
folder = ${
|
|
|
|
if (cfg.daily-notes.folder == "")
|
|
|
|
then "nil,"
|
|
|
|
else "'${cfg.daily-notes.folder}',"
|
|
|
|
}
|
|
|
|
date_format = ${
|
|
|
|
if (cfg.daily-notes.date-format == "")
|
|
|
|
then "nil,"
|
|
|
|
else "'${cfg.daily-notes.date-format}',"
|
2023-02-27 20:26:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|