@@ -105,6 +105,10 @@ local default_config = {
105
105
return nil
106
106
end ,
107
107
},
108
+ -- Set the default mode to create files
109
+ new_file_mode = 644 ,
110
+ -- Set the default mode to create folders
111
+ new_folder_mode = 755 ,
108
112
-- Extra arguments to pass to SCP when moving/copying files over SSH
109
113
extra_scp_args = {},
110
114
-- EXPERIMENTAL support for performing file operations with git
@@ -232,6 +236,8 @@ default_config.view_options.highlight_filename = nil
232
236
--- @field keymaps table<string , any>
233
237
--- @field use_default_keymaps boolean
234
238
--- @field view_options oil.ViewOptions
239
+ --- @field new_file_mode integer
240
+ --- @field new_folder_mode integer
235
241
--- @field extra_scp_args string[]
236
242
--- @field git oil.GitOptions
237
243
--- @field float oil.FloatWindowConfig
@@ -260,6 +266,8 @@ local M = {}
260
266
--- @field keymaps ? table<string , any>
261
267
--- @field use_default_keymaps ? boolean Set to false to disable all of the above keymaps
262
268
--- @field view_options ? oil.SetupViewOptions Configure which files are shown and how they are shown.
269
+ --- @field new_file_mode ? integer Set the default mode to create files
270
+ --- @field new_folder_mode ? integer Set the default mode to create folders
263
271
--- @field extra_scp_args ? string[] Extra arguments to pass to SCP when moving /copying files over SSH
264
272
--- @field git ? oil.SetupGitOptions EXPERIMENTAL support for performing file operations with git
265
273
--- @field float ? oil.SetupFloatWindowConfig Configuration for the floating window in oil.open_float
@@ -408,6 +416,9 @@ M.setup = function(opts)
408
416
if opts .preview and not opts .confirmation then
409
417
new_conf .confirmation = vim .tbl_deep_extend (" keep" , opts .preview , default_config .confirmation )
410
418
end
419
+
420
+ new_conf .new_file_mode = tonumber (tostring (new_conf .new_file_mode ), 8 )
421
+ new_conf .new_folder_mode = tonumber (tostring (new_conf .new_folder_mode ), 8 )
411
422
-- Backwards compatibility. We renamed the 'preview' config to 'preview_win'
412
423
if opts .preview and opts .preview .update_on_cursor_moved ~= nil then
413
424
new_conf .preview_win .update_on_cursor_moved = opts .preview .update_on_cursor_moved
0 commit comments