mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-26 15:06:45 +00:00
Compare commits
7 commits
5fa76cec27
...
3b1a9fdc89
Author | SHA1 | Date | |
---|---|---|---|
|
3b1a9fdc89 | ||
773186d93d | |||
|
0984e84444 | ||
7d077f43f7 | |||
cb57d3d417 | |||
754c29cb7c | |||
0e84e4ebed |
10 changed files with 223 additions and 68 deletions
12
flake.lock
12
flake.lock
|
@ -69,11 +69,11 @@
|
||||||
},
|
},
|
||||||
"mnw": {
|
"mnw": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722037780,
|
"lastModified": 1722191188,
|
||||||
"narHash": "sha256-ejkSFN5qHf161CnFq73b2LZlnJzYidBwUEtdx5/hNiY=",
|
"narHash": "sha256-YF//iMALbrd2Ni9aju7w8NniH16Qz6RFTRD6md5UkDc=",
|
||||||
"owner": "Gerg-L",
|
"owner": "Gerg-L",
|
||||||
"repo": "mnw",
|
"repo": "mnw",
|
||||||
"rev": "81e98e83d863d4fad506ed932d432570030cedd3",
|
"rev": "c7b289f3f5a31b6e744be37d83fc231816621231",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -129,11 +129,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1721016451,
|
"lastModified": 1722141560,
|
||||||
"narHash": "sha256-Cypl9ORr5UjtBsbjXMTJRepTe362yNVrPrntUvHiTaw=",
|
"narHash": "sha256-Ul3rIdesWaiW56PS/Ak3UlJdkwBrD4UcagCmXZR9Z7Y=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a14c5d651cee9ed70f9cd9e83f323f1e531002db",
|
"rev": "038fb464fcfa79b4f08131b07f2d8c9a6bcc4160",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
# Contains configuration for core neovim features
|
# Contains configuration for core neovim features
|
||||||
# such as spellchecking, mappings, and the init script (init.vim).
|
# such as spellchecking, mappings, and the init script (init.vim).
|
||||||
neovim = map (p: ./neovim + "/${p}") [
|
neovim = map (p: ./neovim + "/${p}") [
|
||||||
|
"global"
|
||||||
"init"
|
"init"
|
||||||
"mappings"
|
"mappings"
|
||||||
];
|
];
|
||||||
|
|
12
modules/neovim/global/default.nix
Normal file
12
modules/neovim/global/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.lists) concatLists;
|
||||||
|
inherit (lib.filesystem) listFilesRecursive;
|
||||||
|
in {
|
||||||
|
imports = concatLists [
|
||||||
|
# Configuration options for Neovim UI
|
||||||
|
(listFilesRecursive ./ui)
|
||||||
|
|
||||||
|
# vim.diagnostics
|
||||||
|
[./diagnostics.nix]
|
||||||
|
];
|
||||||
|
}
|
115
modules/neovim/global/diagnostics.nix
Normal file
115
modules/neovim/global/diagnostics.nix
Normal file
|
@ -0,0 +1,115 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
inherit (lib.types) str bool enum either;
|
||||||
|
in {
|
||||||
|
options.vim.diagnostics = {
|
||||||
|
virtual_text = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Whether to use virtual text for diagnostics.
|
||||||
|
|
||||||
|
If multiple diagnostics are set for a namespace, one
|
||||||
|
prefix per diagnostic + the last diagnostic message
|
||||||
|
are shown.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
update_in_insert = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Whether to update diagnostics in insert mode.
|
||||||
|
|
||||||
|
This is useful for slow diagnostics sources, but can
|
||||||
|
also cause lag in insert mode.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
underline = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Whether to underline diagnostics.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
severity_sort = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Whether to sort diagnostics by severity.
|
||||||
|
|
||||||
|
This affects the order in which signs and
|
||||||
|
virtual text are displayed. When true, higher
|
||||||
|
severities are displayed before lower severities (e.g.
|
||||||
|
ERROR is displayed before WARN)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
float = {
|
||||||
|
focusable = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Whether the floating window is focusable.
|
||||||
|
When true, the floating window can be focused and
|
||||||
|
interacted with. When false, the floating window is
|
||||||
|
not focusable and will not receive input.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
border = mkOption {
|
||||||
|
type = enum ["none" "single" "double" "rounded" "solid" "shadow"];
|
||||||
|
default = config.vim.ui.border.globalStyle;
|
||||||
|
description = ''
|
||||||
|
The border style of the floating window.
|
||||||
|
|
||||||
|
Possible values:
|
||||||
|
- none
|
||||||
|
- single
|
||||||
|
- double
|
||||||
|
- rounded
|
||||||
|
- solid
|
||||||
|
- shadow
|
||||||
|
|
||||||
|
See `:h nvim_open_win` for the available border
|
||||||
|
styles and their definitions.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
source = mkOption {
|
||||||
|
type = either bool (enum ["always" "if_many"]);
|
||||||
|
default = "auto";
|
||||||
|
description = ''
|
||||||
|
The source of the floating window.
|
||||||
|
Possible values:
|
||||||
|
- auto: Use the same source as the diagnostics
|
||||||
|
window.
|
||||||
|
- window: Use the window source.
|
||||||
|
- buffer: Use the buffer source.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
prefix = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
Prefix string for each diagnostic in the floating window
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
suffix = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
Suffix string for each diagnostic in the floating window
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
51
modules/neovim/global/ui/borders.nix
Normal file
51
modules/neovim/global/ui/borders.nix
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
inherit (lib.attrsets) mapAttrs;
|
||||||
|
inherit (lib.lists) optionals;
|
||||||
|
inherit (lib.types) enum;
|
||||||
|
|
||||||
|
cfg = config.vim.ui.borders;
|
||||||
|
|
||||||
|
# See `:h nvim_open_win` for the available border styles
|
||||||
|
# this list can be updated if additional styles are added.
|
||||||
|
defaultStyles = ["none" "single" "double" "rounded" "solid" "shadow"];
|
||||||
|
in {
|
||||||
|
options.vim.ui.borders = {
|
||||||
|
enable = mkEnableOption "visible borders for windows that support configurable borders";
|
||||||
|
|
||||||
|
# TODO: support configurable border elements with a lua table converted from a list of str
|
||||||
|
# e.g. [ "╔" "═" "╗" "║" "╝" "═" "╚" "║" ]
|
||||||
|
globalStyle = mkOption {
|
||||||
|
type = enum defaultStyles;
|
||||||
|
default = "single";
|
||||||
|
description = ''
|
||||||
|
The global border style to use.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
plugins = let
|
||||||
|
mkPluginStyleOption = name: {
|
||||||
|
enable = mkEnableOption "borders for the ${name} plugin" // {default = cfg.enable;};
|
||||||
|
|
||||||
|
style = mkOption {
|
||||||
|
type = enum (defaultStyles ++ optionals (name != "which-key") ["shadow"]);
|
||||||
|
default = cfg.globalStyle;
|
||||||
|
description = "The border style to use for the ${name} plugin";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
mapAttrs (_: mkPluginStyleOption) {
|
||||||
|
# despite not having it listed in example configuration, which-key does support the rounded type
|
||||||
|
# additionally, it supports a "shadow" type that is similar to none but is of higher contrast
|
||||||
|
which-key = "which-key";
|
||||||
|
lspsaga = "lspsaga";
|
||||||
|
nvim-cmp = "nvim-cmp";
|
||||||
|
lsp-signature = "lsp-signature";
|
||||||
|
code-action-menu = "code-actions-menu";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
32
modules/neovim/global/ui/icons.nix
Normal file
32
modules/neovim/global/ui/icons.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkOption;
|
||||||
|
inherit (lib.types) str;
|
||||||
|
in {
|
||||||
|
options.vim.ui.icons = {
|
||||||
|
diagnostics = {
|
||||||
|
ERROR = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = " ";
|
||||||
|
description = "The icon to use for error messages";
|
||||||
|
};
|
||||||
|
|
||||||
|
WARN = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = " ";
|
||||||
|
description = "The icon to use for warning messages";
|
||||||
|
};
|
||||||
|
|
||||||
|
INFO = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = " ";
|
||||||
|
description = "The icon to use for info messages";
|
||||||
|
};
|
||||||
|
|
||||||
|
HINT = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = " ";
|
||||||
|
description = "The icon to use for hint messages";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,46 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
|
||||||
inherit (lib.lists) optionals;
|
|
||||||
inherit (lib.types) enum;
|
|
||||||
|
|
||||||
cfg = config.vim.ui.borders;
|
|
||||||
|
|
||||||
defaultStyles = ["none" "single" "double" "rounded"];
|
|
||||||
in {
|
|
||||||
options.vim.ui.borders = {
|
|
||||||
enable = mkEnableOption "visible borders for most windows";
|
|
||||||
|
|
||||||
globalStyle = mkOption {
|
|
||||||
type = enum defaultStyles;
|
|
||||||
default = "rounded";
|
|
||||||
description = ''
|
|
||||||
The global border style to use.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# TODO: make per-plugin borders configurable
|
|
||||||
plugins = let
|
|
||||||
mkPluginStyleOption = name: {
|
|
||||||
enable = mkEnableOption "borders for the ${name} plugin" // {default = cfg.enable;};
|
|
||||||
|
|
||||||
style = mkOption {
|
|
||||||
type = enum (defaultStyles ++ optionals (name != "which-key") ["shadow"]);
|
|
||||||
default = cfg.globalStyle;
|
|
||||||
description = "The border style to use for the ${name} plugin";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
# despite not having it listed in example configuration, which-key does support the rounded type
|
|
||||||
# additionally, it supports a "shadow" type that is similar to none but is of higher contrast
|
|
||||||
which-key = mkPluginStyleOption "which-key";
|
|
||||||
lspsaga = mkPluginStyleOption "lspsaga";
|
|
||||||
nvim-cmp = mkPluginStyleOption "nvim-cmp";
|
|
||||||
lsp-signature = mkPluginStyleOption "lsp-signature";
|
|
||||||
code-action-menu = mkPluginStyleOption "code-actions-menu";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./borders.nix
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,12 +1,11 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./noice
|
./breadcrumbs
|
||||||
./modes
|
|
||||||
./notifications
|
|
||||||
./smartcolumn
|
|
||||||
./colorizer
|
./colorizer
|
||||||
./illuminate
|
./illuminate
|
||||||
./breadcrumbs
|
./modes
|
||||||
./borders
|
./noice
|
||||||
|
./notifications
|
||||||
|
./smartcolumn
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,11 +155,7 @@ in {
|
||||||
-- The following list is generated from `vim.additionalRuntimePaths`
|
-- The following list is generated from `vim.additionalRuntimePaths`
|
||||||
-- and is used to append additional runtime paths to the
|
-- and is used to append additional runtime paths to the
|
||||||
-- `runtimepath` option.
|
-- `runtimepath` option.
|
||||||
local additionalRuntimePaths = ${listToLuaTable cfg.additionalRuntimePaths};
|
vim.opt.runtimepath:append(${listToLuaTable cfg.additionalRuntimePaths})
|
||||||
|
|
||||||
for _, path in ipairs(additionalRuntimePaths) do
|
|
||||||
vim.opt.runtimepath:append(path)
|
|
||||||
end
|
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString cfg.disableDefaultRuntimePaths ''
|
${optionalString cfg.disableDefaultRuntimePaths ''
|
||||||
|
|
Loading…
Reference in a new issue