mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-13 08:15:10 +00:00
Merge pull request #1639 from horriblename/purge-maps
Deprecate vims.maps
This commit is contained in:
commit
69f386eca6
15 changed files with 233 additions and 165 deletions
|
|
@ -39,6 +39,8 @@
|
|||
`setupOpts.strategies.chat.adapter`, rename them to
|
||||
`setupOpts.interactions.chat.adapter`.
|
||||
|
||||
- `vim.maps` is deprecated, use `vim.keymaps` instead.
|
||||
|
||||
[Snoweuph](https://github.com/snoweuph)
|
||||
|
||||
- Remove `mind.nvim`. This plugin doesn't exist anymore. The original author
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
{
|
||||
options,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkMerge;
|
||||
inherit (lib.options) mkOption literalMD;
|
||||
inherit (lib.options) mkOption literalMD showFiles;
|
||||
inherit (lib.types) either str listOf attrsOf nullOr submodule;
|
||||
inherit (lib.attrsets) mapAttrsToList;
|
||||
inherit (lib.lists) flatten;
|
||||
inherit (lib.lists) flatten optional;
|
||||
inherit (lib.trivial) pipe;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.config) mkBool;
|
||||
|
|
@ -63,10 +64,10 @@
|
|||
legacyMapOption = mode:
|
||||
mkOption {
|
||||
description = "Mappings for ${mode} mode";
|
||||
visible = false;
|
||||
type = attrsOf (submodule {
|
||||
options = mapConfigOptions;
|
||||
});
|
||||
default = {};
|
||||
};
|
||||
|
||||
legacyMapModes = {
|
||||
|
|
@ -152,5 +153,14 @@ in {
|
|||
]
|
||||
)
|
||||
];
|
||||
|
||||
# 2026-06-12
|
||||
warnings = mkMerge (mapAttrsToList (
|
||||
name: option:
|
||||
optional
|
||||
option.isDefined
|
||||
"The option `vim.maps.${name}` defined in ${showFiles option.files} is deprecated, please use `vim.keymaps` instead. "
|
||||
)
|
||||
options.vim.maps);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,29 +4,14 @@
|
|||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding;
|
||||
inherit (lib.nvim.binds) mkKeymap;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.assistant.chatgpt;
|
||||
|
||||
mappingDefinitions = options.vim.assistant.chatgpt.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
maps = mkMerge [
|
||||
(mkSetBinding mappings.editWithInstructions "<cmd>ChatGPTEditWithInstruction<CR>")
|
||||
(mkSetBinding mappings.grammarCorrection "<cmd>ChatGPTRun grammar_correction<CR>")
|
||||
(mkSetBinding mappings.translate "<cmd>ChatGPTRun translate<CR>")
|
||||
(mkSetBinding mappings.keyword "<cmd>ChatGPTRun keywords<CR>")
|
||||
(mkSetBinding mappings.docstring "<cmd>ChatGPTRun docstring<CR>")
|
||||
(mkSetBinding mappings.addTests "<cmd>ChatGPTRun add_tests<CR>")
|
||||
(mkSetBinding mappings.optimize "<cmd>ChatGPTRun optimize_code<CR>")
|
||||
(mkSetBinding mappings.summarize "<cmd>ChatGPTRun summarize<CR>")
|
||||
(mkSetBinding mappings.fixBugs "<cmd>ChatGPTRun fix_bugs<CR>")
|
||||
(mkSetBinding mappings.explain "<cmd>ChatGPTRun explain_code<CR>")
|
||||
(mkSetBinding mappings.roxygenEdit "<cmd>ChatGPTRun roxygen_edit<CR>")
|
||||
(mkSetBinding mappings.readabilityanalysis "<cmd>ChatGPTRun code_readability_analysis<CR>")
|
||||
];
|
||||
inherit (options.vim.assistant.chatgpt) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
|
|
@ -45,13 +30,21 @@ in {
|
|||
require("chatgpt").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
|
||||
maps = {
|
||||
visual = maps;
|
||||
normal = mkMerge [
|
||||
(mkSetBinding mappings.chatGpt "<cmd>ChatGPT<CR>")
|
||||
maps
|
||||
];
|
||||
};
|
||||
keymaps = [
|
||||
(mkKeymap ["n" "v"] cfg.mappings.editWithInstructions "<cmd>ChatGPTEditWithInstruction<CR>" {desc = mappings.editWithInstructions.description;})
|
||||
(mkKeymap ["n" "v"] cfg.mappings.grammarCorrection "<cmd>ChatGPTRun grammar_correction<CR>" {desc = mappings.grammarCorrection.description;})
|
||||
(mkKeymap ["n" "v"] cfg.mappings.translate "<cmd>ChatGPTRun translate<CR>" {desc = mappings.translate.description;})
|
||||
(mkKeymap ["n" "v"] cfg.mappings.keyword "<cmd>ChatGPTRun keywords<CR>" {desc = mappings.keyword.description;})
|
||||
(mkKeymap ["n" "v"] cfg.mappings.docstring "<cmd>ChatGPTRun docstring<CR>" {desc = mappings.docstring.description;})
|
||||
(mkKeymap ["n" "v"] cfg.mappings.addTests "<cmd>ChatGPTRun add_tests<CR>" {desc = mappings.addTests.description;})
|
||||
(mkKeymap ["n" "v"] cfg.mappings.optimize "<cmd>ChatGPTRun optimize_code<CR>" {desc = mappings.optimize.description;})
|
||||
(mkKeymap ["n" "v"] cfg.mappings.summarize "<cmd>ChatGPTRun summarize<CR>" {desc = mappings.summarize.description;})
|
||||
(mkKeymap ["n" "v"] cfg.mappings.fixBugs "<cmd>ChatGPTRun fix_bugs<CR>" {desc = mappings.fixBugs.description;})
|
||||
(mkKeymap ["n" "v"] cfg.mappings.explain "<cmd>ChatGPTRun explain_code<CR>" {desc = mappings.explain.description;})
|
||||
(mkKeymap ["n" "v"] cfg.mappings.roxygenEdit "<cmd>ChatGPTRun roxygen_edit<CR>" {desc = mappings.roxygenEdit.description;})
|
||||
(mkKeymap ["n" "v"] cfg.mappings.readabilityanalysis "<cmd>ChatGPTRun code_readability_analysis<CR>" {desc = mappings.readabilityanalysis.description;})
|
||||
(mkKeymap "n" cfg.mappings.chatGpt "<cmd>ChatGPT<CR>" {desc = mappings.chatGpt.description;})
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,31 +5,27 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding;
|
||||
inherit (lib.nvim.binds) mkKeymap;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.git.git-conflict;
|
||||
|
||||
gcMappingDefinitions = options.vim.git.git-conflict.mappings;
|
||||
|
||||
gcMappings = addDescriptionsToMappings cfg.mappings gcMappingDefinitions;
|
||||
inherit (options.vim.git.git-conflict) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
vim = {
|
||||
startPlugins = ["git-conflict-nvim"];
|
||||
|
||||
maps = {
|
||||
normal = mkMerge [
|
||||
(mkSetBinding gcMappings.ours "<Plug>(git-conflict-ours)")
|
||||
(mkSetBinding gcMappings.theirs "<Plug>(git-conflict-theirs)")
|
||||
(mkSetBinding gcMappings.both "<Plug>(git-conflict-both)")
|
||||
(mkSetBinding gcMappings.none "<Plug>(git-conflict-none)")
|
||||
(mkSetBinding gcMappings.prevConflict "<Plug>(git-conflict-prev-conflict)")
|
||||
(mkSetBinding gcMappings.nextConflict "<Plug>(git-conflict-next-conflict)")
|
||||
];
|
||||
};
|
||||
keymaps = [
|
||||
(mkKeymap "n" cfg.mappings.ours "<Plug>(git-conflict-ours)" {desc = mappings.ours.description;})
|
||||
(mkKeymap "n" cfg.mappings.theirs "<Plug>(git-conflict-theirs)" {desc = mappings.theirs.description;})
|
||||
(mkKeymap "n" cfg.mappings.both "<Plug>(git-conflict-both)" {desc = mappings.both.description;})
|
||||
(mkKeymap "n" cfg.mappings.none "<Plug>(git-conflict-none)" {desc = mappings.none.description;})
|
||||
(mkKeymap "n" cfg.mappings.prevConflict "<Plug>(git-conflict-prev-conflict)" {desc = mappings.prevConflict.description;})
|
||||
(mkKeymap "n" cfg.mappings.nextConflict "<Plug>(git-conflict-next-conflict)" {desc = mappings.nextConflict.description;})
|
||||
];
|
||||
|
||||
pluginRC.git-conflict = entryAnywhere ''
|
||||
require('git-conflict').setup(${toLuaObject ({default_mappings = false;} // cfg.setupOpts)})
|
||||
|
|
|
|||
|
|
@ -7,66 +7,107 @@
|
|||
inherit (builtins) toJSON;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetExprBinding mkSetLuaBinding pushDownDefault;
|
||||
inherit (lib.nvim.binds) mkKeymap pushDownDefault;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.git.gitsigns;
|
||||
|
||||
gsMappingDefinitions = options.vim.git.gitsigns.mappings;
|
||||
|
||||
gsMappings = addDescriptionsToMappings cfg.mappings gsMappingDefinitions;
|
||||
inherit (options.vim.git.gitsigns) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
vim = {
|
||||
startPlugins = ["gitsigns-nvim"];
|
||||
|
||||
maps = {
|
||||
normal = mkMerge [
|
||||
(mkSetExprBinding gsMappings.nextHunk ''
|
||||
keymaps = [
|
||||
(mkKeymap "n" cfg.mappings.nextHunk ''
|
||||
function()
|
||||
if vim.wo.diff then return ${toJSON gsMappings.nextHunk.value} end
|
||||
if vim.wo.diff then return ${toJSON cfg.mappings.nextHunk} end
|
||||
|
||||
vim.schedule(function() package.loaded.gitsigns.next_hunk() end)
|
||||
|
||||
return '<Ignore>'
|
||||
end
|
||||
'')
|
||||
'' {
|
||||
desc = mappings.nextHunk.description;
|
||||
lua = true;
|
||||
expr = true;
|
||||
})
|
||||
|
||||
(mkSetExprBinding gsMappings.previousHunk ''
|
||||
(mkKeymap "n" cfg.mappings.previousHunk ''
|
||||
function()
|
||||
if vim.wo.diff then return ${toJSON gsMappings.previousHunk.value} end
|
||||
if vim.wo.diff then return ${toJSON cfg.mappings.previousHunk} end
|
||||
|
||||
vim.schedule(function() package.loaded.gitsigns.prev_hunk() end)
|
||||
|
||||
return '<Ignore>'
|
||||
end
|
||||
'')
|
||||
'' {
|
||||
desc = mappings.previousHunk.description;
|
||||
lua = true;
|
||||
expr = true;
|
||||
})
|
||||
|
||||
(mkSetLuaBinding gsMappings.stageHunk "package.loaded.gitsigns.stage_hunk")
|
||||
(mkSetLuaBinding gsMappings.resetHunk "package.loaded.gitsigns.reset_hunk")
|
||||
(mkSetLuaBinding gsMappings.undoStageHunk "package.loaded.gitsigns.undo_stage_hunk")
|
||||
(mkKeymap "n" cfg.mappings.stageHunk "package.loaded.gitsigns.stage_hunk" {
|
||||
desc = mappings.stageHunk.description;
|
||||
lua = true;
|
||||
})
|
||||
(mkKeymap "n" cfg.mappings.resetHunk "package.loaded.gitsigns.reset_hunk" {
|
||||
desc = mappings.resetHunk.description;
|
||||
lua = true;
|
||||
})
|
||||
(mkKeymap "n" cfg.mappings.undoStageHunk "package.loaded.gitsigns.undo_stage_hunk" {
|
||||
desc = mappings.undoStageHunk.description;
|
||||
lua = true;
|
||||
})
|
||||
|
||||
(mkSetLuaBinding gsMappings.stageBuffer "package.loaded.gitsigns.stage_buffer")
|
||||
(mkSetLuaBinding gsMappings.resetBuffer "package.loaded.gitsigns.reset_buffer")
|
||||
(mkKeymap "n" cfg.mappings.stageBuffer "package.loaded.gitsigns.stage_buffer" {
|
||||
desc = mappings.stageBuffer.description;
|
||||
lua = true;
|
||||
})
|
||||
(mkKeymap "n" cfg.mappings.resetBuffer "package.loaded.gitsigns.reset_buffer" {
|
||||
desc = mappings.resetBuffer.description;
|
||||
lua = true;
|
||||
})
|
||||
|
||||
(mkSetLuaBinding gsMappings.previewHunk "package.loaded.gitsigns.preview_hunk")
|
||||
(mkKeymap "n" cfg.mappings.previewHunk "package.loaded.gitsigns.preview_hunk" {
|
||||
desc = mappings.previewHunk.description;
|
||||
lua = true;
|
||||
})
|
||||
|
||||
(mkSetLuaBinding gsMappings.blameLine "function() package.loaded.gitsigns.blame_line{full=true} end")
|
||||
(mkSetLuaBinding gsMappings.toggleBlame "package.loaded.gitsigns.toggle_current_line_blame")
|
||||
(mkKeymap "n" cfg.mappings.blameLine "function() package.loaded.gitsigns.blame_line{full=true} end" {
|
||||
desc = mappings.blameLine.description;
|
||||
lua = true;
|
||||
})
|
||||
(mkKeymap "n" cfg.mappings.toggleBlame "package.loaded.gitsigns.toggle_current_line_blame" {
|
||||
desc = mappings.toggleBlame.description;
|
||||
lua = true;
|
||||
})
|
||||
|
||||
(mkSetLuaBinding gsMappings.diffThis "package.loaded.gitsigns.diffthis")
|
||||
(mkSetLuaBinding gsMappings.diffProject "function() package.loaded.gitsigns.diffthis('~') end")
|
||||
(mkKeymap "n" cfg.mappings.diffThis "package.loaded.gitsigns.diffthis" {
|
||||
desc = mappings.diffThis.description;
|
||||
lua = true;
|
||||
})
|
||||
(mkKeymap "n" cfg.mappings.diffProject "function() package.loaded.gitsigns.diffthis('~') end" {
|
||||
desc = mappings.diffProject.description;
|
||||
lua = true;
|
||||
})
|
||||
|
||||
(mkSetLuaBinding gsMappings.toggleDeleted "package.loaded.gitsigns.toggle_deleted")
|
||||
];
|
||||
(mkKeymap "n" cfg.mappings.toggleDeleted "package.loaded.gitsigns.toggle_deleted" {
|
||||
desc = mappings.toggleDeleted.description;
|
||||
lua = true;
|
||||
})
|
||||
|
||||
visual = mkMerge [
|
||||
(mkSetLuaBinding gsMappings.stageHunk "function() package.loaded.gitsigns.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end")
|
||||
(mkSetLuaBinding gsMappings.resetHunk "function() package.loaded.gitsigns.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end")
|
||||
];
|
||||
};
|
||||
(mkKeymap "v" cfg.mappings.stageHunk "function() package.loaded.gitsigns.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end" {
|
||||
desc = mappings.stageHunk.description;
|
||||
lua = true;
|
||||
})
|
||||
(mkKeymap "v" cfg.mappings.resetHunk "function() package.loaded.gitsigns.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end" {
|
||||
desc = mappings.resetHunk.description;
|
||||
lua = true;
|
||||
})
|
||||
];
|
||||
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>h" = "+Gitsigns";
|
||||
|
|
|
|||
|
|
@ -4,15 +4,14 @@
|
|||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.binds) mkKeymap;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.lsp.nvim-docs-view;
|
||||
|
||||
mappingDefinitions = options.vim.lsp.nvim-docs-view.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
inherit (options.vim.lsp.nvim-docs-view) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
|
|
@ -23,9 +22,9 @@ in {
|
|||
require("docs-view").setup ${toLuaObject cfg.setupOpts}
|
||||
'';
|
||||
|
||||
maps.normal = mkMerge [
|
||||
(mkSetBinding mappings.viewToggle "<cmd>DocsViewToggle<CR>")
|
||||
(mkSetBinding mappings.viewUpdate "<cmd>DocsViewUpdate<CR>")
|
||||
keymaps = [
|
||||
(mkKeymap "n" cfg.mappings.viewToggle "<cmd>DocsViewToggle<CR>" {desc = mappings.viewToggle.description;})
|
||||
(mkKeymap "n" cfg.mappings.viewUpdate "<cmd>DocsViewUpdate<CR>" {desc = mappings.viewUpdate.description;})
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,22 +4,21 @@
|
|||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding;
|
||||
inherit (lib.nvim.binds) mkKeymap;
|
||||
|
||||
cfg = config.vim.lsp;
|
||||
|
||||
mappingDefinitions = options.vim.lsp.otter-nvim.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.otter-nvim.mappings mappingDefinitions;
|
||||
inherit (options.vim.lsp.otter-nvim) mappings;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.otter-nvim.enable) {
|
||||
vim = {
|
||||
startPlugins = ["otter-nvim"];
|
||||
|
||||
maps.normal = mkMerge [
|
||||
(mkSetBinding mappings.toggle "<cmd>lua require'otter'.activate()<CR>")
|
||||
keymaps = [
|
||||
(mkKeymap "n" cfg.otter-nvim.mappings.toggle "<cmd>lua require'otter'.activate()<CR>" {desc = mappings.toggle.description;})
|
||||
];
|
||||
|
||||
pluginRC.otter-nvim = entryAnywhere ''
|
||||
|
|
|
|||
|
|
@ -4,15 +4,14 @@
|
|||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding pushDownDefault;
|
||||
inherit (lib.nvim.binds) mkKeymap pushDownDefault;
|
||||
|
||||
cfg = config.vim.minimap.codewindow;
|
||||
|
||||
mappingDefinitions = options.vim.minimap.codewindow.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
inherit (options.vim.minimap.codewindow) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
|
|
@ -20,11 +19,23 @@ in {
|
|||
"codewindow-nvim"
|
||||
];
|
||||
|
||||
maps.normal = mkMerge [
|
||||
(mkSetLuaBinding mappings.open "require('codewindow').open_minimap")
|
||||
(mkSetLuaBinding mappings.close "require('codewindow').close_minimap")
|
||||
(mkSetLuaBinding mappings.toggle "require('codewindow').toggle_minimap")
|
||||
(mkSetLuaBinding mappings.toggleFocus "require('codewindow').toggle_focus")
|
||||
keymaps = [
|
||||
(mkKeymap "n" cfg.mappings.open "require('codewindow').open_minimap" {
|
||||
desc = mappings.open.description;
|
||||
lua = true;
|
||||
})
|
||||
(mkKeymap "n" cfg.mappings.close "require('codewindow').close_minimap" {
|
||||
desc = mappings.close.description;
|
||||
lua = true;
|
||||
})
|
||||
(mkKeymap "n" cfg.mappings.toggle "require('codewindow').toggle_minimap" {
|
||||
desc = mappings.toggle.description;
|
||||
lua = true;
|
||||
})
|
||||
(mkKeymap "n" cfg.mappings.toggleFocus "require('codewindow').toggle_focus" {
|
||||
desc = mappings.toggleFocus.description;
|
||||
lua = true;
|
||||
})
|
||||
];
|
||||
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
|
|
|
|||
|
|
@ -4,8 +4,9 @@
|
|||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkMerge mkIf;
|
||||
inherit (lib.nvim.binds) mkBinding;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.lists) optional;
|
||||
inherit (lib.nvim.binds) mkKeymap;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.notes.todo-comments;
|
||||
|
|
@ -17,11 +18,18 @@ in {
|
|||
"todo-comments-nvim"
|
||||
];
|
||||
|
||||
maps.normal = mkMerge [
|
||||
(mkBinding cfg.mappings.quickFix ":TodoQuickFix<CR>" mappings.quickFix.description)
|
||||
(mkIf config.vim.telescope.enable (mkBinding cfg.mappings.telescope ":TodoTelescope<CR>" mappings.telescope.description))
|
||||
(mkIf config.vim.lsp.trouble.enable (mkBinding cfg.mappings.trouble ":TodoTrouble<CR>" mappings.trouble.description))
|
||||
];
|
||||
keymaps =
|
||||
[
|
||||
(mkKeymap "n" cfg.mappings.quickFix ":TodoQuickFix<CR>" {desc = mappings.quickFix.description;})
|
||||
]
|
||||
++ (
|
||||
optional config.vim.telescope.enable
|
||||
(mkKeymap "n" cfg.mappings.telescope ":TodoTelescope<CR>" {desc = mappings.telescope.description;})
|
||||
)
|
||||
++ (
|
||||
optional config.vim.lsp.trouble.enable
|
||||
(mkKeymap "n" cfg.mappings.trouble ":TodoTrouble<CR>" {desc = mappings.trouble.description;})
|
||||
);
|
||||
|
||||
pluginRC.todo-comments = ''
|
||||
require('todo-comments').setup(${toLuaObject cfg.setupOpts})
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.lists) optionals;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.binds) mkBinding;
|
||||
inherit (lib.nvim.binds) mkKeymap;
|
||||
|
||||
cfg = config.vim.session.nvim-session-manager;
|
||||
in {
|
||||
|
|
@ -20,12 +20,11 @@ in {
|
|||
]
|
||||
++ optionals cfg.usePicker ["dressing-nvim"];
|
||||
|
||||
maps.normal = mkMerge [
|
||||
(mkBinding cfg.mappings.loadSession ":SessionManager load_session<CR>" "Load session")
|
||||
(mkBinding cfg.mappings.deleteSession ":SessionManager delete_session<CR>" "Delete session")
|
||||
(mkBinding cfg.mappings.saveCurrentSession ":SessionManager save_current_session<CR>" "Save current session")
|
||||
(mkBinding cfg.mappings.loadLastSession ":SessionManager load_last_session<CR>" "Load last session")
|
||||
# TODO: load_current_dir_session
|
||||
keymaps = [
|
||||
(mkKeymap "n" cfg.mappings.loadSession ":SessionManager load_session<CR>" {desc = "Load session";})
|
||||
(mkKeymap "n" cfg.mappings.deleteSession ":SessionManager delete_session<CR>" {desc = "Delete session";})
|
||||
(mkKeymap "n" cfg.mappings.saveCurrentSession ":SessionManager save_current_session<CR>" {desc = "Save current session";})
|
||||
(mkKeymap "n" cfg.mappings.loadLastSession ":SessionManager load_last_session<CR>" {desc = "Load last session";})
|
||||
];
|
||||
|
||||
pluginRC.nvim-session-manager = entryAnywhere ''
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.binds) mkLuaBinding mkBinding pushDownDefault;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.binds) mkKeymap pushDownDefault;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
|
|
@ -29,30 +29,30 @@ in {
|
|||
mousemoveevent = true;
|
||||
};
|
||||
|
||||
maps.normal = mkMerge [
|
||||
keymaps = [
|
||||
(
|
||||
mkLuaBinding cfg.mappings.closeCurrent "require(\"bufdelete\").bufdelete"
|
||||
mappings.closeCurrent.description
|
||||
mkKeymap "n" cfg.mappings.closeCurrent "require('bufdelete').bufdelete"
|
||||
{
|
||||
desc = mappings.closeCurrent.description;
|
||||
lua = true;
|
||||
}
|
||||
)
|
||||
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
||||
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
||||
(mkBinding cfg.mappings.cyclePrevious ":BufferLineCyclePrev<CR>" mappings.cyclePrevious.description)
|
||||
(mkBinding cfg.mappings.pick ":BufferLinePick<CR>" mappings.pick.description)
|
||||
(mkKeymap "n" cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" {desc = mappings.cycleNext.description;})
|
||||
(mkKeymap "n" cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" {desc = mappings.cycleNext.description;})
|
||||
(mkKeymap "n" cfg.mappings.cyclePrevious ":BufferLineCyclePrev<CR>" {desc = mappings.cyclePrevious.description;})
|
||||
(mkKeymap "n" cfg.mappings.pick ":BufferLinePick<CR>" {desc = mappings.pick.description;})
|
||||
(mkKeymap "n" cfg.mappings.sortByExtension ":BufferLineSortByExtension<CR>" {desc = mappings.sortByExtension.description;})
|
||||
(mkKeymap "n" cfg.mappings.sortByDirectory ":BufferLineSortByDirectory<CR>" {desc = mappings.sortByDirectory.description;})
|
||||
(
|
||||
mkBinding cfg.mappings.sortByExtension ":BufferLineSortByExtension<CR>"
|
||||
mappings.sortByExtension.description
|
||||
mkKeymap "n" cfg.mappings.sortById
|
||||
"function() require('bufferline').sort_buffers_by(function (buf_a, buf_b) return buf_a.id < buf_b.id end) end"
|
||||
{
|
||||
desc = mappings.sortById.description;
|
||||
lua = true;
|
||||
}
|
||||
)
|
||||
(
|
||||
mkBinding cfg.mappings.sortByDirectory ":BufferLineSortByDirectory<CR>"
|
||||
mappings.sortByDirectory.description
|
||||
)
|
||||
(
|
||||
mkLuaBinding cfg.mappings.sortById
|
||||
"function() require(\"bufferline\").sort_buffers_by(function (buf_a, buf_b) return buf_a.id < buf_b.id end) end"
|
||||
mappings.sortById.description
|
||||
)
|
||||
(mkBinding cfg.mappings.moveNext ":BufferLineMoveNext<CR>" mappings.moveNext.description)
|
||||
(mkBinding cfg.mappings.movePrevious ":BufferLineMovePrev<CR>" mappings.movePrevious.description)
|
||||
(mkKeymap "n" cfg.mappings.moveNext ":BufferLineMoveNext<CR>" {desc = mappings.moveNext.description;})
|
||||
(mkKeymap "n" cfg.mappings.movePrevious ":BufferLineMovePrev<CR>" {desc = mappings.movePrevious.description;})
|
||||
];
|
||||
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
|
|
|
|||
|
|
@ -4,26 +4,33 @@
|
|||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.lists) optional;
|
||||
inherit (lib.nvim.binds) mkKeymap;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.gestures.gesture-nvim;
|
||||
|
||||
mappingDefinitions = options.vim.gestures.gesture-nvim.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
inherit (options.vim.gestures.gesture-nvim) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["gesture-nvim"];
|
||||
|
||||
maps.normal = mkMerge [
|
||||
(mkSetLuaBinding mappings.draw "require('gesture').draw")
|
||||
(mkSetLuaBinding mappings.finish "require('gesture').finish")
|
||||
(mkIf (mappings.draw.value == "<RightDrag>") {
|
||||
"<RightMouse>" = {action = "<Nop>";};
|
||||
})
|
||||
];
|
||||
keymaps =
|
||||
[
|
||||
(mkKeymap "n" cfg.mappings.draw "require('gesture').draw" {
|
||||
desc = mappings.draw.description;
|
||||
lua = true;
|
||||
})
|
||||
(mkKeymap "n" cfg.mappings.finish "require('gesture').finish" {
|
||||
desc = mappings.finish.description;
|
||||
lua = true;
|
||||
})
|
||||
]
|
||||
++ optional
|
||||
(cfg.mappings.draw == "<RightDrag>")
|
||||
(mkKeymap "n" "<RightMouse>" "<Nop>" {desc = "Disable right mouse";});
|
||||
|
||||
options.mouse = "a";
|
||||
pluginRC.gesture-nvim = entryAnywhere ''
|
||||
|
|
|
|||
|
|
@ -5,20 +5,21 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding;
|
||||
inherit (lib.nvim.binds) mkKeymap;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.utility.motion.hop;
|
||||
|
||||
mappingDefinitions = options.vim.utility.motion.hop.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
inherit (options.vim.utility.motion.hop) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = ["hop.nvim"];
|
||||
config.vim = mkIf cfg.enable {
|
||||
startPlugins = ["hop.nvim"];
|
||||
|
||||
vim.maps.normal = mkSetBinding mappings.hop "<cmd> HopPattern<CR>";
|
||||
keymaps = [
|
||||
(mkKeymap "n" cfg.mappings.hop "<cmd>HopPattern<CR>" {desc = mappings.hop.description;})
|
||||
];
|
||||
|
||||
vim.pluginRC.hop-nvim = entryAnywhere ''
|
||||
pluginRC.hop-nvim = entryAnywhere ''
|
||||
require('hop').setup()
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,25 +5,25 @@
|
|||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.binds) mkBinding pushDownDefault;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.binds) mkKeymap pushDownDefault;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.utility.preview.glow;
|
||||
inherit (options.vim.utility.preview.glow) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = ["glow-nvim"];
|
||||
config.vim = mkIf cfg.enable {
|
||||
startPlugins = ["glow-nvim"];
|
||||
|
||||
vim.maps.normal = mkMerge [
|
||||
(mkBinding cfg.mappings.openPreview ":Glow<CR>" mappings.openPreview.description)
|
||||
keymaps = [
|
||||
(mkKeymap "n" cfg.mappings.openPreview ":Glow<CR>" {desc = mappings.openPreview.description;})
|
||||
];
|
||||
|
||||
vim.binds.whichKey.register = pushDownDefault {
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>pm" = "+Preview Markdown";
|
||||
};
|
||||
|
||||
vim.pluginRC.glow = entryAnywhere ''
|
||||
pluginRC.glow = entryAnywhere ''
|
||||
require('glow').setup({
|
||||
glow_path = "${pkgs.glow}/bin/glow"
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere entryAfter;
|
||||
inherit (lib.nvim.binds) mkBinding;
|
||||
inherit (lib.nvim.binds) mkKeymap;
|
||||
|
||||
cfg = config.vim.visuals.cellular-automaton;
|
||||
in {
|
||||
|
|
@ -15,7 +15,9 @@ in {
|
|||
vim = {
|
||||
startPlugins = ["cellular-automaton-nvim"];
|
||||
|
||||
maps.normal = mkBinding cfg.mappings.makeItRain "<cmd>CellularAutomaton make_it_rain<CR>" "Make it rain";
|
||||
keymaps = [
|
||||
(mkKeymap "n" cfg.mappings.makeItRain "<cmd>CellularAutomaton make_it_rain<CR>" {desc = "Make it rain";})
|
||||
];
|
||||
|
||||
pluginRC = {
|
||||
# XXX: This has no error handling. User can set
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue