Compare commits

..

No commits in common. "4ffd67bc0fad46de2a06e6c5e001e8972996a189" and "bd9fe9eb68bb4d12cd0f26c320f45609fd35dcc3" have entirely different histories.

29 changed files with 149 additions and 571 deletions

View file

@ -14,7 +14,7 @@ indent_style = space
indent_size = 2
trim_trailing_whitespace = false
[*.{js,nix,yml,yaml}]
[*.{nix,yml,yaml}]
indent_style = space
indent_size = 2
tab_width = 2

22
.github/README.md vendored
View file

@ -69,7 +69,7 @@
[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,
with optional Lua support for robust configurability!
with additional Lua Support
- **Reproducible**: Your configuration will behave the same _anywhere_. No
surprises, promise!
- **Portable**: nvf depends _solely_ on your Nix store, and nothing else. No
@ -77,9 +77,8 @@
- Options to install [standalone], [NixOS module] or [Home-Manager module].
- **Customizable**: There are _almost no defaults_ to annoy you. nvf is fully
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.
- Lazyloading? We got it! Lazyload both internal and external plugins at will.
- **Well-documented**: Documentation is priority. You will _never_ face
undocumented, obscure behaviour.
- **Idiomatic**: nvf does things ✨ _the right way_ ✨ - the codebase is, and
@ -168,19 +167,19 @@ fix.
## Frequently Asked Questions
[issue template]: https://github.com/NotAShelf/nvf/issues/new/choose
[appropriate issue template]: https://github.com/NotAShelf/nvf/issues/new/choose
[list of branches]: https://github.com/NotAShelf/nvf/branches
[list of open pull requests]: https://github.com/NotAShelf/nvf/pulls
**Q**: What platforms are supported?
<br/> **A**: nvf actively supports **Linux and Darwin** platforms using
standalone Nix, NixOS or Home-Manager. Please take a look at the [nvf manual]
for available installation instructions.
<br/> **A**: nvf actively supports Linux and Darwin platforms using standalone
Nix, NixOS or Home-Manager. Please take a look at the [nvf manual] for available
installation instructions.
**Q**: Can you add _X_?
<br/> **A**: Maybe! It is not one of our goals to support each and every Neovim
plugin, however, I am always open to new modules and plugin setup additions to
**nvf**. Use the appropriate [issue template] and I will consider a module
**nvf**. Use the [appropriate issue template] and I will consider a module
addition. As mentioned before, pull requests to add new features are also
welcome.
@ -197,13 +196,6 @@ not noticed any activity on the main branch, consider taking a look at the
_testing_ those release branches to get access to new features ahead of time and
better prepare to breaking changes.
**Q**: Will you support non-flake installations?
<br/> **A**: Quite possibly. **nvf** started as "neovim-flake", which does mean
it is and will remain flakes-first but we might consider non-flakes
compatibility. Though keep in mind that **nvf** under non-flake environments
would lose customizability of plugin inputs, which is one of our primary
features.
## Credits
### Contributors

View file

@ -1,7 +1,3 @@
# This is the sample configuration for nvf, aiming to give you a feel of the default options
# while certain plugins are enabled. While it may act as one, this is not an overview of nvf's
# module options. To find a complete overview of nvf's options and examples, visit the manual.
# https://notashelf.github.io/nvf/options.html
isMaximal: {
config.vim = {
viAlias = true;
@ -35,61 +31,54 @@ isMaximal: {
};
};
# This section does not include a comprehensive list of available language modules.
# To list all available language module options, please visit the nvf manual.
languages = {
enableLSP = true;
enableFormat = true;
enableTreesitter = true;
enableExtraDiagnostics = true;
# Languages that will be supported in default and maximal configurations.
nix.enable = true;
markdown.enable = true;
# Languages that are enabled in the maximal configuration.
bash.enable = isMaximal;
clang.enable = isMaximal;
css.enable = isMaximal;
html.enable = isMaximal;
sql.enable = isMaximal;
java.enable = isMaximal;
kotlin.enable = isMaximal;
ts.enable = isMaximal;
go.enable = isMaximal;
lua.enable = isMaximal;
zig.enable = isMaximal;
python.enable = isMaximal;
typst.enable = isMaximal;
rust = {
enable = isMaximal;
crates.enable = isMaximal;
};
# Language modules that are not as common.
assembly.enable = false;
astro.enable = false;
nu.enable = false;
csharp.enable = false;
julia.enable = false;
vala.enable = false;
scala.enable = false;
r.enable = false;
gleam.enable = false;
dart.enable = false;
ocaml.enable = false;
elixir.enable = false;
haskell.enable = false;
tailwind.enable = false;
svelte.enable = false;
# Nim LSP is broken on Darwin and therefore
# should be disabled by default. Users may still enable
# `vim.languages.vim` to enable it, this does not restrict
# that.
# See: <https://github.com/PMunch/nimlsp/issues/178#issue-2128106096>
nim.enable = false;
nix.enable = true;
# Assembly is not common, and the asm LSP is a major hit-or-miss
assembly.enable = false;
astro.enable = false;
markdown.enable = isMaximal;
html.enable = isMaximal;
css.enable = isMaximal;
sql.enable = isMaximal;
java.enable = isMaximal;
kotlin.enable = isMaximal;
ts.enable = isMaximal;
svelte.enable = isMaximal;
go.enable = isMaximal;
lua.enable = isMaximal;
elixir.enable = isMaximal;
zig.enable = isMaximal;
ocaml.enable = isMaximal;
python.enable = isMaximal;
dart.enable = isMaximal;
bash.enable = isMaximal;
gleam.enable = false;
r.enable = isMaximal;
tailwind.enable = isMaximal;
typst.enable = isMaximal;
clang.enable = isMaximal;
scala.enable = isMaximal;
rust = {
enable = isMaximal;
crates.enable = isMaximal;
};
csharp.enable = isMaximal;
julia.enable = isMaximal;
vala.enable = isMaximal;
nu.enable = false;
};
visuals = {

View file

@ -62,8 +62,7 @@ in
# Copy anchor scripts to the script directory in document root.
cp -vt "$dest"/script \
${./static/script}/anchor-min.js \
${./static/script}/anchor-use.js \
${./static/script}/search.js
${./static/script}/anchor-use.js
substituteInPlace ./options.md \
--subst-var-by OPTIONS_JSON ./config-options.json
@ -101,7 +100,6 @@ in
--script highlightjs/loader.js \
--script script/anchor-use.js \
--script script/anchor-min.js \
--script script/search.js \
--toc-depth 2 \
--section-toc-depth 1 \
manual.md \

View file

@ -1,20 +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.
[amadaluzia](https://github.com/amadaluzia):
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
- Add Haskell support under `vim.languages.haskell` using [haskell-tools.nvim].
[diniamo](https://github.com/diniamo):
- Add Odin support under `vim.languages.odin`.

View file

@ -1,58 +0,0 @@
document.addEventListener("DOMContentLoaded", () => {
if (!window.location.pathname.endsWith("options.html")) return;
const searchDiv = document.createElement("div");
searchDiv.id = "search-bar";
searchDiv.innerHTML = `
<input type="text" id="search-input" placeholder="Search options by ID..." />
<div id="search-results"></div>
`;
document.body.prepend(searchDiv);
const dtElements = Array.from(document.querySelectorAll("dt"));
const ddElements = Array.from(document.querySelectorAll("dd"));
const dtOptionIds = dtElements.map(
(dt) => dt.querySelector("a")?.id.toLowerCase() || "",
);
if (dtElements.length === 0 || ddElements.length === 0) {
console.warn("Something went wrong, page may be loaded incorrectly.");
return;
}
const dtElementsData = dtElements.map((dt, index) => ({
element: dt,
id: dtOptionIds[index],
ddElement: ddElements[index],
}));
const hiddenClass = "hidden";
const hiddenStyle = document.createElement("style");
hiddenStyle.innerHTML = `.${hiddenClass} { display: none; }`;
document.head.appendChild(hiddenStyle);
let debounceTimeout;
document.getElementById("search-input").addEventListener("input", (event) => {
clearTimeout(debounceTimeout);
debounceTimeout = setTimeout(() => {
const query = event.target.value.toLowerCase();
const matches = [];
const nonMatches = [];
dtElementsData.forEach(({ element, id, ddElement }) => {
const isMatch = id.includes(query);
if (isMatch) {
matches.push(element, ddElement);
} else {
nonMatches.push(element, ddElement);
}
});
requestAnimationFrame(() => {
matches.forEach((el) => el?.classList.remove(hiddenClass));
nonMatches.forEach((el) => el?.classList.add(hiddenClass));
});
}, 200);
});
});

View file

@ -189,16 +189,14 @@ th {
dt {
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 {
@include margined;
@ -235,33 +233,6 @@ li {
}
}
#search-bar {
position: sticky;
top: 0;
background: white;
padding: 10px;
border-bottom: 1px solid $color-gray-200;
z-index: 1000;
@media (prefers-color-scheme: dark) {
background: $color-gray-900;
color: $color-gray-50;
border-bottom: 1px solid black;
}
}
#search-input {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
background: inherit;
color: inherit;
}
.hidden {
display: none;
}
div.titlepage {
margin: 40px 0;

View file

@ -684,22 +684,6 @@
"type": "github"
}
},
"plugin-haskell-tools-nvim": {
"flake": false,
"locked": {
"lastModified": 1734222260,
"narHash": "sha256-gZVN9ADPO5wFOaf19FydCneb7aKTT9K1vcLoBURPEjk=",
"owner": "mrcjkb",
"repo": "haskell-tools.nvim",
"rev": "943b77b68a79d3991523ba4d373063c9355c6f55",
"type": "github"
},
"original": {
"owner": "mrcjkb",
"repo": "haskell-tools.nvim",
"type": "github"
}
},
"plugin-highlight-undo": {
"flake": false,
"locked": {
@ -1729,11 +1713,11 @@
"plugin-run-nvim": {
"flake": false,
"locked": {
"lastModified": 1734816675,
"narHash": "sha256-Wuk5HG+vHXAbifzp5YB5V/FxBhBRNWLeypkRczpXbvQ=",
"lastModified": 1732918526,
"narHash": "sha256-kiszNmZZDXG8tAPMQKuGJDCkqCMzsWT7BkCvkVsH2lA=",
"owner": "diniamo",
"repo": "run.nvim",
"rev": "6cd971afdce6443d7a070dcc23af51da1cc932f9",
"rev": "d867466e01b8fa4e54a589b9ef446cf43fb966de",
"type": "github"
},
"original": {
@ -1918,22 +1902,6 @@
"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": {
"flake": false,
"locked": {
@ -2107,7 +2075,6 @@
"plugin-gitsigns-nvim": "plugin-gitsigns-nvim",
"plugin-glow-nvim": "plugin-glow-nvim",
"plugin-gruvbox": "plugin-gruvbox",
"plugin-haskell-tools-nvim": "plugin-haskell-tools-nvim",
"plugin-highlight-undo": "plugin-highlight-undo",
"plugin-hop-nvim": "plugin-hop-nvim",
"plugin-icon-picker-nvim": "plugin-icon-picker-nvim",
@ -2184,7 +2151,6 @@
"plugin-tokyonight": "plugin-tokyonight",
"plugin-trouble": "plugin-trouble",
"plugin-ts-error-translator": "plugin-ts-error-translator",
"plugin-typst-preview-nvim": "plugin-typst-preview-nvim",
"plugin-vim-dirtytalk": "plugin-vim-dirtytalk",
"plugin-vim-fugitive": "plugin-vim-fugitive",
"plugin-vim-illuminate": "plugin-vim-illuminate",

View file

@ -206,11 +206,6 @@
flake = false;
};
plugin-typst-preview-nvim = {
url = "github:chomosuke/typst-preview.nvim";
flake = false;
};
plugin-nvim-metals = {
url = "github:scalameta/nvim-metals";
flake = false;
@ -720,10 +715,5 @@
url = "github:otavioschwanck/new-file-template.nvim";
flake = false;
};
plugin-haskell-tools-nvim = {
url = "github:mrcjkb/haskell-tools.nvim";
flake = false;
};
};
}

View file

@ -14,7 +14,6 @@ in {
./hcl.nix
./kotlin.nix
./html.nix
./haskell.nix
./java.nix
./lua.nix
./markdown.nix
@ -37,7 +36,6 @@ in {
./csharp.nix
./julia.nix
./nu.nix
./odin.nix
];
options.vim.languages = {

View file

@ -1,104 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
inherit (builtins) isList;
inherit (lib.types) either package listOf str;
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.strings) optionalString;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.dag) entryAfter;
inherit (lib.nvim.lua) expToLua;
inherit (pkgs) haskellPackages;
cfg = config.vim.languages.haskell;
in {
options.vim.languages.haskell = {
enable = mkEnableOption "Haskell support";
treesitter = {
enable = mkEnableOption "Treesitter support for Haskell" // {default = config.vim.languages.enableTreesitter;};
package = mkGrammarOption pkgs "haskell";
};
lsp = {
enable = mkEnableOption "LSP support for Haskell" // {default = config.vim.languages.enableLSP;};
package = mkOption {
description = "Haskell LSP package or command to run the Haskell LSP";
example = ''[ (lib.getExe pkgs.haskellPackages.haskell-language-server) "--debug" ]'';
default = haskellPackages.haskell-language-server;
type = either package (listOf str);
};
};
dap = {
enable = mkEnableOption "DAP support for Haskell" // {default = config.vim.languages.enableDAP;};
package = mkOption {
description = "Haskell DAP package or command to run the Haskell DAP";
default = haskellPackages.haskell-debug-adapter;
type = either package (listOf str);
};
};
};
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.treesitter.enable {
vim.treesitter = {
enable = true;
grammars = [cfg.treesitter.package];
};
})
(mkIf (cfg.dap.enable || cfg.lsp.enable) {
vim = {
startPlugins = ["haskell-tools-nvim"];
luaConfigRC.haskell-tools-nvim =
entryAfter
["lsp-setup"]
''
vim.g.haskell_tools = {
${optionalString cfg.lsp.enable ''
-- LSP
tools = {
hover = {
enable = true,
},
},
hls = {
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/haskell-language-server-wrapper"}''
},
on_attach = function(client, bufnr, ht)
default_on_attach(client, bufnr, ht)
local opts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set('n', '<localleader>cl', vim.lsp.codelens.run, opts)
vim.keymap.set('n', '<localleader>hs', ht.hoogle.hoogle_signature, opts)
vim.keymap.set('n', '<localleader>ea', ht.lsp.buf_eval_all, opts)
vim.keymap.set('n', '<localleader>rr', ht.repl.toggle, opts)
vim.keymap.set('n', '<localleader>rf', function()
ht.repl.toggle(vim.api.nvim_buf_get_name(0))
end, opts)
vim.keymap.set('n', '<localleader>rq', ht.repl.quit, opts)
end,
},
''}
${optionalString cfg.dap.enable ''
dap = {
cmd = ${
if isList cfg.dap.package
then expToLua cfg.dap.package
else ''{"${cfg.dap.package}/bin/haskell-debug-adapter"}''
},
},
''}
}
'';
};
})
]);
}

View file

@ -1,71 +0,0 @@
{
config,
pkgs,
lib,
...
}: let
inherit (builtins) attrNames;
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
inherit (lib.types) either listOf package str enum;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.types) mkGrammarOption;
defaultServer = "ols";
servers = {
ols = {
package = pkgs.ols;
lspConfig = ''
lspconfig.ols.setup {
capabilities = capabilities,
on_attach = default_on_attach,
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
else "{'${cfg.lsp.package}/bin/ols'}"
}
}
'';
};
};
cfg = config.vim.languages.odin;
in {
options.vim.languages.odin = {
enable = mkEnableOption "Odin language support";
treesitter = {
enable = mkEnableOption "Odin treesitter" // {default = config.vim.languages.enableTreesitter;};
package = mkGrammarOption pkgs "odin";
};
lsp = {
enable = mkEnableOption "Odin LSP support" // {default = config.vim.languages.enableLSP;};
server = mkOption {
type = enum (attrNames servers);
default = defaultServer;
description = "Odin LSP server to use";
};
package = mkOption {
description = "Ols package, or the command to run as a list of strings";
type = either package (listOf str);
default = pkgs.ols;
};
};
};
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.treesitter.enable {
vim.treesitter.enable = true;
vim.treesitter.grammars = [cfg.treesitter.package];
})
(mkIf cfg.lsp.enable {
vim.lsp.lspconfig.enable = true;
vim.lsp.lspconfig.sources.odin-lsp = servers.${cfg.lsp.server}.lspConfig;
})
]);
}

