my dotfiles for arch
1return {
2 "stevearc/oil.nvim",
3 ---@module 'oil'
4 ---@type oil.SetupOpts
5 opts = {
6 -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`)
7 -- Set to false if you want some other plugin (e.g. netrw) to open when you edit directories.
8 default_file_explorer = true,
9 -- Id is automatically added at the beginning, and name at the end
10 -- See :help oil-columns
11 columns = {
12 "icon",
13 -- "permissions",
14 -- "size",
15 -- "mtime",
16 },
17 -- Buffer-local options to use for oil buffers
18 buf_options = {
19 buflisted = false,
20 bufhidden = "hide",
21 },
22 -- Window-local options to use for oil buffers
23 win_options = {
24 wrap = false,
25 signcolumn = "no",
26 cursorcolumn = false,
27 foldcolumn = "0",
28 spell = false,
29 list = false,
30 conceallevel = 3,
31 concealcursor = "nvic",
32 },
33 -- Send deleted files to the trash instead of permanently deleting them (:help oil-trash)
34 delete_to_trash = false,
35 -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits)
36 skip_confirm_for_simple_edits = false,
37 -- Selecting a new/moved/renamed file or directory will prompt you to save changes first
38 -- (:help prompt_save_on_select_new_entry)
39 prompt_save_on_select_new_entry = true,
40 -- Oil will automatically delete hidden buffers after this delay
41 -- You can set the delay to false to disable cleanup entirely
42 -- Note that the cleanup process only starts when none of the oil buffers are currently displayed
43 cleanup_delay_ms = 2000,
44 lsp_file_methods = {
45 -- Enable or disable LSP file operations
46 enabled = true,
47 -- Time to wait for LSP file operations to complete before skipping
48 timeout_ms = 1000,
49 -- Set to true to autosave buffers that are updated with LSP willRenameFiles
50 -- Set to "unmodified" to only save unmodified buffers
51 autosave_changes = false,
52 },
53 -- Constrain the cursor to the editable parts of the oil buffer
54 -- Set to `false` to disable, or "name" to keep it on the file names
55 constrain_cursor = "editable",
56 -- Set to true to watch the filesystem for changes and reload oil
57 watch_for_changes = true,
58 -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
59 -- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" })
60 -- Additionally, if it is a string that matches "actions.<name>",
61 -- it will use the mapping at require("oil.actions").<name>
62 -- Set to `false` to remove a keymap
63 -- See :help oil-actions for a list of all available actions
64 keymaps = {
65 ["g?"] = "actions.show_help",
66 ["<CR>"] = "actions.select",
67 ["<C-s>"] = { "actions.select", opts = { vertical = true }, desc = "Open the entry in a vertical split" },
68 ["<C-h>"] = {
69 "actions.select",
70 opts = { horizontal = true },
71 desc = "Open the entry in a horizontal split",
72 },
73 ["<C-t>"] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" },
74 ["<C-p>"] = "actions.preview",
75 ["<C-c>"] = "actions.close",
76 ["<C-l>"] = "actions.refresh",
77 ["-"] = "actions.parent",
78 ["_"] = "actions.open_cwd",
79 ["`"] = "actions.cd",
80 ["~"] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory", mode = "n" },
81 ["gs"] = "actions.change_sort",
82 ["gx"] = "actions.open_external",
83 ["g."] = "actions.toggle_hidden",
84 ["g\\"] = "actions.toggle_trash",
85 ["<C-q>"] = "actions.send_to_qflist",
86 },
87 -- Set to false to disable all of the above keymaps
88 use_default_keymaps = true,
89 view_options = {
90 -- Show files and directories that start with "."
91 show_hidden = true,
92 -- This function defines what is considered a "hidden" file
93 is_hidden_file = function(name, bufnr)
94 local m = name:match("^%.")
95 return m ~= nil
96 end,
97 -- This function defines what will never be shown, even when `show_hidden` is set
98 is_always_hidden = function(name, bufnr)
99 return false
100 end,
101 -- Sort file names with numbers in a more intuitive order for humans.
102 -- Can be "fast", true, or false. "fast" will turn it off for large directories.
103 natural_order = "fast",
104 -- Sort file and directory names case insensitive
105 case_insensitive = false,
106 sort = {
107 -- sort order can be "asc" or "desc"
108 -- see :help oil-columns to see which columns are sortable
109 { "type", "asc" },
110 { "name", "asc" },
111 },
112 },
113 -- Extra arguments to pass to SCP when moving/copying files over SSH
114 extra_scp_args = {},
115 -- EXPERIMENTAL support for performing file operations with git
116 git = {
117 -- Return true to automatically git add/mv/rm files
118 add = function(path)
119 return false
120 end,
121 mv = function(src_path, dest_path)
122 return false
123 end,
124 rm = function(path)
125 return false
126 end,
127 },
128 -- Configuration for the floating window in oil.open_float
129 float = {
130 -- Padding around the floating window
131 padding = 2,
132 max_width = 0,
133 max_height = 0,
134 border = "rounded",
135 win_options = {
136 winblend = 0,
137 },
138 -- optionally override the oil buffers window title with custom function: fun(winid: integer): string
139 get_win_title = nil,
140 -- preview_split: Split direction: "auto", "left", "right", "above", "below".
141 preview_split = "auto",
142 -- This is the config that will be passed to nvim_open_win.
143 -- Change values here to customize the layout
144 override = function(conf)
145 return conf
146 end,
147 },
148 -- Configuration for the file preview window
149 preview_win = {
150 -- Whether the preview window is automatically updated when the cursor is moved
151 update_on_cursor_moved = true,
152 -- How to open the preview window "load"|"scratch"|"fast_scratch"
153 preview_method = "fast_scratch",
154 -- A function that returns true to disable preview on a file e.g. to avoid lag
155 disable_preview = function(filename)
156 return false
157 end,
158 -- Window-local options to use for preview window buffers
159 win_options = {},
160 },
161 -- Configuration for the floating action confirmation window
162 confirmation = {
163 -- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
164 -- min_width and max_width can be a single value or a list of mixed integer/float types.
165 -- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total"
166 max_width = 0.9,
167 -- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total"
168 min_width = { 40, 0.4 },
169 -- optionally define an integer/float for the exact width of the preview window
170 width = nil,
171 -- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
172 -- min_height and max_height can be a single value or a list of mixed integer/float types.
173 -- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total"
174 max_height = 0.9,
175 -- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total"
176 min_height = { 5, 0.1 },
177 -- optionally define an integer/float for the exact height of the preview window
178 height = nil,
179 border = "rounded",
180 win_options = {
181 winblend = 0,
182 },
183 },
184 -- Configuration for the floating progress window
185 progress = {
186 max_width = 0.9,
187 min_width = { 40, 0.4 },
188 width = nil,
189 max_height = { 10, 0.9 },
190 min_height = { 5, 0.1 },
191 height = nil,
192 border = "rounded",
193 minimized_border = "none",
194 win_options = {
195 winblend = 0,
196 },
197 },
198 -- Configuration for the floating SSH window
199 ssh = {
200 border = "rounded",
201 },
202 -- Configuration for the floating keymaps help window
203 keymaps_help = {
204 border = "rounded",
205 },
206 },
207 -- Optional dependencies
208 dependencies = { { "echasnovski/mini.icons", opts = {} } },
209 -- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if prefer nvim-web-devicons
210}