Skip to content
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

colors not showing and brackets around icon #23

Open
isabelgk opened this issue Jul 28, 2018 · 15 comments
Open

colors not showing and brackets around icon #23

isabelgk opened this issue Jul 28, 2018 · 15 comments

Comments

@isabelgk
Copy link

I installed the plugin using Vundle by adding Plugin 'tiagofumo/vim-nerdtree-syntax-highlight' in my .vimrc. It successfully installed. I also made sure I had the the devicons font installed.

When I open NERDTree, I see:

image

I tried adding in specified colors to see if anything would change, but no luck.

" you can add these colors to your .vimrc to help customizing
let s:brown = "905532"
let s:aqua =  "3AFFDB"
let s:blue = "689FB6"
let s:darkBlue = "44788E"
let s:purple = "834F79"
let s:lightPurple = "834F79"
let s:red = "AE403F"
let s:beige = "F5C06F"
let s:yellow = "F09F17"
let s:orange = "D4843E"
let s:darkOrange = "F16529"
let s:pink = "CB6F6F"
let s:salmon = "EE6E73"
let s:green = "8FAA54"
let s:lightGreen = "31B53E"
let s:white = "FFFFFF"
let s:rspec_red = 'FE405F'
let s:git_orange = 'F54D27'

let g:NERDTreeExtensionHighlightColor = {} " this line is needed to avoid error
let g:NERDTreeExtensionHighlightColor['css'] = s:blue " sets the color of css files to blue

let g:NERDTreeExactMatchHighlightColor = {} " this line is needed to avoid error
let g:NERDTreeExactMatchHighlightColor['.gitignore'] = s:git_orange " sets the color for .gitignore files

let g:NERDTreePatternMatchHighlightColor = {} " this line is needed to avoid error
let g:NERDTreePatternMatchHighlightColor['.*_spec\.rb$'] = s:rspec_red " sets the color for files ending with _spec.rb

Any idea what I can try?

@ipsod
Copy link

ipsod commented Dec 15, 2018

I get the same thing in NeoVim, but it works as advertised in Vim and GVim.

@hasher-hasher
Copy link

I get the same error that @isabelgk . Somebody have any clue about the issue?

@hasher-hasher
Copy link

I figured it out! I just inserted syntax on in my .vimrc file and the colors started to display normally. I'm using ITerm with zshell

@reisnobre
Copy link

Yeah, I have the same problem on neovim on Iterm

@amuuname
Copy link

amuuname commented May 3, 2020

I used to have a similar problem where the syntax highlight works for the file/folder names, but not for the icons (pink icons for both directories and any type of files). After digging into the problem for hours, I finally figured out how to solve the problem (sort of).
Please refer to ryanoasis/vim-devicons#250 (comment) for the solution. Since I am using NeoVim, I created $HOME/.config/nvim/after/syntax/nerdtree.vim file and added line syntax clear NERDTreeFlags. After restarting the nvim, the devicons are now properly highlighted.
However, now I am having ugly brackets around the devicons. ☹️
Hope this helps.
Screen Shot 2020-05-02 at 8 11 57 PM

@aborzunov
Copy link
Contributor

aborzunov commented May 10, 2020

Supplementing @ryanbyon workaround, you can add this command to your .vimrc

augroup nerdtree
    autocmd!
    autocmd FileType nerdtree syntax clear NERDTreeFlags
    " other nerdtree related aucomds
augroup END

@timoleistner
Copy link

@ryanbyon's approach gave me the same result with squarebrackets.
When I try to add @aborzunov's command to my .vimrc it gives the following error
Error detected while processing FileType Autocommands for "nerdtree":
E28: No such highlight group name: NERDTreeFlags
Im also using NeoVim.
In the previously mentioned threat from vim-devicons, there's a solution proposed but this wont work for me neither, maybe because I use NeoVim and not Vim or GVim.

@allbombson
Copy link

@ryanbyon's method also gave me the square brackets (Im also using nvim) but they are not misaligned see below:
image
image
Maybe its an issue with your term? try using nvim-qt. On the flip side using @aborzunov's method yielded no results at all! As stated above! I was however able to write my own solution. @timoleistner try autocmd Syntax nerdtree syntax clear NERDTreeFlags after syntax on in your vimrc.

@allbombson
Copy link

Here are some screenshots of the output of this:
image
image

@tiagofumo
Copy link
Owner

tiagofumo commented May 28, 2020

@allbombson, @ryanbyon, @timoleistner update nerdtree, vim-devicons and vim-nerdtree-syntax-highlight to the latest version, undo any syntax clear NERDTreeFlags that you have added anywhere and try again, and check if it works now.

@mlwnvncnt
Copy link

mlwnvncnt commented Oct 14, 2020

Adding this removed the ugly bracket for me,
let g:webdevicons_conceal_nerdtree_brackets = o
@ryanbyon

@alexsmartens
Copy link

I'm having the same problem. My colors are good but these ugly brackets...
Screen Shot 2021-08-31 at 4 08 29 PM
I tried the above solutions including syntax clear NERDTreeFlags but they did not help.

syntax enable

...

Plug 'ryanoasis/vim-devicons'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'preservim/nerdtree'

syntax clear NERDTreeFlags

...

Any suggestions/ideas?

@tiagofumo
Copy link
Owner

tiagofumo commented Aug 31, 2021

@alexsmartens have you tried what I mentioned before? Updating vim-devicon, nerdtree and vim-nerdtree-syntax-highlight to the latest versions? You can do that by finding the repo folders on your disk and running "git pull". If you are using Neovim on ubuntu, that would be "~/.config/nvim/bundle/<plugin_name>". Also, after doing that you should remove the syntax clear NERDTreeFlags line from your .vimrc and try again.

@alexsmartens
Copy link

oh my, thanks @tiagofumo. That solved the problem!

Screen Shot 2021-08-31 at 4 41 34 PM

I thought I'm on the latest versions coz I just installed the plugins. There were a couple of updates to vim-devicon and the other ones were up-to-date.

@alexsmartens
Copy link

An interesting thing, the vim that I'm using is a "brew" vim. I installed it as an attempt to solve this problem.
After solving the bracket issue with @tiagofumo's suggestion I uninstalled "brew" vim and immediately started seeing the ugly brackets again.

So, I guess something is still off when using the default vim with vim-devicons. At the same time, the "brew" installation of vim plays nice with the brackets although both versions of vim are 8.2.3350 in my case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests