Giter Club home page Giter Club logo

Comments (9)

akinsho avatar akinsho commented on July 20, 2024 1

Lua plugins exposing a setup function call that a user then uses doesn't seem very unusual, tbh a lot of vim plugins require the user to manually actually activate the plugin. Also calling setup automatically makes a lot of assumptions about what the intended usage for this plugin, since this plugin might be used as a dependency for another one the plugin author might not want this.

from nvim-web-devicons.

romgrk avatar romgrk commented on July 20, 2024 1

lazy loading maybe...?

Lazy-loading sounds good. I've updated #22.

from nvim-web-devicons.

kyazdani42 avatar kyazdani42 commented on July 20, 2024

you can call has_loaded to make sure setup wasn't already called.

from nvim-web-devicons.

romgrk avatar romgrk commented on July 20, 2024

Q1: Can't you call .setup() yourself automatically? Why is it left to the user/plugin author to do it?
Q2: If you insist on someone else than you calling it, why don't you make .setup() return if it has already been called rather than push the .has_loaded() logic to users?

from nvim-web-devicons.

kyazdani42 avatar kyazdani42 commented on July 20, 2024

also users could call setup themselves to provide for alternative config

from nvim-web-devicons.

kyazdani42 avatar kyazdani42 commented on July 20, 2024

but maybe has loaded should be done inside setup

from nvim-web-devicons.

romgrk avatar romgrk commented on July 20, 2024

Counter-arguments:

  • Isn't adding Plug 'kyazdani42/nvim-web-devicons' the usual mark that the user does want to use the plugin? I know many lua plugins expose a .setup() function but it doesn't mean that it's a good thing to do so. Also there is no configuration to do for this plugin.

  • I challenge you to produce a use-case where the user did add the plugin to their vimrc BUT does not want the plugin .setup() to be run automatically.

since this plugin might be used as a dependency for another one the plugin author might not want this

  • If the .setup() function is called from plugin/nvim-web-devicons.vim there is nothing to worry about. Being a plugin author that depends on this, I can also say that I want .setup() to be called...because I depend on it. There is no reason not to call it.

also users could call setup themselves to provide for alternative config

  • I'm not sure that I understand. This plugin doesn't seem configurable, is it?

from nvim-web-devicons.

kyazdani42 avatar kyazdani42 commented on July 20, 2024

lazy loading maybe...?

from nvim-web-devicons.

kyazdani42 avatar kyazdani42 commented on July 20, 2024

the setup fonction allows to override icons and colors

from nvim-web-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.