2023-01-22 16:45:30 +01:00
|
|
|
local M = {
|
|
|
|
'stevearc/oil.nvim',
|
|
|
|
-- lazy = false,
|
|
|
|
event = 'Syntax',
|
|
|
|
}
|
|
|
|
|
|
|
|
function M.config()
|
|
|
|
require('oil').setup {
|
|
|
|
-- Id is automatically added at the beginning, and name at the end
|
|
|
|
-- See :help oil-columns
|
|
|
|
columns = {
|
|
|
|
'icon',
|
|
|
|
-- "permissions",
|
|
|
|
-- "size",
|
|
|
|
-- "mtime",
|
|
|
|
},
|
|
|
|
-- Buffer-local options to use for oil buffers
|
|
|
|
buf_options = {},
|
|
|
|
-- Window-local options to use for oil buffers
|
|
|
|
win_options = {
|
|
|
|
wrap = false,
|
|
|
|
signcolumn = 'no',
|
|
|
|
cursorcolumn = false,
|
|
|
|
foldcolumn = '0',
|
|
|
|
spell = false,
|
|
|
|
list = false,
|
|
|
|
conceallevel = 3,
|
|
|
|
concealcursor = 'n',
|
|
|
|
},
|
|
|
|
-- Restore window options to previous values when leaving an oil buffer
|
|
|
|
restore_win_options = true,
|
|
|
|
-- Skip the confirmation popup for simple operations
|
|
|
|
skip_confirm_for_simple_edits = false,
|
|
|
|
-- 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 = "", nowait = true })
|
|
|
|
-- 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
|
|
|
|
keymaps = {
|
|
|
|
['g?'] = 'actions.show_help',
|
|
|
|
['<CR>'] = 'actions.select',
|
|
|
|
['<C-s>'] = 'actions.select_vsplit',
|
|
|
|
['<C-h>'] = 'actions.select_split',
|
|
|
|
['<C-p>'] = 'actions.preview',
|
2023-01-23 18:57:05 +01:00
|
|
|
['<TAB>'] = 'actions.preview',
|
2023-01-22 16:45:30 +01:00
|
|
|
['<C-c>'] = 'actions.close',
|
|
|
|
['q'] = 'actions.close',
|
|
|
|
['<C-l>'] = 'actions.refresh',
|
|
|
|
['-'] = 'actions.parent',
|
2023-01-23 18:57:05 +01:00
|
|
|
['l'] = 'actions.parent',
|
2023-01-22 16:45:30 +01:00
|
|
|
['_'] = 'actions.open_cwd',
|
|
|
|
['`'] = 'actions.cd',
|
|
|
|
['~'] = 'actions.tcd',
|
|
|
|
['g.'] = 'actions.toggle_hidden',
|
|
|
|
},
|
|
|
|
-- Set to false to disable all of the above keymaps
|
|
|
|
use_default_keymaps = true,
|
|
|
|
view_options = {
|
|
|
|
-- Show files and directories that start with "."
|
|
|
|
show_hidden = false,
|
|
|
|
},
|
|
|
|
-- Configuration for the floating window in oil.open_float
|
|
|
|
float = {
|
|
|
|
-- Padding around the floating window
|
|
|
|
padding = 2,
|
|
|
|
max_width = 0,
|
|
|
|
max_height = 0,
|
|
|
|
border = 'rounded',
|
|
|
|
win_options = {
|
|
|
|
winblend = 10,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
return M
|