Comments (9)
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.
lazy loading maybe...?
Lazy-loading sounds good. I've updated #22.
from nvim-web-devicons.
you can call has_loaded
to make sure setup wasn't already called.
from nvim-web-devicons.
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.
also users could call setup themselves to provide for alternative config
from nvim-web-devicons.
but maybe has loaded should be done inside setup
from nvim-web-devicons.
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 fromplugin/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.
lazy loading maybe...?
from nvim-web-devicons.
the setup fonction allows to override icons and colors
from nvim-web-devicons.
Related Issues (20)
- Material Icon Set
- Highlight Error HOT 4
- Haxe icon not showing HOT 2
- Add mp3 file icons HOT 4
- No way to add/override icons for filetypes HOT 4
- Add openscad icon HOT 1
- Rename `:NvimWebDeviconsHiTest` to anything else like `WebDeviconsHiTest` HOT 8
- Regression: `NvimWebDeviconsHiTest` crashes HOT 5
- Missing icon for Java HOT 2
- :help HOT 1
- Some icons not show correctly HOT 2
- Incorrect NF symbol shown for Rust HOT 5
- Create a category for icons from desktop environments and window managers HOT 2
- Cannot override some icons by filename HOT 7
- TeX icon incorrect HOT 1
- [QUESTION]: how to add custom icon to laravel blade files HOT 4
- Invalid highlight name HOT 15
- change only icon color HOT 1
- W18 invalid character in a group name HOT 2
- Default icon is not working correctly HOT 12
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 nvim-web-devicons.