plugins.oil.settings

Options provided to the require('oil').setup function.

Type: attribute set of anything

Default: { }

Example:

{
  columns = [
    "icon"
  ];
  keymaps = {
    "<C-c>" = false;
    "<C-l>" = false;
    "<C-r>" = "actions.refresh";
    "<leader>qq" = "actions.close";
    "y." = "actions.copy_entry_path";
  };
  skip_confirm_for_simple_edits = true;
  view_options = {
    show_hidden = false;
  };
  win_options = {
    concealcursor = "ncv";
    conceallevel = 3;
    cursorcolumn = false;
    foldcolumn = "0";
    list = false;
    signcolumn = "no";
    spell = false;
    wrap = false;
  };
}

Declared by:

plugins.oil.settings.cleanup_delay_ms

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.

Plugin default: 2000

Type: null or unsigned integer, meaning >=0, or value false (singular enum)

Default: null

Declared by:

plugins.oil.settings.columns

Columns can be specified as a string to use default arguments (e.g. "icon"), or as a table to pass parameters (e.g. {"size", highlight = "Special"})

Default: ["icon"]

Type: list of (string or attribute set of anything or raw lua code)

Default: [ ]

Example:

[
  "type"
  {
    __unkeyed = "icon";
    default_file = "bar";
    directory = "dir";
    highlight = "Foo";
  }
  "size"
  "permissions"
]

Declared by:

plugins.oil.settings.constrain_cursor

Constrain the cursor to the editable parts of the oil buffer. Set to false to disable, or “name” to keep it on the file names.

Plugin default: editable

Type: null or string or value false (singular enum)

Default: null

Declared by:

plugins.oil.settings.default_file_explorer

Oil will take over directory buffers (e.g. vim . or :e src/). Set to false if you still want to use netrw.

Plugin default: true

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.oil.settings.delete_to_trash

Deleted files will be removed with the trash_command (below).

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.oil.settings.experimental_watch_for_changes

Set to true to watch the filesystem for changes and reload oil.

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.oil.settings.keymaps

Keymaps in oil buffer. Can be any value that vim.keymap.set accepts OR a table of keymap options with a callback (e.g. { callback = function() ... end, desc = "", mode = "n" }). Additionally, if it is a string that matches “actions.<name>”, it will use the mapping at require("oil.actions").<name>. Set to false to remove a keymap. See :help oil-actions for a list of all available actions.

Plugin default:

{
  "g?" = "actions.show_help";
  "<CR>" = "actions.select";
  "<C-s>" = "actions.select_vsplit";
  "<C-h>" = "actions.select_split";
  "<C-t>" = "actions.select_tab";
  "<C-p>" = "actions.preview";
  "<C-c>" = "actions.close";
  "<C-l>" = "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";
}

Type: null or (attribute set of (string or attribute set of anything or value false (singular enum) or raw lua code))

Default: null

Declared by:

plugins.oil.settings.keymaps_help

Configuration for the floating keymaps help window.

Plugin default: {border = "rounded";}

Type: null or (attribute set of (anything or raw lua code))

Default: null

Declared by:

plugins.oil.settings.prompt_save_on_select_new_entry

Selecting a new/moved/renamed file or directory will prompt you to save changes first.

Plugin default: true

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.oil.settings.skip_confirm_for_simple_edits

Skip the confirmation popup for simple operations.

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.oil.settings.use_default_keymaps

Set to false to disable all of the above keymaps.

Plugin default: true

Type: null or boolean or raw lua code

Default: null

Declared by: