Compare commits
6 Commits
91e3713bca
...
f991f51cb2
Author | SHA1 | Date |
---|---|---|
|
f991f51cb2 | |
|
95615ec308 | |
|
7d077f43f7 | |
|
cb57d3d417 | |
|
754c29cb7c | |
|
0e84e4ebed |
|
@ -114,11 +114,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1717839683,
|
"lastModified": 1718910271,
|
||||||
"narHash": "sha256-kC0eyEsfpXbtQ2Ee5kgjmLFSVsLgnqpj10LjEi+fK+g=",
|
"narHash": "sha256-vft9UIECxL4FtfX5UsTEE2XvvH9z9/BeP8pACAYEbwY=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "3f3a01219b4a1b6ee63039a3aa63948fbf37c0dd",
|
"rev": "19cd1c918369d89128bcb6a6da87137bdf42e997",
|
||||||
"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"
|
||||||
];
|
];
|
||||||
|
|
|
@ -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]
|
||||||
|
];
|
||||||
|
}
|
|
@ -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
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -18,7 +18,7 @@
|
||||||
defaultServer = "bash-ls";
|
defaultServer = "bash-ls";
|
||||||
servers = {
|
servers = {
|
||||||
bash-ls = {
|
bash-ls = {
|
||||||
package = pkgs.nodePackages.bash-language-server;
|
package = pkgs.bash-language-server;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
lspconfig.bashls.setup{
|
lspconfig.bashls.setup{
|
||||||
capabilities = capabilities;
|
capabilities = capabilities;
|
||||||
|
@ -85,7 +85,7 @@ in {
|
||||||
description = "bash-language-server package, or the command to run as a list of strings";
|
description = "bash-language-server package, or the command to run as a list of strings";
|
||||||
example = literalExpression ''[lib.getExe pkgs.nodePackages.bash-language-server "start"]'';
|
example = literalExpression ''[lib.getExe pkgs.nodePackages.bash-language-server "start"]'';
|
||||||
type = either package (listOf str);
|
type = either package (listOf str);
|
||||||
default = pkgs.nodePackages.bash-language-server;
|
default = pkgs.bash-language-server;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue