Nerdtree: How can I remove the slashes after each directory node?

Created on 19 Feb 2018  路  11Comments  路  Source: preservim/nerdtree

Colors and icons already explaining it's a directory. Having extra / for each one isn't looking good. Is there any way to remove those slashes?

Most helpful comment

Awesome! For those who come across this in the future, note that you also need to turn concealment on; it's off by default. An easy way to do that is to add setlocal conceallevel=3 to the autocmd, like so:

augroup nerdtreehidecwd
    autocmd!
    autocmd FileType nerdtree setlocal conceallevel=3 | syntax match NERDTreeDirSlash #/$# containedin=NERDTreeDir conceal contained
augroup end

All 11 comments

The trailing slash is used in the syntax file to differentiate between directories and files when it comes to highlighting. Without digging into the code further, I think there are other areas where that trailing slash is important.

Another job for conceal. ><

I managed to solve this problem by doing this.

augroup nerdtreehidetirslashes
    autocmd!
    autocmd FileType nerdtree syntax match NERDTreeDirSlash #/$# containedin=NERDTreeDir conceal contained
augroup end

Now it looks like, like this; much much better.

Awesome! For those who come across this in the future, note that you also need to turn concealment on; it's off by default. An easy way to do that is to add setlocal conceallevel=3 to the autocmd, like so:

augroup nerdtreehidecwd
    autocmd!
    autocmd FileType nerdtree setlocal conceallevel=3 | syntax match NERDTreeDirSlash #/$# containedin=NERDTreeDir conceal contained
augroup end

@kutsan how did you get all those fancy icons and stuff and are they terminal compatible ?

@NikosEfthias It's just a custom font and that font has glyphs inside it. You can use those glyphs like I did. Check out these link.

To be honest, it's little hard to setup.

This doesn't seem to work with vim8.1

@cevhyruz It still works, I'm using it.

@kutsan weird.. It doesn't work on my vimrc but if I manually type this on commandline it works.

Okay so its working now.. silly me! :p

Was this page helpful?
0 / 5 - 0 ratings

Related issues

milushov picture milushov  路  4Comments

nicknisi picture nicknisi  路  5Comments

BigfootN picture BigfootN  路  5Comments

DapperFox picture DapperFox  路  4Comments

PinheiroCosta picture PinheiroCosta  路  4Comments