View file

@ -13,7 +13,7 @@
inherit (lib.types) bool package str listOf either enum;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.dag) entryAfter entryAnywhere;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.languages.rust;
@ -127,7 +127,7 @@ in {
vim = {
startPlugins = ["rustaceanvim"];
pluginRC.rustaceanvim = entryAfter ["lsp-setup"] ''
luaConfigRC.rustaceanvim = entryAnywhere ''
vim.g.rustaceanvim = {
${optionalString cfg.lsp.enable ''
-- LSP

View file

@ -23,11 +23,8 @@
package = pkgs.typescript-language-server;
lspConfig = ''
lspconfig.ts_ls.setup {
capabilities = capabilities,
on_attach = function(client, bufnr)
attach_keymaps(client, bufnr);
client.server_capabilities.documentFormattingProvider = false;
end,
capabilities = capabilities;
on_attach = attach_keymaps,
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
@ -82,7 +79,6 @@
ls_sources,
null_ls.builtins.formatting.prettier.with({
command = "${cfg.format.package}/bin/prettier",
filetypes = { "typescript" },
})
)
'';

View file

@ -7,13 +7,10 @@
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
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.generators) mkLuaInline;
inherit (lib.meta) getExe;
inherit (lib.nvim.lua) expToLua toLuaObject;
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.types) mkGrammarOption;
cfg = config.vim.languages.typst;
@ -36,7 +33,6 @@
}
'';
};
tinymist = {
package = pkgs.tinymist;
lspConfig = ''
@ -124,50 +120,6 @@ in {
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 [
(mkIf cfg.treesitter.enable {
@ -184,13 +136,5 @@ in {
vim.lsp.lspconfig.enable = true;
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})
'';
})
]);
}

