mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 21:30:51 +00:00
Compare commits
10 commits
acb42d02af
...
d57a83ee39
Author | SHA1 | Date | |
---|---|---|---|
|
d57a83ee39 | ||
773186d93d | |||
|
0984e84444 | ||
ff9a93d3ed | |||
d88b1129e5 | |||
|
f7db34b197 | ||
|
de19f0249a | ||
|
5c9746aa30 | ||
|
32eb9c3de6 | ||
|
d3cd9809b2 |
11 changed files with 36 additions and 34 deletions
|
@ -53,6 +53,7 @@ configuration formats.
|
||||||
longer filtered and thus should be used instead.
|
longer filtered and thus should be used instead.
|
||||||
- Add dap-go for better dap configurations
|
- Add dap-go for better dap configurations
|
||||||
- Make noice.nvim customizable
|
- Make noice.nvim customizable
|
||||||
|
- Standardize border style options and add custom borders
|
||||||
|
|
||||||
[rust-tools.nvim]: https://github.com/simrat39/rust-tools.nvim
|
[rust-tools.nvim]: https://github.com/simrat39/rust-tools.nvim
|
||||||
[rustaceanvim]: https://github.com/mrcjkb/rustaceanvim
|
[rustaceanvim]: https://github.com/mrcjkb/rustaceanvim
|
||||||
|
|
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": {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
typesCustom = import ./custom.nix {inherit lib;};
|
typesCustom = import ./custom.nix {inherit lib;};
|
||||||
in {
|
in {
|
||||||
inherit (typesDag) dagOf;
|
inherit (typesDag) dagOf;
|
||||||
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType;
|
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType;
|
||||||
inherit (typesLanguage) diagnostics mkGrammarOption;
|
inherit (typesLanguage) diagnostics mkGrammarOption;
|
||||||
inherit (typesCustom) anythingConcatLists char;
|
inherit (typesCustom) anythingConcatLists char;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,9 +51,13 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
borderPresets = ["none" "single" "double" "rounded" "solid" "shadow"];
|
||||||
in {
|
in {
|
||||||
inherit extraPluginType fromInputs pluginType;
|
inherit extraPluginType fromInputs pluginType;
|
||||||
|
|
||||||
|
borderType = either (enum borderPresets) (listOf (either str (listOf str)));
|
||||||
|
|
||||||
pluginsOpt = {
|
pluginsOpt = {
|
||||||
description,
|
description,
|
||||||
example,
|
example,
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.attrsets) mapAttrs;
|
inherit (lib.attrsets) mapAttrs;
|
||||||
inherit (lib.nvim.dag) entryAfter;
|
inherit (lib.nvim.dag) entryAfter;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
cfg = config.vim.lsp;
|
cfg = config.vim.lsp;
|
||||||
in {
|
in {
|
||||||
|
@ -22,7 +23,7 @@ in {
|
||||||
|
|
||||||
${
|
${
|
||||||
optionalString config.vim.ui.borders.enable ''
|
optionalString config.vim.ui.borders.enable ''
|
||||||
require('lspconfig.ui.windows').default_options.border = '${config.vim.ui.borders.globalStyle}'
|
require('lspconfig.ui.windows').default_options.border = ${toLuaObject config.vim.ui.borders.globalStyle}
|
||||||
''
|
''
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
inherit (lib.nvim.binds) mkSetBinding addDescriptionsToMappings pushDownDefault;
|
inherit (lib.nvim.binds) mkSetBinding addDescriptionsToMappings pushDownDefault;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
cfg = config.vim.lsp;
|
cfg = config.vim.lsp;
|
||||||
|
|
||||||
|
@ -25,7 +26,7 @@ in {
|
||||||
|
|
||||||
pluginRC.code-action-menu = entryAnywhere ''
|
pluginRC.code-action-menu = entryAnywhere ''
|
||||||
-- border configuration
|
-- border configuration
|
||||||
vim.g.code_action_menu_window_border = '${config.vim.ui.borders.plugins.code-action-menu.style}'
|
vim.g.code_action_menu_window_border = ${toLuaObject config.vim.ui.borders.plugins.code-action-menu.style}
|
||||||
|
|
||||||
-- show individual sections of the code action menu
|
-- show individual sections of the code action menu
|
||||||
${lib.optionalString cfg.nvimCodeActionMenu.show.details "vim.g.code_action_menu_show_details = true"}
|
${lib.optionalString cfg.nvimCodeActionMenu.show.details "vim.g.code_action_menu_show_details = true"}
|
||||||
|
|
|
@ -4,31 +4,34 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
inherit (lib.lists) optionals;
|
inherit (lib.nvim.types) borderType;
|
||||||
inherit (lib.types) enum;
|
|
||||||
|
|
||||||
cfg = config.vim.ui.borders;
|
cfg = config.vim.ui.borders;
|
||||||
|
|
||||||
defaultStyles = ["none" "single" "double" "rounded"];
|
|
||||||
in {
|
in {
|
||||||
options.vim.ui.borders = {
|
options.vim.ui.borders = {
|
||||||
enable = mkEnableOption "visible borders for most windows";
|
enable = mkEnableOption "visible borders for most windows";
|
||||||
|
|
||||||
globalStyle = mkOption {
|
globalStyle = mkOption {
|
||||||
type = enum defaultStyles;
|
type = borderType;
|
||||||
default = "rounded";
|
default = "rounded";
|
||||||
description = ''
|
description = ''
|
||||||
The global border style to use.
|
The global border style to use.
|
||||||
|
|
||||||
|
If a list is given, it should have a length of eight or any divisor of
|
||||||
|
eight. The array will specify the eight chars building up the border in
|
||||||
|
a clockwise fashion starting with the top-left corner. You can specify
|
||||||
|
a different highlight group for each character by passing a
|
||||||
|
[char, "YourHighlightGroup"] instead
|
||||||
'';
|
'';
|
||||||
|
example = ["╔" "═" "╗" "║" "╝" "═" "╚" "║"];
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: make per-plugin borders configurable
|
|
||||||
plugins = let
|
plugins = let
|
||||||
mkPluginStyleOption = name: {
|
mkPluginStyleOption = name: {
|
||||||
enable = mkEnableOption "borders for the ${name} plugin" // {default = cfg.enable;};
|
enable = mkEnableOption "borders for the ${name} plugin" // {default = cfg.enable;};
|
||||||
|
|
||||||
style = mkOption {
|
style = mkOption {
|
||||||
type = enum (defaultStyles ++ optionals (name != "which-key") ["shadow"]);
|
type = borderType;
|
||||||
default = cfg.globalStyle;
|
default = cfg.globalStyle;
|
||||||
description = "The border style to use for the ${name} plugin";
|
description = "The border style to use for the ${name} plugin";
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
inherit (lib.types) nullOr listOf enum bool str int;
|
inherit (lib.types) nullOr listOf enum bool str int either;
|
||||||
inherit (lib.modules) mkRenamedOptionModule;
|
inherit (lib.modules) mkRenamedOptionModule;
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
inherit (lib.nvim.types) mkPluginSetupOption borderType;
|
||||||
mkSimpleIconOption = default:
|
mkSimpleIconOption = default:
|
||||||
mkOption {
|
mkOption {
|
||||||
inherit default;
|
inherit default;
|
||||||
|
@ -212,8 +212,7 @@ in {
|
||||||
# position = {}
|
# position = {}
|
||||||
|
|
||||||
border = mkOption {
|
border = mkOption {
|
||||||
# TODO: let this type accept a custom string
|
type = borderType;
|
||||||
type = enum ["single" "rounded" "double" "solid" "none"];
|
|
||||||
default = config.vim.ui.borders.globalStyle;
|
default = config.vim.ui.borders.globalStyle;
|
||||||
description = "border style to use";
|
description = "border style to use";
|
||||||
};
|
};
|
||||||
|
@ -236,8 +235,7 @@ in {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
border = mkOption {
|
border = mkOption {
|
||||||
# TODO: let this type accept a custom string
|
type = borderType;
|
||||||
type = nullOr (enum ["single" "rounded" "double" "solid" "none"]);
|
|
||||||
default = config.vim.ui.borders.globalStyle;
|
default = config.vim.ui.borders.globalStyle;
|
||||||
description = "border style to use for the left section of Navbuddy UI";
|
description = "border style to use for the left section of Navbuddy UI";
|
||||||
};
|
};
|
||||||
|
@ -254,8 +252,7 @@ in {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
border = mkOption {
|
border = mkOption {
|
||||||
# TODO: let this type accept a custom string
|
type = borderType;
|
||||||
type = nullOr (enum ["single" "rounded" "double" "solid" "none"]);
|
|
||||||
default = config.vim.ui.borders.globalStyle;
|
default = config.vim.ui.borders.globalStyle;
|
||||||
description = "border style to use for the middle section of Navbuddy UI";
|
description = "border style to use for the middle section of Navbuddy UI";
|
||||||
};
|
};
|
||||||
|
@ -265,8 +262,7 @@ in {
|
||||||
# there is no size option for the right section, it fills the remaining space
|
# there is no size option for the right section, it fills the remaining space
|
||||||
right = {
|
right = {
|
||||||
border = mkOption {
|
border = mkOption {
|
||||||
# TODO: let this type accept a custom string
|
type = borderType;
|
||||||
type = nullOr (enum ["single" "rounded" "double" "solid" "none"]);
|
|
||||||
default = config.vim.ui.borders.globalStyle;
|
default = config.vim.ui.borders.globalStyle;
|
||||||
description = "border style to use for the right section of Navbuddy UI";
|
description = "border style to use for the right section of Navbuddy UI";
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,7 +25,7 @@ in {
|
||||||
|
|
||||||
${optionalString config.vim.ui.borders.plugins.which-key.enable ''
|
${optionalString config.vim.ui.borders.plugins.which-key.enable ''
|
||||||
window = {
|
window = {
|
||||||
border = "${config.vim.ui.borders.plugins.which-key.style}",
|
border = ${toLuaObject config.vim.ui.borders.plugins.which-key.style},
|
||||||
},
|
},
|
||||||
''}
|
''}
|
||||||
})
|
})
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||||
inherit (lib.strings) toUpper;
|
inherit (lib.strings) toUpper;
|
||||||
inherit (lib.types) int float bool str enum listOf attrsOf oneOf nullOr submodule;
|
inherit (lib.types) int float bool str enum listOf attrsOf oneOf nullOr submodule;
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
inherit (lib.nvim.types) mkPluginSetupOption luaInline borderType;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
|
@ -453,7 +453,7 @@ in {
|
||||||
};
|
};
|
||||||
border = mkOption {
|
border = mkOption {
|
||||||
description = "Border style of the notification window";
|
description = "Border style of the notification window";
|
||||||
type = enum ["none" "single" "double" "rounded" "solid" "shadow"];
|
type = borderType;
|
||||||
default =
|
default =
|
||||||
if config.vim.ui.borders.enable
|
if config.vim.ui.borders.enable
|
||||||
then config.vim.ui.borders.globalStyle
|
then config.vim.ui.borders.globalStyle
|
||||||
|
|
|
@ -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