From a04b460ef240023f00fa947c658333cb9d6568b3 Mon Sep 17 00:00:00 2001 From: soapant Date: Mon, 14 Sep 2026 20:36:32 +0300 Subject: [PATCH] add: option to disable every confirmation --- README.md | 3 +++ doc/oil.txt | 8 ++++++++ lua/oil/config.lua | 4 ++++ lua/oil/mutator/confirmation.lua | 4 ++++ scripts/generate.py | 5 +++++ 5 files changed, 24 insertions(+) diff --git a/README.md b/README.md index 89f220bd..83f0902b 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,9 @@ require("oil").setup({ delete_to_trash = false, -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits) skip_confirm_for_simple_edits = false, + -- Or + skip_every_confirm = false, + -- To True To Skip Every Confirmation -- Selecting a new/moved/renamed file or directory will prompt you to save changes first -- (:help prompt_save_on_select_new_entry) prompt_save_on_select_new_entry = true, diff --git a/doc/oil.txt b/doc/oil.txt index bf2dc71f..9bc0517a 100644 --- a/doc/oil.txt +++ b/doc/oil.txt @@ -47,6 +47,9 @@ CONFIG *oil-confi delete_to_trash = false, -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits) skip_confirm_for_simple_edits = false, + -- Or + -- skip_every_confirm = true, + -- To Skip Every Confirmation -- Selecting a new/moved/renamed file or directory will prompt you to save changes first -- (:help prompt_save_on_select_new_entry) prompt_save_on_select_new_entry = true, @@ -235,6 +238,11 @@ skip_confirm_for_simple_edits *oil.skip_confirm_for_simple_edit * contain at most one copy or move * contain at most five creates +skip_every_confirm *oil.skip_every_confirm* + type: `boolean` default: `false` + Before performing filesystem operations, Oil displays a confirmation popup to ensure + that all operations are intentional. When this option is `true`, every confirmation popup will be skipped + prompt_save_on_select_new_entry *oil.prompt_save_on_select_new_entry* type: `boolean` default: `true` There are two cases where this option is relevant: diff --git a/lua/oil/config.lua b/lua/oil/config.lua index cafa783f..1e2c54b9 100644 --- a/lua/oil/config.lua +++ b/lua/oil/config.lua @@ -30,6 +30,8 @@ local default_config = { delete_to_trash = false, -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits) skip_confirm_for_simple_edits = false, + -- Skip every confirmation (:help oil.skip_every_confirm) + skip_every_confirm = false, -- Selecting a new/moved/renamed file or directory will prompt you to save changes first -- (:help prompt_save_on_select_new_entry) prompt_save_on_select_new_entry = true, @@ -231,6 +233,7 @@ default_config.view_options.highlight_filename = nil ---@field win_options table ---@field delete_to_trash boolean ---@field skip_confirm_for_simple_edits boolean +---@field skip_every_confirm boolean ---@field prompt_save_on_select_new_entry boolean ---@field cleanup_delay_ms integer ---@field lsp_file_methods oil.LspFileMethods @@ -260,6 +263,7 @@ local M = {} ---@field win_options? table Window-local options to use for oil buffers ---@field delete_to_trash? boolean Send deleted files to the trash instead of permanently deleting them (:help oil-trash). ---@field skip_confirm_for_simple_edits? boolean Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits). +---@field skip_every_confirm ? boolean Skip the confirmation popup for every operation (:help oil.skip_every_confirm). ---@field prompt_save_on_select_new_entry? boolean Selecting a new/moved/renamed file or directory will prompt you to save changes first (:help prompt_save_on_select_new_entry). ---@field cleanup_delay_ms? integer Oil will automatically delete hidden buffers after this delay. You can set the delay to false to disable cleanup entirely. Note that the cleanup process only starts when none of the oil buffers are currently displayed. ---@field lsp_file_methods? oil.SetupLspFileMethods Configure LSP file operation integration. diff --git a/lua/oil/mutator/confirmation.lua b/lua/oil/mutator/confirmation.lua index 8bc80203..35a80689 100644 --- a/lua/oil/mutator/confirmation.lua +++ b/lua/oil/mutator/confirmation.lua @@ -63,6 +63,10 @@ M.show = vim.schedule_wrap(function(actions, should_confirm, cb) cb(true) return end + if should_confirm == nil and config.skip_every_confirm then + cb(true) + return + end if should_confirm == nil and config.skip_confirm_for_simple_edits and is_simple_edit(actions) then cb(true) return diff --git a/scripts/generate.py b/scripts/generate.py index adcab9e0..e85260b2 100755 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -210,6 +210,11 @@ def get_options_detail_vimdoc() -> "VimdocSection": * contain at most one copy or move * contain at most five creates +skip_every_confirm *oil.skip_every_confirm* + type: `boolean` default: `false` + Before performing filesystem operations, Oil displays a confirmation popup to ensure + that all operations are intentional. When this option is `true`, every confirmation popup will be skipped + prompt_save_on_select_new_entry *oil.prompt_save_on_select_new_entry* type: `boolean` default: `true` There are two cases where this option is relevant: