|
| 1 | +local highlights = require("neo-tree.ui.highlights") |
| 2 | + |
1 | 3 | local config = {
|
2 | 4 | -- The default_source is the one used when calling require('neo-tree').show()
|
3 | 5 | -- without a source argument.
|
@@ -41,6 +43,114 @@ local config = {
|
41 | 43 | -- print(args.source, " moved to ", args.destination)
|
42 | 44 | -- end
|
43 | 45 | -- },
|
44 |
| - --} |
| 46 | + --}, |
| 47 | + filesystem = { |
| 48 | + follow_current_file = false, -- This will find and focus the file in the |
| 49 | + -- active buffer every time the current file is changed while the tree is open. |
| 50 | + use_libuv_file_watcher = false, -- This will use the OS level file watchers |
| 51 | + -- to detect changes instead of relying on nvim autocmd events. |
| 52 | + window = { |
| 53 | + -- see https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup |
| 54 | + -- for possible options. These can also be functions that return these |
| 55 | + -- options. |
| 56 | + position = "left", -- left, right, float |
| 57 | + width = 40, -- applies to left and right positions |
| 58 | + -- settings that apply to float position only |
| 59 | + popup = { |
| 60 | + size = { |
| 61 | + height = "80%", |
| 62 | + width = "50%", |
| 63 | + }, |
| 64 | + position = "50%", -- 50% means center it |
| 65 | + -- you can also specify border here, if you want a different setting from |
| 66 | + -- the global popup_border_style. |
| 67 | + }, |
| 68 | + -- Mappings for tree window. See https://github.com/nvim-neo-tree/neo-tree.nvim/blob/main/lua/neo-tree/sources/filesystem/commands.lua |
| 69 | + -- for built-in commands. You can also create your own commands by |
| 70 | + -- providing a function instead of a string. See the built-in |
| 71 | + -- commands for examples. |
| 72 | + mappings = { |
| 73 | + ["<2-LeftMouse>"] = "open", |
| 74 | + ["<cr>"] = "open", |
| 75 | + ["S"] = "open_split", |
| 76 | + ["s"] = "open_vsplit", |
| 77 | + ["C"] = "close_node", |
| 78 | + ["z"] = "close_all_nodes", |
| 79 | + ["<bs>"] = "navigate_up", |
| 80 | + ["."] = "set_root", |
| 81 | + ["H"] = "toggle_hidden", |
| 82 | + ["I"] = "toggle_gitignore", |
| 83 | + ["R"] = "refresh", |
| 84 | + ["/"] = "filter_as_you_type", |
| 85 | + ["f"] = "filter_on_submit", |
| 86 | + ["<C-x>"] = "clear_filter", |
| 87 | + ["a"] = "add", |
| 88 | + ["d"] = "delete", |
| 89 | + ["r"] = "rename", |
| 90 | + ["c"] = "copy_to_clipboard", |
| 91 | + ["x"] = "cut_to_clipboard", |
| 92 | + ["p"] = "paste_from_clipboard", |
| 93 | + }, |
| 94 | + }, |
| 95 | + --find_command = "fd", |
| 96 | + search_limit = 50, -- max number of search results when using filters |
| 97 | + filters = { |
| 98 | + show_hidden = false, |
| 99 | + respect_gitignore = true, |
| 100 | + }, |
| 101 | + bind_to_cwd = true, -- true creates a 2-way binding between vim's cwd and neo-tree's root |
| 102 | + -- This section provides the renderers that will be used to render the tree. |
| 103 | + -- The first level is the node type. |
| 104 | + -- For each node type, you can specify a list of components to render. |
| 105 | + -- Components are rendered in the order they are specified. |
| 106 | + -- The first field in each component is the name of the function to call. |
| 107 | + -- The rest of the fields are passed to the function as the "config" argument. |
| 108 | + renderers = { |
| 109 | + directory = { |
| 110 | + { |
| 111 | + "icon", |
| 112 | + folder_closed = "", |
| 113 | + folder_open = "", |
| 114 | + padding = " ", |
| 115 | + }, |
| 116 | + { "current_filter" }, |
| 117 | + { "name" }, |
| 118 | + -- { |
| 119 | + -- "symlink_target", |
| 120 | + -- highlight = highlights.SYMBOLIC_LINK_TARGET, |
| 121 | + -- }, |
| 122 | + { |
| 123 | + "clipboard", |
| 124 | + highlight = highlights.DIM_TEXT, |
| 125 | + }, |
| 126 | + { "diagnostics", errors_only = true }, |
| 127 | + --{ "git_status" }, |
| 128 | + }, |
| 129 | + file = { |
| 130 | + { |
| 131 | + "icon", |
| 132 | + default = "*", |
| 133 | + padding = " ", |
| 134 | + }, |
| 135 | + { |
| 136 | + "name", |
| 137 | + use_git_status_colors = true, |
| 138 | + }, |
| 139 | + -- { |
| 140 | + -- "symlink_target", |
| 141 | + -- highlight = highlights.SYMBOLIC_LINK_TARGET, |
| 142 | + -- }, |
| 143 | + { |
| 144 | + "clipboard", |
| 145 | + highlight = highlights.DIM_TEXT, |
| 146 | + }, |
| 147 | + { "diagnostics" }, |
| 148 | + { |
| 149 | + "git_status", |
| 150 | + highlight = highlights.DIM_TEXT, |
| 151 | + }, |
| 152 | + }, |
| 153 | + }, |
| 154 | + }, |
45 | 155 | }
|
46 | 156 | return config
|
0 commit comments