{ plugins.neo-tree = { enable = true; settings = { sources = [ "filesystem" "buffers" "git_status" ]; enable_diagnostics = true; enable_git_status = true; enable_modified_markers = true; enable_refresh_on_write = true; open_files_in_last_window = true; open_files_do_not_replace_types = [ "terminal" "Trouble" "trouble" "qf" "Outline" ]; filesystem = { bind_to_cwd = false; follow_current_file = { enabled = true; }; use_libuv_file_watcher = true; }; window.mappings = { "l" = "open"; "h" = "close_node"; "" = "none"; "Y" = { __raw = '' function(state) local node = state.tree:get_node() local path = node:get_id() vim.fn.setreg("+", path, "c") end ''; desc = "Copy Path to Clipboard"; }; "O" = { __raw = '' function(state) vim.ui.open(state.tree:get_node().path) end ''; desc = "Open with System Application"; }; }; default_component_configs = { indent = { with_expanders = true; expander_collapsed = ""; expander_expanded = ""; expander_highlight = "NeoTreeExpander"; }; git_status.symbols = { unstaged = ""; staged = ""; }; icon = { folder_closed = ""; folder_open = ""; folder_empty = ""; }; }; }; event_handlers = { file_moved = '' function(data) require("snacks.rename").on_rename_file(data.source, data.destination) end ''; file_renamed = '' function(data) require("snacks.rename").on_rename_file(data.source, data.destination) end ''; }; }; keymaps = [ { key = "fe"; mode = [ "n" ]; action.__raw = '' function() require("neo-tree.command").execute({ toggle = true, dir = vim.fn.getcwd() }) end ''; options.desc = "Explorer NeoTree (cwd)"; } { key = "e"; mode = [ "n" ]; action = "fe"; options.remap = true; options.desc = "Explorer NeoTree (cwd)"; } { key = "ge"; mode = [ "n" ]; action.__raw = '' function() require("neo-tree.command").execute({ source = "git_status", toggle = true }) end ''; options.desc = "Git Explorer"; } { key = "be"; mode = [ "n" ]; action.__raw = '' function() require("neo-tree.command").execute({ source = "buffers", toggle = true }) end ''; options.desc = "Buffer Explorer"; } { key = ""; mode = [ "n" ]; action = "Neotree source=filesystem focus"; options.desc = "switch focus"; } ]; }