Compare commits

..

20 commits

Author SHA1 Message Date
raf
9e94434190
Merge 9b111d1fe4 into 57067e85ed 2024-11-08 05:31:43 -05:00
9b111d1fe4
docs/installation: fix logical errors in standalone chapters 2024-11-08 12:27:42 +03:00
f738ad9d1a
docs: use the correct NVF_REPO url 2024-11-08 12:20:16 +03:00
775a867196
docs: compile stylesheet via dart-sass 2024-11-08 12:19:19 +03:00
d582228889
docs: add anchors to individual headers
Taken from Nixpkgs manual derivation, neat.
2024-11-07 16:11:53 +03:00
20dd5f8bb9
docs/installation: connect custom-configuration section to the module chapters better 2024-11-07 15:45:03 +03:00
5987b911e8
docs/hacking: make preface more readable & friendly 2024-11-07 15:17:51 +03:00
2016ca1473
docs/installation: un-linline section link 2024-11-07 15:17:24 +03:00
a831d229d4
docs/options: include warning about option prefix 2024-11-07 15:16:53 +03:00
49f751ee18
docs: use the correct path for quirks.md 2024-11-07 15:08:53 +03:00
3e571d0e0c
docs/preface: include project description in the preface 2024-11-07 15:07:22 +03:00
5c09def08e
docs/plugins: rename to 'quirks' to be more general 2024-11-07 15:07:02 +03:00
318e972a77
docs/try-it-out: correct number of available configs; fix typos 2024-11-07 15:06:07 +03:00
4435754702
docs/custom-plugins: improve wording for DAG; link to local docs 2024-11-07 10:58:40 +03:00
a2b9e645eb
docs/custom-plugins: better wording and edge cases in legacy-method.md 2024-11-07 10:57:59 +03:00
3e0e9331f0
docs: add preface to modules chapter 2024-11-07 10:37:59 +03:00
c1904bc9e5
docs/installation: add standalone flake example 2024-11-07 10:37:58 +03:00
94f6f7eceb
docs: fix typo in standalone installation pages 2024-11-07 10:37:57 +03:00
2a2d1b6d2c
docs: clean up project README 2024-11-07 10:37:56 +03:00
07f6ac5db0
flake: improve deprecation messages for old neovim-flake modules' 2024-11-07 10:37:43 +03:00
21 changed files with 411 additions and 534 deletions

View file