View file

@ -57,7 +57,6 @@ in {
};
};
};
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.treesitter.enable {
vim.treesitter.enable = true;

View file

@ -5,7 +5,6 @@
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.lsp;
in {
@ -17,7 +16,7 @@ in {
vim.api.nvim_command('autocmd CursorHold,CursorHoldI * lua require\'nvim-lightbulb\'.update_lightbulb()')
-- Enable trouble diagnostics viewer
require'nvim-lightbulb'.setup(${toLuaObject cfg.lightbulb.setupOpts})
require'nvim-lightbulb'.setup()
'';
};
};

View file

@ -1,11 +1,9 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.lsp = {
lightbulb = {
enable = mkEnableOption "Lightbulb for code actions. Requires an emoji font";
setupOpts = mkPluginSetupOption "nvim-lightbulb" {};
};
};
}

View file

@ -13,43 +13,41 @@
builtin_themes = [
"auto"
"16color"
"gruvbox"
"ayu_dark"
"ayu_light"
"ayu_mirage"
"ayu"
"base16"
"codedark"
"dracula"
"everforest"
"gruvbox"
"gruvbox_dark"
"gruvbox_light"
"gruvbox-material"
"gruvbox_material"
"horizon"
"iceberg_dark"
"iceberg_light"
"iceberg"
"jellybeans"
"material"
"modus-vivendi"
"modus_vivendi"
"molokai"
"moonfly"
"nightfly"
"nord"
"OceanicNext"
"oceanicnext"
"onedark"
"onelight"
"palenight"
"papercolor_dark"
"papercolor_light"
"PaperColor"
"powerline_dark"
"powerline"
"pywal"
"seoul256"
"solarized_dark"
"solarized_light"
"Tomorrow"
"tomorrow"
"wombat"
];
in {

View file

@ -14,9 +14,17 @@ in {
startPlugins = ["nvim-notify"];
pluginRC.nvim-notify = entryAnywhere ''
local notify = require("notify")
notify.setup(${toLuaObject cfg.setupOpts})
vim.notify = notify
require('notify').setup(${toLuaObject cfg.setupOpts})
-- required to fix offset_encoding errors
local notify = vim.notify
vim.notify = function(msg, ...)
if msg:match("warning: multiple different client offset_encodings") then
return
end
notify(msg, ...)
end
'';
};
};

