Compare commits

...

9 commits

Author SHA1 Message Date
raf
584d67e0c0
Merge 7d077f43f7 into e949a51c55 2024-08-26 21:11:55 +03:00
Ching Pei Yang
e949a51c55
rust/clang: update lldb binary name (#365) 2024-08-24 17:48:20 +00:00
Ching Pei Yang
473ebea4cf
theme: fix broken function signatures (#364) 2024-08-24 12:12:20 +00:00
Gerg-L
fc2e5998e7
flake.lock: Update (#363)
Flake lock file updates:

• Updated input 'mnw':
    'github:Gerg-L/mnw/e06b48c51291cc1df08adcd34a8796f86d5b235e?narHash=sha256-qimVBdes%2B2gNRRcyFoIUA1RyOKV0Ee40hUaVVf7ZsNs%3D' (2024-08-22)
  → 'github:Gerg-L/mnw/c261925dbbf02f523af0e8add844df64fddf0359?narHash=sha256-SMgnviF6ofBPbyV3%2BrljPGcX0Hn9HBOhgXE10Cyjaic%3D' (2024-08-23)
2024-08-24 10:47:26 +00:00
Gerg-L
25fe1c4625
flake.lock: Update (#362)
Flake lock file updates:

• Updated input 'mnw':
    'github:Gerg-L/mnw/c7b289f3f5a31b6e744be37d83fc231816621231?narHash=sha256-YF//iMALbrd2Ni9aju7w8NniH16Qz6RFTRD6md5UkDc%3D' (2024-07-28)
  → 'github:Gerg-L/mnw/e06b48c51291cc1df08adcd34a8796f86d5b235e?narHash=sha256-qimVBdes%2B2gNRRcyFoIUA1RyOKV0Ee40hUaVVf7ZsNs%3D' (2024-08-22)
2024-08-22 23:42:51 +00:00
7d077f43f7
neovim/global: begin adding vim.diagnostics.config() options 2024-05-17 19:03:05 +03:00
cb57d3d417
plugins/ui: re-organize imports 2024-05-17 19:02:37 +03:00
754c29cb7c
neovim/global: add ui/icons 2024-05-17 18:25:26 +03:00
0e84e4ebed
modules/plugins: move plugins/ui to neovim/global/ui 2024-05-17 18:25:25 +03:00
12 changed files with 2251 additions and 2079 deletions

4049
flake.lock

File diff suppressed because it is too large Load diff

View file

@ -10,6 +10,7 @@
# Contains configuration for core neovim features
# such as spellchecking, mappings, and the init script (init.vim).
neovim = map (p: ./neovim + "/${p}") [
"global"
"init"
"mappings"
];

View 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]
];
}

View 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
'';
};
};
};
}

View 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";
};
};
}

View 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";
};
};
};
}

View file

@ -57,7 +57,7 @@
dapConfig = ''
dap.adapters.lldb = {
type = 'executable',
command = '${cfg.dap.package}/bin/lldb-vscode',
command = '${cfg.dap.package}/bin/lldb-dap',
name = 'lldb'
}
dap.configurations.cpp = {

View file

@ -173,7 +173,7 @@ in {
dap = {
adapter = {
type = "executable",
command = "${cfg.dap.package}/bin/lldb-vscode",
command = "${cfg.dap.package}/bin/lldb-dap",
name = "rustacean_lldb",
},
},

View file

@ -6,7 +6,7 @@
inherit (lib.trivial) boolToString warnIf;
in {
onedark = {
setup = {style ? "dark"}: ''
setup = {style ? "dark", ...}: ''
-- OneDark theme
require('onedark').setup {
style = "${style}"
@ -30,7 +30,7 @@ in {
};
dracula = {
setup = {transparent}: ''
setup = {transparent, ...}: ''
require('dracula').setup({
transparent_bg = ${boolToString transparent},
});

View file

@ -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";
};
};
}

View file

@ -1,5 +0,0 @@
{
imports = [
./borders.nix
];
}

View file

@ -1,12 +1,11 @@
{
imports = [
./noice
./modes
./notifications
./smartcolumn
./breadcrumbs
./colorizer
./illuminate
./breadcrumbs
./borders
./modes
./noice
./notifications
./smartcolumn
];
}