From aa5717f00fd14430c80939a68d7107c26de6e554 Mon Sep 17 00:00:00 2001 From: Mohammad Reza Karimi Date: Tue, 20 Jan 2026 15:55:27 -0500 Subject: first commit --- plugin/plugins/oil.lua | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 plugin/plugins/oil.lua (limited to 'plugin/plugins/oil.lua') diff --git a/plugin/plugins/oil.lua b/plugin/plugins/oil.lua new file mode 100644 index 0000000..edb3c50 --- /dev/null +++ b/plugin/plugins/oil.lua @@ -0,0 +1,76 @@ +require("oil").setup({ + default_file_explorer = true, + columns = { + "permissions", + "size", + -- "mtime", + }, + buf_options = { + buflisted = false, + bufhidden = "hide", + }, + win_options = { + wrap = false, + signcolumn = "no", + cursorcolumn = false, + foldcolumn = "0", + spell = false, + list = false, + conceallevel = 3, + concealcursor = "nvic", + }, + delete_to_trash = false, + skip_confirm_for_simple_edits = false, + prompt_save_on_select_new_entry = true, + cleanup_delay_ms = 2000, + lsp_file_methods = { + enabled = true, + timeout_ms = 1000, + autosave_changes = false, + }, + constrain_cursor = "editable", + watch_for_changes = false, + keymaps = { + ["g?"] = { "actions.show_help", mode = "n" }, + [""] = "actions.select", + [""] = { "actions.select", opts = { vertical = true } }, + [""] = { "actions.select", opts = { horizontal = true } }, + [""] = { "actions.select", opts = { tab = true } }, + [""] = false, + [""] = { "actions.close", mode = "n" }, + [""] = "actions.refresh", + ["-"] = { "actions.parent", mode = "n" }, + ["_"] = { "actions.open_cwd", mode = "n" }, + ["`"] = { "actions.cd", mode = "n" }, + ["g~"] = { "actions.cd", opts = { scope = "tab" }, mode = "n" }, + ["gs"] = false, + ["gx"] = "actions.open_external", + ["zh"] = { "actions.toggle_hidden", mode = "n" }, + ["gt"] = "actions.open_terminal", + ["Y"] = require("mo.oil-util").copy_to_clipboard, + ["y"] = function() require("mo.oil-util").copy_to_clipboard({ full_path = false }) end, + [":"] = { + "actions.open_cmdline", + opts = { shorten_path = true, modify = ":h" }, + }, + [";"] = { + "actions.open_cmdline", + opts = { shorten_path = true }, + }, + }, + use_default_keymaps = false, + view_options = { + show_hidden = false, + is_hidden_file = function(name, _bufnr) + local m = name:match("^%.") + return m ~= nil + end, + is_always_hidden = function(_name, _bufnr) return false end, + natural_order = "fast", + case_insensitive = false, + sort = { + { "type", "asc" }, + { "name", "asc" }, + }, + }, +} --[[@as oil.SetupOpts]]) -- cgit v1.2.3-71-gdd5e