2024-07-03 10:37:53 +00:00
|
|
|
-- Fix oil absolute path to relative path conversion
|
|
|
|
vim.api.nvim_create_augroup('OilRelPathFix', {})
|
|
|
|
vim.api.nvim_create_autocmd('BufLeave', {
|
|
|
|
group = 'OilRelPathFix',
|
|
|
|
pattern = 'oil:///*',
|
|
|
|
callback = function()
|
|
|
|
vim.cmd 'cd .'
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
2024-05-20 14:30:34 +00:00
|
|
|
return {
|
2024-08-01 09:29:28 +00:00
|
|
|
{
|
|
|
|
'stevearc/oil.nvim',
|
|
|
|
-- Optional dependencies
|
|
|
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
|
|
|
config = function()
|
|
|
|
local oil = require 'oil'
|
|
|
|
oil.setup {
|
|
|
|
view_options = {
|
|
|
|
show_hidden = true,
|
|
|
|
},
|
|
|
|
}
|
2024-08-01 08:58:47 +00:00
|
|
|
|
2024-08-01 09:29:28 +00:00
|
|
|
vim.keymap.set('n', '<leader>fe', function()
|
|
|
|
if vim.bo.filetype == 'oil' then
|
|
|
|
oil.close()
|
|
|
|
else
|
|
|
|
oil.open()
|
|
|
|
end
|
|
|
|
end, { desc = '[F]ile [E]xplorer' })
|
|
|
|
end,
|
|
|
|
},
|
2024-05-20 14:30:34 +00:00
|
|
|
}
|