aboutsummaryrefslogtreecommitdiff
path: root/mirenn/home/files/dotfiles/.config/nvim/lua/plugins/oil.lua
diff options
context:
space:
mode:
authormirenn <me@mirenn.dev>2026-09-21 23:09:33 +0200
committermirenn <me@mirenn.dev>2026-10-06 14:13:32 +0200
commit8f9c77878f8742a47d34a50748023d1b552cfbf1 (patch)
treef749dff061451ab8427100c452f8175de8e39c53 /mirenn/home/files/dotfiles/.config/nvim/lua/plugins/oil.lua
parent8501a38d7c3bbc2e99466e6658be134c72d4f47a (diff)
downloaddotfiles-8f9c77878f8742a47d34a50748023d1b552cfbf1.tar.gz
dotfiles-8f9c77878f8742a47d34a50748023d1b552cfbf1.zip
guix primer
Diffstat (limited to 'mirenn/home/files/dotfiles/.config/nvim/lua/plugins/oil.lua')
-rw-r--r--mirenn/home/files/dotfiles/.config/nvim/lua/plugins/oil.lua63
1 files changed, 63 insertions, 0 deletions
diff --git a/mirenn/home/files/dotfiles/.config/nvim/lua/plugins/oil.lua b/mirenn/home/files/dotfiles/.config/nvim/lua/plugins/oil.lua
new file mode 100644
index 0000000..0d90db2
--- /dev/null
+++ b/mirenn/home/files/dotfiles/.config/nvim/lua/plugins/oil.lua
@@ -0,0 +1,63 @@
+local init = function()
+ local keymap = vim.keymap
+ keymap.set("n", "<Space>b", ":Oil --float .<Enter>",
+ { noremap = true, silent = true, desc = "File browser (Oil)" }) -- Oil
+end
+
+local config = function()
+ local detail = false
+ require("oil").setup({
+ float = {
+ border = "rounded",
+ },
+ confirmation = {
+ border = "rounded",
+ },
+ progress = {
+ border = "rounded",
+ },
+ ssh = {
+ border = "rounded",
+ },
+ keymaps_help = {
+ border = "rounded",
+ },
+ default_file_explorer = true,
+ delete_to_trash = true,
+ skip_confirm_for_simple_edits = true,
+ keymaps = {
+ ["b?"] = "actions.show_help",
+ ["<CR>"] = "actions.select",
+ ["bp"] = "actions.preview",
+ ["q"] = "actions.close",
+ ["br"] = "actions.refresh",
+ ["-"] = "actions.parent",
+ ["_"] = "actions.open_cwd",
+ ["~"] = "actions.cd",
+ ["bs"] = "actions.change_sort",
+ ["b."] = "actions.toggle_hidden",
+ ["bt"] = "actions.toggle_trash",
+ ["bd"] = {
+ desc = "Toggle file detail view",
+ callback = function()
+ detail = not detail
+ if detail then
+ require("oil").set_columns({ "icon", "permissions", "size", "mtime" })
+ else
+ require("oil").set_columns({ "icon" })
+ end
+ end,
+ },
+ },
+ use_default_keymaps = false,
+ })
+end
+
+return {
+ "stevearc/oil.nvim",
+ dependencies = { "nvim-tree/nvim-web-devicons" },
+ lazy = true,
+ cmd = "Oil",
+ init = init,
+ config = config
+}