mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-26 15:06:45 +00:00
Compare commits
7 commits
383ce4472d
...
8eba0acad5
Author | SHA1 | Date | |
---|---|---|---|
|
8eba0acad5 | ||
|
7d824d6711 | ||
|
de20ff2c51 | ||
7d077f43f7 | |||
cb57d3d417 | |||
754c29cb7c | |||
0e84e4ebed |
12 changed files with 281 additions and 134 deletions
|
@ -143,10 +143,10 @@ configuration formats.
|
||||||
- Add [neo-tree.nvim] as an alternative file-tree plugin. It will be available
|
- Add [neo-tree.nvim] as an alternative file-tree plugin. It will be available
|
||||||
under `vim.filetree.neo-tree`, similar to nvimtree.
|
under `vim.filetree.neo-tree`, similar to nvimtree.
|
||||||
|
|
||||||
- Add `print-nvf-config` & `print-nvf-config-path` helper scripts to Neovim
|
- Add `nvf-print-config` & `nvf-print-config-path` helper scripts to Neovim
|
||||||
closure. Both of those scripts have been automatically added to your PATH upon
|
closure. Both of those scripts have been automatically added to your PATH upon
|
||||||
using neovimConfig or `programs.nvf.enable`.
|
using neovimConfig or `programs.nvf.enable`.
|
||||||
- `print-nvf-config` will display your `init.lua`, in full.
|
- `nvf-print-config` will display your `init.lua`, in full.
|
||||||
- `print-nvf-config-path` will display the path to _a clone_ of your
|
- `nvf-print-config-path` will display the path to _a clone_ of your
|
||||||
`init.lua`. This is not the path used by the Neovim wrapper, but an
|
`init.lua`. This is not the path used by the Neovim wrapper, but an
|
||||||
identical clone.
|
identical clone.
|
||||||
|
|
23
flake.lock
23
flake.lock
|
@ -69,11 +69,11 @@
|
||||||
},
|
},
|
||||||
"mnw": {
|
"mnw": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722191188,
|
"lastModified": 1723419050,
|
||||||
"narHash": "sha256-YF//iMALbrd2Ni9aju7w8NniH16Qz6RFTRD6md5UkDc=",
|
"narHash": "sha256-Eb8jBUgHwpte+bGsqeXNbKMBfZaDB7RiPQwyb1vzJK8=",
|
||||||
"owner": "Gerg-L",
|
"owner": "Gerg-L",
|
||||||
"repo": "mnw",
|
"repo": "mnw",
|
||||||
"rev": "c7b289f3f5a31b6e744be37d83fc231816621231",
|
"rev": "e625f5965567f16102bc52897c7600dcde53c6c3",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -939,6 +939,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"plugin-new-file-template-nvim": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1721518222,
|
||||||
|
"narHash": "sha256-g0IjJrHRXw7U9goVLzVYUyHBSsDZGHMpi3YZPhg64zA=",
|
||||||
|
"owner": "otavioschwanck",
|
||||||
|
"repo": "new-file-template.nvim",
|
||||||
|
"rev": "6ac66669dbf2dc5cdee184a4fe76d22465ca67e8",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "otavioschwanck",
|
||||||
|
"repo": "new-file-template.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"plugin-noice-nvim": {
|
"plugin-noice-nvim": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -1862,6 +1878,7 @@
|
||||||
"plugin-neo-tree-nvim": "plugin-neo-tree-nvim",
|
"plugin-neo-tree-nvim": "plugin-neo-tree-nvim",
|
||||||
"plugin-neocord": "plugin-neocord",
|
"plugin-neocord": "plugin-neocord",
|
||||||
"plugin-neodev-nvim": "plugin-neodev-nvim",
|
"plugin-neodev-nvim": "plugin-neodev-nvim",
|
||||||
|
"plugin-new-file-template-nvim": "plugin-new-file-template-nvim",
|
||||||
"plugin-noice-nvim": "plugin-noice-nvim",
|
"plugin-noice-nvim": "plugin-noice-nvim",
|
||||||
"plugin-none-ls": "plugin-none-ls",
|
"plugin-none-ls": "plugin-none-ls",
|
||||||
"plugin-nui-nvim": "plugin-nui-nvim",
|
"plugin-nui-nvim": "plugin-nui-nvim",
|
||||||
|
|
|
@ -7,84 +7,65 @@ inputs: {
|
||||||
extraModules ? [],
|
extraModules ? [],
|
||||||
}: let
|
}: let
|
||||||
inherit (pkgs) vimPlugins;
|
inherit (pkgs) vimPlugins;
|
||||||
inherit (pkgs.vimUtils) buildVimPlugin;
|
|
||||||
inherit (lib.strings) isString toString;
|
inherit (lib.strings) isString toString;
|
||||||
inherit (lib.lists) filter map concatLists;
|
inherit (lib.lists) filter map concatLists;
|
||||||
inherit (lib.attrsets) recursiveUpdate getAttr;
|
|
||||||
inherit (lib.asserts) assertMsg;
|
|
||||||
|
|
||||||
# import modules.nix with `check`, `pkgs` and `lib` as arguments
|
# import modules.nix with `check`, `pkgs` and `lib` as arguments
|
||||||
# check can be disabled while calling this file is called
|
# check can be disabled while calling this file is called
|
||||||
# to avoid checking in all modules
|
# to avoid checking in all modules
|
||||||
nvimModules = import ./modules.nix {
|
nvimModules = import ./modules.nix {inherit pkgs check lib;};
|
||||||
inherit pkgs check lib;
|
|
||||||
};
|
|
||||||
|
|
||||||
# evaluate the extended library with the modules
|
# evaluate the extended library with the modules
|
||||||
# optionally with any additional modules passed by the user
|
# optionally with any additional modules passed by the user
|
||||||
module = lib.evalModules {
|
module = lib.evalModules {
|
||||||
specialArgs = recursiveUpdate {modulesPath = toString ./.;} extraSpecialArgs;
|
specialArgs = extraSpecialArgs // {modulesPath = toString ./.;};
|
||||||
modules = concatLists [[configuration] nvimModules extraModules];
|
modules = concatLists [[configuration] nvimModules extraModules];
|
||||||
};
|
};
|
||||||
|
|
||||||
# alias to the internal configuration
|
# alias to the internal configuration
|
||||||
vimOptions = module.config.vim;
|
vimOptions = module.config.vim;
|
||||||
|
|
||||||
# build a vim plugin with the given name and arguments
|
|
||||||
# if the plugin is nvim-treesitter, warn the user to use buildTreesitterPlug
|
|
||||||
# instead
|
|
||||||
buildPlug = {pname, ...} @ attrs: let
|
|
||||||
src = getAttr ("plugin-" + pname) inputs;
|
|
||||||
in
|
|
||||||
pkgs.stdenvNoCC.mkDerivation ({
|
|
||||||
inherit src;
|
|
||||||
version = src.shortRev or src.shortDirtyRev or "dirty";
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out
|
|
||||||
cp -r . $out
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
// attrs);
|
|
||||||
|
|
||||||
noBuildPlug = {pname, ...} @ attrs: let
|
noBuildPlug = {pname, ...} @ attrs: let
|
||||||
input = getAttr ("plugin-" + pname) inputs;
|
src = inputs."plugin-${attrs.pname}";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
version = input.shortRev or input.shortDirtyRev or "dirty";
|
version = src.shortRev or src.shortDirtyRev or "dirty";
|
||||||
outPath = getAttr ("plugin-" + pname) inputs;
|
outPath = src;
|
||||||
|
passthru.vimPlugin = false;
|
||||||
}
|
}
|
||||||
// attrs;
|
// attrs;
|
||||||
|
|
||||||
|
# build a vim plugin with the given name and arguments
|
||||||
|
# if the plugin is nvim-treesitter, warn the user to use buildTreesitterPlug
|
||||||
|
# instead
|
||||||
|
buildPlug = attrs: let
|
||||||
|
src = inputs."plugin-${attrs.pname}";
|
||||||
|
in
|
||||||
|
pkgs.vimUtils.buildVimPlugin (
|
||||||
|
{
|
||||||
|
version = src.shortRev or src.shortDirtyRev or "dirty";
|
||||||
|
inherit src;
|
||||||
|
}
|
||||||
|
// attrs
|
||||||
|
);
|
||||||
|
|
||||||
buildTreesitterPlug = grammars: vimPlugins.nvim-treesitter.withPlugins (_: grammars);
|
buildTreesitterPlug = grammars: vimPlugins.nvim-treesitter.withPlugins (_: grammars);
|
||||||
|
|
||||||
buildConfigPlugins = plugins:
|
pluginBuilders = {
|
||||||
map
|
nvim-treesitter = buildTreesitterPlug vimOptions.treesitter.grammars;
|
||||||
(plug: (
|
flutter-tools-patched = buildPlug {
|
||||||
if (isString plug)
|
|
||||||
then
|
|
||||||
(
|
|
||||||
if (plug == "nvim-treesitter")
|
|
||||||
then (buildTreesitterPlug vimOptions.treesitter.grammars)
|
|
||||||
else if (plug == "flutter-tools-patched")
|
|
||||||
then
|
|
||||||
(
|
|
||||||
buildPlug
|
|
||||||
{
|
|
||||||
pname = "flutter-tools";
|
pname = "flutter-tools";
|
||||||
patches = [../patches/flutter-tools.patch];
|
patches = [../patches/flutter-tools.patch];
|
||||||
}
|
};
|
||||||
)
|
};
|
||||||
else noBuildPlug {pname = plug;}
|
|
||||||
)
|
buildConfigPlugins = plugins:
|
||||||
|
map (
|
||||||
|
plug:
|
||||||
|
if (isString plug)
|
||||||
|
then pluginBuilders.${plug} or (noBuildPlug {pname = plug;})
|
||||||
else plug
|
else plug
|
||||||
))
|
) (filter (f: f != null) plugins);
|
||||||
(filter
|
|
||||||
(f: f != null)
|
|
||||||
plugins);
|
|
||||||
|
|
||||||
# built (or "normalized") plugins that are modified
|
# built (or "normalized") plugins that are modified
|
||||||
builtStartPlugins = buildConfigPlugins vimOptions.startPlugins;
|
builtStartPlugins = buildConfigPlugins vimOptions.startPlugins;
|
||||||
|
@ -94,7 +75,7 @@ inputs: {
|
||||||
}) (buildConfigPlugins vimOptions.optPlugins);
|
}) (buildConfigPlugins vimOptions.optPlugins);
|
||||||
|
|
||||||
# additional Lua and Python3 packages, mapped to their respective functions
|
# additional Lua and Python3 packages, mapped to their respective functions
|
||||||
# to conform to the format makeNeovimConfig expects. end user should
|
# to conform to the format mnw expects. end user should
|
||||||
# only ever need to pass a list of packages, which are modified
|
# only ever need to pass a list of packages, which are modified
|
||||||
# here
|
# here
|
||||||
extraLuaPackages = ps: map (x: ps.${x}) vimOptions.luaPackages;
|
extraLuaPackages = ps: map (x: ps.${x}) vimOptions.luaPackages;
|
||||||
|
@ -104,7 +85,7 @@ inputs: {
|
||||||
# generate a wrapped Neovim package.
|
# generate a wrapped Neovim package.
|
||||||
neovim-wrapped = inputs.mnw.lib.wrap pkgs {
|
neovim-wrapped = inputs.mnw.lib.wrap pkgs {
|
||||||
neovim = vimOptions.package;
|
neovim = vimOptions.package;
|
||||||
plugins = concatLists [builtStartPlugins builtOptPlugins];
|
plugins = builtStartPlugins ++ builtOptPlugins;
|
||||||
appName = "nvf";
|
appName = "nvf";
|
||||||
extraBinPath = vimOptions.extraPackages;
|
extraBinPath = vimOptions.extraPackages;
|
||||||
initLua = vimOptions.builtLuaConfigRC;
|
initLua = vimOptions.builtLuaConfigRC;
|
||||||
|
@ -114,20 +95,11 @@ inputs: {
|
||||||
inherit extraLuaPackages extraPython3Packages;
|
inherit extraLuaPackages extraPython3Packages;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dummyInit = pkgs.writeText "nvf-init.lua" vimOptions.builtLuaConfigRC;
|
||||||
# Additional helper scripts for printing and displaying nvf configuration
|
# Additional helper scripts for printing and displaying nvf configuration
|
||||||
# in your commandline.
|
# in your commandline.
|
||||||
printConfig = pkgs.writers.writeDashBin "print-nvf-config" ''
|
printConfig = pkgs.writers.writeDashBin "nvf-print-config" "cat ${dummyInit}";
|
||||||
cat << EOF
|
printConfigPath = pkgs.writers.writeDashBin "nvf-print-config-path" "echo -n ${dummyInit}";
|
||||||
${vimOptions.builtLuaConfigRC}
|
|
||||||
EOF
|
|
||||||
'';
|
|
||||||
|
|
||||||
printConfigPath = pkgs.writers.writeDashBin "print-nvf-config-path" ''
|
|
||||||
realpath ${pkgs.writeTextFile {
|
|
||||||
name = "nvf-init.lua";
|
|
||||||
text = vimOptions.builtLuaConfigRC;
|
|
||||||
}}
|
|
||||||
'';
|
|
||||||
in {
|
in {
|
||||||
inherit (module) options config;
|
inherit (module) options config;
|
||||||
inherit (module._module.args) pkgs;
|
inherit (module._module.args) pkgs;
|
||||||
|
@ -137,7 +109,7 @@ in {
|
||||||
neovim = pkgs.symlinkJoin {
|
neovim = pkgs.symlinkJoin {
|
||||||
name = "nvf-with-helpers";
|
name = "nvf-with-helpers";
|
||||||
paths = [neovim-wrapped printConfig printConfigPath];
|
paths = [neovim-wrapped printConfig printConfigPath];
|
||||||
postBuild = "echo helpers added";
|
postBuild = "echo Helpers added";
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Wrapped version of Neovim with additional helper scripts";
|
description = "Wrapped version of Neovim with additional helper scripts";
|
||||||
|
|
|
@ -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
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,8 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) map mapAttrs filter;
|
inherit (builtins) map mapAttrs filter;
|
||||||
inherit (lib.options) mkOption;
|
inherit (lib.options) mkOption;
|
||||||
inherit (lib.attrsets) filterAttrs getAttrs attrValues attrNames;
|
inherit (lib.attrsets) mapAttrsToList filterAttrs getAttrs attrValues attrNames;
|
||||||
inherit (lib.strings) concatLines concatMapStringsSep;
|
inherit (lib.strings) concatLines concatMapStringsSep;
|
||||||
inherit (lib.misc) mapAttrsFlatten;
|
|
||||||
inherit (lib.trivial) showWarnings;
|
inherit (lib.trivial) showWarnings;
|
||||||
inherit (lib.types) str nullOr;
|
inherit (lib.types) str nullOr;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
|
@ -83,7 +82,7 @@ in {
|
||||||
config = let
|
config = let
|
||||||
filterNonNull = attrs: filterAttrs (_: value: value != null) attrs;
|
filterNonNull = attrs: filterAttrs (_: value: value != null) attrs;
|
||||||
globalsScript =
|
globalsScript =
|
||||||
mapAttrsFlatten (name: value: "vim.g.${name} = ${toLuaObject value}")
|
mapAttrsToList (name: value: "vim.g.${name} = ${toLuaObject value}")
|
||||||
(filterNonNull cfg.globals);
|
(filterNonNull cfg.globals);
|
||||||
|
|
||||||
extraPluginConfigs = resolveDag {
|
extraPluginConfigs = resolveDag {
|
||||||
|
|
Loading…
Reference in a new issue