aboutsummaryrefslogtreecommitdiffstats
path: root/nvim/lua/plugins/oil.lua
blob: 890e05d99e1880282310303d725f0c883be0c807 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
return {
    'stevearc/oil.nvim',
    lazy = false,
    dependencies = 'nvim-tree/nvim-web-devicons',
    opts = {
        default_file_explorer = true,
    },
    keys = { {
        "<leader>ef",
        function()
            local filetype = vim.o.ft
            if filetype == "oil" then
                vim.cmd('q')
            else
                vim.cmd('topleft vsplit +Oil')
            end
            -- TODO: check for other open oil instances
        end,
        desc = "Open Oil file explorer in a far left split, similar to :Lexplore"
    } },
    cmd = "Oil"
}