mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-16 15:30:50 +00:00
Compare commits
No commits in common. "4242640c9801d6bcd9e72ae942eb92928093b0a5" and "8df64accabb71f3a215234287e0423100193a2df" have entirely different histories.
4242640c98
...
8df64accab
6 changed files with 28 additions and 155 deletions
|
|
@ -1,16 +1,13 @@
|
||||||
.TH "nvf" "5" "January 1, 1980" "nvf"
|
.TH "nvf" "5" "01/01/1980" "nvf"
|
||||||
.\" disable hyphenation
|
.\" disable hyphenation
|
||||||
.nh
|
.nh
|
||||||
.\" disable justification (adjust text to left margin only)
|
.\" disable justification (adjust text to left margin only)
|
||||||
.ad l
|
.ad l
|
||||||
.\" enable line breaks after slashes
|
.\" enable line breaks after slashes
|
||||||
.cflags 4 /
|
.cflags 4 /
|
||||||
|
|
||||||
.SH "NAME"
|
.SH "NAME"
|
||||||
nvf \- Configuration specification for the nvf.
|
nvf configuration specification
|
||||||
|
.SH "OPTIONS"
|
||||||
.SH "DESCRIPTION"
|
.PP
|
||||||
The nvf configuration specification provides a declarative structure for configuring Neovim using Nix with few
|
You can use the following options to configure nvf:
|
||||||
lines of Nix. This document outlines the available options and their usage to create modular, reusable, and
|
.PP
|
||||||
reproducible configurations using nvf's module system options. For tips, tricks and possible quirks with available
|
|
||||||
plugins please visit https://notashelf.github.io/nvf/
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
.Dd January 1, 1980
|
.Dd January 1, 1980
|
||||||
.Dt NVF 1
|
.Dt nvf 1
|
||||||
.Os nvf
|
.Os nvf
|
||||||
.\" disable hyphenation
|
.\" disable hyphenation
|
||||||
.nh
|
.nh
|
||||||
|
|
@ -7,46 +7,27 @@
|
||||||
.ad l
|
.ad l
|
||||||
.\" enable line breaks after slashes
|
.\" enable line breaks after slashes
|
||||||
.cflags 4 /
|
.cflags 4 /
|
||||||
|
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm nvf
|
.Nm nvf
|
||||||
.Nd A modular, extensible, and distro-agnostic Neovim configuration framework for Nix/NixOS.
|
.Nd A highly 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
|
.Sh BUGS
|
||||||
.Pp
|
.Pp
|
||||||
Please report any bugs on the project issue tracker:
|
Please report any bugs that you might encounter on the
|
||||||
.Lk https://github.com/notashelf/nvf/issues
|
\m[blue]\fBproject issue tracker\fR\m[]\&.
|
||||||
|
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Pp
|
.Pp
|
||||||
.Fn nvf 5
|
\fBnvf\fR(5)
|
||||||
|
|
||||||
.Sh AUTHOR
|
.Sh AUTHOR
|
||||||
.Pp
|
.Pp
|
||||||
.Fn nvf contributors
|
\fBnvf contributors\fR
|
||||||
.RS 4
|
.RS 4
|
||||||
Primary contributors and maintainers of the project.
|
Author.
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
.Sh COPYRIGHT
|
.Sh COPYRIGHT
|
||||||
.Pp
|
.br
|
||||||
Copyright (c) 2023–2025 nvf contributors.
|
Copyright \(co 2023\(en2024 nvf contributors
|
||||||
|
.br
|
||||||
|
|
|
||||||
|
|
@ -31,12 +31,6 @@
|
||||||
your Editorconfig configuration, or use an autocommand to set indentation
|
your Editorconfig configuration, or use an autocommand to set indentation
|
||||||
values for buffers with the Nix filetype.
|
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.
|
|
||||||
|
|
||||||
[amadaluzia](https://github.com/amadaluzia):
|
[amadaluzia](https://github.com/amadaluzia):
|
||||||
|
|
||||||
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
|
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
|
||||||
|
|
@ -65,8 +59,7 @@
|
||||||
- Add `vim.snippets.luasnip.setupOpts`, which was previously missing.
|
- Add `vim.snippets.luasnip.setupOpts`, which was previously missing.
|
||||||
- Add `"prettierd"` as a formatter option in
|
- Add `"prettierd"` as a formatter option in
|
||||||
`vim.languages.markdown.format.type`.
|
`vim.languages.markdown.format.type`.
|
||||||
- Add the following plugins from
|
- Add the following plugins from [mini.nvim](https://github.com/echasnovski/mini.nvim)
|
||||||
[mini.nvim](https://github.com/echasnovski/mini.nvim)
|
|
||||||
- `mini.ai`
|
- `mini.ai`
|
||||||
- `mini.align`
|
- `mini.align`
|
||||||
- `mini.animate`
|
- `mini.animate`
|
||||||
|
|
@ -109,8 +102,7 @@
|
||||||
- `mini.trailspace`
|
- `mini.trailspace`
|
||||||
- `mini.visits`
|
- `mini.visits`
|
||||||
- Add [fzf-lua](https://github.com/ibhagwan/fzf-lua) in `vim.fzf-lua`
|
- Add [fzf-lua](https://github.com/ibhagwan/fzf-lua) in `vim.fzf-lua`
|
||||||
- Add [rainbow-delimiters](https://github.com/HiPhish/rainbow-delimiters.nvim)
|
- Add [rainbow-delimiters](https://github.com/HiPhish/rainbow-delimiters.nvim) in `vim.visuals.rainbow-delimiters`
|
||||||
in `vim.visuals.rainbow-delimiters`
|
|
||||||
- Add options to define highlights under [](#opt-vim.highlight)
|
- Add options to define highlights under [](#opt-vim.highlight)
|
||||||
|
|
||||||
[kaktu5](https://github.com/kaktu5):
|
[kaktu5](https://github.com/kaktu5):
|
||||||
|
|
@ -130,8 +122,3 @@
|
||||||
[ruff]: (https://github.com/astral-sh/ruff)
|
[ruff]: (https://github.com/astral-sh/ruff)
|
||||||
|
|
||||||
- Add [ruff] as a formatter option in `vim.languages.python.format.type`.
|
- 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.
|
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,10 @@
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.modules) mkIf mkMerge mkDefault;
|
inherit (lib.modules) mkIf mkMerge mkDefault;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.types) bool either listOf package str enum;
|
inherit (lib.types) either listOf package str enum;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
|
|
||||||
cfg = config.vim.languages.zig;
|
|
||||||
|
|
||||||
defaultServer = "zls";
|
defaultServer = "zls";
|
||||||
servers = {
|
servers = {
|
||||||
zls = {
|
zls = {
|
||||||
|
|
@ -33,35 +31,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: dap.adapter.lldb is duplicated when enabling the
|
cfg = config.vim.languages.zig;
|
||||||
# vim.languages.clang.dap module. This does not cause
|
|
||||||
# breakage... but could be cleaner.
|
|
||||||
defaultDebugger = "lldb-vscode";
|
|
||||||
debuggers = {
|
|
||||||
lldb-vscode = {
|
|
||||||
package = pkgs.lldb;
|
|
||||||
dapConfig = ''
|
|
||||||
dap.adapters.lldb = {
|
|
||||||
type = 'executable',
|
|
||||||
command = '${cfg.dap.package}/bin/lldb-dap',
|
|
||||||
name = 'lldb'
|
|
||||||
}
|
|
||||||
dap.configurations.zig = {
|
|
||||||
{
|
|
||||||
name = 'Launch',
|
|
||||||
type = 'lldb',
|
|
||||||
request = 'launch',
|
|
||||||
program = function()
|
|
||||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
|
||||||
end,
|
|
||||||
cwd = "''${workspaceFolder}",
|
|
||||||
stopOnEntry = false,
|
|
||||||
args = {},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
in {
|
||||||
options.vim.languages.zig = {
|
options.vim.languages.zig = {
|
||||||
enable = mkEnableOption "Zig language support";
|
enable = mkEnableOption "Zig language support";
|
||||||
|
|
@ -86,26 +56,6 @@ in {
|
||||||
default = pkgs.zls;
|
default = pkgs.zls;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
dap = {
|
|
||||||
enable = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = config.vim.languages.enableDAP;
|
|
||||||
description = "Enable Zig Debug Adapter";
|
|
||||||
};
|
|
||||||
|
|
||||||
debugger = mkOption {
|
|
||||||
type = enum (attrNames debuggers);
|
|
||||||
default = defaultDebugger;
|
|
||||||
description = "Zig debugger to use";
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
type = package;
|
|
||||||
default = debuggers.${cfg.dap.debugger}.package;
|
|
||||||
description = "Zig debugger package.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
|
@ -127,12 +77,5 @@ in {
|
||||||
globals.zig_fmt_autosave = mkDefault 0;
|
globals.zig_fmt_autosave = mkDefault 0;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.dap.enable {
|
|
||||||
vim = {
|
|
||||||
debugger.nvim-dap.enable = true;
|
|
||||||
debugger.nvim-dap.sources.zig-debugger = debuggers.${cfg.dap.debugger}.dapConfig;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.strings) optionalString;
|
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
|
|
@ -13,29 +12,13 @@ in {
|
||||||
config = mkIf (cfg.enable && cfg.lightbulb.enable) {
|
config = mkIf (cfg.enable && cfg.lightbulb.enable) {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = ["nvim-lightbulb"];
|
startPlugins = ["nvim-lightbulb"];
|
||||||
|
|
||||||
pluginRC.lightbulb = entryAnywhere ''
|
pluginRC.lightbulb = entryAnywhere ''
|
||||||
local nvim_lightbulb = require("nvim-lightbulb")
|
vim.api.nvim_command('autocmd CursorHold,CursorHoldI * lua require\'nvim-lightbulb\'.update_lightbulb()')
|
||||||
nvim_lightbulb.setup(${toLuaObject cfg.lightbulb.setupOpts})
|
|
||||||
${optionalString cfg.lightbulb.autocmd.enable ''
|
-- Enable trouble diagnostics viewer
|
||||||
vim.api.nvim_create_autocmd(${toLuaObject cfg.lightbulb.autocmd.events}, {
|
require'nvim-lightbulb'.setup(${toLuaObject cfg.lightbulb.setupOpts})
|
||||||
pattern = ${toLuaObject cfg.lightbulb.autocmd.pattern},
|
|
||||||
callback = function()
|
|
||||||
nvim_lightbulb.update_lightbulb()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
''}
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
warnings = [
|
|
||||||
# This could have been an assertion, but the chances of collision is very low and asserting here
|
|
||||||
# might be too dramatic. Let's only warn the user, *in case* this occurs and is not intended. No
|
|
||||||
# error will be thrown if 'lightbulb.setupOpts.autocmd.enable' has not been set by the user.
|
|
||||||
(mkIf (cfg.lightbulb.autocmd.enable -> (cfg.lightbulb.setupOpts.autocmd.enabled or false)) ''
|
|
||||||
Both 'vim.lsp.lightbulb.autocmd.enable' and 'vim.lsp.lightbulb.setupOpts.autocmd.enable' are set
|
|
||||||
simultaneously. This might have performance implications due to frequent updates. Please set only
|
|
||||||
one option to handle nvim-lightbulb autocmd.
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,11 @@
|
||||||
{lib, ...}: let
|
{lib, ...}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
inherit (lib.options) mkEnableOption;
|
||||||
inherit (lib.types) listOf str either;
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
|
||||||
in {
|
in {
|
||||||
options.vim.lsp = {
|
options.vim.lsp = {
|
||||||
lightbulb = {
|
lightbulb = {
|
||||||
enable = mkEnableOption "Lightbulb for code actions. Requires an emoji font";
|
enable = mkEnableOption "Lightbulb for code actions. Requires an emoji font";
|
||||||
setupOpts = mkPluginSetupOption "nvim-lightbulb" {};
|
setupOpts = mkPluginSetupOption "nvim-lightbulb" {};
|
||||||
autocmd = {
|
|
||||||
enable = mkEnableOption "updating lightbulb glyph automatically" // {default = true;};
|
|
||||||
events = mkOption {
|
|
||||||
type = listOf str;
|
|
||||||
default = ["CursorHold" "CursorHoldI"];
|
|
||||||
description = "Events on which to update nvim-lightbulb glyphs";
|
|
||||||
};
|
|
||||||
|
|
||||||
pattern = mkOption {
|
|
||||||
type = either str luaInline;
|
|
||||||
default = "*";
|
|
||||||
description = ''
|
|
||||||
File patterns or buffer names to match, determining which files or buffers trigger
|
|
||||||
glyph updates.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue