Compare commits

..

5 Commits

Author SHA1 Message Date
Ching Pei Yang b859b66b4d
Merge 6d9d2b2d3d into 95615ec308 2024-06-21 22:16:36 +01:00
Ching Pei Yang 6d9d2b2d3d docs: update release notes 2024-05-22 21:37:35 +02:00
Ching Pei Yang 4f07550013 noice: use setupOpts 2024-05-22 20:11:52 +02:00
Ching Pei Yang 999a033bd1 noice: add filter 2024-05-22 20:11:52 +02:00
Ching Pei Yang 0c8555ec39 noice: add setupOpts 2024-05-21 23:15:23 +02:00
13 changed files with 51 additions and 158 deletions

View File

@ -222,10 +222,10 @@ inputs: let
enable = true;
setupOpts.custom_colorcolumn = {
# this is a freeform module, it's `buftype = int;` for configuring column position
nix = "110";
ruby = "120";
java = "130";
go = ["90" "130"];
nix = 110;
ruby = 120;
java = 130;
go = [90 130];
};
};
};

View File

@ -12,40 +12,21 @@ Release notes for release 0.7
[frothymarrow](https://github.com/frothymarrow):
- Modified type for
[vim.visuals.fidget-nvim.setupOpts.progress.display.overrides](#opt-vim.visuals.fidget-nvim.setupOpts.progress.display.overrides)
from `anything` to a `submodule` for better type checking.
[](#opt-vim.visuals.fidget-nvim.setupOpts.progress.display.overrides) from
`anything` to a `submodule` for better type checking.
- 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 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`.
- Add basic transparency support for `oxocarbon` theme by setting the
highlight group for `Normal`, `NormalFloat`, `LineNr`, `SignColumn` and
optionally `NvimTreeNormal` to `none`.
[horriblename](https://github.com/horriblename):
- Fix broken treesitter-context keybinds in visual mode
- Deprecate use of `__empty` to define empty tables in lua. Empty attrset are no
longer filtered and thus should be used instead.
- Depcrecate use of `__empty` to define empty tables in lua. Empty attrset are
no longer filtered and thus should be used instead.
- Make noice.nvim customizable
[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):
[NotAShelf](https://github.com/notashelf)
- Add `deno fmt` as the default Markdown formatter. This will be enabled
automatically if you have autoformatting enabled, but can be disabled manually
@ -59,12 +40,13 @@ Release notes for release 0.7
added once the [credo](https://github.com/rrrene/credo) linter has been added
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
blending issues in component separators.
- Add
[ts-error-translator.nvim](https://github.com/dmmulroy/ts-error-translator.nvim)
extension of the TS language module, under
`vim.languages.ts.extensions.ts-error-translator`
[jacekpoz](https://github.com/jacekpoz):
- Add [ocaml-lsp](https://github.com/ocaml/ocaml-lsp) support.
- Fix Emac typo

View File

@ -114,16 +114,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1719082008,
"narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=",
"lastModified": 1718910271,
"narHash": "sha256-vft9UIECxL4FtfX5UsTEE2XvvH9z9/BeP8pACAYEbwY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9693852a2070b398ee123a329e68f0dab5526681",
"rev": "19cd1c918369d89128bcb6a6da87137bdf42e997",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"ref": "nixos-unstable-small",
"repo": "nixpkgs",
"type": "github"
}
@ -1597,22 +1597,6 @@
"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": {
"flake": false,
"locked": {
@ -1856,7 +1840,6 @@
"plugin-toggleterm-nvim": "plugin-toggleterm-nvim",
"plugin-tokyonight": "plugin-tokyonight",
"plugin-trouble": "plugin-trouble",
"plugin-ts-error-translator": "plugin-ts-error-translator",
"plugin-vim-dirtytalk": "plugin-vim-dirtytalk",
"plugin-vim-fugitive": "plugin-vim-fugitive",
"plugin-vim-illuminate": "plugin-vim-illuminate",

View File

@ -77,7 +77,7 @@
# Flake inputs
inputs = {
## Basic Inputs
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-utils.url = "github:numtide/flake-utils";
systems.url = "github:nix-systems/default";
@ -183,11 +183,6 @@
flake = false;
};
plugin-ts-error-translator = {
url = "github:dmmulroy/ts-error-translator.nvim";
flake = false;
};
# Copying/Registers
plugin-registers = {
url = "github:tversteeg/registers.nvim";

View File

@ -4,8 +4,9 @@
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.trivial) boolToString;
inherit (lib.strings) optionalString;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.autopairs;
in {
@ -13,7 +14,7 @@ in {
vim.startPlugins = ["nvim-autopairs"];
vim.luaConfigRC.autopairs = entryAnywhere ''
require("nvim-autopairs").setup({ map_cr = ${boolToString (!config.vim.autocomplete.enable)} })
require("nvim-autopairs").setup{}
'';
};
}

View File

@ -61,19 +61,15 @@ in {
(mkSetLuaBinding mappings.complete ''
require('cmp').complete
'')
(let
defaultKeys =
if config.vim.autopairs.enable
then "require('nvim-autopairs').autopairs_cr()"
else "vim.api.nvim_replace_termcodes(${toJSON mappings.confirm.value}, true, false, true)";
in
mkSetLuaBinding mappings.confirm ''
function()
if not require('cmp').confirm({ select = true }) then
vim.fn.feedkeys(${defaultKeys}, 'n')
end
(mkSetLuaBinding mappings.confirm ''
function()
if not require('cmp').confirm({ select = true }) then
local termcode = vim.api.nvim_replace_termcodes(${toJSON mappings.confirm.value}, true, false, true)
vim.fn.feedkeys(termcode, 'n')
end
'')
end
'')
(mkSetLuaBinding mappings.next ''
function()
local has_words_before = function()

View File

@ -35,7 +35,7 @@
'';
};
clangd = {
package = pkgs.clang-tools;
package = pkgs.clang-tools_16;
lspConfig = ''
local clangd_cap = capabilities
-- use same offsetEncoding as null-ls

View File

@ -4,33 +4,17 @@
lib,
...
}: let
inherit (builtins) attrNames;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.strings) optionalString;
inherit (lib.trivial) boolToString;
inherit (lib.lists) isList optionals;
inherit (lib.types) bool package str listOf either enum;
inherit (lib.types) bool package str listOf either;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.dag) entryAnywhere;
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 {
options.vim.languages.rust = {
enable = mkEnableOption "Rust language support";
@ -65,22 +49,6 @@ 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 = {
enable = mkOption {
description = "Rust Debug Adapter support";
@ -118,11 +86,6 @@ in {
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) {
vim = {
startPlugins = ["rust-tools"] ++ optionals cfg.dap.enable [cfg.dap.package];

View File

@ -9,11 +9,10 @@
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
inherit (lib.meta) getExe;
inherit (lib.types) enum either listOf package str bool;
inherit (lib.nvim.lua) expToLua toLuaObject;
inherit (lib.nvim.types) mkGrammarOption diagnostics mkPluginSetupOption;
inherit (lib.types) enum either listOf package str;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.types) mkGrammarOption diagnostics;
inherit (lib.nvim.languages) diagnosticsToLua;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.languages.ts;
@ -33,7 +32,6 @@
}
'';
};
denols = {
package = pkgs.deno;
lspConfig = ''
@ -145,24 +143,6 @@ in {
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 [
@ -189,12 +169,5 @@ in {
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})
'';
})
]);
}

View File

@ -22,6 +22,9 @@ in {
};
luaConfigRC.orgmode = entryAnywhere ''
-- Load custom treesitter grammar for org filetype
require('orgmode').setup_ts_grammar()
-- Treesitter configuration
require('nvim-treesitter.configs').setup {

View File

@ -53,7 +53,6 @@ in {
require('catppuccin').setup {
flavour = "${style}",
transparent_background = ${boolToString transparent},
term_colors = true,
integrations = {
nvimtree = {
enabled = true,

View File

@ -45,12 +45,10 @@ in {
config = mkIf cfg.enable {
vim = {
startPlugins = [cfg.name];
configRC.theme = entryBefore ["luaScript"] ''
lua << EOF
${cfg.extraConfig}
${supported_themes.${cfg.name}.setup (with cfg; {inherit style transparent;})}
EOF
'';
luaConfigRC = {
themeSetup = entryBefore ["theme"] cfg.extraConfig;
theme = supported_themes.${cfg.name}.setup (with cfg; {inherit style transparent;});
};
};
};
}

View File

@ -31,15 +31,15 @@ in {
custom_colorcolumn = mkOption {
description = "The position at which smart column should be displayed for each individual buffer type";
type = attrsOf (either str (listOf str));
type = attrsOf (either int (listOf int));
default = {};
example = literalExpression ''
vim.ui.smartcolumn.setupOpts.custom_colorcolumn = {
nix = "110";
ruby = "120";
java = "130";
go = ["90" "130"];
nix = 110;
ruby = 120;
java = 130;
go = [90 130];
};
'';
};