mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-10 14:39:48 +01:00
Compare commits
No commits in common. "6567b463ee001d984a7ac9eaf3effe80a557f7b8" and "781385f991f26a36102fe289f0e44770ff581ec5" have entirely different histories.
6567b463ee
...
781385f991
9 changed files with 36 additions and 145 deletions
3
.github/README.md
vendored
3
.github/README.md
vendored
|
@ -69,7 +69,7 @@
|
||||||
[Home-Manager module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-hm
|
[Home-Manager module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-hm
|
||||||
|
|
||||||
- **Simple**: One language to rule them all! Use Nix to configure everything,
|
- **Simple**: One language to rule them all! Use Nix to configure everything,
|
||||||
with optional Lua support for robust configurability!
|
with additional Lua Support
|
||||||
- **Reproducible**: Your configuration will behave the same _anywhere_. No
|
- **Reproducible**: Your configuration will behave the same _anywhere_. No
|
||||||
surprises, promise!
|
surprises, promise!
|
||||||
- **Portable**: nvf depends _solely_ on your Nix store, and nothing else. No
|
- **Portable**: nvf depends _solely_ on your Nix store, and nothing else. No
|
||||||
|
@ -79,7 +79,6 @@
|
||||||
customizable through the Nix module system.
|
customizable through the Nix module system.
|
||||||
- Not comfortable with a full-nix config or want to bring your Lua config? You
|
- Not comfortable with a full-nix config or want to bring your Lua config? You
|
||||||
can do just that, no unnecessary restrictions.
|
can do just that, no unnecessary restrictions.
|
||||||
- Lazyloading? We got it! Lazyload both internal and external plugins at will.
|
|
||||||
- **Well-documented**: Documentation is priority. You will _never_ face
|
- **Well-documented**: Documentation is priority. You will _never_ face
|
||||||
undocumented, obscure behaviour.
|
undocumented, obscure behaviour.
|
||||||
- **Idiomatic**: nvf does things ✨ _the right way_ ✨ - the codebase is, and
|
- **Idiomatic**: nvf does things ✨ _the right way_ ✨ - the codebase is, and
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
# Release 0.8 {#sec-release-0.8}
|
|
||||||
|
|
||||||
[NotAShelf](https://github.com/notashelf):
|
|
||||||
|
|
||||||
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
|
|
||||||
|
|
||||||
- Add [typst-preview.nvim] under
|
|
||||||
`languages.typst.extensions.typst-preview-nvim`.
|
|
||||||
|
|
||||||
- Add a search widget to the options page in the nvf manual.
|
|
21
docs/static/script/search.js
vendored
21
docs/static/script/search.js
vendored
|
@ -26,32 +26,21 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
ddElement: ddElements[index],
|
ddElement: ddElements[index],
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const hiddenClass = "hidden";
|
|
||||||
const hiddenStyle = document.createElement("style");
|
|
||||||
hiddenStyle.innerHTML = `.${hiddenClass} { display: none; }`;
|
|
||||||
document.head.appendChild(hiddenStyle);
|
|
||||||
|
|
||||||
let debounceTimeout;
|
let debounceTimeout;
|
||||||
document.getElementById("search-input").addEventListener("input", (event) => {
|
document.getElementById("search-input").addEventListener("input", (event) => {
|
||||||
clearTimeout(debounceTimeout);
|
clearTimeout(debounceTimeout);
|
||||||
debounceTimeout = setTimeout(() => {
|
debounceTimeout = setTimeout(() => {
|
||||||
const query = event.target.value.toLowerCase();
|
const query = event.target.value.toLowerCase();
|
||||||
|
|
||||||
const matches = [];
|
requestAnimationFrame(() => {
|
||||||
const nonMatches = [];
|
const fragment = document.createDocumentFragment();
|
||||||
|
|
||||||
dtElementsData.forEach(({ element, id, ddElement }) => {
|
dtElementsData.forEach(({ element, id, ddElement }) => {
|
||||||
const isMatch = id.includes(query);
|
const isMatch = id.includes(query);
|
||||||
if (isMatch) {
|
if (element.classList.contains("hidden") !== !isMatch) {
|
||||||
matches.push(element, ddElement);
|
element.classList.toggle("hidden", !isMatch);
|
||||||
} else {
|
ddElement?.classList.toggle("hidden", !isMatch);
|
||||||
nonMatches.push(element, ddElement);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
requestAnimationFrame(() => {
|
|
||||||
matches.forEach((el) => el?.classList.remove(hiddenClass));
|
|
||||||
nonMatches.forEach((el) => el?.classList.add(hiddenClass));
|
|
||||||
});
|
});
|
||||||
}, 200);
|
}, 200);
|
||||||
});
|
});
|
||||||
|
|
17
docs/static/style.scss
vendored
17
docs/static/style.scss
vendored
|
@ -189,16 +189,14 @@ th {
|
||||||
|
|
||||||
dt {
|
dt {
|
||||||
margin: 1.2rem 0 0.8rem;
|
margin: 1.2rem 0 0.8rem;
|
||||||
content-visibility: auto;
|
|
||||||
contain-intrinsic-size: auto 42px;
|
|
||||||
}
|
|
||||||
dd {
|
|
||||||
margin-left: 2rem;
|
|
||||||
content-visibility: auto;
|
|
||||||
contain-intrinsic-size: auto 500px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
div.book {}
|
dd {
|
||||||
|
margin-left: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.book {
|
||||||
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
@include margined;
|
@include margined;
|
||||||
|
@ -240,12 +238,11 @@ li {
|
||||||
top: 0;
|
top: 0;
|
||||||
background: white;
|
background: white;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border-bottom: 1px solid $color-gray-200;
|
border-bottom: 1px solid #ccc;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
background: $color-gray-900;
|
background: $color-gray-900;
|
||||||
color: $color-gray-50;
|
color: $color-gray-50;
|
||||||
border-bottom: 1px solid black;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
17
flake.lock
17
flake.lock
|
@ -1902,22 +1902,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"plugin-typst-preview-nvim": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1733120663,
|
|
||||||
"narHash": "sha256-uYMZ2PONiiI3UDvCgNvyy4+jhzmUDbAyxX0phKxELXw=",
|
|
||||||
"owner": "chomosuke",
|
|
||||||
"repo": "typst-preview.nvim",
|
|
||||||
"rev": "0cb5f5627312f50ce089f785ec42b55a85f30ce7",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "chomosuke",
|
|
||||||
"repo": "typst-preview.nvim",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"plugin-vim-dirtytalk": {
|
"plugin-vim-dirtytalk": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -2167,7 +2151,6 @@
|
||||||
"plugin-tokyonight": "plugin-tokyonight",
|
"plugin-tokyonight": "plugin-tokyonight",
|
||||||
"plugin-trouble": "plugin-trouble",
|
"plugin-trouble": "plugin-trouble",
|
||||||
"plugin-ts-error-translator": "plugin-ts-error-translator",
|
"plugin-ts-error-translator": "plugin-ts-error-translator",
|
||||||
"plugin-typst-preview-nvim": "plugin-typst-preview-nvim",
|
|
||||||
"plugin-vim-dirtytalk": "plugin-vim-dirtytalk",
|
"plugin-vim-dirtytalk": "plugin-vim-dirtytalk",
|
||||||
"plugin-vim-fugitive": "plugin-vim-fugitive",
|
"plugin-vim-fugitive": "plugin-vim-fugitive",
|
||||||
"plugin-vim-illuminate": "plugin-vim-illuminate",
|
"plugin-vim-illuminate": "plugin-vim-illuminate",
|
||||||
|
|
|
@ -206,11 +206,6 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-typst-preview-nvim = {
|
|
||||||
url = "github:chomosuke/typst-preview.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-metals = {
|
plugin-nvim-metals = {
|
||||||
url = "github:scalameta/nvim-metals";
|
url = "github:scalameta/nvim-metals";
|
||||||
flake = false;
|
flake = false;
|
||||||
|
|
|
@ -7,13 +7,10 @@
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.types) nullOr enum either attrsOf listOf package str;
|
inherit (lib.types) enum either listOf package str;
|
||||||
inherit (lib.attrsets) attrNames;
|
inherit (lib.attrsets) attrNames;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
inherit (lib.nvim.lua) expToLua toLuaObject;
|
|
||||||
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption;
|
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
|
|
||||||
cfg = config.vim.languages.typst;
|
cfg = config.vim.languages.typst;
|
||||||
|
|
||||||
|
@ -36,7 +33,6 @@
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
tinymist = {
|
tinymist = {
|
||||||
package = pkgs.tinymist;
|
package = pkgs.tinymist;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
|
@ -124,50 +120,6 @@ in {
|
||||||
default = formats.${cfg.format.type}.package;
|
default = formats.${cfg.format.type}.package;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
extensions = {
|
|
||||||
typst-preview-nvim = {
|
|
||||||
enable =
|
|
||||||
mkEnableOption ''
|
|
||||||
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
|
|
||||||
|
|
||||||
Low latency typst preview for Neovim via [typst-preview.nvim]
|
|
||||||
''
|
|
||||||
// {default = true;};
|
|
||||||
|
|
||||||
setupOpts = mkPluginSetupOption "typst-preview-nvim" {
|
|
||||||
open_cmd = mkOption {
|
|
||||||
type = nullOr str;
|
|
||||||
default = null;
|
|
||||||
example = "firefox %s -P typst-preview --class typst-preview";
|
|
||||||
description = ''
|
|
||||||
Custom format string to open the output link provided with `%s`
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
dependencies_bin = mkOption {
|
|
||||||
type = attrsOf str;
|
|
||||||
default = {
|
|
||||||
"tinymist" = getExe servers.tinymist.package;
|
|
||||||
"websocat" = getExe pkgs.websocat;
|
|
||||||
};
|
|
||||||
|
|
||||||
description = ''
|
|
||||||
Provide the path to binaries for dependencies. Setting this
|
|
||||||
to a non-null value will skip the download of the binary by
|
|
||||||
the plugin.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
extra_args = mkOption {
|
|
||||||
type = nullOr (listOf str);
|
|
||||||
default = null;
|
|
||||||
example = ["--input=ver=draft" "--ignore-system-fonts"];
|
|
||||||
description = "A list of extra arguments (or `null`) to be passed to previewer";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
(mkIf cfg.treesitter.enable {
|
(mkIf cfg.treesitter.enable {
|
||||||
|
@ -184,13 +136,5 @@ in {
|
||||||
vim.lsp.lspconfig.enable = true;
|
vim.lsp.lspconfig.enable = true;
|
||||||
vim.lsp.lspconfig.sources.typst-lsp = servers.${cfg.lsp.server}.lspConfig;
|
vim.lsp.lspconfig.sources.typst-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
})
|
})
|
||||||
|
|
||||||
# Extensions
|
|
||||||
(mkIf cfg.extensions.typst-preview-nvim.enable {
|
|
||||||
vim.startPlugins = ["typst-preview-nvim"];
|
|
||||||
vim.pluginRC.typst-preview-nvim = entryAnywhere ''
|
|
||||||
require("typst-preview").setup(${toLuaObject cfg.extensions.typst-preview-nvim.setupOpts})
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,11 +12,7 @@
|
||||||
cfg = config.vim;
|
cfg = config.vim;
|
||||||
in {
|
in {
|
||||||
options.vim = {
|
options.vim = {
|
||||||
enableLuaLoader = mkOption {
|
enableLuaLoader = mkEnableOption ''
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
description = ''
|
|
||||||
[{option}`official documentation`]: https://neovim.io/doc/user/lua.html#vim.loader.enable()
|
[{option}`official documentation`]: https://neovim.io/doc/user/lua.html#vim.loader.enable()
|
||||||
|
|
||||||
the experimental Lua module loader to speed up the start up process
|
the experimental Lua module loader to speed up the start up process
|
||||||
|
@ -28,12 +24,10 @@ in {
|
||||||
- removes the default Neovim loader
|
- removes the default Neovim loader
|
||||||
|
|
||||||
::: {.note}
|
::: {.note}
|
||||||
The Lua module loader is *disabled* by default. Before setting this option, please
|
This is disabled by default. Before setting this option, please
|
||||||
take a look at the [{option}`official documentation`]. This option may be enabled by
|
take a look at the [{option}`official documentation`].
|
||||||
default in the future.
|
|
||||||
:::
|
:::
|
||||||
'';
|
'';
|
||||||
};
|
|
||||||
|
|
||||||
additionalRuntimePaths = mkOption {
|
additionalRuntimePaths = mkOption {
|
||||||
type = listOf (either path str);
|
type = listOf (either path str);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"release": "v0.8",
|
"release": "v0.7",
|
||||||
"isReleaseBranch": false
|
"isReleaseBranch": true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue