Closed tracyone closed 11 months ago
Hello, May I ask what you use for displaying those icons? I can see 2 spaces here. NERDTree only puts one space between the directory arrow and the rest of it. The extra space here is introduced by those icons. As for the space from NERDTree, there is no option available to remove this space.
Hi, rzvxa
I use ryanoasis/vim-devicons plugin.
I also use vim-devicons, there is no option in either of these 2 plugins to remove that extra space when they are working together.
Fun Fact: The icon you see is called a flag, And NERDTree actually shows the flag inside of brackets [ ]
like this:
vim-devicons uses a special hackish way to conceal these brackets using syntax highlighting with this code:
function! s:setSyntax()
if g:webdevicons_enable_nerdtree == 1 && g:webdevicons_conceal_nerdtree_brackets == 1
augroup webdevicons_conceal_nerdtree_brackets
au!
autocmd FileType nerdtree syntax match hideBracketsInNerdTree "\]" contained conceal containedin=NERDTreeFlags
autocmd FileType nerdtree syntax match hideBracketsInNerdTree "\[" contained conceal containedin=NERDTreeFlags
autocmd FileType nerdtree syntax match hideBracketsInNerdTree "\]" contained conceal containedin=NERDTreeLinkFile
autocmd FileType nerdtree syntax match hideBracketsInNerdTree "\]" contained conceal containedin=NERDTreeLinkDir
autocmd FileType nerdtree syntax match hideBracketsInNerdTree "\[" contained conceal containedin=NERDTreeLinkFile
autocmd FileType nerdtree syntax match hideBracketsInNerdTree "\[" contained conceal containedin=NERDTreeLinkDir
autocmd FileType nerdtree setlocal conceallevel=3
autocmd FileType nerdtree setlocal concealcursor=nvic
augroup END
endif
endfunction
So in theory you should also be able to conceal those extra spaces. Or even patch one of these 2 plugins for your use case and remove the spacing in them. TL;DR There is no way to change this padding behavior.
Thanks a lot, look like a good solution, I will try it later tonight