-
Notifications
You must be signed in to change notification settings - Fork 255
Feature request: customizable tree layout #130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In my humble opinion, adding some configurable option/feature to choose which tree drawing style to be used would be great, but even if an user chooses the current default style the misaligned indentation would need to be fixed. |
For the folder icons, that is configurable by setting the neo-tree.nvim/lua/neo-tree/defaults.lua Line 140 in caa64cf
The problem with the indent alignment is that I pad the window with 1 space because I don't show indent lines on the tree and to me it looks better with the padding. I can certainly make that configurable. There is also a PR that is almost complete to add indent guides. I think that is stalled but I'll finish it up and get it merged. |
This should be handled with the changes in #131 which are now in the latest release. You should be able to get what you want with this config: require("neo-tree").setup({
default_component_configs = {
indent = {
indent_size = 2,
padding = 0, -- extra padding on left hand side
with_markers = true,
indent_marker = "│",
last_indent_marker = "└",
highlight = "NeoTreeIndentMarker",
},
icon = {
folder_closed = "",
folder_open = "",
trailing_slash = true,
default_icon = "*",
},
... If you have the The indent component is brand new. |
Thanks, the new feature works very well for me. One minor issue: Has the default_icon changed? It was |
I moved the default settings from the individual renderers to the I never actually saw the default icon getting used on my computer, |
I don't think This line didn't catch up the changes in 567176f:
|
Ok so this seems to be a typo. You probably have meant icon = {
- default_icon = "",
+ default = "",
}, in the config (README, docs, etc.). What the default icon hard-coded (in L105) did you intend just in case |
🤦♂️ Good catch, thanks for finding that! |
While it works, I would like to know why |
@nyngwang Indent makers are just one of the possible features of indent. The other configurations exposed here are how many spaces to indent and how much padding to add. Not everyone likes have indent markers so the default is false. |
Got it! |
Uh oh!
There was an error while loading. Please reload this page.
Left: NERDTree, Mid: nvim-tree.lua, Right: NeoTree
It would be great if neotree can support customization tree layout. For example, I personally prefer the style of nvim-tree.lua (or coc-explorer) where a fancy unicode characters is used to denote the expanded tree. Compared to that, the style of NERDTree and NeoTree seem less intuitive for me.
NeoTree follows the default style of NERDTree, but it has another problem: the indent align is not proper. This is more noticable when one has some indent level guide plugin. I have a tabsize of 4 (
&sw = 4
) in this example -- somehow it was supposed to be2
but I just did not have such config (although the plugin itself might want to add buffer-specific options). Please compare with that of NERDTree. It might be fixed either if (i) there is no a padding (in one space character) on the left, (ii) if no space/tab is used with different tree drawing style (like nvim-tree), or (iii) I just don't use the indent-blankline plugin.The text was updated successfully, but these errors were encountered: