local use_google = require("utils").use_google

return {
	-- {
	-- 	"cmdtree",
	-- 	dir = "~/cmdtree",
	-- },
	{
		"nvim-neo-tree/neo-tree.nvim",
		branch = "v3.x",
		lazy = false, -- neo-tree will lazily load itself
		dependencies = {
			"nvim-lua/plenary.nvim",
			"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
			"MunifTanjim/nui.nvim",
			-- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information
		},
		-----@module "neo-tree"
		-----@type neotree.Config
		opts = {
			filesystem = {
				hijack_netrw_behavior = "open_default",
				filtered_items = {
					hide_dotfiles = false,
				},
				-- follow_current_file = {
				-- 	enabled = true,
				-- 	leave_dirs_open = false,
				-- },
				group_empty_dirs = true,
			},
			sources = {
				"filesystem",
				"buffers",
				"git_status",
				--"cmdtree",
				-- ...and any additional source
			},
			window = {
				mappings = {
					["O"] = "expand_all_nodes",
				},
			},
		},
    -- stylua: ignore
    keys = {
      (function()
        -- if use_google() then
        --   return { "<C-n>m", ":Neotree float cmdtree<CR>", desc = "Open NeoTree CWD float" }
        -- end
        return { "<C-n>m", ":Neotree float git_status<CR>", desc = "Open NeoTree CWD float" }
      end)(),
      { "<C-n>", ":Neotree reveal left<cr>" },
      { "<C-n>.", ":Neotree reveal left dir=%:p:h<cr>" },
    },
	},
}
