summaryrefslogtreecommitdiff
path: root/plugin/plugins/oil.lua
diff options
context:
space:
mode:
authorMohammad Reza Karimi <m.r.karimi.j@gmail.com>2026-01-20 15:55:27 -0500
committerMohammad Reza Karimi <m.r.karimi.j@gmail.com>2026-01-20 15:55:27 -0500
commitaa5717f00fd14430c80939a68d7107c26de6e554 (patch)
tree784e99d9b018e0554369c41cb33e2e195e28d3c6 /plugin/plugins/oil.lua
first commit
Diffstat (limited to 'plugin/plugins/oil.lua')
-rw-r--r--plugin/plugins/oil.lua76
1 files changed, 76 insertions, 0 deletions
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" },
+ ["<CR>"] = "actions.select",
+ ["<M-s>"] = { "actions.select", opts = { vertical = true } },
+ ["<M-h>"] = { "actions.select", opts = { horizontal = true } },
+ ["<M-t>"] = { "actions.select", opts = { tab = true } },
+ ["<C-p>"] = false,
+ ["<C-c>"] = { "actions.close", mode = "n" },
+ ["<C-l>"] = "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",
+ ["<Leader>Y"] = require("mo.oil-util").copy_to_clipboard,
+ ["<Leader>y"] = function() require("mo.oil-util").copy_to_clipboard({ full_path = false }) end,
+ ["<Leader>:"] = {
+ "actions.open_cmdline",
+ opts = { shorten_path = true, modify = ":h" },
+ },
+ ["<Leader>;"] = {
+ "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]])