mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-14 05:55:59 +01:00
47 lines
971 B
Nix
47 lines
971 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib) mkIf nvim pushDownDefault;
|
|
|
|
cfg = config.vim.notes.obsidian;
|
|
auto = config.vim.autocomplete;
|
|
in {
|
|
config = mkIf (cfg.enable) {
|
|
vim.startPlugins = [
|
|
"obsidian-nvim"
|
|
"vim-markdown"
|
|
"tabular"
|
|
];
|
|
|
|
vim.binds.whichKey.register = pushDownDefault {
|
|
"<leader>o" = "+Notes";
|
|
};
|
|
|
|
vim.luaConfigRC.obsidian = nvim.dag.entryAnywhere ''
|
|
require("obsidian").setup({
|
|
dir = "${cfg.dir}",
|
|
completion = {
|
|
nvim_cmp = ${
|
|
if (auto.type == "nvim-cmp")
|
|
then "true"
|
|
else "false"
|
|
}
|
|
},
|
|
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}',"
|
|
}
|
|
}
|
|
})
|
|
'';
|
|
};
|
|
}
|