Compare commits
27 Commits
b859b66b4d
...
d1c2b9cd73
Author | SHA1 | Date |
---|---|---|
Ching Pei Yang | d1c2b9cd73 | |
Ching Pei Yang | d53040dd34 | |
Ching Pei Yang | 718b48cfdb | |
Ching Pei Yang | 1b96dab877 | |
Ching Pei Yang | 72e39a910c | |
raf | b0af809b95 | |
NotAShelf | 1bb901edeb | |
diniamo | bb2a78272b | |
raf | 155bc8e1cc | |
diniamo | a145f997f3 | |
raf | 688a457a3d | |
diniamo | c2c85d70ee | |
raf | 335fbea0c0 | |
Frothy | 216cb34caf | |
Frothy | 2e99a21010 | |
raf | 7b719d0044 | |
NotAShelf | ba803c8684 | |
NotAShelf | f00ecd4eb9 | |
raf | 35c7327f81 | |
diniamo | 8a0cddd9bb | |
raf | 923481640e | |
raf | 2759b9caae | |
jacekpoz | abdcb62941 | |
jacekpoz | d873bc0667 | |
raf | f66c40b687 | |
Frothy | ad22bca3d7 | |
diniamo | d6cd853520 |
|
@ -222,10 +222,10 @@ inputs: let
|
||||||
enable = true;
|
enable = true;
|
||||||
setupOpts.custom_colorcolumn = {
|
setupOpts.custom_colorcolumn = {
|
||||||
# this is a freeform module, it's `buftype = int;` for configuring column position
|
# this is a freeform module, it's `buftype = int;` for configuring column position
|
||||||
nix = 110;
|
nix = "110";
|
||||||
ruby = 120;
|
ruby = "120";
|
||||||
java = 130;
|
java = "130";
|
||||||
go = [90 130];
|
go = ["90" "130"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,20 +12,40 @@ Release notes for release 0.7
|
||||||
[frothymarrow](https://github.com/frothymarrow):
|
[frothymarrow](https://github.com/frothymarrow):
|
||||||
|
|
||||||
- Modified type for
|
- Modified type for
|
||||||
[](#opt-vim.visuals.fidget-nvim.setupOpts.progress.display.overrides) from
|
[vim.visuals.fidget-nvim.setupOpts.progress.display.overrides](#opt-vim.visuals.fidget-nvim.setupOpts.progress.display.overrides)
|
||||||
`anything` to a `submodule` for better type checking.
|
from `anything` to a `submodule` for better type checking.
|
||||||
|
|
||||||
- Fix null `vim.lsp.mappings` generating an error and not being filtered out.
|
- Fix null `vim.lsp.mappings` generating an error and not being filtered out.
|
||||||
- Add basic transparency support for `oxocarbon` theme by setting the
|
|
||||||
highlight group for `Normal`, `NormalFloat`, `LineNr`, `SignColumn` and
|
- Add basic transparency support for `oxocarbon` theme by setting the highlight
|
||||||
optionally `NvimTreeNormal` to `none`.
|
group for `Normal`, `NormalFloat`, `LineNr`, `SignColumn` and optionally
|
||||||
|
`NvimTreeNormal` to `none`.
|
||||||
|
|
||||||
|
- Fix [vim.ui.smartcolumn.setupOpts.custom_colorcolumn](#opt-vim.ui.smartcolumn.setupOpts.custom_colorcolumn)
|
||||||
|
using the wrong type `int` instead of the expected type `string`.
|
||||||
|
|
||||||
[horriblename](https://github.com/horriblename):
|
[horriblename](https://github.com/horriblename):
|
||||||
|
|
||||||
- Fix broken treesitter-context keybinds in visual mode
|
- Fix broken treesitter-context keybinds in visual mode
|
||||||
- Depcrecate use of `__empty` to define empty tables in lua. Empty attrset are
|
- Deprecate use of `__empty` to define empty tables in lua. Empty attrset are no
|
||||||
no longer filtered and thus should be used instead.
|
longer filtered and thus should be used instead.
|
||||||
|
- Make noice.nvim customizable
|
||||||
|
|
||||||
[NotAShelf](https://github.com/notashelf)
|
[jacekpoz](https://github.com/jacekpoz):
|
||||||
|
|
||||||
|
- Add [ocaml-lsp](https://github.com/ocaml/ocaml-lsp) support.
|
||||||
|
|
||||||
|
- Fix Emac typo
|
||||||
|
|
||||||
|
[diniamo](https://github.com/diniamo):
|
||||||
|
|
||||||
|
- Move the `theme` dag entry to before `luaScript`.
|
||||||
|
|
||||||
|
- Add rustfmt as the default formatter for Rust.
|
||||||
|
|
||||||
|
- Enabled the terminal integration of catppuccin for theming Neovim's built-in terminal (this also affects toggleterm).
|
||||||
|
|
||||||
|
[NotAShelf](https://github.com/notashelf):
|
||||||
|
|
||||||
- Add `deno fmt` as the default Markdown formatter. This will be enabled
|
- Add `deno fmt` as the default Markdown formatter. This will be enabled
|
||||||
automatically if you have autoformatting enabled, but can be disabled manually
|
automatically if you have autoformatting enabled, but can be disabled manually
|
||||||
|
@ -39,13 +59,12 @@ Release notes for release 0.7
|
||||||
added once the [credo](https://github.com/rrrene/credo) linter has been added
|
added once the [credo](https://github.com/rrrene/credo) linter has been added
|
||||||
to nixpkgs. A pull request is currently open.
|
to nixpkgs. A pull request is currently open.
|
||||||
|
|
||||||
- Remove vim-tidal and friends
|
- Remove vim-tidal and friends.
|
||||||
|
|
||||||
- Clean up Lualine module to reduce theme dependency on Catppuccin, and fixed
|
- Clean up Lualine module to reduce theme dependency on Catppuccin, and fixed
|
||||||
blending issues in component separators.
|
blending issues in component separators.
|
||||||
|
|
||||||
[jacekpoz](https://github.com/jacekpoz):
|
- Add
|
||||||
|
[ts-error-translator.nvim](https://github.com/dmmulroy/ts-error-translator.nvim)
|
||||||
- Add [ocaml-lsp](https://github.com/ocaml/ocaml-lsp) support.
|
extension of the TS language module, under
|
||||||
|
`vim.languages.ts.extensions.ts-error-translator`
|
||||||
- Fix Emac typo
|
|
||||||
|
|
25
flake.lock
25
flake.lock
|
@ -114,16 +114,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1718910271,
|
"lastModified": 1719082008,
|
||||||
"narHash": "sha256-vft9UIECxL4FtfX5UsTEE2XvvH9z9/BeP8pACAYEbwY=",
|
"narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "19cd1c918369d89128bcb6a6da87137bdf42e997",
|
"rev": "9693852a2070b398ee123a329e68f0dab5526681",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-unstable-small",
|
"ref": "nixpkgs-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
@ -1597,6 +1597,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"plugin-ts-error-translator": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1712269172,
|
||||||
|
"narHash": "sha256-NJ0qfKvkwZ/0GolAeATlQLyQ7nGN6Z6q3uRqI+73wPk=",
|
||||||
|
"owner": "dmmulroy",
|
||||||
|
"repo": "ts-error-translator.nvim",
|
||||||
|
"rev": "11ae55b28bde02663b5f983f59b0e3fd9c4e845b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "dmmulroy",
|
||||||
|
"repo": "ts-error-translator.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"plugin-vim-dirtytalk": {
|
"plugin-vim-dirtytalk": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -1840,6 +1856,7 @@
|
||||||
"plugin-toggleterm-nvim": "plugin-toggleterm-nvim",
|
"plugin-toggleterm-nvim": "plugin-toggleterm-nvim",
|
||||||
"plugin-tokyonight": "plugin-tokyonight",
|
"plugin-tokyonight": "plugin-tokyonight",
|
||||||
"plugin-trouble": "plugin-trouble",
|
"plugin-trouble": "plugin-trouble",
|
||||||
|
"plugin-ts-error-translator": "plugin-ts-error-translator",
|
||||||
"plugin-vim-dirtytalk": "plugin-vim-dirtytalk",
|
"plugin-vim-dirtytalk": "plugin-vim-dirtytalk",
|
||||||
"plugin-vim-fugitive": "plugin-vim-fugitive",
|
"plugin-vim-fugitive": "plugin-vim-fugitive",
|
||||||
"plugin-vim-illuminate": "plugin-vim-illuminate",
|
"plugin-vim-illuminate": "plugin-vim-illuminate",
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
# Flake inputs
|
# Flake inputs
|
||||||
inputs = {
|
inputs = {
|
||||||
## Basic Inputs
|
## Basic Inputs
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
systems.url = "github:nix-systems/default";
|
systems.url = "github:nix-systems/default";
|
||||||
|
@ -183,6 +183,11 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugin-ts-error-translator = {
|
||||||
|
url = "github:dmmulroy/ts-error-translator.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
# Copying/Registers
|
# Copying/Registers
|
||||||
plugin-registers = {
|
plugin-registers = {
|
||||||
url = "github:tversteeg/registers.nvim";
|
url = "github:tversteeg/registers.nvim";
|
||||||
|
|
|
@ -4,9 +4,8 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.trivial) boolToString;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
|
||||||
|
|
||||||
cfg = config.vim.autopairs;
|
cfg = config.vim.autopairs;
|
||||||
in {
|
in {
|
||||||
|
@ -14,7 +13,7 @@ in {
|
||||||
vim.startPlugins = ["nvim-autopairs"];
|
vim.startPlugins = ["nvim-autopairs"];
|
||||||
|
|
||||||
vim.luaConfigRC.autopairs = entryAnywhere ''
|
vim.luaConfigRC.autopairs = entryAnywhere ''
|
||||||
require("nvim-autopairs").setup{}
|
require("nvim-autopairs").setup({ map_cr = ${boolToString (!config.vim.autocomplete.enable)} })
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,15 +61,19 @@ in {
|
||||||
(mkSetLuaBinding mappings.complete ''
|
(mkSetLuaBinding mappings.complete ''
|
||||||
require('cmp').complete
|
require('cmp').complete
|
||||||
'')
|
'')
|
||||||
(mkSetLuaBinding mappings.confirm ''
|
(let
|
||||||
function()
|
defaultKeys =
|
||||||
if not require('cmp').confirm({ select = true }) then
|
if config.vim.autopairs.enable
|
||||||
local termcode = vim.api.nvim_replace_termcodes(${toJSON mappings.confirm.value}, true, false, true)
|
then "require('nvim-autopairs').autopairs_cr()"
|
||||||
|
else "vim.api.nvim_replace_termcodes(${toJSON mappings.confirm.value}, true, false, true)";
|
||||||
vim.fn.feedkeys(termcode, 'n')
|
in
|
||||||
|
mkSetLuaBinding mappings.confirm ''
|
||||||
|
function()
|
||||||
|
if not require('cmp').confirm({ select = true }) then
|
||||||
|
vim.fn.feedkeys(${defaultKeys}, 'n')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
'')
|
||||||
'')
|
|
||||||
(mkSetLuaBinding mappings.next ''
|
(mkSetLuaBinding mappings.next ''
|
||||||
function()
|
function()
|
||||||
local has_words_before = function()
|
local has_words_before = function()
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
clangd = {
|
clangd = {
|
||||||
package = pkgs.clang-tools_16;
|
package = pkgs.clang-tools;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
local clangd_cap = capabilities
|
local clangd_cap = capabilities
|
||||||
-- use same offsetEncoding as null-ls
|
-- use same offsetEncoding as null-ls
|
||||||
|
|
|
@ -4,17 +4,33 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.trivial) boolToString;
|
inherit (lib.trivial) boolToString;
|
||||||
inherit (lib.lists) isList optionals;
|
inherit (lib.lists) isList optionals;
|
||||||
inherit (lib.types) bool package str listOf either;
|
inherit (lib.types) bool package str listOf either enum;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
cfg = config.vim.languages.rust;
|
cfg = config.vim.languages.rust;
|
||||||
|
|
||||||
|
defaultFormat = "rustfmt";
|
||||||
|
formats = {
|
||||||
|
rustfmt = {
|
||||||
|
package = pkgs.rustfmt;
|
||||||
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.rustfmt.with({
|
||||||
|
command = "${cfg.format.package}/bin/rustfmt",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
options.vim.languages.rust = {
|
options.vim.languages.rust = {
|
||||||
enable = mkEnableOption "Rust language support";
|
enable = mkEnableOption "Rust language support";
|
||||||
|
@ -49,6 +65,22 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
format = {
|
||||||
|
enable = mkEnableOption "Rust formatting" // {default = config.vim.languages.enableFormat;};
|
||||||
|
|
||||||
|
type = mkOption {
|
||||||
|
description = "Rust formatter to use";
|
||||||
|
type = enum (attrNames formats);
|
||||||
|
default = defaultFormat;
|
||||||
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
description = "Rust formatter package";
|
||||||
|
type = package;
|
||||||
|
default = formats.${cfg.format.type}.package;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
dap = {
|
dap = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
description = "Rust Debug Adapter support";
|
description = "Rust Debug Adapter support";
|
||||||
|
@ -86,6 +118,11 @@ in {
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.format.enable {
|
||||||
|
vim.lsp.null-ls.enable = true;
|
||||||
|
vim.lsp.null-ls.sources.rust-format = formats.${cfg.format.type}.nullConfig;
|
||||||
|
})
|
||||||
|
|
||||||
(mkIf (cfg.lsp.enable || cfg.dap.enable) {
|
(mkIf (cfg.lsp.enable || cfg.dap.enable) {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = ["rust-tools"] ++ optionals cfg.dap.enable [cfg.dap.package];
|
startPlugins = ["rust-tools"] ++ optionals cfg.dap.enable [cfg.dap.package];
|
||||||
|
|
|
@ -9,10 +9,11 @@
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.types) enum either listOf package str;
|
inherit (lib.types) enum either listOf package str bool;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua toLuaObject;
|
||||||
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
inherit (lib.nvim.types) mkGrammarOption diagnostics mkPluginSetupOption;
|
||||||
inherit (lib.nvim.languages) diagnosticsToLua;
|
inherit (lib.nvim.languages) diagnosticsToLua;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
cfg = config.vim.languages.ts;
|
cfg = config.vim.languages.ts;
|
||||||
|
|
||||||
|
@ -32,6 +33,7 @@
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
denols = {
|
denols = {
|
||||||
package = pkgs.deno;
|
package = pkgs.deno;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
|
@ -143,6 +145,24 @@ in {
|
||||||
inherit defaultDiagnosticsProvider;
|
inherit defaultDiagnosticsProvider;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extensions = {
|
||||||
|
ts-error-translator = {
|
||||||
|
enable = mkEnableOption ''
|
||||||
|
Typescript error translation with
|
||||||
|
[ts-error-translator.nvim](github.com/dmmulroy/ts-error-translator.nvim)
|
||||||
|
'';
|
||||||
|
|
||||||
|
setupOpts = mkPluginSetupOption "ts-error-translator" {
|
||||||
|
# This is the default configuration behaviour.
|
||||||
|
auto_override_publish_diagnostics = mkOption {
|
||||||
|
description = "Automatically override the publish_diagnostics handler";
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
@ -169,5 +189,12 @@ in {
|
||||||
inherit diagnosticsProviders;
|
inherit diagnosticsProviders;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.extensions."ts-error-translator".enable {
|
||||||
|
vim.startPlugins = ["ts-error-translator"];
|
||||||
|
vim.luaConfigRC.ts-error-translator = entryAnywhere ''
|
||||||
|
require("ts-error-translator").setup(${toLuaObject cfg.extensions.ts-error-translator.setupOpts})
|
||||||
|
'';
|
||||||
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,9 +22,6 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
luaConfigRC.orgmode = entryAnywhere ''
|
luaConfigRC.orgmode = entryAnywhere ''
|
||||||
-- Load custom treesitter grammar for org filetype
|
|
||||||
require('orgmode').setup_ts_grammar()
|
|
||||||
|
|
||||||
-- Treesitter configuration
|
-- Treesitter configuration
|
||||||
require('nvim-treesitter.configs').setup {
|
require('nvim-treesitter.configs').setup {
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@ in {
|
||||||
require('catppuccin').setup {
|
require('catppuccin').setup {
|
||||||
flavour = "${style}",
|
flavour = "${style}",
|
||||||
transparent_background = ${boolToString transparent},
|
transparent_background = ${boolToString transparent},
|
||||||
|
term_colors = true,
|
||||||
integrations = {
|
integrations = {
|
||||||
nvimtree = {
|
nvimtree = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
|
|
|
@ -45,10 +45,12 @@ in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = [cfg.name];
|
startPlugins = [cfg.name];
|
||||||
luaConfigRC = {
|
configRC.theme = entryBefore ["luaScript"] ''
|
||||||
themeSetup = entryBefore ["theme"] cfg.extraConfig;
|
lua << EOF
|
||||||
theme = supported_themes.${cfg.name}.setup (with cfg; {inherit style transparent;});
|
${cfg.extraConfig}
|
||||||
};
|
${supported_themes.${cfg.name}.setup (with cfg; {inherit style transparent;})}
|
||||||
|
EOF
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,13 +6,11 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.lists) optionals;
|
inherit (lib.lists) optionals;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
inherit (lib.trivial) boolToString;
|
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
cfg = config.vim.ui.noice;
|
cfg = config.vim.ui.noice;
|
||||||
tscfg = config.vim.treesitter;
|
tscfg = config.vim.treesitter;
|
||||||
cmptype = config.vim.autocomplete.type;
|
|
||||||
|
|
||||||
defaultGrammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [vim regex lua bash markdown];
|
defaultGrammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [vim regex lua bash markdown];
|
||||||
in {
|
in {
|
||||||
|
@ -26,67 +24,7 @@ in {
|
||||||
treesitter.grammars = optionals tscfg.addDefaultGrammars defaultGrammars;
|
treesitter.grammars = optionals tscfg.addDefaultGrammars defaultGrammars;
|
||||||
|
|
||||||
luaConfigRC.noice-nvim = entryAnywhere ''
|
luaConfigRC.noice-nvim = entryAnywhere ''
|
||||||
require("noice").setup({
|
require("noice").setup(${toLuaObject cfg.setupOpts})
|
||||||
lsp = {
|
|
||||||
override = {
|
|
||||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
|
||||||
["vim.lsp.util.stylize_markdown"] = true,
|
|
||||||
${optionalString (cmptype == "nvim-cmp") "[\"cmp.entry.get_documentation\"] = true,"}
|
|
||||||
},
|
|
||||||
|
|
||||||
signature = {
|
|
||||||
enabled = false, -- FIXME: enabling this file throws an error which I couldn't figure out
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
hover = {
|
|
||||||
enabled = true,
|
|
||||||
silent = false, -- set to true to not show a message if hover is not available
|
|
||||||
view = nil, -- when nil, use defaults from documentation
|
|
||||||
opts = {}, -- merged with defaults from documentation
|
|
||||||
},
|
|
||||||
|
|
||||||
presets = {
|
|
||||||
bottom_search = true, -- use a classic bottom cmdline for search
|
|
||||||
command_palette = true, -- position the cmdline and popupmenu together
|
|
||||||
long_message_to_split = true, -- long messages will be sent to a split
|
|
||||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
|
||||||
lsp_doc_border = ${boolToString config.vim.ui.borders.enable}, -- add a border to hover docs and signature help
|
|
||||||
},
|
|
||||||
|
|
||||||
format = {
|
|
||||||
cmdline = { pattern = "^:", icon = "", lang = "vim" },
|
|
||||||
search_down = { kind = "search", pattern = "^/", icon = " ", lang = "regex" },
|
|
||||||
search_up = { kind = "search", pattern = "^%?", icon = " ", lang = "regex" },
|
|
||||||
filter = { pattern = "^:%s*!", icon = "", lang = "bash" },
|
|
||||||
lua = { pattern = "^:%s*lua%s+", icon = "", lang = "lua" },
|
|
||||||
help = { pattern = "^:%s*he?l?p?%s+", icon = "" },
|
|
||||||
input = {},
|
|
||||||
},
|
|
||||||
|
|
||||||
messages = {
|
|
||||||
-- NOTE: If you enable messages, then the cmdline is enabled automatically.
|
|
||||||
-- This is a current Neovim limitation.
|
|
||||||
enabled = true, -- enables the Noice messages UI
|
|
||||||
view = "notify", -- default view for messages
|
|
||||||
view_error = "notify", -- view for errors
|
|
||||||
view_warn = "notify", -- view for warnings
|
|
||||||
view_history = "messages", -- view for :messages
|
|
||||||
view_search = "virtualtext", -- view for search count messages. Set to `false` to disable
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Hide written messages
|
|
||||||
routes = {
|
|
||||||
{
|
|
||||||
filter = {
|
|
||||||
event = "msg_show",
|
|
||||||
kind = "",
|
|
||||||
find = "written",
|
|
||||||
},
|
|
||||||
opts = { skip = true },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,140 @@
|
||||||
{lib, ...}: let
|
{
|
||||||
inherit (lib.options) mkEnableOption;
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
|
inherit (lib.types) anything nullOr listOf submodule str;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
inherit (lib.nvim.config) mkBool;
|
||||||
in {
|
in {
|
||||||
options.vim.ui.noice = {
|
options.vim.ui.noice = {
|
||||||
enable = mkEnableOption "noice.nvim UI modification library";
|
enable = mkEnableOption "noice.nvim UI modification library";
|
||||||
|
|
||||||
|
setupOpts = mkPluginSetupOption "noice.nvim" {
|
||||||
|
lsp = {
|
||||||
|
override = {
|
||||||
|
"vim.lsp.util.convert_input_to_markdown_lines" =
|
||||||
|
mkBool true "override the default lsp markdown formatter with Noice";
|
||||||
|
|
||||||
|
"vim.lsp.util.stylize_markdown" =
|
||||||
|
mkBool true "override the lsp markdown formatter with Noice";
|
||||||
|
|
||||||
|
"cmp.entry.get_documentation" =
|
||||||
|
mkBool (config.vim.autocomplete.type == "nvim-cmp") "override cmp documentation with Noice";
|
||||||
|
};
|
||||||
|
|
||||||
|
signature = {
|
||||||
|
enabled = mkEnableOption "signature help";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
presets = {
|
||||||
|
bottom_search = mkBool true "use a classic bottom cmdline for search";
|
||||||
|
command_palette = mkBool true "position the cmdline and popupmenu together";
|
||||||
|
long_message_to_split = mkBool true "long messages will be sent to a split";
|
||||||
|
inc_rename = mkBool false "enables an input dialog for inc-rename.nvim";
|
||||||
|
lsp_doc_border =
|
||||||
|
mkBool config.vim.ui.borders.enable "add a border to hover docs and signature help";
|
||||||
|
};
|
||||||
|
|
||||||
|
# TODO: is it possible to write a submodule for this?
|
||||||
|
format = {
|
||||||
|
cmdline = mkOption {
|
||||||
|
description = "formatting options for the cmdline";
|
||||||
|
type = nullOr anything;
|
||||||
|
default = {
|
||||||
|
pattern = "^:";
|
||||||
|
icon = "";
|
||||||
|
lang = "vim";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
search_down = mkOption {
|
||||||
|
description = "formatting options for search_down";
|
||||||
|
type = nullOr anything;
|
||||||
|
default = {
|
||||||
|
kind = "search";
|
||||||
|
pattern = "^/";
|
||||||
|
icon = " ";
|
||||||
|
lang = "regex";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
search_up = mkOption {
|
||||||
|
description = "formatting options for search_up";
|
||||||
|
type = nullOr anything;
|
||||||
|
default = {
|
||||||
|
kind = "search";
|
||||||
|
pattern = "^%?";
|
||||||
|
icon = " ";
|
||||||
|
lang = "regex";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
filter = mkOption {
|
||||||
|
description = "formatting options for filter";
|
||||||
|
type = nullOr anything;
|
||||||
|
default = {
|
||||||
|
pattern = "^:%s*!";
|
||||||
|
icon = "";
|
||||||
|
lang = "bash";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
lua = mkOption {
|
||||||
|
description = "formatting options for lua";
|
||||||
|
type = nullOr anything;
|
||||||
|
default = {
|
||||||
|
pattern = "^:%s*lua%s+";
|
||||||
|
icon = "";
|
||||||
|
lang = "lua";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
help = mkOption {
|
||||||
|
description = "formatting options for help";
|
||||||
|
type = nullOr anything;
|
||||||
|
default = {
|
||||||
|
pattern = "^:%s*he?l?p?%s+";
|
||||||
|
icon = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
routes = mkOption {
|
||||||
|
description = "How to route messages";
|
||||||
|
type = listOf (submodule {
|
||||||
|
options = {
|
||||||
|
view = mkOption {
|
||||||
|
description = "";
|
||||||
|
type = str;
|
||||||
|
};
|
||||||
|
|
||||||
|
filter = mkOption {
|
||||||
|
description = "";
|
||||||
|
type = anything;
|
||||||
|
};
|
||||||
|
|
||||||
|
opts = mkOption {
|
||||||
|
description = "";
|
||||||
|
type = nullOr anything;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
default = [
|
||||||
|
{
|
||||||
|
filter = {
|
||||||
|
event = "msg_show";
|
||||||
|
kind = "";
|
||||||
|
find = "written";
|
||||||
|
};
|
||||||
|
opts = {skip = true;};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
defaultText = "Hide written messages";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,15 +31,15 @@ in {
|
||||||
|
|
||||||
custom_colorcolumn = mkOption {
|
custom_colorcolumn = mkOption {
|
||||||
description = "The position at which smart column should be displayed for each individual buffer type";
|
description = "The position at which smart column should be displayed for each individual buffer type";
|
||||||
type = attrsOf (either int (listOf int));
|
type = attrsOf (either str (listOf str));
|
||||||
default = {};
|
default = {};
|
||||||
|
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
vim.ui.smartcolumn.setupOpts.custom_colorcolumn = {
|
vim.ui.smartcolumn.setupOpts.custom_colorcolumn = {
|
||||||
nix = 110;
|
nix = "110";
|
||||||
ruby = 120;
|
ruby = "120";
|
||||||
java = 130;
|
java = "130";
|
||||||
go = [90 130];
|
go = ["90" "130"];
|
||||||
};
|
};
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue