-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
File coloring based on type. #201
Comments
Of course, I think this is a good idea. |
I think it would make sense to use the .dircolors file if it exists (probably only unix machines). |
If |
wow pretty dam fast response!! 👍 Were you talking of something like that ? :) |
NERDTree has its own filetype - i.e.
This is a really crude way (could probably find a much better regex) to highlight .txt files with the error highlight group. If you want to really define your own colors you could do this:
Thoughts? We could write a helper function to wrap this up - something like:
This is just an hacky example implementation written in 2 minutes - there is a lot wrong with it. But you get an idea of the interface. Anyway, for now just use the first method i described and post anything you do back here. Ill be interested to see what comes up - if there is enough interest then we can look at how people are using the highlighting and come up with an API for it |
@Turg0n yes. |
@scrooloose cool. I agreed. |
@scrooloose ty for the detailed answer. Based on it I modified it a bit into the following:
Your original code did now allow for defining colors for various files because all were using I quickly hacked the following since it matches the files i'm using in my projects:
It would be interesting to consider Cheers! |
It would be rather easy to strip the color from the |
I think use Vim color function wrapper instead of |
@NAGATOPain i think the idea is that there would be a second function that parses @Turg0n much nicer :) There are lots of other changes that could be made to the body - e.g. store the extention/colors in a hash and just add a single autocmd to set up the highlights. I think the interface is the important thing at the moment though - just to try and scope out what behaviour people want. |
@scrooloose I agreed, two solution with one option to specify. |
So would that be incorporated into the repo? If so, how should we proceed? I never create a vim plugin per-say haha! (only played with the vimrc!) |
If NERDTree read from dircolors that would definitely be very cool |
I am using Iterm2 + Solarized Dark theme. Can't get highlighting based on file type to work. I tried all variations including Tried the one in vim-devicons FAQ as well
|
@atoder Look at If you want a funny potpourri of colors, this somewhat resembles the colors github uses for it's languages.
Obviously only has support for languages / files I regularly use, extend as you wish. And you might want to add colors for GUI mode, if you use Vim in a GUI. (Who does that?) |
For anyone looking for this, I created this: https://github.com/tiagofumo/vim-nerdtree-syntax-highlight Take a look at the screenshots and see if you like it. You can use it with vim-devicons or not. If you don't want to use it with vim-devicons, add the following line to your .vimrc:
|
@tiagofumo wow, that looks amazing! Thanks for sharing :) |
What does everyone here think? With @tiagofumo's NERDTree plugin, can we consider this issue closed? |
I just tested it out and it makes the cursor navigation really slow when you have a medium amount of dirs! 🤕 That said, the |
FYI, related solutions: ryanoasis/vim-devicons#158 |
Here is a basic syntax file I got working for nerdtree colors. Make sure you put in |
@PhilRunninger When I was testing it.. the Nerd Tree was scrolling super slow.. as soon as I removed it.. it got fast again..
|
@atoder,
I would love to merge a pull request with a fix for this performance issue. Feel free to contribute. |
I am going to close this issue. @tiagofumo's plugin is a good start. Good luck to those who choose to tackle improving its performance. |
Any update on this part? I'd love to integrate |
I've not heard of anyone tackling the |
Is it possible to change the color of files based on their extension?
The text was updated successfully, but these errors were encountered: