Comments (13)
Heh I actually messed around with some test code to do this a while ago but it broke some big things
So yes this is something I would like to improve, either directly or a PR on NERDTree (but that would be difficult to get one in I think)
from vim-devicons.
You can always fork nerd tree and have people point Vundle to your fork if people want to avoid the extra [] characters.
from vim-devicons.
That is true but my test code was essentially a fork of a specific part of code that displays the brackets. I think this is the one I was messing with:
let g:NERDTreeFlagSet.renderToString = substitute(g:NERDTreeFlagSet.renderToString(), "[", "x", "")
from vim-devicons.
I just realized something - wouldn't there be a way to use the vim
conceal
capabilities? You could add a concealment for each GLYPH
such as: [GLYPH] => GLYPH
.
You would probably need to have concealcursor=nvc
for it to look good, and that's okay except it would conflict with the very small set of people that wish to use concealcursor
for other purposes with a setting different than nvc
. If they use nvc
, it should be fine.
from vim-devicons.
That is an interesting idea! Thanks I'll have to try it!
from vim-devicons.
Here's what will work best:
(You have to make sure it only ever runs in the nerd tree syntax highlighting - not other panes).
" Replace any `[` or `]` with underscore.
" We'll hide the underscores anyways.
syntax match hideBracketsInNerdTree "[\]|\[]*" conceal cchar=_
" Must be completely hidden otherwise cursorline doesn't highlight the concealed bg color correctly.
set conceallevel=3
set concealcursor=nvic
This seems to work great - I just don't know where in the plugin is best to place this.
Also, when concealed, you'll probably want to add one extra space after the icon (can't be done with conceal and has to be done in the plugin) just so it doesn't look as cramped.
from vim-devicons.
Looks like just placing all that above code in the NERDTreeWebDevIconsRefreshListener
method works. It also doesn't seem to interfere with other buffers that have conceal since conceal settings seem to be per buffer.
(Requires adding one extra character of padding).
(edit: nevermind, it isn't initialized properly and refreshing messes up other highlighting).
from vim-devicons.
😄 Great sounds like you have probably the best solution. Do you want to submit a PR ? If not I will eventually get to making your changes myself (just might take a little longer that way)
from vim-devicons.
See my note, it didn't work and I don't understand Vim plugin architecture well enough.
from vim-devicons.
Ah okay no problem. What you have given me is good info to make an attempt, so stay tuned 👍
from vim-devicons.
👍
from vim-devicons.
fixed with v0.4.0 release
from vim-devicons.
👍
from vim-devicons.
Related Issues (20)
- Nerdtree icons are looking weird . HOT 1
- NERDTree needs to be called after vim-devicons HOT 4
- WSL NERDTree only works with patched fonts that are in the `.ttf` format
- Link of Powerline setup in wiki is broken HOT 1
- Custom Folder Icons for Matching Folder Patters or Words in Vim and NeoVim
- Incorrect Icons in NERDTree HOT 1
- NERDTree icons all pink OR with square brackets if I change color. HOT 1
- Add support for Vite configuration files (`vite.config.ts`, `vite.config.js`)
- Add support for Docker Compose files (`docker-compose.yaml`, `compose.yaml`)
- Devicons are not visible (If you are a SpaceVim user, refer to this issue) HOT 1
- Misalignment due to length of folder name HOT 1
- Colored Icons HOT 1
- Provide option to configure distro icon
- Missing icons after install on Windows WSL2 (Running Ubuntu 22.04) HOT 1
- How would I integrate vim-devicons into vim's quickfix list
- Icons are squares with question mark in the middle on MacVim. HOT 1
- Codepoint of some icons changed in nerd-fonts 3.0.0
- [Bug]: Vim in termux have a little issue
- ExactSymbols doesn't override icon set by ExtensionSymbols
- Redundant spaces between NERDTree directory symbol and devicons directory icon HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-devicons.