Skip to content

Commit eeafe2a

Browse files
GaetanLepagenix-infra-bot
authored andcommitted
plugins/zotcite: init
1 parent b6c0cfa commit eeafe2a

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed

plugins/by-name/zotcite/default.nix

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{ lib, ... }:
2+
let
3+
inherit (lib) types;
4+
inherit (lib.nixvim) defaultNullOpts;
5+
in
6+
lib.nixvim.plugins.mkNeovimPlugin {
7+
name = "zotcite";
8+
9+
maintainers = [ lib.maintainers.GaetanLepage ];
10+
11+
settingsOptions = {
12+
hl_cite_key = defaultNullOpts.mkBool true ''
13+
Set to `false` if you want to disable Zotcite's syntax highlighting of citation keys.
14+
'';
15+
16+
conceallevel = defaultNullOpts.mkUnsignedInt 2 ''
17+
Zotcite sets the `conceallevel` of the Markdown document to `2`.
18+
Use this option if you want a different value.
19+
'';
20+
21+
wait_attachment = defaultNullOpts.mkBool false ''
22+
While opening an attachment, Zotcite cannot catch errors because it doesn't wait for the
23+
application to finish.
24+
25+
If zotcite fails to open a PDF attachment, you may want to temporarily set this option to
26+
`true`.
27+
28+
Then, Neovim should freeze until the attachment is closed, and, if the PDF viewer finishes
29+
with non-zero status, anything output to the `stderr` will be displayed as a warning message.
30+
'';
31+
32+
open_in_zotero = defaultNullOpts.mkBool false ''
33+
Set this to `true` if you want `:ZOpenAttachment` to open PDF attachments in Zotero (as
34+
opposed to your system's default PDF viewer).
35+
36+
Note that you'll need to have Zotero configured as the default app for opening `zotero://`
37+
links.
38+
On Linux, assuming your Zotero installation included a `zotero.desktop` file, you can do the
39+
following:
40+
```console
41+
xdg-mime default zotero.desktop x-scheme-handler/zotero
42+
```
43+
'';
44+
45+
filetypes = defaultNullOpts.mkListOf types.str [ "markdown" "pandoc" "rmd" "quarto" "vimwiki" ] ''
46+
Which filetypes to enable Zotcite on.
47+
'';
48+
};
49+
50+
settingsExample = {
51+
hl_cite_key = false;
52+
wait_attachment = true;
53+
open_in_zotero = true;
54+
filetypes = [
55+
"markdown"
56+
"quarto"
57+
];
58+
};
59+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
empty = {
3+
plugins.zotcite.enable = true;
4+
};
5+
6+
defaults = {
7+
plugins.zotcite = {
8+
enable = true;
9+
10+
settings = {
11+
hl_cite_key = true;
12+
conceallevel = 2;
13+
wait_attachment = false;
14+
open_in_zotero = false;
15+
filetypes = [
16+
"markdown"
17+
"pandoc"
18+
"rmd"
19+
"quarto"
20+
"vimwiki"
21+
];
22+
};
23+
};
24+
};
25+
26+
example = {
27+
plugins.zotcite = {
28+
enable = true;
29+
30+
settings = {
31+
hl_cite_key = false;
32+
wait_attachment = true;
33+
open_in_zotero = true;
34+
filetypes = [
35+
"markdown"
36+
"quarto"
37+
];
38+
};
39+
};
40+
};
41+
}

0 commit comments

Comments
 (0)