View file

@ -28,7 +28,7 @@ in {
};
stages = mkOption {
type = enum ["fade_in_slide_out" "fade" "slide" "static"];
type = enum ["fade_in_slide_out" "fade_in" "slide_out" "none"];
default = "fade_in_slide_out";
description = "The stages of the notification";
};
@ -41,7 +41,7 @@ in {
background_colour = mkOption {
type = str;
default = "NotifyBackground";
default = "#000000";
description = "The background colour of the notification";
};

View file

@ -4,8 +4,8 @@
lib,
...
}: let
inherit (lib.strings) concatMapStringsSep;
inherit (lib.modules) mkIf;
cfg = config.vim.utility.preview.markdownPreview;
in {
config = mkIf cfg.enable {
@ -15,7 +15,7 @@ in {
mkdp_auto_start = cfg.autoStart;
mkdp_auto_close = cfg.autoClose;
mkdp_refresh_slow = cfg.lazyRefresh;
mkdp_filetypes = cfg.filetypes;
mkdp_filetypes = [(concatMapStringsSep ", " (x: "'" + x + "'") cfg.filetypes)];
mkdp_command_for_global = cfg.alwaysAllowPreview;
mkdp_open_to_the_world = cfg.broadcastServer;
mkdp_open_ip = cfg.customIP;

View file

@ -4,32 +4,50 @@
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.utility.surround;
mkLznKey = mode: key: {
inherit mode key;
inherit key mode;
};
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["nvim-surround"];
pluginRC.surround = entryAnywhere "require('nvim-surround').setup(${toLuaObject cfg.setupOpts})";
lazy.plugins.nvim-surround = {
package = "nvim-surround";
setupModule = "nvim-surround";
inherit (cfg) setupOpts;
keys = [
(mkLznKey "i" cfg.setupOpts.keymaps.insert)
(mkLznKey "i" cfg.setupOpts.keymaps.insert_line)
(mkLznKey "x" cfg.setupOpts.keymaps.visual)
(mkLznKey "x" cfg.setupOpts.keymaps.visual_line)
(mkLznKey "n" cfg.setupOpts.keymaps.normal)
(mkLznKey "n" cfg.setupOpts.keymaps.normal_cur)
(mkLznKey "n" cfg.setupOpts.keymaps.normal_line)
(mkLznKey "n" cfg.setupOpts.keymaps.normal_cur_line)
(mkLznKey "n" cfg.setupOpts.keymaps.delete)
(mkLznKey "n" cfg.setupOpts.keymaps.change)
(mkLznKey "n" cfg.setupOpts.keymaps.change_line)
keys =
[
(mkLznKey ["i"] cfg.setupOpts.keymaps.insert)
(mkLznKey ["i"] cfg.setupOpts.keymaps.insert_line)
(mkLznKey ["x"] cfg.setupOpts.keymaps.visual)
(mkLznKey ["x"] cfg.setupOpts.keymaps.visual_line)
(mkLznKey ["n"] cfg.setupOpts.keymaps.normal)
(mkLznKey ["n"] cfg.setupOpts.keymaps.normal_cur)
(mkLznKey ["n"] cfg.setupOpts.keymaps.normal_line)
(mkLznKey ["n"] cfg.setupOpts.keymaps.normal_cur_line)
(mkLznKey ["n"] cfg.setupOpts.keymaps.delete)
(mkLznKey ["n"] cfg.setupOpts.keymaps.change)
(mkLznKey ["n"] cfg.setupOpts.keymaps.change_line)
]
++ map (mkLznKey ["n" "i" "v"]) [
"<Plug>(nvim-surround-insert)"
"<Plug>(nvim-surround-insert-line)"
"<Plug>(nvim-surround-normal)"
"<Plug>(nvim-surround-normal-cur)"
"<Plug>(nvim-surround-normal-line)"
"<Plug>(nvim-surround-normal-cur-line)"
"<Plug>(nvim-surround-visual)"
"<Plug>(nvim-surround-visual-line)"
"<Plug>(nvim-surround-delete)"
"<Plug>(nvim-surround-change)"
"<Plug>(nvim-surround-change-line)"
];
};
};

View file

@ -6,7 +6,6 @@
inherit (lib.modules) mkRenamedOptionModule;
inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) int bool str nullOr either listOf attrsOf;
inherit (lib.nvim.types) mkPluginSetupOption;
cfg = config.vim.visuals;
in {
@ -16,7 +15,7 @@ in {
options.vim.visuals.indent-blankline = {
enable = mkEnableOption "indentation guides [indent-blankline]";
setupOpts = mkPluginSetupOption "indent-blankline" {
setupOpts = {
debounce = mkOption {
type = int;
description = "Debounce time in milliseconds";

View file

@ -76,7 +76,6 @@
else
mkLuaInline ''
function()
${optionalString (spec.beforeSetup != null) spec.beforeSetup}
${
optionalString (spec.setupModule != null)
"require(${toJSON spec.setupModule}).setup(${toLuaObject spec.setupOpts})"

View file

@ -74,15 +74,6 @@
'';
};
beforeSetup = mkOption {
type = nullOr lines;
default = null;
description = ''
Lua code to run after the plugin is loaded, but before the setup
function is called.
'';
};
setupModule = mkOption {
type = nullOr str;
default = null;

View file

@ -12,11 +12,7 @@
cfg = config.vim;
in {
options.vim = {
enableLuaLoader = mkOption {
type = bool;
default = false;
example = true;
description = ''
enableLuaLoader = mkEnableOption ''
[{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
@ -28,12 +24,10 @@ in {
- removes the default Neovim loader
::: {.note}
The Lua module loader is *disabled* by default. Before setting this option, please
take a look at the [{option}`official documentation`]. This option may be enabled by
default in the future.
This is disabled by default. Before setting this option, please
take a look at the [{option}`official documentation`].
:::
'';
};
additionalRuntimePaths = mkOption {
type = listOf (either path str);
@ -126,14 +120,16 @@ in {
example = {"some_variable" = 42;};
description = ''
A freeform attribute set containing global variable values for setting vim
variables as early as possible. If populated, this option will set vim variables
in the built {option}`luaConfigRC` as the first item.
An attribute set containing global variable values
for storing vim variables as early as possible. If
populated, this option will set vim variables in the
built luaConfigRC as the first item.
::: {.note}
`{foo = "bar";}` will set `vim.g.foo` to "bar", where the type of `bar` in the
resulting Lua value will be inferred from the type of the value in the
`{name = value;}` pair passed to the option.
`{foo = "bar";}` will set `vim.g.foo` to "bar", where
the type of `bar` in the resulting Lua value will be
inferred from the type of the value in the `{name = value;}`
pair passed to the option.
:::
'';
};
@ -210,39 +206,21 @@ in {
default = true;
description = "Enable word wrapping.";
};
tabstop = mkOption {
type = int;
default = 8; # Neovim default
description = ''
Number of spaces that a `<Tab>` in the file counts for. Also see
the {command}`:retab` command, and the {option}`softtabstop` option.
'';
};
shiftwidth = mkOption {
type = int;
default = 8; # Neovim default
description = ''
Number of spaces to use for each step of (auto)indent. Used for
{option}`cindent`, `>>`, `<<`, etc.
When zero the {option}`tabstop` value will be used.
'';
};
};
};
example = {visualbell = true;};
description = ''
A freeform attribute set containing vim options to be set as early as possible.
If populated, this option will set vim options in the built {option}`luaConfigRC`
after `basic` and before `pluginConfigs` DAG entries.
An attribute set containing vim options to be set
as early as possible. If populated, this option will
set vim options in the built luaConfigRC after `basic`
and before `pluginConfigs` DAG entries.
::: {.note}
`{foo = "bar";}` will set `vim.o.foo` to "bar", where the type of `bar` in the
resulting Lua value will be inferred from the type of the value in the
`{name = value;}` pair passed to the option.
`{foo = "bar";}` will set `vim.o.foo` to "bar", where
the type of `bar` in the resulting Lua value will be
inferred from the type of the value in the`{name = value;}`
pair passed to the option.
:::
'';
};

View file

@ -1,4 +1,4 @@
{
"release": "v0.8",
"isReleaseBranch": false
"release": "v0.7",
"isReleaseBranch": true
}