Skip to content

Commit 03f477a

Browse files
committed
change: fix release note
2 parents cbda2a2 + 4242640 commit 03f477a

File tree

9 files changed

+275
-31
lines changed

9 files changed

+275
-31
lines changed

docs/man/header.5

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
.TH "nvf" "5" "01/01/1980" "nvf"
1+
.TH "nvf" "5" "January 1, 1980" "nvf"
22
.\" disable hyphenation
33
.nh
44
.\" disable justification (adjust text to left margin only)
55
.ad l
66
.\" enable line breaks after slashes
77
.cflags 4 /
8+
89
.SH "NAME"
9-
nvf configuration specification
10-
.SH "OPTIONS"
11-
.PP
12-
You can use the following options to configure nvf:
13-
.PP
10+
nvf \- Configuration specification for the nvf.
11+
12+
.SH "DESCRIPTION"
13+
The nvf configuration specification provides a declarative structure for configuring Neovim using Nix with few
14+
lines of Nix. This document outlines the available options and their usage to create modular, reusable, and
15+
reproducible configurations using nvf's module system options. For tips, tricks and possible quirks with available
16+
plugins please visit https://notashelf.github.io/nvf/

docs/man/nvf.1

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,52 @@
11
.Dd January 1, 1980
2-
.Dt nvf 1
2+
.Dt NVF 1
33
.Os nvf
44
.\" disable hyphenation
55
.nh
66
.\" disable justification (adjust text to left margin only)
77
.ad l
88
.\" enable line breaks after slashes
99
.cflags 4 /
10+
1011
.Sh NAME
1112
.Nm nvf
12-
.Nd A highly modular, extensible and distro-agnostic Neovim configuration framework for Nix/NixOS.
13-
.
13+
.Nd A modular, extensible, and distro-agnostic Neovim configuration framework for Nix/NixOS.
14+
15+
.Sh DESCRIPTION
16+
.Nm nvf
17+
is a highly modular, configurable, extensible, and easy-to-use Neovim configuration in Nix.
18+
Designed for flexibility and ease of use, nvf allows you to easily configure your fully featured
19+
Neovim instance with a few lines of Nix.
20+
21+
.Sh COMMANDS
22+
The following commands are bundled with nvf to allow easier debugging of your configuration.
23+
24+
.Bl -tag -width Ds
25+
.It Nm nvf-print-config
26+
Outputs the full configuration of the current `nvf` setup. This command is useful for debugging
27+
or inspecting the applied configuration.
28+
.Pp
29+
.It Nm nvf-print-config-path
30+
Prints the file path to the configuration file currently in use. This command is helpful for locating
31+
the source configuration file for troubleshooting or easily sharing it via online paste utilities.
32+
.El
33+
1434
.Sh BUGS
1535
.Pp
16-
Please report any bugs that you might encounter on the
17-
\m[blue]\fBproject issue tracker\fR\m[]\&.
36+
Please report any bugs on the project issue tracker:
37+
.Lk https://github.com/notashelf/nvf/issues
1838

1939
.Sh SEE ALSO
2040
.Pp
21-
\fBnvf\fR(5)
41+
.Fn nvf 5
2242

2343
.Sh AUTHOR
2444
.Pp
25-
\fBnvf contributors\fR
45+
.Fn nvf contributors
2646
.RS 4
27-
Author.
47+
Primary contributors and maintainers of the project.
2848
.RE
2949

