mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-15 06:43:52 +00:00
Merge pull request #1450 from alfarelcynthesis/no-default-mappings-option
treewide: allow disabling nvf mappings
This commit is contained in:
parent
63d5d8b2d4
commit
3ab2d5d876
52 changed files with 489 additions and 622 deletions
|
|
@ -214,24 +214,31 @@ in {
|
|||
on_attach = function(client, bufnr)
|
||||
default_on_attach(client, bufnr)
|
||||
local opts = { noremap=true, silent=true, buffer = bufnr }
|
||||
vim.keymap.set("n", "<localleader>rr", ":RustLsp runnables<CR>", opts)
|
||||
vim.keymap.set("n", "<localleader>rp", ":RustLsp parentModule<CR>", opts)
|
||||
vim.keymap.set("n", "<localleader>rm", ":RustLsp expandMacro<CR>", opts)
|
||||
vim.keymap.set("n", "<localleader>rc", ":RustLsp openCargo", opts)
|
||||
vim.keymap.set("n", "<localleader>rg", ":RustLsp crateGraph x11", opts)
|
||||
${optionalString cfg.dap.enable ''
|
||||
|
||||
${optionalString config.vim.vendoredKeymaps.enable ''
|
||||
vim.keymap.set("n", "<localleader>rr", ":RustLsp runnables<CR>", opts)
|
||||
vim.keymap.set("n", "<localleader>rp", ":RustLsp parentModule<CR>", opts)
|
||||
vim.keymap.set("n", "<localleader>rm", ":RustLsp expandMacro<CR>", opts)
|
||||
vim.keymap.set("n", "<localleader>rc", ":RustLsp openCargo", opts)
|
||||
vim.keymap.set("n", "<localleader>rg", ":RustLsp crateGraph x11", opts)
|
||||
''}
|
||||
|
||||
${optionalString (cfg.dap.enable && config.vim.vendoredKeymaps.enable) ''
|
||||
vim.keymap.set("n", "<localleader>rd", ":RustLsp debuggables<cr>", opts)
|
||||
''}
|
||||
|
||||
${optionalString (cfg.dap.enable && config.vim.debugger.nvim-dap.mappings.continue != null) ''
|
||||
vim.keymap.set(
|
||||
"n", "${config.vim.debugger.nvim-dap.mappings.continue}",
|
||||
function()
|
||||
local dap = require("dap")
|
||||
if dap.status() == "" then
|
||||
vim.cmd "RustLsp debuggables"
|
||||
else
|
||||
dap.continue()
|
||||
end
|
||||
end,
|
||||
opts
|
||||
"n", "${config.vim.debugger.nvim-dap.mappings.continue}",
|
||||
function()
|
||||
local dap = require("dap")
|
||||
if dap.status() == "" then
|
||||
vim.cmd "RustLsp debuggables"
|
||||
else
|
||||
dap.continue()
|
||||
end
|
||||
end,
|
||||
opts
|
||||
)
|
||||
''}
|
||||
end
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
}: let
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.types) mkGrammarOption luaInline;
|
||||
inherit (lib.options) mkOption mkEnableOption mkPackageOption literalExpression;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.types) attrsOf anything bool;
|
||||
inherit (config.vim.lib) mkMappingOption;
|
||||
|
||||
listCommandsAction =
|
||||
if config.vim.telescope.enable
|
||||
|
|
@ -117,7 +117,9 @@ in {
|
|||
|
||||
local attach_metals_keymaps = function(client, bufnr)
|
||||
attach_keymaps(client, bufnr) -- from lsp-setup
|
||||
${optionalString (cfg.lsp.extraMappings.listCommands != null) ''
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '${cfg.lsp.extraMappings.listCommands}', '<cmd>lua ${listCommandsAction}<CR>', {noremap=true, silent=true, desc='Show all Metals commands'})
|
||||
''}
|
||||
end
|
||||
|
||||
metals_config = require('metals').bare_config()
|
||||
|
|
|
|||
|
|
@ -13,8 +13,9 @@
|
|||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.nvim.binds) mkKeymap mkMappingOption;
|
||||
inherit (lib.nvim.binds) mkKeymap;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (config.vim.lib) mkMappingOption;
|
||||
|
||||
cfg = config.vim.languages.typst;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue