Merge branch 'main' into add-multicursors-nvim

one more - replacement

Update modules/plugins/utility/multicursors/multicursors.nix

Co-authored-by: raf <raf@notashelf.dev>

remove redundancies

missing an extra -
This commit is contained in:
Joe Hanson 2025-02-22 08:23:13 -06:00 committed by Joseph Hanson
commit e07b53d188
No known key found for this signature in database
5 changed files with 70 additions and 6 deletions

View file

@ -1,5 +1,10 @@
# Release 0.8 {#sec-release-0.8} # Release 0.8 {#sec-release-0.8}
## Breaking changes
- `git-conflict` keybinds are now prefixed with `<leader>` to avoid conflicting
with builtins
[NotAShelf](https://github.com/notashelf): [NotAShelf](https://github.com/notashelf):
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim [typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
@ -176,3 +181,4 @@
[Libadoxon](https://github.com/Libadoxon) [Libadoxon](https://github.com/Libadoxon)
- Add [git-conflict](https://github.com/akinsho/git-conflict.nvim) plugin for resolving git conflicts - Add [git-conflict](https://github.com/akinsho/git-conflict.nvim) plugin for resolving git conflicts
- Add formatters for go: [gofmt](https://go.dev/blog/gofmt), [golines](https://github.com/segmentio/golines) and [gofumpt](https://github.com/mvdan/gofumpt)

View file

@ -12,10 +12,10 @@ in {
setupOpts = mkPluginSetupOption "git-conflict" {}; setupOpts = mkPluginSetupOption "git-conflict" {};
mappings = { mappings = {
ours = mkMappingOption "Choose Ours [Git-Conflict]" "co"; ours = mkMappingOption "Choose Ours [Git-Conflict]" "<leader>co";
theirs = mkMappingOption "Choose Theirs [Git-Conflict]" "ct"; theirs = mkMappingOption "Choose Theirs [Git-Conflict]" "<leader>ct";
both = mkMappingOption "Choose Both [Git-Conflict]" "cb"; both = mkMappingOption "Choose Both [Git-Conflict]" "<leader>cb";
none = mkMappingOption "Choose None [Git-Conflict]" "c0"; none = mkMappingOption "Choose None [Git-Conflict]" "<leader>c0";
prevConflict = mkMappingOption "Go to the previous Conflict [Git-Conflict]" "]x"; prevConflict = mkMappingOption "Go to the previous Conflict [Git-Conflict]" "]x";
nextConflict = mkMappingOption "Go to the next Conflict [Git-Conflict]" "[x"; nextConflict = mkMappingOption "Go to the next Conflict [Git-Conflict]" "[x";
}; };

View file

@ -34,6 +34,43 @@
}; };
}; };
defaultFormat = "gofmt";
formats = {
gofmt = {
package = pkgs.go;
nullConfig = ''
table.insert(
ls_sources,
null_ls.builtins.formatting.gofmt.with({
command = "${cfg.format.package}/bin/gofmt",
})
)
'';
};
gofumpt = {
package = pkgs.gofumpt;
nullConfig = ''
table.insert(
ls_sources,
null_ls.builtins.formatting.gofumpt.with({
command = "${cfg.format.package}/bin/gofumpt",
})
)
'';
};
golines = {
package = pkgs.golines;
nullConfig = ''
table.insert(
ls_sources,
null_ls.builtins.formatting.golines.with({
command = "${cfg.format.package}/bin/golines",
})
)
'';
};
};
defaultDebugger = "delve"; defaultDebugger = "delve";
debuggers = { debuggers = {
delve = { delve = {
@ -67,6 +104,22 @@ in {
}; };
}; };
format = {
enable = mkEnableOption "Go formatting" // {default = config.vim.languages.enableFormat;};
type = mkOption {
description = "Go formatter to use";
type = enum (attrNames formats);
default = defaultFormat;
};
package = mkOption {
description = "Go formatter package";
type = package;
default = formats.${cfg.format.type}.package;
};
};
dap = { dap = {
enable = mkOption { enable = mkOption {
description = "Enable Go Debug Adapter via nvim-dap-go plugin"; description = "Enable Go Debug Adapter via nvim-dap-go plugin";
@ -99,6 +152,11 @@ in {
vim.lsp.lspconfig.sources.go-lsp = servers.${cfg.lsp.server}.lspConfig; vim.lsp.lspconfig.sources.go-lsp = servers.${cfg.lsp.server}.lspConfig;
}) })
(mkIf cfg.format.enable {
vim.lsp.null-ls.enable = true;
vim.lsp.null-ls.sources.go-format = formats.${cfg.format.type}.nullConfig;
})
(mkIf cfg.dap.enable { (mkIf cfg.dap.enable {
vim = { vim = {
startPlugins = ["nvim-dap-go"]; startPlugins = ["nvim-dap-go"];

View file

@ -9,7 +9,7 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim = { vim = {
startPlugins = ["hydra-nvim"]; startPlugins = ["hydra-nvim"];
lazy.plugins."multicursors.nvim" = { lazy.plugins."multicursors-nvim" = {
package = "multicursors-nvim"; package = "multicursors-nvim";
setupModule = "multicursors"; setupModule = "multicursors";
inherit (cfg) setupOpts; inherit (cfg) setupOpts;

View file

@ -45,7 +45,7 @@
pluginBuilders = { pluginBuilders = {
nvim-treesitter = buildTreesitterPlug config.vim.treesitter.grammars; nvim-treesitter = buildTreesitterPlug config.vim.treesitter.grammars;
flutter-tools-patched = buildPlug { flutter-tools-patched = buildPlug {
pname = "flutter-tools"; pname = "flutter-tools-nvim";
patches = [./patches/flutter-tools.patch]; patches = [./patches/flutter-tools.patch];
# Disable failing require check hook checks # Disable failing require check hook checks