Files
dotfiles/nvim/lua/plugins/neotree.lua

50 lines
1.1 KiB
Lua

vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
return {
'nvim-neo-tree/neo-tree.nvim',
version = '*',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
'MunifTanjim/nui.nvim',
},
cmd = 'Neotree',
keys = {
{ '<leader>e', ':Neotree reveal action=focus toggle=true<CR>', silent=true }
},
init = function()
if vim.fn.argc(-1) == 1 then
local stat = vim.loop.fs_stat(vim.fn.argv(0))
if stat and stat.type == "directory" then
require("neo-tree")
end
end
end,
opts = {
close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab
filesystem = {
filtered_items = {
hide_dotfiles = false,
hide_gitignored = false,
hide_by_name = {
'.git',
},
never_show = {
'__pycache__',
'.DS_Store',
},
},
use_libuv_file_watcher = true,
window = {
mappings = {
['\\'] = 'close_window',
['P'] = 'toggle_preview',
},
},
},
},
}