-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Indent lines #1136
Comments
conceallevel=3 always hides the character, but conceallevel=2 allows an alternate character to be displayed instead.
* Closes #1136. Allow concealed characters to show another character. conceallevel=3 always hides the character, but conceallevel=2 allows an alternate character to be displayed instead. * Update version number in changelog.
Lines showing the tree structure were removed from NERDTree nine years ago (commit eac3214), long before I took over support for it. I can only guess as to why, but Martin may have liked the cleaner look of the triangles and no lines. I have no plans to reintroduce the lines, because I think they clutter the display. You can, however, simulate them to a certain extent with some clever syntax rules. Save the following text to your vim setup. Pay attention to the file's name and path:
" This block displays every other leading space in the NERDTree buffer as
" a vertical bar. It works only if your vim has the +conceal feature
" turned on, and this file must be saved as ~/.vim/after/syntax/nerdtree.vim
" to work properly.
if has("conceal")
syntax clear NERDTreeOpenable
syntax clear NERDTreeClosable
let s:dirArrows = escape(g:NERDTreeDirArrowCollapsible, '~]\-').escape(g:NERDTreeDirArrowExpandable, '~]\-')
exec 'syntax match MarkIndents #\( \)\{-}\zs \ze \( \)*\(['.s:dirArrows.' ] \)\?'.g:NERDTreeNodeDelimiter.'# containedin=ALL conceal cchar=|'
endif It will display every other leading space as a vertical bar, like so: You will need to pull the latest version of NERDTree, and nerdtree-buffer-ops if you use it. |
vim-devicons is another NERDTree plugin, and it sets |
This is great, thank you! |
Could this be like a configurable setting? I would like to activate it too, and at the same time I wish this persists in my vimrc so I can easily replicate my environment on a different pc and such... Thanks PS: I could implement it and do PR but I need some hints how to do it |
@alexnix No, as stated above, I won't reintroduce the lines into NERDTree. As far as your vim configuration goes, don't try to put every setup statement into your vimrc file. Your config can, and should, contain multiple files in several folders. The files in the different folders are sourced at the appropriate time or for specific purposes, and using the folders makes your config simpler than trying to accomplish that in a single vimrc file. Take a look at my Neovim setup for an example of how to do it. With it being in Github, replicating my vim environment is as simple as cloning the repo on a new machine. |
Description
When you open the file explorer, it can sometimes be hard to determine the level of nesting for each of the files display. It would be great if there was indent lines displayed to help you determine that.
The text was updated successfully, but these errors were encountered: