mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-10 15:35:30 +00:00
Merge branch 'NotAShelf:main' into feature-language-tex
This commit is contained in:
commit
2b2eddcdb6
13 changed files with 325 additions and 8 deletions
|
|
@ -173,17 +173,18 @@ isMaximal: {
|
||||||
utility = {
|
utility = {
|
||||||
ccc.enable = false;
|
ccc.enable = false;
|
||||||
vim-wakatime.enable = false;
|
vim-wakatime.enable = false;
|
||||||
icon-picker.enable = isMaximal;
|
|
||||||
surround.enable = isMaximal;
|
|
||||||
diffview-nvim.enable = true;
|
diffview-nvim.enable = true;
|
||||||
yanky-nvim.enable = false;
|
yanky-nvim.enable = false;
|
||||||
|
icon-picker.enable = isMaximal;
|
||||||
|
surround.enable = isMaximal;
|
||||||
leetcode-nvim.enable = isMaximal;
|
leetcode-nvim.enable = isMaximal;
|
||||||
|
multicursors.enable = isMaximal;
|
||||||
|
|
||||||
motion = {
|
motion = {
|
||||||
hop.enable = true;
|
hop.enable = true;
|
||||||
leap.enable = true;
|
leap.enable = true;
|
||||||
precognition.enable = isMaximal;
|
precognition.enable = isMaximal;
|
||||||
};
|
};
|
||||||
|
|
||||||
images = {
|
images = {
|
||||||
image-nvim.enable = false;
|
image-nvim.enable = false;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
@ -154,6 +159,12 @@
|
||||||
|
|
||||||
- Add support for [nixd](https://github.com/nix-community/nixd) language server.
|
- Add support for [nixd](https://github.com/nix-community/nixd) language server.
|
||||||
|
|
||||||
|
[jahanson](https://github.com/jahanson):
|
||||||
|
|
||||||
|
- Add [multicursors.nvim](https://github.com/smoka7/multicursors.nvim) to
|
||||||
|
available plugins, under `vim.utility.multicursors`.
|
||||||
|
- Add [hydra.nvim](https://github.com/nvimtools/hydra.nvim) as dependency for
|
||||||
|
`multicursors.nvim` and lazy loads by default.
|
||||||
[folospior](https://github.com/folospior)
|
[folospior](https://github.com/folospior)
|
||||||
|
|
||||||
- Fix plugin name for lsp/lspkind.
|
- Fix plugin name for lsp/lspkind.
|
||||||
|
|
@ -170,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)
|
||||||
|
|
|
||||||
|
|
@ -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";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
22
modules/plugins/hydra/config.nix
Normal file
22
modules/plugins/hydra/config.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
cfg = config.vim.hydra;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = [];
|
||||||
|
lazy.plugins.hydra = {
|
||||||
|
package = "hydra.nvim";
|
||||||
|
setupModule = "hydra";
|
||||||
|
inherit (cfg) setupOpts;
|
||||||
|
|
||||||
|
event = ["DeferredUIEnter"];
|
||||||
|
cmd = ["MCstart" "MCvisual" "MCclear" "MCpattern" "MCvisualPattern" "MCunderCursor"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
6
modules/plugins/hydra/default.nix
Normal file
6
modules/plugins/hydra/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hydra.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
7
modules/plugins/hydra/hydra.nix
Normal file
7
modules/plugins/hydra/hydra.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkEnableOption;
|
||||||
|
in {
|
||||||
|
options.vim.utility.hydra = {
|
||||||
|
enable = mkEnableOption "utility for creating custom submodes and menus [nvimtools/hydra.nvim]";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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"];
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
./icon-picker
|
./icon-picker
|
||||||
./images
|
./images
|
||||||
./motion
|
./motion
|
||||||
|
./multicursors
|
||||||
./new-file-template
|
./new-file-template
|
||||||
./outline
|
./outline
|
||||||
./preview
|
./preview
|
||||||
|
|
|
||||||
36
modules/plugins/utility/multicursors/config.nix
Normal file
36
modules/plugins/utility/multicursors/config.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
cfg = config.vim.utility.multicursors;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = ["hydra-nvim"];
|
||||||
|
lazy.plugins."multicursors-nvim" = {
|
||||||
|
package = "multicursors-nvim";
|
||||||
|
setupModule = "multicursors";
|
||||||
|
inherit (cfg) setupOpts;
|
||||||
|
|
||||||
|
event = ["DeferredUIEnter"];
|
||||||
|
cmd = ["MCstart" "MCvisual" "MCclear" "MCpattern" "MCvisualPattern" "MCunderCursor"];
|
||||||
|
keys = [
|
||||||
|
{
|
||||||
|
mode = ["v" "n"];
|
||||||
|
key = "<leader>mcs";
|
||||||
|
action = ":MCstart<cr>";
|
||||||
|
desc = "Create a selection for selected text or word under the cursor [multicursors.nvim]";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = ["v" "n"];
|
||||||
|
key = "<leader>mcp";
|
||||||
|
action = ":MCpattern<cr>";
|
||||||
|
desc = "Create a selection for pattern entered [multicursors.nvim]";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
6
modules/plugins/utility/multicursors/default.nix
Normal file
6
modules/plugins/utility/multicursors/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./multicursors.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
138
modules/plugins/utility/multicursors/multicursors.nix
Normal file
138
modules/plugins/utility/multicursors/multicursors.nix
Normal file
|
|
@ -0,0 +1,138 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
inherit (lib.types) attrsOf nullOr bool int str submodule;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
|
||||||
|
hintConfig = {
|
||||||
|
options = {
|
||||||
|
float_opts = mkOption {
|
||||||
|
description = "The options for the floating hint window";
|
||||||
|
type = submodule {
|
||||||
|
options = {
|
||||||
|
border = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "none";
|
||||||
|
description = "The border style for the hint window";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
position = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "bottom";
|
||||||
|
description = "The position of the hint window";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
generateHints = {
|
||||||
|
options = {
|
||||||
|
normal = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Generate hints for the normal mode";
|
||||||
|
};
|
||||||
|
|
||||||
|
insert = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Generate hints for the insert mode";
|
||||||
|
};
|
||||||
|
|
||||||
|
extend = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Generate hints for the extend mode";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkOption {
|
||||||
|
description = "The configuration for generating hints for multicursors.nvim";
|
||||||
|
type = submodule {
|
||||||
|
options = {
|
||||||
|
column_count = mkOption {
|
||||||
|
type = nullOr int;
|
||||||
|
default = null;
|
||||||
|
description = "The number of columns to use for the hint window";
|
||||||
|
};
|
||||||
|
|
||||||
|
max_hint_length = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 25;
|
||||||
|
description = "The maximum length of the hint";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
default = {
|
||||||
|
column_count = null;
|
||||||
|
max_hint_length = 25;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
options.vim.utility.multicursors = {
|
||||||
|
enable = mkEnableOption "vscode like multiple cursors [multicursor.nvim]";
|
||||||
|
|
||||||
|
setupOpts = mkPluginSetupOption "multicursors" {
|
||||||
|
DEBUG_MODE = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable debug mode.";
|
||||||
|
};
|
||||||
|
|
||||||
|
create_commands = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Create Multicursor user commands";
|
||||||
|
};
|
||||||
|
|
||||||
|
updatetime = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 50;
|
||||||
|
description = "The time in milliseconds to wait before updating the cursor in insert mode";
|
||||||
|
};
|
||||||
|
|
||||||
|
nowait = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Don't wait for the cursor to move before updating the cursor";
|
||||||
|
};
|
||||||
|
|
||||||
|
mode_keys = mkOption {
|
||||||
|
type = attrsOf str;
|
||||||
|
default = {
|
||||||
|
insert = "i";
|
||||||
|
append = "a";
|
||||||
|
change = "c";
|
||||||
|
extend = "e";
|
||||||
|
};
|
||||||
|
description = "The keys to use for each mode";
|
||||||
|
};
|
||||||
|
|
||||||
|
hint_config = mkOption {
|
||||||
|
type = submodule hintConfig;
|
||||||
|
default = {
|
||||||
|
float_opts.border = "none";
|
||||||
|
position = "bottom";
|
||||||
|
};
|
||||||
|
description = "The configuration for the hint window";
|
||||||
|
};
|
||||||
|
|
||||||
|
generate_hints = mkOption {
|
||||||
|
type = submodule generateHints;
|
||||||
|
default = {
|
||||||
|
normal = true;
|
||||||
|
insert = true;
|
||||||
|
extend = true;
|
||||||
|
config = {
|
||||||
|
column_count = null;
|
||||||
|
max_hint_length = 25;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
description = "The configuration for generating hints";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -507,6 +507,21 @@
|
||||||
"url": "https://github.com/phaazon/hop.nvim/archive/1a1eceafe54b5081eae4cb91c723abd1d450f34b.tar.gz",
|
"url": "https://github.com/phaazon/hop.nvim/archive/1a1eceafe54b5081eae4cb91c723abd1d450f34b.tar.gz",
|
||||||
"hash": "08h18cam2yr57qvfsnf1bra28vbl6013wlchnr5crb757xw8aysa"
|
"hash": "08h18cam2yr57qvfsnf1bra28vbl6013wlchnr5crb757xw8aysa"
|
||||||
},
|
},
|
||||||
|
"hydra-nvim": {
|
||||||
|
"type": "GitRelease",
|
||||||
|
"repository": {
|
||||||
|
"type": "GitHub",
|
||||||
|
"owner": "nvimtools",
|
||||||
|
"repo": "hydra.nvim"
|
||||||
|
},
|
||||||
|
"pre_releases": false,
|
||||||
|
"version_upper_bound": null,
|
||||||
|
"release_prefix": null,
|
||||||
|
"version": "v1.0.2",
|
||||||
|
"revision": "8578056a2226ed49fc608167edc143a87f75d809",
|
||||||
|
"url": "https://api.github.com/repos/nvimtools/hydra.nvim/tarball/v1.0.2",
|
||||||
|
"hash": "13f04pmqrfl65xx9bfkdak6ll57s94anaw7nqd0fm5hp50b7c6j3"
|
||||||
|
},
|
||||||
"icon-picker-nvim": {
|
"icon-picker-nvim": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
@ -1202,6 +1217,21 @@
|
||||||
"url": "https://github.com/mvllow/modes.nvim/archive/c7a4b1b383606832aab150902719bd5eb5cdb2b0.tar.gz",
|
"url": "https://github.com/mvllow/modes.nvim/archive/c7a4b1b383606832aab150902719bd5eb5cdb2b0.tar.gz",
|
||||||
"hash": "1hy3ghscf8hfmg487p9b8cwd0y8nsi8j24kq2ir3vhd82gqhl4ja"
|
"hash": "1hy3ghscf8hfmg487p9b8cwd0y8nsi8j24kq2ir3vhd82gqhl4ja"
|
||||||
},
|
},
|
||||||
|
"multicursors-nvim": {
|
||||||
|
"type": "GitRelease",
|
||||||
|
"repository": {
|
||||||
|
"type": "GitHub",
|
||||||
|
"owner": "smoka7",
|
||||||
|
"repo": "multicursors.nvim"
|
||||||
|
},
|
||||||
|
"pre_releases": false,
|
||||||
|
"version_upper_bound": null,
|
||||||
|
"release_prefix": null,
|
||||||
|
"version": "v2.0.0",
|
||||||
|
"revision": "782820896b1691ed664e4c24f1cd9793dcb33dfb",
|
||||||
|
"url": "https://api.github.com/repos/smoka7/multicursors.nvim/tarball/v2.0.0",
|
||||||
|
"hash": "171aysqsyapw434xkibxv69p5fkwha4addkqfdssdm0wq9n9cm4q"
|
||||||
|
},
|
||||||
"neo-tree-nvim": {
|
"neo-tree-nvim": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue