2023-02-27 19:26:16 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-07 00:50:27 +00:00
|
|
|
}: let
|
2024-02-26 03:52:21 +00:00
|
|
|
inherit (lib) mkIf nvim pushDownDefault;
|
2023-11-07 00:50:27 +00:00
|
|
|
|
2023-02-27 19:26:16 +00: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 03:52:21 +00:00
|
|
|
vim.binds.whichKey.register = pushDownDefault {
|
2024-02-25 16:39:05 +00:00
|
|
|
"<leader>o" = "+Notes";
|
|
|
|
};
|
|
|
|
|
2023-02-27 19:26:16 +00: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 16:49:27 +00: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 19:26:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|