3050
.Sh COPYRIGHT
31-
.br
32-
Copyright \(co 2023\(en2024 nvf contributors
33-
.br
51+
.Pp
52+
Copyright (c) 2023–2025 nvf contributors.

docs/release-notes/rl-0.8.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
your Editorconfig configuration, or use an autocommand to set indentation
3232
values for buffers with the Nix filetype.
3333

34+
- Add [](#opt-vim.lsp.lightbulb.autocmd.enable) for manually managing the
35+
previously managed lightbulb autocommand.
36+
- A warning will occur if [](#opt-vim.lsp.lightbulb.autocmd.enable) and
37+
`vim.lsp.lightbulb.setupOpts.autocmd.enabled` are both set at the same time.
38+
Pick only one.
39+
3440
[amadaluzia](https://github.com/amadaluzia):
3541

3642
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
@@ -105,6 +111,7 @@
105111
- Add [fzf-lua](https://github.com/ibhagwan/fzf-lua) in `vim.fzf-lua`
106112
- Add [rainbow-delimiters](https://github.com/HiPhish/rainbow-delimiters.nvim)
107113
in `vim.visuals.rainbow-delimiters`
114+
- Add options to define highlights under [](#opt-vim.highlight)
108115

109116
[kaktu5](https://github.com/kaktu5):
110117

@@ -126,7 +133,10 @@
126133

127134
[QuiNzX](https://github.com/QuiNzX):
128135

129-
[ruff]: (https://github.com/astral-sh/ruff)
130-
131136
- Add ruff as lsp alongside other lsp servers in a list as an option. Under
132137
`vim.languages.python.lsp.server`.
138+
139+
[ARCIII](https://github.com/ArmandoCIII):
140+
141+
- Add `vim.languages.zig.dap` support through pkgs.lldb dap adapter. Code
142+
Inspiration from `vim.languages.clang.dap` implementation.

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/neovim/init/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
imports = [
33
./basic.nix
44
./debug.nix
5+
./highlight.nix
56
./spellcheck.nix
67
];
78
}

modules/neovim/init/highlight.nix

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
config,
3+
lib,
4+
...
5+
}: let
6+
inherit (lib.options) mkOption;
7+
inherit (lib.types) nullOr attrsOf listOf submodule bool ints str enum;
8+
inherit (lib.strings) hasPrefix concatLines;
9+
inherit (lib.attrsets) mapAttrsToList;
10+
inherit (lib.nvim.dag) entryBetween;
11+
inherit (lib.nvim.lua) toLuaObject;
12+
inherit (lib.nvim.types) hexColor;
13+
14+
mkColorOption = target:
15+
mkOption {
16+
type = nullOr hexColor;
17+
default = null;
18+
example = "#ebdbb2";
19+
description = ''
20+
The ${target} color to use. Written as color name or hex "#RRGGBB".
21+
'';
22+
};
23+
24+
mkBoolOption = name:
25+
mkOption {
26+
type = nullOr bool;
27+
default = null;
28+
example = false;
29+
description = "Whether to enable ${name}";
30+
};
31+
32+
cfg = config.vim.highlight;
33+
in {
34+
options.vim.highlight = mkOption {
35+
type = attrsOf (submodule {
36+
# See :h nvim_set_hl
37+
options = {
38+
bg = mkColorOption "background";
39+
fg = mkColorOption "foreground";
40+
sp = mkColorOption "special";
41+
blend = mkOption {
42+
type = nullOr (ints.between 0 100);
43+
default = null;
44+
description = "Blend as an integer between 0 and 100";
45+
};
46+
bold = mkBoolOption "bold";
47+
standout = mkBoolOption "standout";
48+
underline = mkBoolOption "underline";
49+
undercurl = mkBoolOption "undercurl";
50+
underdouble = mkBoolOption "underdouble";
51+
underdotted = mkBoolOption "underdotted";
52+
underdashed = mkBoolOption "underdashed";
53+
strikethrough = mkBoolOption "strikethrough";
54+
italic = mkBoolOption "italic";
55+
reverse = mkBoolOption "reverse";
56+
nocombine = mkBoolOption "nocombine";
57+
link = mkOption {
58+
type = nullOr str;
59+
default = null;
60+
description = "The name of another highlight group to link to";
61+
};
62+
default = mkOption {
63+
type = nullOr bool;
64+
default = null;
65+
description = "Don't override existing definition";
66+
};
67+
ctermfg = mkOption {
68+
type = nullOr str;
69+
default = null;
70+
description = "The cterm foreground color to use";
71+
};
72+
ctermbg = mkOption {
73+
type = nullOr str;
74+
default = null;
75+
description = "The cterm background color to use";
76+
};
77+
cterm = mkOption {
78+
type = nullOr (listOf (enum [
79+
"bold"
80+
"underline"
81+
"undercurl"
82+
"underdouble"
83+
"underdotted"
84+
"underdashed"
85+
"strikethrough"
86+
"reverse"
87+
"inverse"
88+
"italic"
89+
"standout"
90+
"altfont"
91+
"nocombine"
92+
"NONE"
93+
]));
94+
default = null;
95+
description = "The cterm arguments to use. See ':h highlight-args'";
96+
};
97+
force = mkBoolOption "force update";
98+
};
99+
});
100+
default = {};
101+
example = {
102+
SignColumn = {
103+
bg = "#282828";
104+
};
105+
};
106+
description = "Custom highlights to apply";
107+
};
108+
109+
config = {
110+
vim.luaConfigRC.highlight = let
111+
highlights =
112+
mapAttrsToList (
113+
name: value: ''vim.api.nvim_set_hl(0, ${toLuaObject name}, ${toLuaObject value})''
114+
)
115+
cfg;
116+
in
117+
entryBetween ["lazyConfigs" "pluginConfigs" "extraPluginConfigs"] ["theme"] (concatLines highlights);
118+
};
119+
}

modules/plugins/languages/zig.nix

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
inherit (lib.options) mkEnableOption mkOption;
99
inherit (lib.modules) mkIf mkMerge mkDefault;
1010
inherit (lib.lists) isList;
11-
inherit (lib.types) either listOf package str enum;
11+
inherit (lib.types) bool either listOf package str enum;
1212
inherit (lib.nvim.lua) expToLua;
1313
inherit (lib.nvim.types) mkGrammarOption;
1414

15+
cfg = config.vim.languages.zig;
16+
1517
defaultServer = "zls";
1618
servers = {
1719
zls = {
@@ -31,7 +33,35 @@
3133
};
3234
};
3335

34-
cfg = config.vim.languages.zig;
36+
# TODO: dap.adapter.lldb is duplicated when enabling the
37+
# vim.languages.clang.dap module. This does not cause
38+
# breakage... but could be cleaner.
39+
defaultDebugger = "lldb-vscode";
40+
debuggers = {
41+
lldb-vscode = {
42+
package = pkgs.lldb;
43+
dapConfig = ''
44+
dap.adapters.lldb = {
45+
type = 'executable',
46+
command = '${cfg.dap.package}/bin/lldb-dap',
47+
name = 'lldb'
48+
}
49+
dap.configurations.zig = {
50+
{
51+
name = 'Launch',
52+
type = 'lldb',
53+
request = 'launch',
54+
program = function()
55+
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
56+
end,
57+
cwd = "''${workspaceFolder}",
58+
stopOnEntry = false,
59+
args = {},
60+
},
61+
}
62+
'';
63+
};
64+
};
3565
in {
3666
options.vim.languages.zig = {
3767
enable = mkEnableOption "Zig language support";
@@ -56,6 +86,26 @@ in {
5686
default = pkgs.zls;
5787
};
5888
};
89+
90+
dap = {
91+
enable = mkOption {
92+
type = bool;
93+
default = config.vim.languages.enableDAP;
94+
description = "Enable Zig Debug Adapter";
95+
};
96+
97+
debugger = mkOption {
98+
type = enum (attrNames debuggers);
99+
default = defaultDebugger;
100+
description = "Zig debugger to use";
101+
};
102+
103+
package = mkOption {
104+
type = package;
105+
default = debuggers.${cfg.dap.debugger}.package;
106+
description = "Zig debugger package.";
107+
};
108+
};
59109
};
60110

61111
config = mkIf cfg.enable (mkMerge [
@@ -77,5 +127,12 @@ in {
77127
globals.zig_fmt_autosave = mkDefault 0;
78128
};
79129
})
130+
131+
(mkIf cfg.dap.enable {
132+
vim = {
133+
debugger.nvim-dap.enable = true;
134+
debugger.nvim-dap.sources.zig-debugger = debuggers.${cfg.dap.debugger}.dapConfig;
135+
};
136+
})
80137
]);
81138
}

modules/plugins/lsp/lightbulb/config.nix

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
...
55
}: let
66
inherit (lib.modules) mkIf;
7+
inherit (lib.strings) optionalString;
78
inherit (lib.nvim.dag) entryAnywhere;
89
inherit (lib.nvim.lua) toLuaObject;
910

@@ -12,13 +13,29 @@ in {
1213
config = mkIf (cfg.enable && cfg.lightbulb.enable) {
1314
vim = {
1415
startPlugins = ["nvim-lightbulb"];
15-
1616
pluginRC.lightbulb = entryAnywhere ''
17-
vim.api.nvim_command('autocmd CursorHold,CursorHoldI * lua require\'nvim-lightbulb\'.update_lightbulb()')
18-
19-
-- Enable trouble diagnostics viewer
20-
require'nvim-lightbulb'.setup(${toLuaObject cfg.lightbulb.setupOpts})
17+
local nvim_lightbulb = require("nvim-lightbulb")
18+
nvim_lightbulb.setup(${toLuaObject cfg.lightbulb.setupOpts})
19+
${optionalString cfg.lightbulb.autocmd.enable ''
20+
vim.api.nvim_create_autocmd(${toLuaObject cfg.lightbulb.autocmd.events}, {
21+
pattern = ${toLuaObject cfg.lightbulb.autocmd.pattern},
22+
callback = function()
23+
nvim_lightbulb.update_lightbulb()
24+
end,
25+
})
26+
''}
2127
'';
2228
};
29+
30+
warnings = [
31+
# This could have been an assertion, but the chances of collision is very low and asserting here
32+
# might be too dramatic. Let's only warn the user, *in case* this occurs and is not intended. No
33+
# error will be thrown if 'lightbulb.setupOpts.autocmd.enable' has not been set by the user.
34+
(mkIf (cfg.lightbulb.autocmd.enable -> (cfg.lightbulb.setupOpts.autocmd.enabled or false)) ''
35+
Both 'vim.lsp.lightbulb.autocmd.enable' and 'vim.lsp.lightbulb.setupOpts.autocmd.enable' are set
36+
simultaneously. This might have performance implications due to frequent updates. Please set only
37+
one option to handle nvim-lightbulb autocmd.
38+
'')
39+
];
2340
};
2441
}

0 commit comments

Comments
 (0)