Skip to content

Commit

Permalink
Merge branch 'main' into docs-touchup
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAShelf authored Feb 3, 2025
2 parents 9afe574 + 9443273 commit e77d79d
Show file tree
Hide file tree
Showing 16 changed files with 387 additions and 46 deletions.
1 change: 1 addition & 0 deletions configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ isMaximal: {
icon-picker.enable = isMaximal;
surround.enable = isMaximal;
diffview-nvim.enable = true;
yanky-nvim.enable = false;
motion = {
hop.enable = true;
leap.enable = true;
Expand Down
15 changes: 9 additions & 6 deletions docs/man/header.5
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
.TH "nvf" "5" "01/01/1980" "nvf"
.TH "nvf" "5" "January 1, 1980" "nvf"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" enable line breaks after slashes
.cflags 4 /

.SH "NAME"
nvf configuration specification
.SH "OPTIONS"
.PP
You can use the following options to configure nvf:
.PP
nvf \- Configuration specification for the nvf.

.SH "DESCRIPTION"
The nvf configuration specification provides a declarative structure for configuring Neovim using Nix with few
lines of Nix. This document outlines the available options and their usage to create modular, reusable, and
reproducible configurations using nvf's module system options. For tips, tricks and possible quirks with available
plugins please visit https://notashelf.github.io/nvf/
41 changes: 30 additions & 11 deletions docs/man/nvf.1
Original file line number Diff line number Diff line change
@@ -1,33 +1,52 @@
.Dd January 1, 1980
.Dt nvf 1
.Dt NVF 1
.Os nvf
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" enable line breaks after slashes
.cflags 4 /

.Sh NAME
.Nm nvf
.Nd A highly modular, extensible and distro-agnostic Neovim configuration framework for Nix/NixOS.
.
.Nd A modular, extensible, and distro-agnostic Neovim configuration framework for Nix/NixOS.

.Sh DESCRIPTION
.Nm nvf
is a highly modular, configurable, extensible, and easy-to-use Neovim configuration in Nix.
Designed for flexibility and ease of use, nvf allows you to easily configure your fully featured
Neovim instance with a few lines of Nix.

.Sh COMMANDS
The following commands are bundled with nvf to allow easier debugging of your configuration.

.Bl -tag -width Ds
.It Nm nvf-print-config
Outputs the full configuration of the current `nvf` setup. This command is useful for debugging
or inspecting the applied configuration.
.Pp
.It Nm nvf-print-config-path
Prints the file path to the configuration file currently in use. This command is helpful for locating
the source configuration file for troubleshooting or easily sharing it via online paste utilities.
.El

.Sh BUGS
.Pp
Please report any bugs that you might encounter on the
\m[blue]\fBproject issue tracker\fR\m[]\&.
Please report any bugs on the project issue tracker:
.Lk https://github.com/notashelf/nvf/issues

.Sh SEE ALSO
.Pp
\fBnvf\fR(5)
.Fn nvf 5

.Sh AUTHOR
.Pp
\fBnvf contributors\fR
.Fn nvf contributors
.RS 4
Author.
Primary contributors and maintainers of the project.
.RE

.Sh COPYRIGHT
.br
Copyright \(co 2023\(en2024 nvf contributors
.br
.Pp
Copyright (c) 2023–2025 nvf contributors.
22 changes: 20 additions & 2 deletions docs/release-notes/rl-0.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
[render-markdown.nvim]: https://github.com/MeanderingProgrammer/render-markdown.nvim
[yanky.nvim]: https://github.com/gbprod/yanky.nvim

- Add [typst-preview.nvim] under
`languages.typst.extensions.typst-preview-nvim`.
Expand Down Expand Up @@ -31,6 +32,15 @@
your Editorconfig configuration, or use an autocommand to set indentation
values for buffers with the Nix filetype.

- Add [](#opt-vim.lsp.lightbulb.autocmd.enable) for manually managing the
previously managed lightbulb autocommand.

- A warning will occur if [](#opt-vim.lsp.lightbulb.autocmd.enable) and
`vim.lsp.lightbulb.setupOpts.autocmd.enabled` are both set at the same time.
Pick only one.

- Add [yanky.nvim] to available plugins, under `vim.utility.yanky-nvim`.

[amadaluzia](https://github.com/amadaluzia):

[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
Expand Down Expand Up @@ -59,7 +69,8 @@
- Add `vim.snippets.luasnip.setupOpts`, which was previously missing.
- Add `"prettierd"` as a formatter option in
`vim.languages.markdown.format.type`.
- Add the following plugins from [mini.nvim](https://github.com/echasnovski/mini.nvim)
- Add the following plugins from
[mini.nvim](https://github.com/echasnovski/mini.nvim)
- `mini.ai`
- `mini.align`
- `mini.animate`
Expand Down Expand Up @@ -102,7 +113,9 @@
- `mini.trailspace`
- `mini.visits`
- Add [fzf-lua](https://github.com/ibhagwan/fzf-lua) in `vim.fzf-lua`
- Add [rainbow-delimiters](https://github.com/HiPhish/rainbow-delimiters.nvim) in `vim.visuals.rainbow-delimiters`
- Add [rainbow-delimiters](https://github.com/HiPhish/rainbow-delimiters.nvim)
in `vim.visuals.rainbow-delimiters`
- Add options to define highlights under [](#opt-vim.highlight)

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

Expand All @@ -121,3 +134,8 @@
[ruff]: (https://github.com/astral-sh/ruff)

- Add [ruff] as a formatter option in `vim.languages.python.format.type`.

[ARCIII](https://github.com/ArmandoCIII):

- Add `vim.languages.zig.dap` support through pkgs.lldb dap adapter. Code
Inspiration from `vim.languages.clang.dap` implementation.
33 changes: 25 additions & 8 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,11 @@
flake = false;
};

plugin-yanky-nvim = {
url = "github:gbprod/yanky.nvim";
flake = false;
};

# Note-taking
plugin-obsidian-nvim = {
url = "github:epwalsh/obsidian.nvim";
Expand Down Expand Up @@ -642,7 +647,7 @@
};

plugin-nvim-colorizer-lua = {
url = "github:NvChad/nvim-colorizer.lua";
url = "github:catgoose/nvim-colorizer.lua";
flake = false;
};

Expand Down
1 change: 1 addition & 0 deletions modules/neovim/init/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
imports = [
./basic.nix
./debug.nix
./highlight.nix
./spellcheck.nix
];
}
119 changes: 119 additions & 0 deletions modules/neovim/init/highlight.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkOption;
inherit (lib.types) nullOr attrsOf listOf submodule bool ints str enum;
inherit (lib.strings) hasPrefix concatLines;
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.nvim.dag) entryBetween;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.types) hexColor;

mkColorOption = target:
mkOption {
type = nullOr hexColor;
default = null;
example = "#ebdbb2";
description = ''
The ${target} color to use. Written as color name or hex "#RRGGBB".
'';
};

mkBoolOption = name:
mkOption {
type = nullOr bool;
default = null;
example = false;
description = "Whether to enable ${name}";
};

cfg = config.vim.highlight;
in {
options.vim.highlight = mkOption {
type = attrsOf (submodule {
# See :h nvim_set_hl
options = {
bg = mkColorOption "background";
fg = mkColorOption "foreground";
sp = mkColorOption "special";
blend = mkOption {
type = nullOr (ints.between 0 100);
default = null;
description = "Blend as an integer between 0 and 100";
};
bold = mkBoolOption "bold";
standout = mkBoolOption "standout";
underline = mkBoolOption "underline";
undercurl = mkBoolOption "undercurl";
underdouble = mkBoolOption "underdouble";
underdotted = mkBoolOption "underdotted";
underdashed = mkBoolOption "underdashed";
strikethrough = mkBoolOption "strikethrough";
italic = mkBoolOption "italic";
reverse = mkBoolOption "reverse";
nocombine = mkBoolOption "nocombine";
link = mkOption {
type = nullOr str;
default = null;
description = "The name of another highlight group to link to";
};
default = mkOption {
type = nullOr bool;
default = null;
description = "Don't override existing definition";
};
ctermfg = mkOption {
type = nullOr str;
default = null;
description = "The cterm foreground color to use";
};
ctermbg = mkOption {
type = nullOr str;
default = null;
description = "The cterm background color to use";
};
cterm = mkOption {
type = nullOr (listOf (enum [
"bold"
"underline"
"undercurl"
"underdouble"
"underdotted"
"underdashed"
"strikethrough"
"reverse"
"inverse"
"italic"
"standout"
"altfont"
"nocombine"
"NONE"
]));
default = null;
description = "The cterm arguments to use. See ':h highlight-args'";
};
force = mkBoolOption "force update";
};
});
default = {};
example = {
SignColumn = {
bg = "#282828";
};
};
description = "Custom highlights to apply";
};

config = {
vim.luaConfigRC.highlight = let
highlights =
mapAttrsToList (
name: value: ''vim.api.nvim_set_hl(0, ${toLuaObject name}, ${toLuaObject value})''
)
cfg;
in
entryBetween ["lazyConfigs" "pluginConfigs" "extraPluginConfigs"] ["theme"] (concatLines highlights);
};
}
2 changes: 1 addition & 1 deletion modules/plugins/languages/ts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
ls_sources,
null_ls.builtins.formatting.prettier.with({
command = "${cfg.format.package}/bin/prettier",
filetypes = { "typescript" },
filetypes = { "typescript", "javascript" },
})
)
'';
Expand Down
Loading

0 comments on commit e77d79d

Please sign in to comment.