From 28da68ac5ca451a1f882ecc1eb720295e8c8fd51 Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Thu, 5 Jan 2023 08:59:09 -0800 Subject: [PATCH] feat: option to disable all default keymaps (#16) --- lua/oil/config.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/oil/config.lua b/lua/oil/config.lua index 19fff9b..0d837eb 100644 --- a/lua/oil/config.lua +++ b/lua/oil/config.lua @@ -41,6 +41,8 @@ local default_config = { ["~"] = "actions.tcd", ["g."] = "actions.toggle_hidden", }, + -- Set to false to disable all of the above keymaps + use_default_keymaps = true, view_options = { -- Show files and directories that start with "." show_hidden = false, @@ -71,6 +73,9 @@ local M = {} M.setup = function(opts) local new_conf = vim.tbl_deep_extend("keep", opts or {}, default_config) + if not new_conf.use_default_keymaps then + new_conf.keymaps = opts.keymaps + end for k, v in pairs(new_conf) do M[k] = v