mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 18:31:35 +00:00
treewide: restructure modules directory; add comments to modules top-level import
This commit is contained in:
parent
6eea801cd6
commit
43263040a4
14 changed files with 218 additions and 181 deletions
50
modules/neovim/init/debug.nix
Normal file
50
modules/neovim/init/debug.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) path enum nullOr;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
|
||||
cfg = config.vim.debugMode;
|
||||
in {
|
||||
options.vim = {
|
||||
debugMode = {
|
||||
enable = mkEnableOption "debug mode";
|
||||
level = mkOption {
|
||||
type = enum [2 3 4 5 8 9 11 12 13 14 15 16];
|
||||
default = 16;
|
||||
description = ''
|
||||
Set verbosity level of Neovim while debug mode is enabled.
|
||||
|
||||
Value must be be one of the levels expected by Neovim's
|
||||
[`verbose` option](https://neovim.io/doc/user/options.html#'verbose')
|
||||
'';
|
||||
};
|
||||
|
||||
logFile = mkOption {
|
||||
type = nullOr path;
|
||||
default = null;
|
||||
description = ''
|
||||
Set the log file that will be used to store verbose messages
|
||||
set by the `verbose` option.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config.vim = mkIf cfg.enable {
|
||||
luaConfigRC.debug-mode = entryAfter ["basic"] ''
|
||||
-- Debug mode settings
|
||||
vim.o.verbose = ${toString cfg.level},
|
||||
|
||||
${optionalString (cfg.logFile != null) ''
|
||||
-- Set verbose log file
|
||||
vim.o.verbosefile = ${cfg.logFile},
|
||||
''}
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue