neovim-flake/modules/plugins/notes/obsidian/obsidian.nix
diniamo 7dbd1cd8d1
treewide: rewrite autocompletion module and related stuff (#404)
* modules/completion: rewrite

* treewide: remove vsnip, add luasnip

* nvim-cmp: add default sorting

* nvim-cmp: load after luasnip

* lib: fix docs for mergelessListOf

* docs: add changelog entires for rewrite

* deprecations: add rewrite deprecations

* nvim-cmp: clarify in format description

* docs: fix option reference in release notes

* treewide: remove reduant `// {default = false;}`s

* luasnip: add missing `{option}` for option reference

* deprecations: add entry for vsnip

* nvim-autopairs: use multiline string

* nvim-dap: use outer attribute
2024-10-09 17:50:34 +00:00

57 lines
1.7 KiB
Nix

{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) bool str nullOr;
inherit (lib.modules) mkRenamedOptionModule;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
imports = let
renamedSetupOption = oldPath: newPath:
mkRenamedOptionModule
(["vim" "notes" "obsidian"] ++ oldPath)
(["vim" "notes" "obsidian" "setupOpts"] ++ newPath);
in [
(renamedSetupOption ["dir"] ["dir"])
(renamedSetupOption ["daily-notes" "folder"] ["daily_notes" "folder"])
(renamedSetupOption ["daily-notes" "date-format"] ["daily_notes" "date_format"])
(renamedSetupOption ["completion"] ["completion"])
];
options.vim.notes = {
obsidian = {
enable = mkEnableOption "complementary neovim plugins for Obsidian editor";
setupOpts = mkPluginSetupOption "Obsidian.nvim" {
dir = mkOption {
type = str;
default = "~/my-vault";
description = "Obsidian vault directory";
};
daily_notes = {
folder = mkOption {
type = nullOr str;
default = null;
description = "Directory in which daily notes should be created";
};
date_format = mkOption {
type = nullOr str;
default = null;
description = "Date format used for creating daily notes";
};
};
completion = {
nvim_cmp = mkOption {
# If using nvim-cmp, otherwise set to false
type = bool;
description = "If using nvim-cmp, otherwise set to false";
default = config.vim.autocomplete.nvim-cmp.enable;
};
};
};
};
};
}