Comments (7)
I mean we already infer some packages based on config, which is really good. I am pretty sure nvim-cmp sources are inferred from your config and I really think this is good user experience.
This proposal just sets out to allow commands from small plugins too.
To me this is not the same thing. What we do now is enabling a package or plugin which is a dependency (strict or optional) of the plugin you want to configure.
For instance, if I set plugins.lualine.iconsEnabled
to true
, nixvim will add the nvim-web-devicons
plugin to extraPlugins
.
In your example, you want to embed a command offered by another plugin in a separate one.
Actually your solution 1 (or a variation of it) seems legit in terms of technical solution.
The only thing is that I cannot get to imagine many examples of such command imports.
One last thing. I am willing to review and test any proposal code. I am really not closed to a solution proposition.
This is not a strong "no" at all. :)
At this stage, I just need to be more convinced of both the usefulness and the feasibility of it.
from nixvim.
I think I agree with your points on this one after a lot of thought. It may not be as easy as I had anticipated. I will close this issue, hopefully I might figure something out somehow.
from nixvim.
Hello Alex,
To be perfectly honest, I am not really convinced by such a feature.
Here is why.
Obviously, wanting a better user experience should be our ultimate goal. However, in this case I am not sure it is a good thing.
The reason is the extra added complexity. The latter is dual:
-
For us (the developers): Supporting this would lead to complicating the code base and the way our module works. As you pointed out, it would require some pretty advanced techniques which would make nixvim less "straightforward".
However, I am not at all intrinsically opposed to anything that is harder or more complex to implement. What matters at the end is the user. But still, we have to keep the code base as maintainable as possible. -
For the user: What I personally liked about nixvim when I found out about it, is that it is mostly straightforward:
- It makes it possible to translate your lua config to nix in a natural way. (Options are the same, they are just translated to lua very naturally).
- It handles several things thanks to nix that the user can stop worrying about. (I think mostly about the plugin manager and the package dependencies like the language servers).
But it does not do more than this. And, according to me, this is great. I get what you mean when you say "With this, the user can directly use the plugin without explicitly requiring it". However, to me, you should be explicit about which plugin you want to install on your system. The behavior you want to push seems like the one a neovim distribution would have (such as LunarVim, NvChad...). In those, the chosen paradigm is different as they abstract many more things.
From what I understand, nixvim is more a simple module that lets the power (and the responsibility) to the user.
This is my own opinion. Obviously, the final word should be Pedro's. I would be glad to hear what @traxys and @pta2002 think about this.
Anyway, thank you for bringing new ideas on the table :)
from nixvim.
Thanks for the feedback @GaetanLepage. I just thought this feature would fit nicely in nixvim since we are already utilizing the power of nix.
I totally agree with you that nixvim should be maintainable, and I don't think that the logic is too complex, we just need to change the way things are added and changed, I think.
On the other side, you may be right that this should be in a separate project. However it would be coolest to have the feature in nixvim in some way ;)
And to address that you should be explicit, I think that makes very good sense as Nix is all about being declarative, but that is why I also wanted idea 1, where you could explicitly say, that you want to import a specific command, Nixvim would just handle the dependency management :)
from nixvim.
IMO I mostly agree with what @GaetanLepage said. I think it'd very quickly turn into a maintenance nightmare. The only real way I can see this working would be something like what you initially suggested with the imports, but even then I think it'd very easily become a maintenance nightmare. I think a simpler way to do this would just be plugins.[plugin].extraConfig = plugin: "${plugin}.setup(...)"
or something like that, basically a config parameter that lets you define your own config with the plugin's name in scope, acessible via the plugin
parameter.
from nixvim.
At first I had not really understood his proposal.
I think it is easier to stay in the NixOS/HM module paradigm (i.e. if I want to use foo
, I have to set foo.enable = true;
).
I cannot think about a lot of cases where this would be useful...
from nixvim.
Okay...
I mean we already infer some packages based on config, which is really good. I am pretty sure nvim-cmp sources are inferred from your config and I really think this is good user experience.
This proposal just sets out to allow commands from small plugins too.
I might try to come up with a solution. And if it doesn't fit in Nixvim I will probably make it some sort of plugin/module in a side project.
from nixvim.
Related Issues (20)
- [BUG] Example for plugins.gitsigns.onAttach is wrong / confusing
- [BUG] Unable to set obsidian.followUrlFunc using if statement
- [PLUGIN REQUEST] virt-column.nvim
- [BUG] attribute 'base16-nvim' missing HOT 2
- [BUG] Can't install nixvim, "option ... does not exist" HOT 2
- [BUG] Alpha terminal
- [BUG] Conform plugin does not install enabled formatters
- [PLUGIN REQUEST] indent-o-matic
- [PLUGIN REQUEST] direnv.vim
- [PLUGIN REQUEST] crates.nvim HOT 2
- Running `nix flake show` fails to evaluate on `x86_64-linux` HOT 2
- [BUG] copilot-vim.keymaps do not work properly
- LSP keymaps should use keymap-helpers submodule HOT 2
- [PLUGIN REQUEST] lsp-status.nvim
- [BUG] error: `phpcbf` is now deprecated, use `php-codesniffer` instead which contains both `phpcs` and `phpcbf`. HOT 14
- [PLUGIN REQUEST] vim-sandwich
- [BUG] Treesitter configures custom parser lists incorrectly HOT 4
- plugins/whichkey: Support window and layout fields HOT 1
- [PLUGIN REQUEST] <auto-save fork>
- [BUG] [nvim-cmp] unable to pass a function in sources entryFilter HOT 3
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 nixvim.