Code Monkey home page Code Monkey logo

Comments (13)

ryanoasis avatar ryanoasis commented on May 4, 2024

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.

jordwalke avatar jordwalke commented on May 4, 2024

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.

ryanoasis avatar ryanoasis commented on May 4, 2024

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.

jordwalke avatar jordwalke commented on May 4, 2024

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.

ryanoasis avatar ryanoasis commented on May 4, 2024

That is an interesting idea! Thanks I'll have to try it!

from vim-devicons.

jordwalke avatar jordwalke commented on May 4, 2024

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.

jordwalke avatar jordwalke commented on May 4, 2024

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.

ryanoasis avatar ryanoasis commented on May 4, 2024

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

jordwalke avatar jordwalke commented on May 4, 2024

See my note, it didn't work and I don't understand Vim plugin architecture well enough.

from vim-devicons.

ryanoasis avatar ryanoasis commented on May 4, 2024

Ah okay no problem. What you have given me is good info to make an attempt, so stay tuned 👍

from vim-devicons.

jordwalke avatar jordwalke commented on May 4, 2024

👍

from vim-devicons.

ryanoasis avatar ryanoasis commented on May 4, 2024

fixed with v0.4.0 release

from vim-devicons.

jordwalke avatar jordwalke commented on May 4, 2024

👍

from vim-devicons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.