@ -46,8 +46,6 @@ isMaximal: {
nix.enable = true;
# Assembly is not common, and the asm LSP is a major hit-or-miss
assembly.enable = false;
markdown.enable = isMaximal;
html.enable = isMaximal;
css.enable = isMaximal;

View file

@ -1,8 +1,6 @@
{
lib,
stdenvNoCC,
fetchzip,
runCommandLocal,
# build inputs
nixos-render-docs,
documentation-highlighter,
@ -13,25 +11,6 @@
optionsJSON,
} @ args: let
manual-release = args.release or "unstable";
scss-reset = fetchzip {
url = "https://github.com/Frontend-Layers/scss-reset/archive/refs/tags/1.4.2.zip";
hash = "sha256-cif5Sx8Ca5vxdw/mNAgpulLH15TwmzyJFNM7JURpoaE=";
};
compileStylesheet = runCommandLocal "compile-nvf-stylesheet" {} ''
mkdir -p $out
tmpfile=$(mktemp -d)
trap "rm -r $tmpfile" EXIT
ln -s "${scss-reset}/build" "$tmpfile/scss-reset"
${dart-sass}/bin/sass --load-path "$tmpfile" \
${./static/style.scss} "$out/style.css"
echo "Generated styles"
'';
in
stdenvNoCC.mkDerivation {
name = "nvf-manual";
@ -42,6 +21,7 @@ in
strictDependencies = true;
nativeBuildInputs = [nixos-render-docs];
buildInputs = [dart-sass];
postPatch = ''
ln -s ${optionsJSON}/share/doc/nixos/options.json ./config-options.json
@ -60,7 +40,7 @@ in
${documentation-highlighter}/loader.js
# Copy anchor scripts to the script directory in document root.
cp -vt "$dest"/script \
cp -vt $dest/script \
${./static/script}/anchor-min.js \
${./static/script}/anchor-use.js
@ -73,9 +53,8 @@ in
substituteInPlace ./hacking/additional-plugins.md \
--subst-var-by NVF_REPO "https://github.com/notashelf/nvf/blob/${manual-release}"
# Move compiled stylesheet
cp -vt $dest \
${compileStylesheet}/style.css
# Compile and copy stylesheet to the project root.
sass ${./static/style.css} "$dest/style.css"
# Move release notes
cp -vr ${./release-notes} release-notes
@ -95,9 +74,9 @@ in
nixos-render-docs manual html \
--manpage-urls ${path + "/doc/manpage-urls.json"} \
--revision ${lib.trivial.revisionWithDefault manual-release} \
--stylesheet "$dest"/style.css \
--script ./highlightjs/highlight.pack.js \
--script ./highlightjs/loader.js \
--stylesheet style.css \
--script highlightjs/highlight.pack.js \
--script highlightjs/loader.js \
--script script/anchor-use.js \
--script script/anchor-min.js \
--toc-depth 2 \

View file

@ -285,9 +285,6 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
- Add [](#opt-vim.spellcheck.extraSpellWords) to allow adding arbitrary
spellfiles to Neovim's runtime with ease.
- Add combined nvf configuration (`config.vim`) into the final package's
passthru as `passthru.neovimConfiguration` for easier debugging.
[ppenguin](https://github.com/ppenguin):
- Telescope:
@ -297,7 +294,6 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
[Soliprem](https://github.com/Soliprem):
- Add LSP and Treesitter support for R under `vim.languages.R`.
- Add formatter suppoort for R, with styler and formatR as options
- Add Otter support under `vim.lsp.otter` and an assert to prevent conflict with
ccc
- Fixed typo in Otter's setupOpts
@ -306,9 +302,6 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
`vim.languages.kotlin`
- changed default keybinds for leap.nvim to avoid altering expected behavior
- Add LSP, formatter and Treesitter support for Vala under `vim.languages.vala`
- Add [Tinymist](https://github.com/Myriad-Dreamin/tinymist] as a formatter for
the Typst language module.
- Add LSP and Treesitter support for Assembly under `vim.languages.assembly`
[Bloxx12](https://github.com/Bloxx12)
@ -333,3 +326,4 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
[Nowaaru](https://github.com/Nowaaru):
- Add `precognition-nvim`.

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,3 @@
@use "scss-reset/reset";
:root {
--nmd-color0: #0a3e68;
--nmd-color1: #268598;
@ -34,6 +32,8 @@ $color-blue-700: #1d4ed8;
$color-blue-800: #1e40af;
$color-blue-900: #1e3a8a;
@use "scss-reset/reset";
@mixin boxed {
background: $color-gray-50;
margin: 2rem 16px;

View file

@ -4,4 +4,99 @@
License: ~ MIT (or more permissive) [via base16-schemes-source]
Maintainer: @highlightjs/core-team
Version: 2021.09.0
*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#ccc;background:#2d2d2d}.hljs ::selection,.hljs::selection{background-color:#515151;color:#ccc}.hljs-comment{color:#999}.hljs-tag{color:#b4b7b4}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#ccc}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#f2777a}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f99157}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fc6}.hljs-strong{font-weight:700;color:#fc6}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#9c9}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#6cc}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#69c}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#c9c}.hljs-emphasis{color:#c9c;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a3685a}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700}
*/
pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}
code.hljs {
padding: 3px 5px;
}
.hljs {
color: #ccc;
background: #2d2d2d;
}
.hljs ::selection,
.hljs::selection {
background-color: #515151;
color: #ccc;
}
.hljs-comment {
color: #999;
}
.hljs-tag {
color: #b4b7b4;
}
.hljs-operator,
.hljs-punctuation,
.hljs-subst {
color: #ccc;
}
.hljs-operator {
opacity: 0.7;
}
.hljs-bullet,
.hljs-deletion,
.hljs-name,
.hljs-selector-tag,
.hljs-template-variable,
.hljs-variable {
color: #f2777a;
}
.hljs-attr,
.hljs-link,
.hljs-literal,
.hljs-number,
.hljs-symbol,
.hljs-variable.constant_ {
color: #f99157;
}
.hljs-class .hljs-title,
.hljs-title,
.hljs-title.class_ {
color: #fc6;
}
.hljs-strong {
font-weight: 700;
color: #fc6;
}
.hljs-addition,
.hljs-code,
.hljs-string,
.hljs-title.class_.inherited__ {
color: #9c9;
}
.hljs-built_in,
.hljs-doctag,
.hljs-keyword.hljs-atrule,
.hljs-quote,
.hljs-regexp {
color: #6cc;
}
.hljs-attribute,
.hljs-function .hljs-title,
.hljs-section,
.hljs-title.function_,
.ruby .hljs-property {
color: #69c;
}
.diff .hljs-meta,
.hljs-keyword,
.hljs-template-tag,
.hljs-type {
color: #c9c;
}
.hljs-emphasis {
color: #c9c;
font-style: italic;
}
.hljs-meta,
.hljs-meta .hljs-keyword,
.hljs-meta .hljs-string {
color: #a3685a;
}
.hljs-meta .hljs-keyword,
.hljs-meta-keyword {
font-weight: 700;
}

File diff suppressed because it is too large Load diff

View file

@ -123,11 +123,6 @@ in {
paths = [neovim-wrapped printConfig printConfigPath];
postBuild = "echo Helpers added";
# Allow evaluating vimOptions, i.e., config.vim from the packages' passthru
# attribute. For example, packages.x86_64-linux.neovim.passthru.neovimConfig
# will return the configuration in full.
passthru.neovimConfig = vimOptions;
meta = {
description = "Wrapped version of Neovim with additional helper scripts";
mainProgram = "nvim";

View file

@ -42,20 +42,6 @@ in {
after = ''
${optionalString luasnipEnable "local luasnip = require('luasnip')"}
local cmp = require("cmp")
local kinds = require("cmp.types").lsp.CompletionItemKind
local deprio = function(kind)
return function(e1, e2)
if e1:get_kind() == kind then
return false
end
if e2:get_kind() == kind then
return true
end
return nil
end
end
cmp.setup(${toLuaObject cfg.setupOpts})
${optionalString config.vim.lazy.enable

View file

@ -29,8 +29,6 @@ in {
sorting.comparators = mkOption {
type = mergelessListOf (either str luaInline);
default = [
(mkLuaInline "deprio(kinds.Text)")
(mkLuaInline "deprio(kinds.Snippet)")
"offset"
"exact"
"score"
@ -45,12 +43,6 @@ in {
(see `:help cmp-config.sorting.comparators`),
or a string, in which case the builtin comparator with that name will
be used.
A `deprio` function and a `kinds`
(`require("cmp.types").lsp.CompletionItemKind`) variable is provided
above `setupOpts`. By passing a type to the funcion, the returned
function will be a comparator that always ranks the specified kind the
lowest.
'';
apply = map (
c:

View file

@ -24,7 +24,7 @@ in {
cmd = ["Neotree"];
};
visuals.nvim-web-devicons.enable = true;
visuals.nvimWebDevicons.enable = true;
};
};
}

View file

@ -1,49 +0,0 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.types) package;
inherit (lib.nvim.types) mkGrammarOption;
cfg = config.vim.languages.assembly;
in {
options.vim.languages.assembly = {
enable = mkEnableOption "Assembly support";
treesitter = {
enable = mkEnableOption "Assembly treesitter" // {default = config.vim.languages.enableTreesitter;};
package = mkGrammarOption pkgs "asm";
};
lsp = {
enable = mkEnableOption "Assembly LSP support (asm-lsp)" // {default = config.vim.languages.enableLSP;};
package = mkOption {
type = package;
default = pkgs.asm-lsp;
description = "asm-lsp package";
};
};
};
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.asm-lsp = ''
lspconfig.asm_lsp.setup {
capabilities = capabilities,
on_attach = default_on_attach,
cmd = {"${cfg.lsp.package}/bin/asm-lsp"},
}
'';
})
]);
}

View file

@ -2,7 +2,6 @@
inherit (lib.nvim.languages) mkEnable;
in {
imports = [
./asm.nix
./bash.nix
./dart.nix
./clang.nix

View file

@ -15,38 +15,7 @@
cfg = config.vim.languages.r;
r-with-languageserver = pkgs.rWrapper.override {
packages = [pkgs.rPackages.languageserver];
};
defaultFormat = "format_r";
formats = {
styler = {
package = pkgs.rWrapper.override {
packages = [pkgs.rPackages.styler];
};
nullConfig = ''
table.insert(
ls_sources,
null_ls.builtins.formatting.styler.with({
command = "${cfg.format.package}/bin/R",
})
)
'';
};
format_r = {
package = pkgs.rWrapper.override {
packages = [pkgs.rPackages.formatR];
};
nullConfig = ''
table.insert(
ls_sources,
null_ls.builtins.formatting.format_r.with({
command = "${cfg.format.package}/bin/R",
})
)
'';
};
packages = with pkgs.rPackages; [languageserver];
};
defaultServer = "r_language_server";
@ -93,22 +62,6 @@ in {
default = servers.${cfg.lsp.server}.package;
};
};
format = {
enable = mkEnableOption "R formatting" // {default = config.vim.languages.enableFormat;};
type = mkOption {
type = enum (attrNames formats);
default = defaultFormat;
description = "R formatter to use";
};
package = mkOption {
type = package;
default = formats.${cfg.format.type}.package;
description = "R formatter package";
};
};
};
config = mkIf cfg.enable (mkMerge [
@ -117,11 +70,6 @@ in {
vim.treesitter.grammars = [cfg.treesitter.package];
})
(mkIf cfg.format.enable {
vim.lsp.null-ls.enable = true;
vim.lsp.null-ls.sources.r-format = formats.${cfg.format.type}.nullConfig;
})
(mkIf cfg.lsp.enable {
vim.lsp.lspconfig.enable = true;
vim.lsp.lspconfig.sources.r-lsp = servers.${cfg.lsp.server}.lspConfig;

View file

@ -14,38 +14,6 @@
cfg = config.vim.languages.typst;
defaultServer = "tinymist";
servers = {
typst-lsp = {
package = pkgs.typst-lsp;
lspConfig = ''
lspconfig.typst_lsp.setup {
capabilities = capabilities,
on_attach = default_on_attach,
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/typst-lsp"}''
},
}
'';
};
tinymist = {
package = pkgs.tinymist;
lspConfig = ''
lspconfig.tinymist.setup {
capabilities = capabilities,
on_attach = default_on_attach,
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/tinymist"}''
},
}
'';
};
};
defaultFormat = "typstfmt";
formats = {
typstfmt = {
@ -84,17 +52,11 @@ in {
lsp = {
enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.languages.enableLSP;};
server = mkOption {
description = "Typst LSP server to use";
type = enum (attrNames servers);
default = defaultServer;
};
package = mkOption {
description = "typst-lsp package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
type = either package (listOf str);
default = servers.${cfg.lsp.server}.package;
default = pkgs.typst-lsp;
};
};
@ -120,14 +82,19 @@ in {
vim.treesitter.grammars = [cfg.treesitter.package];
})
(mkIf cfg.format.enable {
vim.lsp.null-ls.enable = true;
vim.lsp.null-ls.sources.typst-format = formats.${cfg.format.type}.nullConfig;
})
(mkIf cfg.lsp.enable {
vim.lsp.lspconfig.enable = true;
vim.lsp.lspconfig.sources.typst-lsp = servers.${cfg.lsp.server}.lspConfig;
vim.lsp.lspconfig.sources.typst-lsp = ''
lspconfig.typst_lsp.setup {
capabilities = capabilities,
on_attach=default_on_attach,
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/typst-lsp"}''
},
}
'';
})
]);
}

View file

@ -4,20 +4,33 @@
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.strings) optionalString;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.binds.whichKey;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["which-key"];
vim.startPlugins = ["which-key"];
pluginRC.whichkey = entryAnywhere ''
local wk = require("which-key")
wk.setup (${toLuaObject cfg.setupOpts})
wk.register(${toLuaObject cfg.register})
'';
};
vim.pluginRC.whichkey = entryAnywhere ''
local wk = require("which-key")
wk.setup ({
key_labels = {
["<space>"] = "SPACE",
["<leader>"] = "SPACE",
["<cr>"] = "RETURN",
["<tab>"] = "TAB",
},
${optionalString config.vim.ui.borders.plugins.which-key.enable ''
window = {
border = ${toLuaObject config.vim.ui.borders.plugins.which-key.style},
},
''}
})
wk.register(${toLuaObject cfg.register})
'';
};
}

View file

@ -1,4 +1,4 @@
{
_: {
imports = [
./which-key.nix
./config.nix

View file

@ -1,51 +1,14 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) attrsOf nullOr str attrs enum bool;
inherit (lib.nvim.types) mkPluginSetupOption;
{lib, ...}: let
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) attrsOf nullOr str;
in {
options.vim.binds.whichKey = {
enable = mkEnableOption "which-key keybind helper menu";
register = mkOption {
description = "Register label for which-key keybind helper menu";
type = attrsOf (nullOr str);
default = {};
description = "Register label for which-key keybind helper menu";
};
setupOpts = mkPluginSetupOption "which-key" {
preset = mkOption {
type = enum ["classic" "modern" "helix"];
default = "modern";
description = "The default preset for the which-key window";
};
notify = mkOption {
type = bool;
default = true;
description = "Show a warning when issues were detected with mappings";
};
replace = mkOption {
type = attrs;
default = {
"<space>" = "SPACE";
"<leader>" = "SPACE";
"<cr>" = "RETURN";
"<tab>" = "TAB";
};
description = "Functions/Lua Patterns for formatting the labels";
};
win = {
border = mkOption {
type = str;
default = config.vim.ui.borders.plugins.which-key.style;
description = "Which-key window border style";
};
};
};
};
}

View file

@ -3,8 +3,8 @@
in {
imports = [
(mkRemovedOptionModule ["vim" "visuals" "enable"] ''
As top-level toggles are being deprecated, you are encouraged to handle plugin
toggles under individual options.
As top-level toggles are being deprecated, you are encouraged
to handle plugin toggles under individual options.
'')
./cellular-automaton

View file

@ -16,7 +16,7 @@ in {
enable = mkEnableOption "Neovim dev icons [nvim-web-devicons]";
setupOpts = mkPluginSetupOption "nvim-web-devicons" {
color_icons = mkEnableOption "different highlight colors per icon" // {default = true;};
color_icons = mkEnableOption "different highlight colors per icon";
variant = mkOption {
type = nullOr (enum ["light" "dark"]);
default = null;

View file

@ -189,7 +189,7 @@ in {
};
plugins = mkOption {
default = {};
default = [];
type = attrsOf lznPluginType;
description = ''
Plugins to lazy load.