-- Oil.nvim: file manipulation with buffer sync -- Handles rename/move/delete operations that would break buffer names -- Use when shell operations would cause buffer issues return { 'stevearc/oil.nvim', -- set lazy loading lazy = true, keys = { { 'fo', 'Oil', desc = 'Oil: Open file browser' }, { 'fO', 'Oil --float', desc = 'Oil: Open in floating window' }, }, opts = { -- Don't hijack netrw - allow both to coexist default_file_explorer = false, -- Columns shown in the oil buffer columns = { 'icon', -- 'permissions', -- 'size', -- 'mtime', }, -- Buffer-local options to use for oil buffers buf_options = { buflisted = false, bufhidden = 'hide', }, -- Window-local options to use for oil buffers win_options = { wrap = false, signcolumn = 'no', cursorcolumn = false, foldcolumn = '0', spell = false, list = false, conceallevel = 3, concealcursor = 'nvic', number = true, relativenumber = true, }, -- Delete to trash instead of permanently deleting delete_to_trash = false, -- Skip confirmation for simple operations skip_confirm_for_simple_edits = false, -- Prompt before deleting a directory prompt_save_on_select_new_entry = true, -- Use default keymaps (see :help oil-actions) use_default_keymaps = true, -- Set to false to disable all of the above keymaps keymaps = { ['g?'] = 'actions.show_help', [''] = 'actions.select', [''] = 'actions.select_vsplit', [''] = 'actions.select_split', [''] = 'actions.select_tab', -- Preview opens to the right via vertical split [''] = { 'actions.preview', opts = { vertical = true, split = 'belowright' }, }, [''] = 'actions.close', [''] = 'actions.refresh', ['-'] = 'actions.parent', ['_'] = 'actions.open_cwd', ['`'] = 'actions.cd', ['~'] = 'actions.tcd', ['gs'] = 'actions.change_sort', ['gx'] = 'actions.open_external', ['g.'] = 'actions.toggle_hidden', ['g\\'] = 'actions.toggle_trash', }, -- Configuration for the floating window in oil.open_float float = { -- Padding around the floating window padding = 2, max_width = 0, max_height = 0, border = 'rounded', win_options = { winblend = 0, }, -- Preview split direction for floating Oil windows preview_split = "right", }, -- Configuration for the actions floating preview window preview = { -- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) max_width = 0.9, -- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total" min_width = { 40, 0.4 }, -- optionally define an integer/float for the exact width of the preview window width = nil, -- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) max_height = 0.9, min_height = { 5, 0.1 }, height = nil, border = 'rounded', win_options = { winblend = 0, }, }, -- Preview split direction: "auto" (floating), "left", "right", "above", "below" -- This setting is deprecated; use keymap opts or float.preview_split instead -- preview_split = "right", -- Configuration for the floating progress window progress = { max_width = 0.9, min_width = { 40, 0.4 }, width = nil, max_height = { 10, 0.9 }, min_height = { 5, 0.1 }, height = nil, border = 'rounded', minimized_border = 'none', win_options = { winblend = 0, }, }, }, }