vim-nerdtree-syntax-highlight icon indicating copy to clipboard operation
vim-nerdtree-syntax-highlight copied to clipboard

colors not showing and brackets around icon

Open isabelgk opened this issue 6 years ago • 15 comments

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?

isabelgk avatar Jul 28 '18 23:07 isabelgk

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

ipsod avatar Dec 15 '18 10:12 ipsod

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

hasher-hasher avatar Jun 07 '19 09:06 hasher-hasher

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

hasher-hasher avatar Jun 07 '19 09:06 hasher-hasher

Yeah, I have the same problem on neovim on Iterm

reisnobre avatar Nov 16 '19 21:11 reisnobre

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 https://github.com/ryanoasis/vim-devicons/issues/250#issuecomment-503616655 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

amuuname avatar May 03 '20 03:05 amuuname

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

aborzunov avatar May 10 '20 14:05 aborzunov

@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.

timoleistner avatar May 11 '20 17:05 timoleistner

@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 avatar May 22 '20 15:05 allbombson

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

allbombson avatar May 22 '20 15:05 allbombson

@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.

tiagofumo avatar May 28 '20 10:05 tiagofumo

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

mlwnvncnt avatar Oct 14 '20 12:10 mlwnvncnt

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?

alexsmartens avatar Aug 31 '21 20:08 alexsmartens

@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.

tiagofumo avatar Aug 31 '21 20:08 tiagofumo

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 avatar Aug 31 '21 20:08 alexsmartens

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.

alexsmartens avatar Aug 31 '21 21:08 alexsmartens