mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-15 23:17:48 +00:00
Compare commits
247 commits
2a89fd4093
...
b248b5af59
| Author | SHA1 | Date | |
|---|---|---|---|
|
b248b5af59 |
|||
|
|
b9941583fd |
||
|
|
5fbc72d697 |
||
|
|
4aac51ec19 |
||
|
|
54476b5a8b |
||
|
e42bcbe1ec |
|||
|
|
ae26ece143 |
||
|
|
14ca70e490 |
||
|
|
72ae20dc3d |
||
|
|
0644475408 |
||
|
4196be3ac8 |
|||
|
|
a86df770c1 |
||
|
|
e49228d642 |
||
|
|
9b20083128 |
||
|
|
63c032cf87 |
||
|
|
6e7e91fc11 |
||
|
fe60999d1e |
|||
|
b9968f13bd |
|||
|
80a4ab903c |
|||
|
c96f5f0d8c |
|||
|
033a47a7d6 |
|||
|
678598167c |
|||
|
d221c4b49a |
|||
|
6538fadb65 |
|||
|
f62de17141 |
|||
|
dad18b3226 |
|||
|
fd8e97a2ff |
|||
|
14d25e4153 |
|||
|
d4a1fb26f1 |
|||
|
|
0c6308313b |
||
|
|
7eb1780ab6 |
||
|
ae677cebfa |
|||
|
6d7b8ec2f1 |
|||
|
|
c4cb29b7a3 |
||
|
|
5671d7b42c | ||
|
39d4e7796b |
|||
|
|
b9562b3314 | ||
|
6469e061f6 |
|||
|
8adc4c352a |
|||
|
7510ef2c13 |
|||
|
5b5fd3db14 |
|||
|
5554c867ee |
|||
|
021f2531cc |
|||
|
2476d7e78f |
|||
|
a78026438c |
|||
|
f192344f7d |
|||
|
316d4a0825 |
|||
|
3f9078d7d9 |
|||
|
e5ced28b67 |
|||
|
75b402e9f0 |
|||
|
ff31e0fe25 |
|||
|
8f7d2181ae |
|||
|
|
132c3da8ec |
||
|
a6d9e75f37 |
|||
|
|
88fdf83156 |
||
|
|
8a069a6835 |
||
|
|
9dccd4b4a8 |
||
|
|
122f3b3f35 |
||
|
|
9e2ddbba49 |
||
|
|
00e9f27aca |
||
|
|
2a9a662f45 |
||
|
|
5a42eff8fd |
||
|
|
102d103986 |
||
|
|
214e2d597e |
||
|
|
d2424e7913 |
||
|
|
2dde21e19c |
||
|
62bc9764f1 |
|||
|
|
e9e7bfba53 |
||
|
90943ff33a |
|||
|
328b309af1 |
|||
|
b3154b6da7 |
|||
|
3843e14b3a |
|||
|
7443f0a470 |
|||
|
c9ac830a2d |
|||
|
199babe62c |
|||
|
a26e93c410 |
|||
|
9f1bd7fb35 |
|||
|
ef1fa6bf25 |
|||
|
2c2c714f8e |
|||
|
faea8c1900 |
|||
|
91df9c81c4 |
|||
|
7b886c9879 |
|||
|
90abd270a6 |
|||
|
|
9443273297 |
||
|
e5f6aa23ea |
|||
|
ee89d9d5bc |
|||
|
da48a862a3 |
|||
|
0fbcf1ca6f |
|||
|
4242640c98 |
|||
|
a5b7b17947 |
|||
|
3a6d2f7294 |
|||
|
9a93409606 |
|||
|
|
547cbd28b6 |
||
|
8df64accab |
|||
|
|
e3d99f2969 |
||
|
4b6021073c |
|||
|
|
f58f41629f |
||
|
|
28bbe89fbc |
||
|
|
653e5d6a17 |
||
|
|
5e3a0dcdc3 |
||
|
|
fcb6f82892 |
||
|
|
dfd4dc8494 |
||
|
db8a586b7e |
|||
|
abd9176a2a |
|||
|
779af80bf2 |
|||
|
9e38d00f1f |
|||
|
|
e331f009d5 |
||
|
|
ae81ab2c5f |
||
|
91cb482873 |
|||
|
|
f338fd3411 |
||
|
|
ba55a1b54a |
||
|
|
775963dd9d |
||
|
|
ce7017cf5b |
||
|
|
f279e3a585 |
||
|
22a1aef09e |
|||
|
e51dce002e |
|||
| 7d0c56d74c | |||
| 4200828526 | |||
|
e7649d1ec5 |
|||
|
ba27d85dee |
|||
|
|
cb1462f1c1 |
||
|
|
5f00d7d0d2 |
||
|
|
f1f89a5c49 |
||
|
|
e8e5594fb9 |
||
|
|
0994337d02 |
||
|
|
ae76778186 |
||
|
|
400c7b84e3 |
||
|
|
8809ecd689 |
||
|
|
d1fa88595b |
||
|
|
f7abf7577c |
||
|
|
52bc5f23ee |
||
|
|
7fc00f75f6 |
||
|
|
39d8f52f0e |
||
|
|
af36e185b5 |
||
|
|
226c25d45d |
||
|
|
088083c68a |
||
|
|
2691dbd351 |
||
|
|
6060ae4182 |
||
|
|
9a27dafe67 |
||
|
|
c9d39cb758 |
||
|
|
e58472cee7 |
||
|
|
36f535c4ef |
||
|
|
be7d949605 |
||
|
|
f31b2e06cb |
||
|
|
755052cea9 |
||
|
|
fca63ede6c |
||
|
|
c490536230 |
||
|
|
173ea3f43c |
||
|
|
7472cac221 |
||
|
|
3533d5bcbd |
||
|
|
753eb3e99d |
||
|
|
4b4423af91 |
||
|
|
887e563076 |
||
|
|
68483183c1 |
||
|
|
86fc7a3764 |
||
|
|
3d47d3f8c3 |
||
|
|
beedffcb5b |
||
|
|
eaae68aea2 |
||
|
|
be5ab79342 |
||
|
|
c52e3c0507 |
||
|
|
a1a0ab89b6 |
||
|
|
c8d727f2e9 |
||
|
|
8923d3b891 |
||
|
|
ae3340f2d1 | ||
|
|
9c09915170 |
||
|
|
952a3f1ad0 |
||
|
45a6d9b890 |
|||
|
|
f6d249d076 | ||
|
|
3f43edd635 | ||
|
|
ecf832681c | ||
|
|
dcb9b16f81 | ||
|
9142a5b9dd |
|||
|
4b9047025f |
|||
|
|
149d68b3e8 | ||
|
dc5fc8c6a4 |
|||
|
2e3c479e84 |
|||
|
|
bbca939ced | ||
|
520a06586b |
|||
|
|
fedbee3a30 |
||
|
|
607373645f |
||
|
|
c59f8922b2 |
||
|
|
9818d19937 |
||
|
a5a5aba34a |
|||
|
|
983a81c96c |
||
|
|
7012938e21 |
||
|
|
69cb99dc2b |
||
|
|
98a7959047 |
||
|
|
6e98b894b7 |
||
|
4df1cc3a7f |
|||
|
4aa183d734 |
|||
|
ab3a68fe1a |
|||
|
3825793549 |
|||
|
9c8fbc774f |
|||
|
6097f7eb11 |
|||
|
c8dbcde66a |
|||
|
2c54ecd306 |
|||
|
c5f16b96c0 |
|||
|
c734a81e40 |
|||
|
c09ae380f0 |
|||
|
4e949b3df8 |
|||
|
|
6852120514 |
||
|
5250f8e771 |
|||
|
6f1293053c |
|||
|
8448a6ca0f |
|||
|
|
b0fb0a93cb |
||
|
dab409685d |
|||
|
|
ea056532bc |
||
|
|
a26cdd2d25 |
||
|
ab49ba443d |
|||
|
7dbe7a08b3 |
|||
|
|
752915e639 |
||
|
356f92053c |
|||
|
aa7b55fa49 |
|||
|
b704a28a12 |
|||
|
2728e65a5e |
|||
|
a1bac1d356 |
|||
|
|
de02e2fa57 |
||
|
|
c071f2caa2 |
||
|
|
92e38fbfae |
||
|
|
ee4c072ba3 |
||
|
9888a277ad |
|||
|
b7bea89d9a |
|||
|
9584fe25e2 |
|||
|
5749739e4b |
|||
|
85347de09d |
|||
|
b67759273b |
|||
|
eb6e8b17b7 |
|||
|
fcc6aa485c |
|||
|
e614860a12 |
|||
|
|
af0eed84e0 | ||
|
|
ecc9b60a2d | ||
|
|
fcbc49e2e5 | ||
|
|
59bf01bbe0 | ||
|
|
9ccd0bfd4e | ||
|
|
411e641eab | ||
|
|
98b36e08f0 | ||
|
|
8c1352502a | ||
|
|
7d043e5f14 | ||
|
|
26398b6b14 | ||
|
|
f9d1684b5f | ||
|
8febf44422 |
|||
|
c0c6447090 |
|||
|
66005a51c3 |
|||
|
c19c925f1d |
|||
|
07f50e84eb |
|||
|
5a5f49f85f |
|||
|
0650aa31ac |
284 changed files with 7267 additions and 3736 deletions
|
|
@ -14,7 +14,7 @@ indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
[*.{js,nix,yml,yaml}]
|
[*.{js,json,nix,yml,yaml}]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
tab_width = 2
|
tab_width = 2
|
||||||
|
|
@ -26,3 +26,6 @@ trim_trailing_whitespace = unset
|
||||||
|
|
||||||
[*.lock]
|
[*.lock]
|
||||||
indent_size = unset
|
indent_size = unset
|
||||||
|
|
||||||
|
[npins/sources.json]
|
||||||
|
insert_final_newline = unset
|
||||||
|
|
|
||||||
3
.github/FUNDING.yml
vendored
3
.github/FUNDING.yml
vendored
|
|
@ -1,4 +1 @@
|
||||||
github: NotAShelf
|
github: NotAShelf
|
||||||
ko_fi: NotAShelf
|
|
||||||
liberapay: NotAShelf
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,17 @@ or dependency in this section.
|
||||||
If your pull request aims to fix an open issue or a please bug, please also link the relevant issue
|
If your pull request aims to fix an open issue or a please bug, please also link the relevant issue
|
||||||
below this line. You may attach an issue to your pull request with `Fixes #<issue number>` outside
|
below this line. You may attach an issue to your pull request with `Fixes #<issue number>` outside
|
||||||
this comment, and it will be closed when your pull request is merged.
|
this comment, and it will be closed when your pull request is merged.
|
||||||
|
|
||||||
|
A developer package template is provided in flake/develop.nix. If working on a module, you may use
|
||||||
|
it to test your changes with minimal dependency changes.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
## Sanity Checking
|
## Sanity Checking
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Please check all that apply. As before, this section is not a hard requirement but checklists with more checked
|
Please check all that apply. As before, this section is not a hard requirement but checklists with more checked
|
||||||
items are likely to be merged faster. You may save some time in maintainer review by performing self-reviews here
|
items are likely to be merged faster. You may save some time in maintainer reviews by performing self-reviews
|
||||||
before submitting your pull request.
|
here before submitting your pull request.
|
||||||
|
|
||||||
If your pull request includes any change or unexpected behaviour not covered below, please do make sure to include
|
If your pull request includes any change or unexpected behaviour not covered below, please do make sure to include
|
||||||
it above in your description.
|
it above in your description.
|
||||||
|
|
@ -22,9 +25,11 @@ it above in your description.
|
||||||
|
|
||||||
[editorconfig]: https://editorconfig.org
|
[editorconfig]: https://editorconfig.org
|
||||||
[changelog]: https://github.com/NotAShelf/nvf/tree/main/docs/release-notes
|
[changelog]: https://github.com/NotAShelf/nvf/tree/main/docs/release-notes
|
||||||
|
[hacking nvf]: https://notashelf.github.io/nvf/index.xhtml#sec-guidelines
|
||||||
|
|
||||||
- [ ] I have updated the [changelog] as per my changes
|
- [ ] I have updated the [changelog] as per my changes
|
||||||
- [ ] I have tested, and self-reviewed my code
|
- [ ] I have tested, and self-reviewed my code
|
||||||
|
- [ ] My changes fit guidelines found in [hacking nvf]
|
||||||
- Style and consistency
|
- Style and consistency
|
||||||
- [ ] I ran **Alejandra** to format my code (`nix fmt`)
|
- [ ] I ran **Alejandra** to format my code (`nix fmt`)
|
||||||
- [ ] My code conforms to the [editorconfig] configuration of the project
|
- [ ] My code conforms to the [editorconfig] configuration of the project
|
||||||
|
|
@ -34,9 +39,10 @@ it above in your description.
|
||||||
- [ ] I have added a section in the manual
|
- [ ] I have added a section in the manual
|
||||||
- [ ] _(For breaking changes)_ I have included a migration guide
|
- [ ] _(For breaking changes)_ I have included a migration guide
|
||||||
- Package(s) built:
|
- Package(s) built:
|
||||||
- [ ] `.#nix` (default package)
|
- [ ] `.#nix` _(default package)_
|
||||||
- [ ] `.#maximal`
|
- [ ] `.#maximal`
|
||||||
- [ ] `.#docs-html` (manual, must build)
|
- [ ] `.#docs-html` _(manual, must build)_
|
||||||
|
- [ ] `.#docs-linkcheck` _(optional, please build if adding links)_
|
||||||
- Tested on platform(s)
|
- Tested on platform(s)
|
||||||
- [ ] `x86_64-linux`
|
- [ ] `x86_64-linux`
|
||||||
- [ ] `aarch64-linux`
|
- [ ] `aarch64-linux`
|
||||||
|
|
@ -46,7 +52,8 @@ it above in your description.
|
||||||
<!--
|
<!--
|
||||||
If your changes touch upon a portion of the codebase that you do not understand well, please make sure to consult
|
If your changes touch upon a portion of the codebase that you do not understand well, please make sure to consult
|
||||||
the maintainers on your changes. In most cases, making an issue before creating your PR will help you avoid duplicate
|
the maintainers on your changes. In most cases, making an issue before creating your PR will help you avoid duplicate
|
||||||
efforts in the long run.
|
efforts in the long run. `git blame` might help you find out who is the "author" or the "maintainer" of a current
|
||||||
|
module by showing who worked on it the most.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
||||||
132
.github/README.md
vendored
132
.github/README.md
vendored
|
|
@ -50,6 +50,7 @@
|
||||||
[Contribute]: #contributing
|
[Contribute]: #contributing
|
||||||
[FAQ]: #frequently-asked-questions
|
[FAQ]: #frequently-asked-questions
|
||||||
[Credits]: #credits
|
[Credits]: #credits
|
||||||
|
[License]: #license
|
||||||
|
|
||||||
**[<kbd><br> Features <br></kbd>][Features]**
|
**[<kbd><br> Features <br></kbd>][Features]**
|
||||||
**[<kbd><br> Get Started <br></kbd>][Get Started]**
|
**[<kbd><br> Get Started <br></kbd>][Get Started]**
|
||||||
|
|
@ -67,6 +68,10 @@
|
||||||
[standalone]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-installation
|
[standalone]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-installation
|
||||||
[NixOS module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-nixos
|
[NixOS module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-nixos
|
||||||
[Home-Manager module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-hm
|
[Home-Manager module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-hm
|
||||||
|
[release notes]: https://notashelf.github.io/nvf/release-notes.html
|
||||||
|
[discussions tab]: https://github.com/notashelf/nvf/discussions
|
||||||
|
[FAQ section]: #frequently-asked-questions
|
||||||
|
[DAG]: https://en.wikipedia.org/wiki/Directed_acyclic_graph
|
||||||
|
|
||||||
- **Simple**: One language to rule them all! Use Nix to configure everything,
|
- **Simple**: One language to rule them all! Use Nix to configure everything,
|
||||||
with optional Lua support for robust configurability!
|
with optional Lua support for robust configurability!
|
||||||
|
|
@ -79,11 +84,31 @@
|
||||||
customizable through the Nix module system.
|
customizable through the Nix module system.
|
||||||
- Not comfortable with a full-nix config or want to bring your Lua config? You
|
- Not comfortable with a full-nix config or want to bring your Lua config? You
|
||||||
can do just that, no unnecessary restrictions.
|
can do just that, no unnecessary restrictions.
|
||||||
- Lazyloading? We got it! Lazyload both internal and external plugins at will.
|
- Lazyloading 💤? We got it! Lazyload both internal and external plugins at
|
||||||
|
will.
|
||||||
|
- nvf allows _ordering configuration bits_ using [DAG] (_Directed acyclic
|
||||||
|
graph_)s. It has never been easier to construct an editor configuration
|
||||||
|
deterministically!
|
||||||
|
- nvf exposes everything you need to avoid a vendor lock-in. Which means you
|
||||||
|
can add new modules, plugins and so on without relying on us adding a module
|
||||||
|
for them! Though, of course, feel free to request them.
|
||||||
|
- Use plugins from anywhere. Inputs, npins, nixpkgs... You name it.
|
||||||
|
- Add your own modules, with ease. It's all built-in!
|
||||||
- **Well-documented**: Documentation is priority. You will _never_ face
|
- **Well-documented**: Documentation is priority. You will _never_ face
|
||||||
undocumented, obscure behaviour.
|
undocumented, obscure behaviour.
|
||||||
|
- Changes, breaking or otherwise, will be communicated in the [release notes]
|
||||||
|
- Refer to the [FAQ section] for answers to common questions.
|
||||||
|
- Your question not there? Head to the to the [discussions tab]!
|
||||||
- **Idiomatic**: nvf does things ✨ _the right way_ ✨ - the codebase is, and
|
- **Idiomatic**: nvf does things ✨ _the right way_ ✨ - the codebase is, and
|
||||||
will, remain maintainable for myself and any contributors.
|
will, remain maintainable for myself and any contributors.
|
||||||
|
- **Community-Led**: we would like nvf to be fully capable of accomplishing what
|
||||||
|
you really want it to do. If you have a use case that is not made possible by
|
||||||
|
nvf, please open an issue (or a pull request!)
|
||||||
|
- Your feedback is more than welcome! Feedback is what _drives_ nvf forward.
|
||||||
|
If you have anything to say, or ask, please let us know.
|
||||||
|
- Pull requests are _always_ welcome. If you think the project can benefit
|
||||||
|
from something you did locally, but are not quite sure how to upstream,
|
||||||
|
please feel free to contact us! We'll help you get it done.
|
||||||
|
|
||||||
## Get Started
|
## Get Started
|
||||||
|
|
||||||
|
|
@ -173,39 +198,66 @@ fix.
|
||||||
[list of open pull requests]: https://github.com/NotAShelf/nvf/pulls
|
[list of open pull requests]: https://github.com/NotAShelf/nvf/pulls
|
||||||
|
|
||||||
**Q**: What platforms are supported?
|
**Q**: What platforms are supported?
|
||||||
<br/> **A**: nvf actively supports **Linux and Darwin** platforms using
|
|
||||||
standalone Nix, NixOS or Home-Manager. Please take a look at the [nvf manual]
|
**A**: nvf actively supports **Linux and Darwin** platforms using standalone
|
||||||
for available installation instructions.
|
Nix, NixOS or Home-Manager. Please take a look at the [nvf manual] for available
|
||||||
|
installation instructions.
|
||||||
|
|
||||||
**Q**: Can you add _X_?
|
**Q**: Can you add _X_?
|
||||||
<br/> **A**: Maybe! It is not one of our goals to support each and every Neovim
|
|
||||||
|
**A**: Maybe! It is not one of our goals to support each and every Neovim
|
||||||
plugin, however, I am always open to new modules and plugin setup additions to
|
plugin, however, I am always open to new modules and plugin setup additions to
|
||||||
**nvf**. Use the appropriate [issue template] and I will consider a module
|
**nvf**. Use the appropriate [issue template] and I will consider a module
|
||||||
addition. As mentioned before, pull requests to add new features are also
|
addition. As mentioned before, pull requests to add new features are also
|
||||||
welcome.
|
welcome.
|
||||||
|
|
||||||
**Q**: A plugin I need is not available in **nvf**. What to do?
|
**Q**: A plugin I need is not available in **nvf**. What to do?
|
||||||
<br/> **A**: **nvf** exposes several APIs for you to be able to add your own
|
|
||||||
plugin configurations! Please see the documentation on how you may do this.
|
**A**: **nvf** exposes several APIs for you to be able to add your own plugin
|
||||||
|
configurations! Please see the documentation on how you may do this.
|
||||||
|
|
||||||
**Q**: Main branch is awfully silent, is the project dead?
|
**Q**: Main branch is awfully silent, is the project dead?
|
||||||
<br/> **A**: No! Sometimes we branch out (e.g. `v0.6`) to avoid breaking
|
|
||||||
userspace and work in a separate branch until we make sure the new additions are
|
**A**: No! Sometimes we branch out (e.g. `v0.6`) to avoid breaking userspace and
|
||||||
implemented in the most comfortable way possible for the end user. If you have
|
work in a separate branch until we make sure the new additions are implemented
|
||||||
not noticed any activity on the main branch, consider taking a look at the
|
in the most comfortable way possible for the end user. If you have not noticed
|
||||||
|
any activity on the main branch, consider taking a look at the
|
||||||
[list of branches] or the [list of open pull requests]. You may also consider
|
[list of branches] or the [list of open pull requests]. You may also consider
|
||||||
_testing_ those release branches to get access to new features ahead of time and
|
_testing_ those release branches to get access to new features ahead of time and
|
||||||
better prepare to breaking changes.
|
better prepare to breaking changes.
|
||||||
|
|
||||||
**Q**: Will you support non-flake installations?
|
**Q**: Will you support non-flake installations?
|
||||||
<br/> **A**: Quite possibly. **nvf** started as "neovim-flake", which does mean
|
|
||||||
it is and will remain flakes-first but we might consider non-flakes
|
**A**: Quite possibly. **nvf** started as "neovim-flake", which does mean it is
|
||||||
compatibility. Though keep in mind that **nvf** under non-flake environments
|
and will remain flakes-first but we might consider non-flakes compatibility.
|
||||||
would lose customizability of plugin inputs, which is one of our primary
|
Though keep in mind that **nvf** under non-flake environments would lose
|
||||||
features.
|
customizability of plugin inputs, which is one of our primary features.
|
||||||
|
|
||||||
|
**Q**: I prefer working with Lua, can I use nvf as a plugin manager while I use
|
||||||
|
an imperative path (e.g., `~/.config/nvim`) for my Neovim configuration instead
|
||||||
|
of a configuration generated from Nix?
|
||||||
|
|
||||||
|
**A**: Yes! Add `"~/.config.nvim"` to `vim.additionalRuntimePaths = [ ... ]` and
|
||||||
|
any plugins you want to load to `vim.startPlugins`. This will load your
|
||||||
|
configuration from `~/.config/nvim`. You may still use `vim.*` to modify
|
||||||
|
Neovim's behaviour with Nix.
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
### Co-Maintainers
|
||||||
|
|
||||||
|
Alongside myself, nvf is developed by those talented folk:
|
||||||
|
|
||||||
|
- [**@horriblename**](https://github.com/horriblename)
|
||||||
|
([Liberapay](https://liberapay.com/horriblename/))- For actively implementing
|
||||||
|
planned features and quality of life updates.
|
||||||
|
- [**@Diniamo**](https://github.com/Diniamo)
|
||||||
|
([Liberapay](https://en.liberapay.com/diniamo/)) - For actively submitting
|
||||||
|
pull requests, issues and assistance with maintenance of nvf.
|
||||||
|
|
||||||
|
Please do remember to extend your thanks (financially or otherwise) if this
|
||||||
|
project has been helpful to you.
|
||||||
|
|
||||||
### Contributors
|
### Contributors
|
||||||
|
|
||||||
[mnw]: https://github.com/gerg-l/mnw
|
[mnw]: https://github.com/gerg-l/mnw
|
||||||
|
|
@ -213,41 +265,39 @@ features.
|
||||||
nvf would not be what it is today without the awesome people below. Special,
|
nvf would not be what it is today without the awesome people below. Special,
|
||||||
heart-felt thanks to
|
heart-felt thanks to
|
||||||
|
|
||||||
- [@fufexan](https://github.com/fufexan) - For the transition to flake-parts and
|
- [**@fufexan**](https://github.com/fufexan) - For the transition to flake-parts
|
||||||
invaluable Nix assistance.
|
and invaluable Nix assistance.
|
||||||
- [@FlafyDev](https://github.com/FlafyDev) - For getting home-manager module to
|
- [**@FlafyDev**](https://github.com/FlafyDev) - For getting Home-Manager module
|
||||||
work and Nix assistance.
|
to work and Nix assistance.
|
||||||
- [@n3oney](https://github.com/n3oney) - For making custom keybinds finally
|
- [**@n3oney**](https://github.com/n3oney) - For making custom keybinds finally
|
||||||
possible, and other module additions.
|
possible, and other module additions.
|
||||||
- [@horriblename](https://github.com/horriblename) - For actively implementing
|
- [**@Yavko**](https://github.com/Yavko) - For the amazing **nvf** logo
|
||||||
planned features and quality of life updates.
|
- [**@FrothyMarrow**](https://github.com/FrothyMarrow) - For seeing mistakes
|
||||||
- [@Yavko](https://github.com/Yavko) - For the amazing **nvf** logo
|
that I could not.
|
||||||
- [@FrothyMarrow](https://github.com/FrothyMarrow) - For seeing mistakes that I
|
- [**@Gerg-l**](https://github.com/gerg-l) 🐸 - For the modern Neovim wrapper,
|
||||||
could not.
|
[mnw], and occasional code improvements.
|
||||||
- [@Diniamo](https://github.com/Diniamo) - For actively submitting pull
|
- [**@Soliprem**](https://github.com/soliprem) - Rigorously implementing missing
|
||||||
requests, issues and assistance with maintenance of nvf.
|
features and excellent work on new language modules.
|
||||||
- [@Gerg-l](https://github.com/gerg-l) - For the modern Neovim wrapper, [mnw],
|
|
||||||
and occasional code improvements.
|
|
||||||
|
|
||||||
and everyone who has submitted issues or pull requests!
|
and everyone who has submitted issues or pull requests!
|
||||||
|
|
||||||
### Inspiration
|
### Inspiration
|
||||||
|
|
||||||
This configuration borrows from and is based on a few other configurations,
|
This configuration borrows from, and is based on a few other configurations,
|
||||||
including:
|
including:
|
||||||
|
|
||||||
- [@jordanisaacs's](https://github.com/jordanisaacs)
|
- [@jordanisaacs's](https://github.com/jordanisaacs)
|
||||||
[neovim-flake](https://github.com/jordanisaacs/neovim-flake) that this flake
|
[**neovim-flake**](https://github.com/jordanisaacs/neovim-flake) that this
|
||||||
is originally based on.
|
flake is originally based on.
|
||||||
- [@sioodmy's](https://github.com/sioodmy)
|
|
||||||
[dotfiles](https://github.com/sioodmy/dotfiles) that inspired the design
|
|
||||||
choices for UI and plugin defaults.
|
|
||||||
- [@wiltaylor's](https://github.com/wiltaylor)
|
- [@wiltaylor's](https://github.com/wiltaylor)
|
||||||
[neovim-flake](https://github.com/wiltaylor/neovim-flake) for plugin and
|
[neovim-flake](https://github.com/wiltaylor/neovim-flake) for plugin and
|
||||||
design ideas.
|
design ideas.
|
||||||
- [@gvolpe's](https://github.com/gvolpe)
|
- [@gvolpe's](https://github.com/gvolpe)
|
||||||
[neovim-flake](https://github.com/gvolpe/neovim-flake) for plugin, design and
|
[neovim-flake](https://github.com/gvolpe/neovim-flake) for plugin, design and
|
||||||
nix concepts.
|
nix concepts.
|
||||||
|
- [@sioodmy's](https://github.com/sioodmy)
|
||||||
|
[dotfiles](https://github.com/sioodmy/dotfiles) that inspired the design
|
||||||
|
choices for UI and plugin defaults.
|
||||||
|
|
||||||
I am grateful for their previous work and inspiration, and I wholeheartedly
|
I am grateful for their previous work and inspiration, and I wholeheartedly
|
||||||
recommend checking their work out.
|
recommend checking their work out.
|
||||||
|
|
@ -255,12 +305,12 @@ recommend checking their work out.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Following the license of the
|
Following the license of
|
||||||
[original neovim-flake](https://github.com/jordanisaacs/neovim-flake), nvf has
|
[the original neovim-flake](https://github.com/jordanisaacs/neovim-flake), nvf
|
||||||
been made available under the [**MIT License**](LICENSE). However, all assets
|
has been made available under the [**MIT License**](LICENSE). However, all
|
||||||
and documentation are published under the
|
assets and documentation are published under the
|
||||||
[**CC BY License**](https://github.com/NotAShelf/nvf/blob/main/.github/assets/LICENSE)
|
[**CC BY License**](https://github.com/NotAShelf/nvf/blob/main/.github/assets/LICENSE)
|
||||||
under explicit permission by the artist.
|
under explicit permission by the author or authors.
|
||||||
|
|
||||||
<h6 align="center">Yes, this includes the logo work too. Stop taking artwork that is not yours!</h6>
|
<h6 align="center">Yes, this includes the logo work too. Stop taking artwork that is not yours!</h6>
|
||||||
|
|
||||||
|
|
|
||||||
3
.github/typos.toml
vendored
3
.github/typos.toml
vendored
|
|
@ -1,2 +1,5 @@
|
||||||
|
|
||||||
default.extend-ignore-words-re = ["(?i)(noice)", "befores", "annote", "viw"]
|
default.extend-ignore-words-re = ["(?i)(noice)", "befores", "annote", "viw"]
|
||||||
|
files.extend-exclude = [
|
||||||
|
"npins/sources.json"
|
||||||
|
]
|
||||||
|
|
|
||||||
1
.github/workflows/cachix.yml
vendored
1
.github/workflows/cachix.yml
vendored
|
|
@ -35,7 +35,6 @@ jobs:
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
||||||
|
|
||||||
- uses: cachix/cachix-action@v15
|
- uses: cachix/cachix-action@v15
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
3
.github/workflows/check-docs.yml
vendored
3
.github/workflows/check-docs.yml
vendored
|
|
@ -21,7 +21,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
@ -42,13 +41,13 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: "${{ matrix.package }}"
|
name: "${{ matrix.package }}"
|
||||||
path: result/share/doc/nvf
|
path: result/share/doc/nvf
|
||||||
|
|
||||||
flake-docs-linkcheck:
|
flake-docs-linkcheck:
|
||||||
name: Validate hyperlinks in documentation sources
|
name: Validate hyperlinks in documentation sources
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
|
||||||
2
.github/workflows/check.yml
vendored
2
.github/workflows/check.yml
vendored
|
|
@ -19,7 +19,6 @@ jobs:
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
||||||
|
|
||||||
- name: Check Flake
|
- name: Check Flake
|
||||||
run: nix flake check
|
run: nix flake check
|
||||||
|
|
@ -33,6 +32,5 @@ jobs:
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
||||||
|
|
||||||
- run: nix run nixpkgs#alejandra -- -c .
|
- run: nix run nixpkgs#alejandra -- -c .
|
||||||
|
|
|
||||||
184
.github/workflows/docs-preview.yml
vendored
Normal file
184
.github/workflows/docs-preview.yml
vendored
Normal file
|
|
@ -0,0 +1,184 @@
|
||||||
|
name: Build and Preview Manual
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request_target:
|
||||||
|
types: [opened, synchronize, reopened, closed]
|
||||||
|
paths:
|
||||||
|
- ".github/workflows/docs-preview.yml"
|
||||||
|
- "modules/**"
|
||||||
|
- "docs/**"
|
||||||
|
|
||||||
|
# Defining permissions here passes it to all workflows.
|
||||||
|
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
issues: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-preview:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install Nix
|
||||||
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set default git branch (to reduce log spam)
|
||||||
|
run: git config --global init.defaultBranch main
|
||||||
|
|
||||||
|
- name: Build documentation packages
|
||||||
|
run: nix build .#docs-html --print-build-logs
|
||||||
|
|
||||||
|
- name: Deploy to GitHub Pages preview
|
||||||
|
run: |
|
||||||
|
PR_NUMBER=${{ github.event.pull_request.number }}
|
||||||
|
BRANCH_NAME="gh-pages"
|
||||||
|
PREVIEW_DIR="docs-preview-${PR_NUMBER}"
|
||||||
|
|
||||||
|
# Clone the gh-pages branch and move to the preview subdirectory
|
||||||
|
git clone --single-branch --branch $BRANCH_NAME https://github.com/${{ github.repository }} gh-pages
|
||||||
|
cd gh-pages
|
||||||
|
|
||||||
|
mkdir -p $PREVIEW_DIR
|
||||||
|
|
||||||
|
# Copy the build files to the preview subdirectory
|
||||||
|
cp -rvf ../result/share/doc/nvf/* ./$PREVIEW_DIR
|
||||||
|
|
||||||
|
# Configure git to use the GitHub Actions token for authentication
|
||||||
|
git config --global user.name "GitHub Actions"
|
||||||
|
git config --global user.email "actions@github.com"
|
||||||
|
|
||||||
|
# Set the GitHub token for authentication
|
||||||
|
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
|
||||||
|
|
||||||
|
# Add and commit the changes
|
||||||
|
git add --all
|
||||||
|
git commit -m "Deploy PR #${PR_NUMBER} preview" || echo "No changes to commit"
|
||||||
|
git push --force origin $BRANCH_NAME
|
||||||
|
|
||||||
|
comment-url:
|
||||||
|
needs: build-preview
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Prepare Environment
|
||||||
|
id: prelude
|
||||||
|
run: |
|
||||||
|
PR_NUMBER=${{ github.event.pull_request.number }}
|
||||||
|
URL="https://${{ github.repository_owner }}.github.io/nvf/docs-preview-${PR_NUMBER}/"
|
||||||
|
|
||||||
|
# Propagate non-interpolatable environment vars
|
||||||
|
echo "URL=$URL" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "REV=$GITHUB_SHA" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "ACTOR=$GITHUB_ACTOR" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "REF=$GITHUB_HEAD_REF" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "RUNS=$GITHUB_RUN_NUMBER" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
echo "Live Preview URL: $URL"
|
||||||
|
echo "Rev: $GITHUB_SHA"
|
||||||
|
echo "Actor: $GITHUB_ACTOR"
|
||||||
|
echo "Ref: "$GITHUB_HEAD_REF"
|
||||||
|
echo "Reruns: "$GITHUB_RUN_NUMBER"
|
||||||
|
|
||||||
|
echo "### :rocket: Live Preview Deployed " >> "$GITHUB_STEP_SUMMARY"
|
||||||
|
echo "Preview can be found at ${URL}" >> "$GITHUB_STEP_SUMMARY"
|
||||||
|
|
||||||
|
- name: Find Comment
|
||||||
|
uses: peter-evans/find-comment@v3
|
||||||
|
id: fc
|
||||||
|
with:
|
||||||
|
comment-author: "github-actions[bot]"
|
||||||
|
issue-number: ${{ github.event.pull_request.number }}
|
||||||
|
body-includes: "Live preview deployed"
|
||||||
|
|
||||||
|
- name: Post live preview comment
|
||||||
|
uses: peter-evans/create-or-update-comment@v4
|
||||||
|
env:
|
||||||
|
COMMENT_ID: ${{ steps.fc.outputs.comment-id }}
|
||||||
|
URL: ${{ steps.prelude.outputs.URL }}
|
||||||
|
GITHUB_SHA: ${{ steps.prelude.outputs.REV }}
|
||||||
|
ACTOR: ${{ steps.prelude.outputs.ACTOR }}
|
||||||
|
REF: ${{ steps.prelude.outputs.REF }}
|
||||||
|
RUNS: ${{ steps.prelude.outputs.RUNS }}
|
||||||
|
with:
|
||||||
|
comment-id: ${{ env.COMMENT_ID }}
|
||||||
|
issue-number: ${{ github.event.pull_request.number }} # issue number also applies to pull requests
|
||||||
|
edit-mode: replace # replace previous body
|
||||||
|
body: |
|
||||||
|
### :rocket: Live preview deployed from ${{ env.GITHUB_SHA }}
|
||||||
|
|
||||||
|
View it [here](${{ env.URL }}):
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><strong>Debug Information</strong></summary>
|
||||||
|
<p>Triggered by: ${{ env.ACTOR }}</p>
|
||||||
|
<p><code>HEAD</code> at: ${{ env.REF }}</p>
|
||||||
|
<p>Reruns: ${{ env.RUNS }}</p>
|
||||||
|
</details>
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
if: ${{ github.event.pull_request.merged == true || github.event.pull_request.state == 'closed' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Delete preview for closed/merged PR
|
||||||
|
run: |
|
||||||
|
PR_NUMBER=${{ github.event.pull_request.number }}
|
||||||
|
BRANCH_NAME="gh-pages"
|
||||||
|
PREVIEW_DIR="docs-preview-${PR_NUMBER}"
|
||||||
|
|
||||||
|
# Clone the gh-pages branch
|
||||||
|
git clone --single-branch --branch $BRANCH_NAME https://github.com/${{ github.repository }} gh-pages
|
||||||
|
cd gh-pages
|
||||||
|
|
||||||
|
# Check if the preview directory exists, and delete it if it does
|
||||||
|
if [ -d "$PREVIEW_DIR" ]; then
|
||||||
|
echo "Deleting preview directory $PREVIEW_DIR"
|
||||||
|
rm -rf $PREVIEW_DIR
|
||||||
|
else
|
||||||
|
echo "Preview directory $PREVIEW_DIR does not exist. Skipping deletion."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Configure git to use the GitHub Actions token for authentication
|
||||||
|
git config --global user.name "GitHub Actions"
|
||||||
|
git config --global user.email "actions@github.com"
|
||||||
|
|
||||||
|
# Set the GitHub token for authentication
|
||||||
|
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
|
||||||
|
|
||||||
|
# Add and commit the changes (only if there's something to delete)
|
||||||
|
git add .
|
||||||
|
git diff --quiet || git commit -m "Remove preview for PR #${PR_NUMBER}"
|
||||||
|
git push origin $BRANCH_NAME
|
||||||
|
|
||||||
|
cleanup-comment:
|
||||||
|
needs: cleanup
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Double check preview directory deletion
|
||||||
|
run: |
|
||||||
|
# Check if the preview directory exists, and delete it if it does
|
||||||
|
if [ -d "docs-preview-${{ github.event.pull_request.number }}" ]; then
|
||||||
|
echo "Something went wrong, preview directory is not deleted."
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "Preview directory has been deleted successfully, proceeding."
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Post cleanup verification
|
||||||
|
uses: peter-evans/create-or-update-comment@v4
|
||||||
|
with:
|
||||||
|
issue-number: ${{ github.event.pull_request.number }}
|
||||||
|
body: |
|
||||||
|
✅ Preview has been deleted successfully!
|
||||||
1
.github/workflows/editorconfig.yml
vendored
1
.github/workflows/editorconfig.yml
vendored
|
|
@ -30,7 +30,6 @@ jobs:
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
||||||
|
|
||||||
- name: Checking EditorConfig
|
- name: Checking EditorConfig
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
||||||
1
.github/workflows/manual.yml
vendored
1
.github/workflows/manual.yml
vendored
|
|
@ -45,7 +45,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.7
|
- uses: actions/checkout@v4.1.7
|
||||||
- uses: DeterminateSystems/nix-installer-action@main
|
- uses: DeterminateSystems/nix-installer-action@main
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
||||||
- run: |
|
- run: |
|
||||||
nix build .#docs -Lv
|
nix build .#docs -Lv
|
||||||
cp -r result/share/doc/nvf public
|
cp -r result/share/doc/nvf public
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
# This is the sample configuration for nvf, aiming to give you a feel of the default options
|
# This is the sample configuration for nvf, aiming to give you a feel of the default options
|
||||||
# while certain plugins are enabled. While it may act as one, this is not an overview of nvf's
|
# while certain plugins are enabled. While it may partially act as one, this is *not* quite
|
||||||
# module options. To find a complete overview of nvf's options and examples, visit the manual.
|
# an overview of nvf's module options. To find a complete and curated list of nvf module
|
||||||
|
# options, examples, instruction tutorials and more; please visit the online manual.
|
||||||
# https://notashelf.github.io/nvf/options.html
|
# https://notashelf.github.io/nvf/options.html
|
||||||
isMaximal: {
|
isMaximal: {
|
||||||
config.vim = {
|
config.vim = {
|
||||||
|
|
@ -13,7 +14,7 @@ isMaximal: {
|
||||||
};
|
};
|
||||||
|
|
||||||
spellcheck = {
|
spellcheck = {
|
||||||
enable = isMaximal;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
|
|
@ -80,6 +81,7 @@ isMaximal: {
|
||||||
ocaml.enable = false;
|
ocaml.enable = false;
|
||||||
elixir.enable = false;
|
elixir.enable = false;
|
||||||
haskell.enable = false;
|
haskell.enable = false;
|
||||||
|
ruby.enable = false;
|
||||||
|
|
||||||
tailwind.enable = false;
|
tailwind.enable = false;
|
||||||
svelte.enable = false;
|
svelte.enable = false;
|
||||||
|
|
@ -171,15 +173,18 @@ isMaximal: {
|
||||||
utility = {
|
utility = {
|
||||||
ccc.enable = false;
|
ccc.enable = false;
|
||||||
vim-wakatime.enable = false;
|
vim-wakatime.enable = false;
|
||||||
|
diffview-nvim.enable = true;
|
||||||
|
yanky-nvim.enable = false;
|
||||||
icon-picker.enable = isMaximal;
|
icon-picker.enable = isMaximal;
|
||||||
surround.enable = isMaximal;
|
surround.enable = isMaximal;
|
||||||
diffview-nvim.enable = true;
|
leetcode-nvim.enable = isMaximal;
|
||||||
|
multicursors.enable = isMaximal;
|
||||||
|
|
||||||
motion = {
|
motion = {
|
||||||
hop.enable = true;
|
hop.enable = true;
|
||||||
leap.enable = true;
|
leap.enable = true;
|
||||||
precognition.enable = isMaximal;
|
precognition.enable = isMaximal;
|
||||||
};
|
};
|
||||||
|
|
||||||
images = {
|
images = {
|
||||||
image-nvim.enable = false;
|
image-nvim.enable = false;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,16 @@
|
||||||
.TH "nvf" "5" "01/01/1980" "nvf"
|
.TH "nvf" "5" "January 1, 1980" "nvf"
|
||||||
.\" disable hyphenation
|
.\" disable hyphenation
|
||||||
.nh
|
.nh
|
||||||
.\" disable justification (adjust text to left margin only)
|
.\" disable justification (adjust text to left margin only)
|
||||||
.ad l
|
.ad l
|
||||||
.\" enable line breaks after slashes
|
.\" enable line breaks after slashes
|
||||||
.cflags 4 /
|
.cflags 4 /
|
||||||
|
|
||||||
.SH "NAME"
|
.SH "NAME"
|
||||||
nvf configuration specification
|
nvf \- Configuration specification for the nvf.
|
||||||
.SH "OPTIONS"
|
|
||||||
.PP
|
.SH "DESCRIPTION"
|
||||||
You can use the following options to configure nvf:
|
The nvf configuration specification provides a declarative structure for configuring Neovim using Nix with few
|
||||||
.PP
|
lines of Nix. This document outlines the available options and their usage to create modular, reusable, and
|
||||||
|
reproducible configurations using nvf's module system options. For tips, tricks and possible quirks with available
|
||||||
|
plugins please visit https://notashelf.github.io/nvf/
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
.Dd January 1, 1980
|
.Dd January 1, 1980
|
||||||
.Dt nvf 1
|
.Dt NVF 1
|
||||||
.Os nvf
|
.Os nvf
|
||||||
.\" disable hyphenation
|
.\" disable hyphenation
|
||||||
.nh
|
.nh
|
||||||
|
|
@ -7,27 +7,46 @@
|
||||||
.ad l
|
.ad l
|
||||||
.\" enable line breaks after slashes
|
.\" enable line breaks after slashes
|
||||||
.cflags 4 /
|
.cflags 4 /
|
||||||
|
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm nvf
|
.Nm nvf
|
||||||
.Nd A highly modular, extensible and distro-agnostic Neovim configuration framework for Nix/NixOS.
|
.Nd A modular, extensible, and distro-agnostic Neovim configuration framework for Nix/NixOS.
|
||||||
.
|
|
||||||
|
.Sh DESCRIPTION
|
||||||
|
.Nm nvf
|
||||||
|
is a highly modular, configurable, extensible, and easy-to-use Neovim configuration in Nix.
|
||||||
|
Designed for flexibility and ease of use, nvf allows you to easily configure your fully featured
|
||||||
|
Neovim instance with a few lines of Nix.
|
||||||
|
|
||||||
|
.Sh COMMANDS
|
||||||
|
The following commands are bundled with nvf to allow easier debugging of your configuration.
|
||||||
|
|
||||||
|
.Bl -tag -width Ds
|
||||||
|
.It Nm nvf-print-config
|
||||||
|
Outputs the full configuration of the current `nvf` setup. This command is useful for debugging
|
||||||
|
or inspecting the applied configuration.
|
||||||
|
.Pp
|
||||||
|
.It Nm nvf-print-config-path
|
||||||
|
Prints the file path to the configuration file currently in use. This command is helpful for locating
|
||||||
|
the source configuration file for troubleshooting or easily sharing it via online paste utilities.
|
||||||
|
.El
|
||||||
|
|
||||||
.Sh BUGS
|
.Sh BUGS
|
||||||
.Pp
|
.Pp
|
||||||
Please report any bugs that you might encounter on the
|
Please report any bugs on the project issue tracker:
|
||||||
\m[blue]\fBproject issue tracker\fR\m[]\&.
|
.Lk https://github.com/notashelf/nvf/issues
|
||||||
|
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Pp
|
.Pp
|
||||||
\fBnvf\fR(5)
|
.Fn nvf 5
|
||||||
|
|
||||||
.Sh AUTHOR
|
.Sh AUTHOR
|
||||||
.Pp
|
.Pp
|
||||||
\fBnvf contributors\fR
|
.Fn nvf contributors
|
||||||
.RS 4
|
.RS 4
|
||||||
Author.
|
Primary contributors and maintainers of the project.
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
.Sh COPYRIGHT
|
.Sh COPYRIGHT
|
||||||
.br
|
.Pp
|
||||||
Copyright \(co 2023\(en2024 nvf contributors
|
Copyright (c) 2023–2025 nvf contributors.
|
||||||
.br
|
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ in
|
||||||
--script script/anchor-use.js \
|
--script script/anchor-use.js \
|
||||||
--script script/anchor-min.js \
|
--script script/anchor-min.js \
|
||||||
--script script/search.js \
|
--script script/search.js \
|
||||||
--toc-depth 2 \
|
--toc-depth 1 \
|
||||||
--section-toc-depth 1 \
|
--section-toc-depth 1 \
|
||||||
manual.md \
|
manual.md \
|
||||||
"$dest/index.xhtml"
|
"$dest/index.xhtml"
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
```{=include=} chapters
|
```{=include=} chapters
|
||||||
configuring/custom-package.md
|
configuring/custom-package.md
|
||||||
configuring/custom-plugins.md
|
configuring/custom-plugins.md
|
||||||
configuring/custom-inputs.md
|
configuring/overriding-plugins.md
|
||||||
configuring/languages.md
|
configuring/languages.md
|
||||||
configuring/dags.md
|
configuring/dags.md
|
||||||
configuring/dag-entries.md
|
configuring/dag-entries.md
|
||||||
|
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
# Custom Inputs {#ch-custom-inputs}
|
|
||||||
|
|
||||||
One of the greatest strengths of **nvf** is its ability to get plugins from
|
|
||||||
flake inputs and build them locally from any given source. For plugins that do
|
|
||||||
not require any kind of additional building step, this is a powerful method of
|
|
||||||
adding plugins to your configuration that are not packaged in nixpkgs, or those
|
|
||||||
you want to track from source without relying on nixpkgs.
|
|
||||||
|
|
||||||
The [additional plugins section](#sec-additional-plugins) details the addition
|
|
||||||
of new plugins to nvf under regular circumstances, i.e. while making a pull
|
|
||||||
request to the project. You may _override_ those plugin inputs in your own
|
|
||||||
`flake.nix` to change source versions, e.g., to use newer versions of plugins
|
|
||||||
that are not yet updated in **nvf**.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
|
|
||||||
inputs = {
|
|
||||||
# ...
|
|
||||||
|
|
||||||
# The name here is arbitrary, you can name it whatever.
|
|
||||||
# This will add a plugin input called "your-neodev-input"
|
|
||||||
# that you can reference in a `follows` line.
|
|
||||||
your-neodev-input = {
|
|
||||||
url = "github:folke/neodev.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
nvf = {
|
|
||||||
url = "github:notashelf/nvf";
|
|
||||||
|
|
||||||
# The name of the input must match for the follows line
|
|
||||||
# plugin-neodev-nvim is what the input is called inside nvf
|
|
||||||
# so you must match the exact name here.
|
|
||||||
inputs.plugin-neodev-nvim.follows = "your-neodev-input";
|
|
||||||
};
|
|
||||||
# ...
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
This will override the source for the `neodev.nvim` plugin that is used in nvf
|
|
||||||
with your own input. You can update your new input via `nix flake update` or
|
|
||||||
more specifically `nix flake update <name of your input>` to keep it up to date.
|
|
||||||
|
|
||||||
::: {.warning}
|
|
||||||
|
|
||||||
While updating plugin inputs, make sure that any configuration that has been
|
|
||||||
deprecated in newer versions is changed in the plugin's `setupOpts`. If you
|
|
||||||
depend on a new version, requesting a version bump in the issues section is a
|
|
||||||
more reliable option.
|
|
||||||
|
|
||||||
:::
|
|
||||||
35
docs/manual/configuring/overriding-plugins.md
Normal file
35
docs/manual/configuring/overriding-plugins.md
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
# Overriding plugins {#ch-overriding-plugins}
|
||||||
|
|
||||||
|
The [additional plugins section](#sec-additional-plugins) details the addition
|
||||||
|
of new plugins to nvf under regular circumstances, i.e. while making a pull
|
||||||
|
request to the project. You may _override_ those plugins in your config
|
||||||
|
to change source versions, e.g., to use newer versions of plugins
|
||||||
|
that are not yet updated in **nvf**.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
vim.pluginOverrides = {
|
||||||
|
lazydev-nvim = pkgs.fetchFromGitHub {
|
||||||
|
owner = "folke";
|
||||||
|
repo = "lazydev.nvim";
|
||||||
|
rev = "";
|
||||||
|
hash = "";
|
||||||
|
};
|
||||||
|
# It's also possible to use a flake input
|
||||||
|
lazydev-nvim = inputs.lazydev-nvim;
|
||||||
|
# Or a local path
|
||||||
|
lazydev-nvim = ./lazydev;
|
||||||
|
# Or a npins pin... etc
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
This will override the source for the `neodev.nvim` plugin that is used in nvf
|
||||||
|
with your own plugin.
|
||||||
|
|
||||||
|
::: {.warning}
|
||||||
|
|
||||||
|
While updating plugin inputs, make sure that any configuration that has been
|
||||||
|
deprecated in newer versions is changed in the plugin's `setupOpts`. If you
|
||||||
|
depend on a new version, requesting a version bump in the issues section is a
|
||||||
|
more reliable option.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
@ -1,36 +1,25 @@
|
||||||
# Adding Plugins {#sec-additional-plugins}
|
# Adding Plugins {#sec-additional-plugins}
|
||||||
|
|
||||||
To add a new Neovim plugin, first add the source url in the inputs section of
|
To add a new Neovim plugin, use `npins`
|
||||||
`flake.nix` with the prefix `plugin-`
|
|
||||||
|
Use:
|
||||||
|
|
||||||
|
`nix-shell -p npins` or `nix shell nixpkgs#npins`
|
||||||
|
|
||||||
|
Then run:
|
||||||
|
|
||||||
|
`npins add --name <plugin name> github <owner> <repo> -b <branch>`
|
||||||
|
|
||||||
|
Be sure to replace any non-alphanumeric characters with `-` for `--name`
|
||||||
|
|
||||||
|
For example
|
||||||
|
|
||||||
|
`npins add --name lazydev-nvim github folke lazydev.nvim -b main`
|
||||||
|
|
||||||
|
You can now reference this plugin as a **string**.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
config.vim.startPlugins = ["lazydev-nvim"];
|
||||||
inputs = {
|
|
||||||
# ...
|
|
||||||
plugin-neodev-nvim = {
|
|
||||||
url = "github:folke/neodev.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
# ...
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Prepending `plugin-` to the name of the input will allow nvf to automatically
|
|
||||||
discover inputs that are marked as plugins, and make them available in
|
|
||||||
`vim.startPlugins` or other areas that require a very specific plugin type as it
|
|
||||||
is defined in `@NVF_REPO@/lib/types/plugins.nix`
|
|
||||||
|
|
||||||
The addition of the `plugin-` prefix will allow **nvf** to autodiscover the
|
|
||||||
input from the flake inputs automatically, allowing you to refer to it in areas
|
|
||||||
that require a very specific plugin type as defined in `lib/types/plugins.nix`
|
|
||||||
|
|
||||||
You can now reference this plugin using its string name, the plugin will be
|
|
||||||
built with the name and source URL from the flake input, allowing you to refer
|
|
||||||
to it as a **string**.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
config.vim.startPlugins = ["neodev-nvim"];
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Modular setup options {#sec-modular-setup-options}
|
## Modular setup options {#sec-modular-setup-options}
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,11 @@ necessarily) before you start developing.
|
||||||
|
|
||||||
## Adding Documentation {#sec-guidelines-documentation}
|
## Adding Documentation {#sec-guidelines-documentation}
|
||||||
|
|
||||||
Most, if not all, changes warrant changes to the documentation. Module options
|
[Nixpkgs Flavoured Markdown]: https://github.com/NixOS/nixpkgs/blob/master/doc/README.md#syntax
|
||||||
should be documented with
|
|
||||||
[Nixpkgs-flavoured Markdown](https://nixos.org/manual/nixpkgs/unstable/#sec-contributing-markup),
|
|
||||||
albeit with exceptions.
|
|
||||||
|
|
||||||
::: {.note} As of **v0.5**, **nvf** is itself documented using full markdown in
|
Almost all changes warrant updates to the documentation: at the very least, you
|
||||||
both module options and the manual. With **v0.6**, this manual has also been
|
must update the changelog. Both the manual and module options use
|
||||||
converted to markdown in full. :::
|
[Nixpkgs Flavoured Markdown].
|
||||||
|
|
||||||
The HTML version of this manual containing both the module option descriptions
|
The HTML version of this manual containing both the module option descriptions
|
||||||
and the documentation of **nvf** (such as this page) can be generated and opened
|
and the documentation of **nvf** (such as this page) can be generated and opened
|
||||||
|
|
@ -117,10 +114,11 @@ applies to string literals and module descriptions and documentation.
|
||||||
|
|
||||||
### Nix {#sec-code-style-nix}
|
### Nix {#sec-code-style-nix}
|
||||||
|
|
||||||
**nvf** is formatted by the
|
[alejandra]: https://github.com/kamadorueda/alejandra
|
||||||
[alejandra](https://github.com/kamadorueda/alejandra) tool and the formatting is
|
|
||||||
checked in the pull request and push workflows. Run the `nix fmt` command inside
|
**nvf** is formatted by the [alejandra] tool and the formatting is checked in
|
||||||
the project repository before submitting your pull request.
|
the pull request and push workflows. Run the `nix fmt` command inside the
|
||||||
|
project repository before submitting your pull request.
|
||||||
|
|
||||||
While Alejandra is mostly opinionated on how code looks after formatting,
|
While Alejandra is mostly opinionated on how code looks after formatting,
|
||||||
certain changes are done at the user's discretion based on how the original code
|
certain changes are done at the user's discretion based on how the original code
|
||||||
|
|
@ -138,10 +136,14 @@ module = {
|
||||||
# same as parent modules, unfold submodules
|
# same as parent modules, unfold submodules
|
||||||
subModule = {
|
subModule = {
|
||||||
# this is an option that contains more than one nested value
|
# this is an option that contains more than one nested value
|
||||||
|
# Note: try to be careful about the ordering of `mkOption` arguments.
|
||||||
|
# General rule of thumb is to order from least to most likely to change.
|
||||||
|
# This is, for most cases, type < default < description.
|
||||||
|
# Example, if present, would be between default and description
|
||||||
someOtherValue = mkOption {
|
someOtherValue = mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
description = "Some other description";
|
|
||||||
default = true;
|
default = true;
|
||||||
|
description = "Some other description";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,15 +23,17 @@ An example flake that exposes your custom Neovim configuration might look like
|
||||||
nvf.url = "github:notashelf/nvf";
|
nvf.url = "github:notashelf/nvf";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {nixpkgs, ...} @ inputs: {
|
||||||
self,
|
packages.x86_64-linux = {
|
||||||
nixpkgs,
|
# Set the default package to the wrapped instance of Neovim.
|
||||||
...
|
# This will allow running your Neovim configuration with
|
||||||
} @ inputs: {
|
# `nix run` and in addition, sharing your configuration with
|
||||||
packages."x86_64-linux" = let
|
# other users in case your repository is public.
|
||||||
neovimConfigured = (inputs.nvf.lib.neovimConfiguration {
|
default =
|
||||||
inherit (nixpkgs.legacyPackages."x86_64-linux") pkgs;
|
(inputs.nvf.lib.neovimConfiguration {
|
||||||
modules = [{
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
|
modules = [
|
||||||
|
{
|
||||||
config.vim = {
|
config.vim = {
|
||||||
# Enable custom theming options
|
# Enable custom theming options
|
||||||
theme.enable = true;
|
theme.enable = true;
|
||||||
|
|
@ -43,14 +45,10 @@ An example flake that exposes your custom Neovim configuration might look like
|
||||||
# reference in Appendix B of the nvf manual.
|
# reference in Appendix B of the nvf manual.
|
||||||
# ...
|
# ...
|
||||||
};
|
};
|
||||||
}];
|
}
|
||||||
});
|
];
|
||||||
in {
|
})
|
||||||
# Set the default package to the wrapped instance of Neovim.
|
.neovim;
|
||||||
# This will allow running your Neovim configuration with
|
|
||||||
# `nix run` and in addition, sharing your configuration with
|
|
||||||
# other users in case your repository is public.
|
|
||||||
default = neovimConfigured.neovim;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,18 @@ To use it, we first add the input flake.
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
|
# Optional, if you intend to follow nvf's obsidian-nvim input
|
||||||
|
# you must also add it as a flake input.
|
||||||
obsidian-nvim.url = "github:epwalsh/obsidian.nvim";
|
obsidian-nvim.url = "github:epwalsh/obsidian.nvim";
|
||||||
|
|
||||||
|
# Required, nvf works best and only directly supports flakes
|
||||||
nvf = {
|
nvf = {
|
||||||
url = "github:notashelf/nvf";
|
url = "github:notashelf/nvf";
|
||||||
# you can override input nixpkgs
|
# You can override the input nixpkgs to follow your system's
|
||||||
|
# instance of nixpkgs. This is safe to do as nvf does not depend
|
||||||
|
# on a binary cache.
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
# you can also override individual plugins
|
# Optionally, you can also override individual plugins
|
||||||
# for example:
|
# for example:
|
||||||
inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs
|
inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs
|
||||||
};
|
};
|
||||||
|
|
@ -27,8 +33,8 @@ Followed by importing the home-manager module somewhere in your configuration.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
# assuming nvf is in your inputs and inputs is in the argset
|
# Assuming "nvf" is in your inputs and inputs is in the argument set.
|
||||||
# see example below
|
# See example installation below
|
||||||
imports = [ inputs.nvf.homeManagerModules.default ];
|
imports = [ inputs.nvf.homeManagerModules.default ];
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
@ -43,13 +49,13 @@ Followed by importing the home-manager module somewhere in your configuration.
|
||||||
nvf.url = "github:notashelf/nvf";
|
nvf.url = "github:notashelf/nvf";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nixpkgs, home-manager, nvf, ... }: let
|
outputs = { nixpkgs, home-manager, nvf, ... }: {
|
||||||
system = "x86_64-linux"; in {
|
|
||||||
# ↓ this is your home output in the flake schema, expected by home-manager
|
# ↓ this is your home output in the flake schema, expected by home-manager
|
||||||
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration
|
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration {
|
||||||
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
modules = [
|
modules = [
|
||||||
nvf.homeManagerModules.default # <- this imports the home-manager module that provides the options
|
nvf.homeManagerModules.default # <- this imports the home-manager module that provides the options
|
||||||
./home.nix # <- your home entrypoint
|
./home.nix # <- your home entrypoint, `programs.nvf.*` may be defined here
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,18 @@ To use it, we first add the input flake.
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
|
# Optional, if you intend to follow nvf's obsidian-nvim input
|
||||||
|
# you must also add it as a flake input.
|
||||||
obsidian-nvim.url = "github:epwalsh/obsidian.nvim";
|
obsidian-nvim.url = "github:epwalsh/obsidian.nvim";
|
||||||
|
|
||||||
|
# Required, nvf works best and only directly supports flakes
|
||||||
nvf = {
|
nvf = {
|
||||||
url = "github:notashelf/nvf";
|
url = "github:notashelf/nvf";
|
||||||
# you can override input nixpkgs
|
# You can override the input nixpkgs to follow your system's
|
||||||
|
# instance of nixpkgs. This is safe to do as nvf does not depend
|
||||||
|
# on a binary cache.
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
# you can also override individual plugins
|
# Optionally, you can also override individual plugins
|
||||||
# for example:
|
# for example:
|
||||||
inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs
|
inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs
|
||||||
};
|
};
|
||||||
|
|
@ -42,13 +48,12 @@ Followed by importing the NixOS module somewhere in your configuration.
|
||||||
nvf.url = "github:notashelf/nvf";
|
nvf.url = "github:notashelf/nvf";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nixpkgs, nvf, ... }: let
|
outputs = { nixpkgs, nvf, ... }: {
|
||||||
system = "x86_64-linux"; in {
|
|
||||||
# ↓ this is your host output in the flake schema
|
# ↓ this is your host output in the flake schema
|
||||||
nixosConfigurations."yourUsername»" = nixpkgs.lib.nixosSystem {
|
nixosConfigurations."your-hostname" = nixpkgs.lib.nixosSystem {
|
||||||
modules = [
|
modules = [
|
||||||
nvf.nixosModules.default # <- this imports the NixOS module that provides the options
|
nvf.nixosModules.default # <- this imports the NixOS module that provides the options
|
||||||
./configuration.nix # <- your host entrypoint
|
./configuration.nix # <- your host entrypoint, `programs.nvf.*` may be defined here
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -16,26 +16,32 @@ the default theme enabled. You may use other options inside `config.vim` in
|
||||||
nvf.url = "github:notashelf/nvf";
|
nvf.url = "github:notashelf/nvf";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {nixpkgs, nvf, ...}: let
|
outputs = {
|
||||||
system = "x86_64-linux";
|
nixpkgs,
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
nvf,
|
||||||
configModule = {
|
self,
|
||||||
# Add any custom options (and do feel free to upstream them!)
|
...
|
||||||
# options = { ... };
|
}: {
|
||||||
|
|
||||||
config.vim = {
|
|
||||||
theme.enable = true;
|
|
||||||
# and more options as you see fit...
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
customNeovim = nvf.lib.neovimConfiguration {
|
|
||||||
inherit pkgs;
|
|
||||||
modules = [configModule];
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
# This will make the package available as a flake output under 'packages'
|
# This will make the package available as a flake output under 'packages'
|
||||||
packages.${system}.my-neovim = customNeovim.neovim;
|
packages.x86_64-linux.my-neovim =
|
||||||
|
(nvf.lib.neovimConfiguration {
|
||||||
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
|
modules = [
|
||||||
|
# Or move this to a separate file and add it's path here instead
|
||||||
|
# IE: ./nvf_module.nix
|
||||||
|
(
|
||||||
|
{pkgs, ...}: {
|
||||||
|
# Add any custom options (and do feel free to upstream them!)
|
||||||
|
# options = { ... };
|
||||||
|
config.vim = {
|
||||||
|
theme.enable = true;
|
||||||
|
# and more options as you see fit...
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
|
];
|
||||||
|
})
|
||||||
|
.neovim;
|
||||||
|
|
||||||
# Example nixosConfiguration using the configured Neovim package
|
# Example nixosConfiguration using the configured Neovim package
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
|
|
@ -43,11 +49,13 @@ the default theme enabled. You may use other options inside `config.vim` in
|
||||||
# ...
|
# ...
|
||||||
modules = [
|
modules = [
|
||||||
# This will make wrapped neovim available in your system packages
|
# This will make wrapped neovim available in your system packages
|
||||||
{environment.systemPackages = [customNeovim.neovim];}
|
# Can also move this to another config file if you pass inputs/self around with specialArgs
|
||||||
|
({pkgs, ...}: {
|
||||||
|
environment.systemPackages = [self.packages.${pkgs.stdenv.system}.neovim];
|
||||||
|
})
|
||||||
];
|
];
|
||||||
# ...
|
# ...
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}```
|
||||||
```
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ try-it-out.md
|
||||||
default-configs.md
|
default-configs.md
|
||||||
installation.md
|
installation.md
|
||||||
configuring.md
|
configuring.md
|
||||||
|
tips.md
|
||||||
```
|
```
|
||||||
|
|
||||||
```{=include=} chapters
|
```{=include=} chapters
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,13 @@
|
||||||
# Neovim Flake Configuration Options {#ch-options}
|
# nvf Configuration Options {#ch-options}
|
||||||
|
|
||||||
Below are the module options provided by nvf, in no particular order. Most
|
Below are the module options provided by nvf, in no particular order. Most
|
||||||
options will include useful comments, warnings or setup tips on how a module
|
options will include useful comments, warnings or setup tips on how a module
|
||||||
option is meant to be used as well as examples in complex cases.
|
option is meant to be used as well as examples in complex cases.
|
||||||
|
|
||||||
|
An offline version of this page is bundled with nvf as a part of the manpages
|
||||||
|
which you can access with `man 5 nvf`. Please us know if you believe any of the
|
||||||
|
options below are missing useful examples.
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
In the manual, individual options may be referenced in Hyperlinks as follows:
|
In the manual, individual options may be referenced in Hyperlinks as follows:
|
||||||
[](#opt-vim.*) If changing the prefix here, do keep in mind the #opt- suffix will have
|
[](#opt-vim.*) If changing the prefix here, do keep in mind the #opt- suffix will have
|
||||||
|
|
|
||||||
7
docs/manual/tips.md
Normal file
7
docs/manual/tips.md
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# Helpful Tips {#ch-helpful-tips}
|
||||||
|
|
||||||
|
```{=include=} chapters
|
||||||
|
tips/pure-lua-config.md
|
||||||
|
tips/debugging-nvf.md
|
||||||
|
tips/offline-docs.md
|
||||||
|
```
|
||||||
25
docs/manual/tips/debugging-nvf.md
Normal file
25
docs/manual/tips/debugging-nvf.md
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
# Debugging nvf {#sec-debugging-nvf}
|
||||||
|
|
||||||
|
There may be instances where the your Nix configuration evaluates to invalid
|
||||||
|
Lua, or times when you will be asked to provide your built Lua configuration for
|
||||||
|
easier debugging by nvf maintainers. nvf provides two helpful utilities out of
|
||||||
|
the box.
|
||||||
|
|
||||||
|
**nvf-print-config** and **nvf-print-config-path** will be bundled with nvf as
|
||||||
|
lightweight utilities to help you view or share your built configuration when
|
||||||
|
necessary.
|
||||||
|
|
||||||
|
To view your configuration with syntax highlighting, you may use the
|
||||||
|
[bat pager](https://github.com/sharkdp/bat).
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nvf-print-config | bat --language=lua
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, `cat` or `less` may also be used.
|
||||||
|
|
||||||
|
## Accessing `neovimConfig` {#sec-accessing-config}
|
||||||
|
|
||||||
|
It is also possible to access the configuration for the wrapped package. The
|
||||||
|
_built_ Neovim package will contain a `neovimConfig` attribute in its
|
||||||
|
`passthru`.
|
||||||
11
docs/manual/tips/offline-docs.md
Normal file
11
docs/manual/tips/offline-docs.md
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Offline Documentation {#sec-offline-documentation}
|
||||||
|
|
||||||
|
[https://notashelf.github.io/nvf/options.html]: https://notashelf.github.io/nvf/options.html
|
||||||
|
|
||||||
|
The manpages provided by nvf contains an offline version of the option search
|
||||||
|
normally available at [https://notashelf.github.io/nvf/options.html]. You may
|
||||||
|
use the `man 5 nvf` command to view option documentation from the comfort of
|
||||||
|
your terminal.
|
||||||
|
|
||||||
|
Note that this is only available for NixOS and Home-Manager module
|
||||||
|
installations.
|
||||||
117
docs/manual/tips/pure-lua-config.md
Normal file
117
docs/manual/tips/pure-lua-config.md
Normal file
|
|
@ -0,0 +1,117 @@
|
||||||
|
# Pure Lua Configuration {#sec-pure-lua-config}
|
||||||
|
|
||||||
|
We recognize that you might not always want to configure your setup purely in
|
||||||
|
Nix, sometimes doing things in Lua is simply the "superior" option. In such a
|
||||||
|
case you might want to configure your Neovim instance using Lua, and nothing but
|
||||||
|
Lua. It is also possible to mix Lua and Nix configurations.
|
||||||
|
|
||||||
|
Pure Lua or hybrid Lua/Nix configurations can be achieved in two different ways.
|
||||||
|
_Purely_, by modifying Neovim's runtime directory or _impurely_ by placing Lua
|
||||||
|
configuration in a directory found in `$HOME`. For your convenience, this
|
||||||
|
section will document both methods as they can be used.
|
||||||
|
|
||||||
|
## Pure Runtime Directory {#sec-pure-nvf-runtime}
|
||||||
|
|
||||||
|
As of 0.6, nvf allows you to modify Neovim's runtime path to suit your needs.
|
||||||
|
One of the ways the new runtime option is to add a configuration **located
|
||||||
|
relative to your `flake.nix`**, which must be version controlled in pure flakes
|
||||||
|
manner.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
# Let us assume we are in the repository root, i.e., the same directory as the
|
||||||
|
# flake.nix. For the sake of the argument, we will assume that the Neovim lua
|
||||||
|
# configuration is in a nvim/ directory relative to flake.nix.
|
||||||
|
vim = {
|
||||||
|
additionalRuntimeDirectories = [
|
||||||
|
# This will be added to Neovim's runtime paths. Conceptually, this behaves
|
||||||
|
# very similarly to ~/.config/nvim but you may not place a top-level
|
||||||
|
# init.lua to be able to require it directly.
|
||||||
|
./nvim
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This will add the `nvim` directory, or rather, the _store path_ that will be
|
||||||
|
realised after your flake gets copied to the Nix store, to Neovim's runtime
|
||||||
|
directory. You may now create a `lua/myconfig` directory within this nvim
|
||||||
|
directory, and call it with [](#opt-vim.luaConfigRC).
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{pkgs, ...}: {
|
||||||
|
vim = {
|
||||||
|
additionalRuntimeDirectories = [
|
||||||
|
# You can list more than one file here.
|
||||||
|
./nvim-custom-1
|
||||||
|
|
||||||
|
# To make sure list items are ordered, use lib.mkBefore or lib.mkAfter
|
||||||
|
# Simply placing list items in a given order will **not** ensure that
|
||||||
|
# this list will be deterministic.
|
||||||
|
./nvim-custom-2
|
||||||
|
];
|
||||||
|
|
||||||
|
startPlugins = [pkgs.vimPlugins.gitsigns];
|
||||||
|
|
||||||
|
# Neovim supports in-line syntax highlighting for multi-line strings.
|
||||||
|
# Simply place the filetype in a /* comment */ before the line.
|
||||||
|
luaConfigRC.myconfig = /* lua */ ''
|
||||||
|
-- Call the Lua module from ./nvim/lua/myconfig
|
||||||
|
require("myconfig")
|
||||||
|
|
||||||
|
-- Any additional Lua configuration that you might want *after* your own
|
||||||
|
-- configuration. For example, a plugin setup call.
|
||||||
|
require('gitsigns').setup({})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Impure Absolute Directory {#sec-impure-absolute-dir}
|
||||||
|
|
||||||
|
[Neovim 0.9]: https://github.com/neovim/neovim/pull/22128
|
||||||
|
|
||||||
|
As of [Neovim 0.9], {var}`$NVIM_APPNAME` is a variable expected by Neovim to
|
||||||
|
decide on the configuration directory. nvf sets this variable as `"nvf"`,
|
||||||
|
meaning `~/.config/nvf` will be regarded as _the_ configuration directory by
|
||||||
|
Neovim, similar to how `~/.config/nvim` behaves in regular installations. This
|
||||||
|
allows some degree of Lua configuration, backed by our low-level wrapper
|
||||||
|
[mnw](https://github.com/Gerg-L/mnw). Creating a `lua/` directory located in
|
||||||
|
`$NVIM_APPNAME` ("nvf" by default) and placing your configuration in, e.g.,
|
||||||
|
`~/.config/nvf/lua/myconfig` will allow you to `require` it as a part of the Lua
|
||||||
|
module system through nvf's module system.
|
||||||
|
|
||||||
|
Let's assume your `~/.config/nvf/lua/myconfig/init.lua` consists of the
|
||||||
|
following:
|
||||||
|
|
||||||
|
```lua
|
||||||
|
-- init.lua
|
||||||
|
vim.keymap.set("n", " ", "<Nop>", { silent = true, remap = false })
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
```
|
||||||
|
|
||||||
|
The following Nix configuration via [](#opt-vim.luaConfigRC) will allow loading
|
||||||
|
this
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
# The attribute name "myconfig-dir" here is arbitrary. It is required to be
|
||||||
|
# a *named* attribute by the DAG system, but the name is entirely up to you.
|
||||||
|
vim.luaConfigRC.myconfig-dir = ''
|
||||||
|
require("myconfig")
|
||||||
|
|
||||||
|
-- Any additional Lua
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
[DAG system]: https://notashelf.github.io/nvf/index.xhtml#ch-using-dags
|
||||||
|
|
||||||
|
After you load your custom configuration, you may use an `init.lua` located in
|
||||||
|
your custom configuration directory to configure Neovim exactly as you would
|
||||||
|
without a wrapper like nvf. If you want to place your `require` call in a
|
||||||
|
specific position (i.e., before or after options you set in nvf) the
|
||||||
|
[DAG system] will let you place your configuration in a location of your
|
||||||
|
choosing.
|
||||||
|
|
||||||
|
[top-level DAG system]: https://notashelf.github.io/nvf/index.xhtml#ch-vim-luaconfigrc
|
||||||
|
|
@ -28,11 +28,11 @@ configuration formats.
|
||||||
|
|
||||||
### `vim.maps` rewrite {#sec-vim-maps-rewrite}
|
### `vim.maps` rewrite {#sec-vim-maps-rewrite}
|
||||||
|
|
||||||
Instead of specifying map modes using submodules (eg.: `vim.maps.normal`), a new
|
Instead of specifying map modes using submodules (e.g., `vim.maps.normal`), a
|
||||||
`vim.keymaps` submodule with support for a `mode` option has been introduced. It
|
new `vim.keymaps` submodule with support for a `mode` option has been
|
||||||
can be either a string, or a list of strings, where a string represents the
|
introduced. It can be either a string, or a list of strings, where a string
|
||||||
short-name of the map mode(s), that the mapping should be set for. See
|
represents the short-name of the map mode(s), that the mapping should be set
|
||||||
`:help map-modes` for more information.
|
for. See `:help map-modes` for more information.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,184 @@
|
||||||
# Release 0.8 {#sec-release-0.8}
|
# Release 0.8 {#sec-release-0.8}
|
||||||
|
|
||||||
|
## Breaking changes
|
||||||
|
|
||||||
|
- `git-conflict` keybinds are now prefixed with `<leader>` to avoid conflicting
|
||||||
|
with builtins
|
||||||
|
|
||||||
[NotAShelf](https://github.com/notashelf):
|
[NotAShelf](https://github.com/notashelf):
|
||||||
|
|
||||||
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
|
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
|
||||||
|
[render-markdown.nvim]: https://github.com/MeanderingProgrammer/render-markdown.nvim
|
||||||
|
[yanky.nvim]: https://github.com/gbprod/yanky.nvim
|
||||||
|
|
||||||
- Add [typst-preview.nvim] under
|
- Add [typst-preview.nvim] under
|
||||||
`languages.typst.extensions.typst-preview-nvim`.
|
`languages.typst.extensions.typst-preview-nvim`.
|
||||||
|
|
||||||
- Add a search widget to the options page in the nvf manual.
|
- Add a search widget to the options page in the nvf manual.
|
||||||
|
|
||||||
|
- Add [render-markdown.nvim] under
|
||||||
|
`languages.markdown.extensions.render-markdown-nvim`
|
||||||
|
|
||||||
|
- Implement [](#opt-vim.git.gitsigns.setupOpts) for user-specified setup table
|
||||||
|
in gitsigns configuration.
|
||||||
|
|
||||||
|
- [](#opt-vim.options.mouse) no longer compares values to an enum of available
|
||||||
|
mouse modes. This means you can provide any string without the module system
|
||||||
|
warning you that it is invalid. Do keep in mind that this value is no longer
|
||||||
|
checked, so you will be responsible for ensuring its validity.
|
||||||
|
|
||||||
|
- Deprecate `vim.enableEditorconfig` in favor of
|
||||||
|
[](#opt-vim.globals.editorconfig).
|
||||||
|
|
||||||
|
- Deprecate rnix-lsp as it has been abandoned and archived upstream.
|
||||||
|
|
||||||
|
- Hardcoded indentation values for the Nix language module have been removed. To
|
||||||
|
replicate previous behaviour, you must either consolidate Nix indentation in
|
||||||
|
your Editorconfig configuration, or use an autocommand to set indentation
|
||||||
|
values for buffers with the Nix filetype.
|
||||||
|
|
||||||
|
- Add [](#opt-vim.lsp.lightbulb.autocmd.enable) for manually managing the
|
||||||
|
previously managed lightbulb autocommand.
|
||||||
|
|
||||||
|
- A warning will occur if [](#opt-vim.lsp.lightbulb.autocmd.enable) and
|
||||||
|
`vim.lsp.lightbulb.setupOpts.autocmd.enabled` are both set at the same time.
|
||||||
|
Pick only one.
|
||||||
|
|
||||||
|
- Add [yanky.nvim] to available plugins, under `vim.utility.yanky-nvim`.
|
||||||
|
|
||||||
[amadaluzia](https://github.com/amadaluzia):
|
[amadaluzia](https://github.com/amadaluzia):
|
||||||
|
|
||||||
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
|
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
|
||||||
|
|
||||||
- Add Haskell support under `vim.languages.haskell` using [haskell-tools.nvim].
|
- Add Haskell support under `vim.languages.haskell` using [haskell-tools.nvim].
|
||||||
|
|
||||||
|
[horriblename](https://github.com/horriblename):
|
||||||
|
|
||||||
|
[blink.cmp]: https://github.com/saghen/blink.cmp
|
||||||
|
|
||||||
|
- Add [blink.cmp] support
|
||||||
|
|
||||||
[diniamo](https://github.com/diniamo):
|
[diniamo](https://github.com/diniamo):
|
||||||
|
|
||||||
- Add Odin support under `vim.languages.odin`.
|
- Add Odin support under `vim.languages.odin`.
|
||||||
|
|
||||||
- Disable the built-in format-on-save feature of zls. Use `vim.lsp.formatOnSave`
|
- Disable the built-in format-on-save feature of zls. Use `vim.lsp.formatOnSave`
|
||||||
instead.
|
instead.
|
||||||
|
|
||||||
|
[horriblename](https://github.com/horriblename):
|
||||||
|
|
||||||
|
[aerial.nvim]: (https://github.com/stevearc/aerial.nvim)
|
||||||
|
[nvim-ufo]: (https://github.com/kevinhwang91/nvim-ufo)
|
||||||
|
|
||||||
|
- Add [aerial.nvim]
|
||||||
|
- Add [nvim-ufo]
|
||||||
|
|
||||||
|
[LilleAila](https://github.com/LilleAila):
|
||||||
|
|
||||||
|
- Remove `vim.notes.obsidian.setupOpts.dir`, which was set by default. Fixes
|
||||||
|
issue with setting the workspace directory.
|
||||||
|
- Add `vim.snippets.luasnip.setupOpts`, which was previously missing.
|
||||||
|
- Add `"prettierd"` as a formatter option in
|
||||||
|
`vim.languages.markdown.format.type`.
|
||||||
|
- Add the following plugins from
|
||||||
|
[mini.nvim](https://github.com/echasnovski/mini.nvim)
|
||||||
|
- `mini.ai`
|
||||||
|
- `mini.align`
|
||||||
|
- `mini.animate`
|
||||||
|
- `mini.base16`
|
||||||
|
- `mini.basics`
|
||||||
|
- `mini.bracketed`
|
||||||
|
- `mini.bufremove`
|
||||||
|
- `mini.clue`
|
||||||
|
- `mini.colors`
|
||||||
|
- `mini.comment`
|
||||||
|
- `mini.completion`
|
||||||
|
- `mini.deps`
|
||||||
|
- `mini.diff`
|
||||||
|
- `mini.doc`
|
||||||
|
- `mini.extra`
|
||||||
|
- `mini.files`
|
||||||
|
- `mini.fuzzy`
|
||||||
|
- `mini.git`
|
||||||
|
- `mini.hipatterns`
|
||||||
|
- `mini.hues`
|
||||||
|
- `mini.icons`
|
||||||
|
- `mini.indentscope`
|
||||||
|
- `mini.jump`
|
||||||
|
- `mini.jump2d`
|
||||||
|
- `mini.map`
|
||||||
|
- `mini.misc`
|
||||||
|
- `mini.move`
|
||||||
|
- `mini.notify`
|
||||||
|
- `mini.operators`
|
||||||
|
- `mini.pairs`
|
||||||
|
- `mini.pick`
|
||||||
|
- `mini.sessions`
|
||||||
|
- `mini.snippets`
|
||||||
|
- `mini.splitjoin`
|
||||||
|
- `mini.starter`
|
||||||
|
- `mini.statusline`
|
||||||
|
- `mini.surround`
|
||||||
|
- `mini.tabline`
|
||||||
|
- `mini.test`
|
||||||
|
- `mini.trailspace`
|
||||||
|
- `mini.visits`
|
||||||
|
- Add [fzf-lua](https://github.com/ibhagwan/fzf-lua) in `vim.fzf-lua`
|
||||||
|
- Add [rainbow-delimiters](https://github.com/HiPhish/rainbow-delimiters.nvim)
|
||||||
|
in `vim.visuals.rainbow-delimiters`
|
||||||
|
- Add options to define highlights under [](#opt-vim.highlight)
|
||||||
|
|
||||||
|
[kaktu5](https://github.com/kaktu5):
|
||||||
|
|
||||||
|
- Add WGSL support under `vim.languages.wgsl`.
|
||||||
|
|
||||||
|
[tomasguinzburg](https://github.com/tomasguinzburg):
|
||||||
|
|
||||||
|
[solargraph]: https://github.com/castwide/solargraph
|
||||||
|
[gbprod/nord.nvim]: https://github.com/gbprod/nord.nvim
|
||||||
|
|
||||||
|
- Add Ruby support under `vim.languages.ruby` using [solargraph].
|
||||||
|
- Add `nord` theme from [gbprod/nord.nvim].
|
||||||
|
|
||||||
|
[thamenato](https://github.com/thamenato):
|
||||||
|
|
||||||
|
[ruff]: (https://github.com/astral-sh/ruff)
|
||||||
|
|
||||||
|
- Add [ruff] as a formatter option in `vim.languages.python.format.type`.
|
||||||
|
|
||||||
|
[ARCIII](https://github.com/ArmandoCIII):
|
||||||
|
|
||||||
|
[leetcode.nvim]: https://github.com/kawre/leetcode.nvim
|
||||||
|
|
||||||
|
- Add `vim.languages.zig.dap` support through pkgs.lldb dap adapter. Code
|
||||||
|
Inspiration from `vim.languages.clang.dap` implementation.
|
||||||
|
- Add [leetcode.nvim] plugin under `vim.utility.leetcode-nvim`.
|
||||||
|
|
||||||
|
|
||||||
|
[nezia1](https://github.com/nezia1)
|
||||||
|
|
||||||
|
- Add support for [nixd](https://github.com/nix-community/nixd) language server.
|
||||||
|
|
||||||
|
[jahanson](https://github.com/jahanson):
|
||||||
|
|
||||||
|
- Add [multicursors.nvim](https://github.com/smoka7/multicursors.nvim) to
|
||||||
|
available plugins, under `vim.utility.multicursors`.
|
||||||
|
- Add [hydra.nvim](https://github.com/nvimtools/hydra.nvim) as dependency for
|
||||||
|
`multicursors.nvim` and lazy loads by default.
|
||||||
|
[folospior](https://github.com/folospior)
|
||||||
|
|
||||||
|
- Fix plugin name for lsp/lspkind.
|
||||||
|
|
||||||
|
[iynaix](https://github.com/iynaix)
|
||||||
|
|
||||||
|
- Add lsp options support for [nixd](https://github.com/nix-community/nixd)
|
||||||
|
language server.
|
||||||
|
|
||||||
|
[Mr-Helpful](https://github.com/Mr-Helpful)
|
||||||
|
|
||||||
|
- Corrects pin names used for nvim themes
|
||||||
|
|
||||||
|
[Libadoxon](https://github.com/Libadoxon)
|
||||||
|
|
||||||
|
- Add [git-conflict](https://github.com/akinsho/git-conflict.nvim) plugin for resolving git conflicts
|
||||||
|
- Add formatters for go: [gofmt](https://go.dev/blog/gofmt), [golines](https://github.com/segmentio/golines) and [gofumpt](https://github.com/mvdan/gofumpt)
|
||||||
|
|
|
||||||
2087
flake.lock
generated
2087
flake.lock
generated
File diff suppressed because it is too large
Load diff
643
flake.nix
643
flake.nix
|
|
@ -5,9 +5,9 @@
|
||||||
self,
|
self,
|
||||||
...
|
...
|
||||||
} @ inputs: let
|
} @ inputs: let
|
||||||
# call the extedended library with `inputs`
|
# call the extended library with `inputs`
|
||||||
# inputs is used to get the original standard library, and to pass inputs to the plugin autodiscovery function
|
# inputs is used to get the original standard library, and to pass inputs to the plugin autodiscovery function
|
||||||
lib = import ./lib/stdlib-extended.nix inputs;
|
lib = import ./lib/stdlib-extended.nix {inherit inputs self;};
|
||||||
in
|
in
|
||||||
flake-parts.lib.mkFlake {
|
flake-parts.lib.mkFlake {
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
|
|
@ -17,6 +17,8 @@
|
||||||
# «https://github.com/nix-systems/nix-systems»
|
# «https://github.com/nix-systems/nix-systems»
|
||||||
systems = import inputs.systems;
|
systems = import inputs.systems;
|
||||||
imports = [
|
imports = [
|
||||||
|
./flake/templates
|
||||||
|
|
||||||
./flake/apps.nix
|
./flake/apps.nix
|
||||||
./flake/legacyPackages.nix
|
./flake/legacyPackages.nix
|
||||||
./flake/overlays.nix
|
./flake/overlays.nix
|
||||||
|
|
@ -31,7 +33,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
homeManagerModules = {
|
homeManagerModules = {
|
||||||
nvf = import ./flake/modules/home-manager.nix self.packages lib;
|
nvf = import ./flake/modules/home-manager.nix {inherit lib inputs;};
|
||||||
default = self.homeManagerModules.nvf;
|
default = self.homeManagerModules.nvf;
|
||||||
neovim-flake =
|
neovim-flake =
|
||||||
lib.warn ''
|
lib.warn ''
|
||||||
|
|
@ -42,7 +44,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosModules = {
|
nixosModules = {
|
||||||
nvf = import ./flake/modules/nixos.nix self.packages lib;
|
nvf = import ./flake/modules/nixos.nix {inherit lib inputs;};
|
||||||
default = self.nixosModules.nvf;
|
default = self.nixosModules.nvf;
|
||||||
neovim-flake =
|
neovim-flake =
|
||||||
lib.warn ''
|
lib.warn ''
|
||||||
|
|
@ -51,6 +53,8 @@
|
||||||
''
|
''
|
||||||
self.nixosModules.nvf;
|
self.nixosModules.nvf;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inherit (lib.importJSON ./npins/sources.json) pins;
|
||||||
};
|
};
|
||||||
|
|
||||||
perSystem = {pkgs, ...}: {
|
perSystem = {pkgs, ...}: {
|
||||||
|
|
@ -89,641 +93,10 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
# Language servers (use master instead of nixpkgs)
|
# Language servers (use master instead of nixpkgs)
|
||||||
rnix-lsp.url = "github:nix-community/rnix-lsp";
|
|
||||||
nil = {
|
nil = {
|
||||||
url = "github:oxalica/nil";
|
url = "github:oxalica/nil";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
inputs.flake-utils.follows = "flake-utils";
|
inputs.flake-utils.follows = "flake-utils";
|
||||||
};
|
};
|
||||||
|
|
||||||
## Plugins
|
|
||||||
# Lazy loading
|
|
||||||
plugin-lz-n = {
|
|
||||||
url = "github:nvim-neorocks/lz.n";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-lzn-auto-require = {
|
|
||||||
url = "github:horriblename/lzn-auto-require/require-rewrite";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-rtp-nvim = {
|
|
||||||
url = "github:nvim-neorocks/rtp.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# LSP plugins
|
|
||||||
plugin-nvim-lspconfig = {
|
|
||||||
url = "github:neovim/nvim-lspconfig";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-lspsaga = {
|
|
||||||
url = "github:tami5/lspsaga.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-lspkind = {
|
|
||||||
url = "github:onsails/lspkind-nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-trouble = {
|
|
||||||
url = "github:folke/trouble.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-treesitter-context = {
|
|
||||||
url = "github:nvim-treesitter/nvim-treesitter-context";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-lightbulb = {
|
|
||||||
url = "github:kosayoda/nvim-lightbulb";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-fastaction-nvim = {
|
|
||||||
url = "github:Chaitanyabsprip/fastaction.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-lsp-signature = {
|
|
||||||
url = "github:ray-x/lsp_signature.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-lsp-lines = {
|
|
||||||
url = "sourcehut:~whynothugo/lsp_lines.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-none-ls = {
|
|
||||||
# https://github.com/nvimtools/none-ls.nvim/issues/58
|
|
||||||
url = "github:nvimtools/none-ls.nvim/bb680d752cec37949faca7a1f509e2fe67ab418a";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-docs-view = {
|
|
||||||
url = "github:amrbashir/nvim-docs-view";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-otter-nvim = {
|
|
||||||
url = "github:jmbuhr/otter.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Language support
|
|
||||||
plugin-sqls-nvim = {
|
|
||||||
url = "github:nanotee/sqls.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-rustaceanvim = {
|
|
||||||
url = "github:mrcjkb/rustaceanvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-flutter-tools = {
|
|
||||||
url = "github:akinsho/flutter-tools.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-neodev-nvim = {
|
|
||||||
url = "github:folke/neodev.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-elixir-tools = {
|
|
||||||
url = "github:elixir-tools/elixir-tools.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-ts-error-translator = {
|
|
||||||
url = "github:dmmulroy/ts-error-translator.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-typst-preview-nvim = {
|
|
||||||
url = "github:chomosuke/typst-preview.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-metals = {
|
|
||||||
url = "github:scalameta/nvim-metals";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-omnisharp-extended = {
|
|
||||||
url = "github:Hoffs/omnisharp-extended-lsp.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-csharpls-extended = {
|
|
||||||
url = "github:Decodetalkers/csharpls-extended-lsp.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Copying/Registers
|
|
||||||
plugin-registers = {
|
|
||||||
url = "github:tversteeg/registers.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-neoclip = {
|
|
||||||
url = "github:AckslD/nvim-neoclip.lua";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Telescope
|
|
||||||
plugin-telescope = {
|
|
||||||
url = "github:nvim-telescope/telescope.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Runners
|
|
||||||
plugin-run-nvim = {
|
|
||||||
url = "github:diniamo/run.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Debuggers
|
|
||||||
plugin-nvim-dap = {
|
|
||||||
url = "github:mfussenegger/nvim-dap";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-dap-ui = {
|
|
||||||
url = "github:rcarriga/nvim-dap-ui";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-dap-go = {
|
|
||||||
url = "github:leoluz/nvim-dap-go";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Filetrees
|
|
||||||
plugin-nvim-tree-lua = {
|
|
||||||
url = "github:nvim-tree/nvim-tree.lua";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-neo-tree-nvim = {
|
|
||||||
url = "github:nvim-neo-tree/neo-tree.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Tablines
|
|
||||||
plugin-nvim-bufferline-lua = {
|
|
||||||
url = "github:akinsho/nvim-bufferline.lua";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Statuslines
|
|
||||||
plugin-lualine = {
|
|
||||||
url = "github:hoob3rt/lualine.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-cmp = {
|
|
||||||
url = "github:hrsh7th/nvim-cmp";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-cmp-buffer = {
|
|
||||||
url = "github:hrsh7th/cmp-buffer";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-cmp-nvim-lsp = {
|
|
||||||
url = "github:hrsh7th/cmp-nvim-lsp";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-cmp-path = {
|
|
||||||
url = "github:hrsh7th/cmp-path";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-cmp-treesitter = {
|
|
||||||
url = "github:ray-x/cmp-treesitter";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-cmp-luasnip = {
|
|
||||||
url = "github:saadparwaiz1/cmp_luasnip";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# snippets
|
|
||||||
plugin-luasnip = {
|
|
||||||
url = "github:L3MON4D3/LuaSnip";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-friendly-snippets = {
|
|
||||||
url = "github:rafamadriz/friendly-snippets";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Presence
|
|
||||||
plugin-neocord = {
|
|
||||||
url = "github:IogaMaster/neocord";
|
|
||||||
flake = false; # uses flake-utils, avoid the flake
|
|
||||||
};
|
|
||||||
|
|
||||||
# Autopairs
|
|
||||||
plugin-nvim-autopairs = {
|
|
||||||
url = "github:windwp/nvim-autopairs";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-ts-autotag = {
|
|
||||||
url = "github:windwp/nvim-ts-autotag";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Commenting
|
|
||||||
plugin-comment-nvim = {
|
|
||||||
url = "github:numToStr/Comment.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-todo-comments = {
|
|
||||||
url = "github:folke/todo-comments.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Buffer tools
|
|
||||||
plugin-bufdelete-nvim = {
|
|
||||||
url = "github:famiu/bufdelete.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Dashboard Utilities
|
|
||||||
plugin-dashboard-nvim = {
|
|
||||||
url = "github:glepnir/dashboard-nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-alpha-nvim = {
|
|
||||||
url = "github:goolord/alpha-nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-vim-startify = {
|
|
||||||
url = "github:mhinz/vim-startify";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Themes
|
|
||||||
plugin-base16 = {
|
|
||||||
url = "github:rrethy/base16-nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-tokyonight = {
|
|
||||||
url = "github:folke/tokyonight.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-onedark = {
|
|
||||||
url = "github:navarasu/onedark.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-catppuccin = {
|
|
||||||
url = "github:catppuccin/nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-dracula = {
|
|
||||||
url = "github:Mofiqul/dracula.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-oxocarbon = {
|
|
||||||
url = "github:nyoom-engineering/oxocarbon.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-gruvbox = {
|
|
||||||
url = "github:ellisonleao/gruvbox.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-rose-pine = {
|
|
||||||
url = "github:rose-pine/neovim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Rust crates
|
|
||||||
plugin-crates-nvim = {
|
|
||||||
url = "github:Saecki/crates.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Project Management
|
|
||||||
plugin-project-nvim = {
|
|
||||||
url = "github:ahmedkhalf/project.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Visuals
|
|
||||||
plugin-nvim-cursorline = {
|
|
||||||
url = "github:yamatsum/nvim-cursorline";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-scrollbar = {
|
|
||||||
url = "github:petertriho/nvim-scrollbar";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-cinnamon-nvim = {
|
|
||||||
url = "github:declancm/cinnamon.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-cellular-automaton = {
|
|
||||||
url = "github:Eandrju/cellular-automaton.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-indent-blankline = {
|
|
||||||
url = "github:lukas-reineke/indent-blankline.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-web-devicons = {
|
|
||||||
url = "github:nvim-tree/nvim-web-devicons";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-tiny-devicons-auto-colors = {
|
|
||||||
url = "github:rachartier/tiny-devicons-auto-colors.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-gitsigns-nvim = {
|
|
||||||
url = "github:lewis6991/gitsigns.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-vim-fugitive = {
|
|
||||||
url = "github:tpope/vim-fugitive";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-fidget-nvim = {
|
|
||||||
url = "github:j-hui/fidget.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-highlight-undo = {
|
|
||||||
url = "github:tzachar/highlight-undo.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Minimap
|
|
||||||
plugin-minimap-vim = {
|
|
||||||
url = "github:wfxr/minimap.vim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-codewindow-nvim = {
|
|
||||||
url = "github:gorbit99/codewindow.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Notifications
|
|
||||||
plugin-nvim-notify = {
|
|
||||||
url = "github:rcarriga/nvim-notify";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Utilities
|
|
||||||
plugin-ccc = {
|
|
||||||
url = "github:uga-rosa/ccc.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-diffview-nvim = {
|
|
||||||
url = "github:sindrets/diffview.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-icon-picker-nvim = {
|
|
||||||
url = "github:ziontee113/icon-picker.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-which-key = {
|
|
||||||
url = "github:folke/which-key.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-cheatsheet-nvim = {
|
|
||||||
url = "github:sudormrfbin/cheatsheet.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-gesture-nvim = {
|
|
||||||
url = "github:notomo/gesture.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-hop-nvim = {
|
|
||||||
url = "github:phaazon/hop.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-leap-nvim = {
|
|
||||||
url = "github:ggandor/leap.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-smartcolumn = {
|
|
||||||
url = "github:m4xshen/smartcolumn.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-surround = {
|
|
||||||
url = "github:kylechui/nvim-surround";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-glow-nvim = {
|
|
||||||
url = "github:ellisonleao/glow.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-image-nvim = {
|
|
||||||
url = "github:3rd/image.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-precognition-nvim = {
|
|
||||||
url = "github:tris203/precognition.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Note-taking
|
|
||||||
plugin-obsidian-nvim = {
|
|
||||||
url = "github:epwalsh/obsidian.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-orgmode-nvim = {
|
|
||||||
url = "github:nvim-orgmode/orgmode";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-mind-nvim = {
|
|
||||||
url = "github:phaazon/mind.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Spellchecking
|
|
||||||
plugin-vim-dirtytalk = {
|
|
||||||
url = "github:psliwka/vim-dirtytalk";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Terminal
|
|
||||||
plugin-toggleterm-nvim = {
|
|
||||||
url = "github:akinsho/toggleterm.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# UI
|
|
||||||
plugin-nvim-navbuddy = {
|
|
||||||
url = "github:SmiteshP/nvim-navbuddy";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-navic = {
|
|
||||||
url = "github:SmiteshP/nvim-navic";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-noice-nvim = {
|
|
||||||
url = "github:folke/noice.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-modes-nvim = {
|
|
||||||
url = "github:mvllow/modes.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-colorizer-lua = {
|
|
||||||
url = "github:NvChad/nvim-colorizer.lua";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-vim-illuminate = {
|
|
||||||
url = "github:RRethy/vim-illuminate";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Assistant
|
|
||||||
plugin-chatgpt = {
|
|
||||||
url = "github:jackMort/ChatGPT.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-copilot-lua = {
|
|
||||||
url = "github:zbirenbaum/copilot.lua";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-copilot-cmp = {
|
|
||||||
url = "github:zbirenbaum/copilot-cmp";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Session management
|
|
||||||
plugin-nvim-session-manager = {
|
|
||||||
url = "github:Shatur/neovim-session-manager";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Dependencies
|
|
||||||
plugin-plenary-nvim = {
|
|
||||||
# (required by crates-nvim)
|
|
||||||
url = "github:nvim-lua/plenary.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-dressing-nvim = {
|
|
||||||
# (required by icon-picker-nvim)
|
|
||||||
url = "github:stevearc/dressing.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-vim-markdown = {
|
|
||||||
# (required by obsidian-nvim)
|
|
||||||
url = "github:preservim/vim-markdown";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-tabular = {
|
|
||||||
# (required by vim-markdown)
|
|
||||||
url = "github:godlygeek/tabular";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-lua-utils-nvim = {
|
|
||||||
url = "github:nvim-neorg/lua-utils.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-pathlib-nvim = {
|
|
||||||
url = "github:pysan3/pathlib.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-neorg = {
|
|
||||||
url = "github:nvim-neorg/neorg";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-neorg-telescope = {
|
|
||||||
url = "github:nvim-neorg/neorg-telescope";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nui-nvim = {
|
|
||||||
# (required by noice.nvim)
|
|
||||||
url = "github:MunifTanjim/nui.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-vim-repeat = {
|
|
||||||
# (required by leap.nvim)
|
|
||||||
url = "github:tpope/vim-repeat";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-nio = {
|
|
||||||
# (required by nvim-dap-ui)
|
|
||||||
url = "github:nvim-neotest/nvim-nio";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-new-file-template-nvim = {
|
|
||||||
# (required by new-file-template.nvim)
|
|
||||||
url = "github:otavioschwanck/new-file-template.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-haskell-tools-nvim = {
|
|
||||||
url = "github:mrcjkb/haskell-tools.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
default = self'.devShells.lsp;
|
default = self'.devShells.lsp;
|
||||||
nvim-nix = pkgs.mkShellNoCC {packages = [config.packages.nix];};
|
nvim-nix = pkgs.mkShellNoCC {packages = [config.packages.nix];};
|
||||||
lsp = pkgs.mkShellNoCC {
|
lsp = pkgs.mkShellNoCC {
|
||||||
packages = with pkgs; [nil statix deadnix alejandra];
|
packages = with pkgs; [nil statix deadnix alejandra npins];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
{inputs, ...}: {
|
{
|
||||||
|
inputs,
|
||||||
|
self,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
perSystem = {
|
perSystem = {
|
||||||
system,
|
system,
|
||||||
inputs',
|
inputs',
|
||||||
|
|
@ -8,9 +12,22 @@
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [
|
overlays = [
|
||||||
inputs.self.overlays.default
|
inputs.self.overlays.default
|
||||||
(_: _: {
|
|
||||||
rnix-lsp = inputs'.rnix-lsp.defaultPackage;
|
(final: prev: {
|
||||||
|
# Build nil from source to get most recent
|
||||||
|
# features as they are added.
|
||||||
nil = inputs'.nil.packages.default;
|
nil = inputs'.nil.packages.default;
|
||||||
|
blink-cmp = let
|
||||||
|
pin = self.pins.blink-cmp;
|
||||||
|
in
|
||||||
|
final.callPackage ./legacyPackages/blink-cmp.nix {
|
||||||
|
inherit (pin) version;
|
||||||
|
src = prev.fetchFromGitHub {
|
||||||
|
inherit (pin.repository) owner repo;
|
||||||
|
rev = pin.revision;
|
||||||
|
sha256 = pin.hash;
|
||||||
|
};
|
||||||
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
38
flake/legacyPackages/blink-cmp.nix
Normal file
38
flake/legacyPackages/blink-cmp.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
rustPlatform,
|
||||||
|
hostPlatform,
|
||||||
|
vimUtils,
|
||||||
|
git,
|
||||||
|
src,
|
||||||
|
version,
|
||||||
|
}: let
|
||||||
|
blink-fuzzy-lib = rustPlatform.buildRustPackage {
|
||||||
|
pname = "blink-fuzzy-lib";
|
||||||
|
inherit version src;
|
||||||
|
|
||||||
|
# TODO: remove this if plugin stops using nightly rust
|
||||||
|
env.RUSTC_BOOTSTRAP = true;
|
||||||
|
|
||||||
|
nativeBuildInputs = [git];
|
||||||
|
cargoLock = {
|
||||||
|
lockFile = "${src}/Cargo.lock";
|
||||||
|
allowBuiltinFetchGit = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
libExt =
|
||||||
|
if hostPlatform.isDarwin
|
||||||
|
then "dylib"
|
||||||
|
else "so";
|
||||||
|
in
|
||||||
|
vimUtils.buildVimPlugin {
|
||||||
|
pname = "blink-cmp";
|
||||||
|
inherit version src;
|
||||||
|
|
||||||
|
# blink references a repro.lua which is placed outside the lua/ directory
|
||||||
|
doCheck = false;
|
||||||
|
preInstall = ''
|
||||||
|
mkdir -p target/release
|
||||||
|
ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy.${libExt} target/release/libblink_cmp_fuzzy.${libExt}
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
@ -1,22 +1,28 @@
|
||||||
# Home Manager module
|
# Home Manager module
|
||||||
packages: lib: {
|
{
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
|
}: {
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
inherit (inputs.self) packages;
|
||||||
inherit (lib) maintainers;
|
inherit (lib) maintainers;
|
||||||
inherit (lib.modules) mkIf mkAliasOptionModule;
|
inherit (lib.modules) mkIf mkAliasOptionModule;
|
||||||
inherit (lib.lists) optional;
|
inherit (lib.lists) optional;
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
inherit (lib.types) attrsOf anything bool;
|
inherit (lib.types) anything bool submoduleWith;
|
||||||
inherit (lib.nvim) neovimConfiguration;
|
|
||||||
inherit (lib.nvim.types) anythingConcatLists;
|
|
||||||
|
|
||||||
cfg = config.programs.nvf;
|
cfg = config.programs.nvf;
|
||||||
|
|
||||||
neovimConfigured = neovimConfiguration {
|
nvfModule = submoduleWith {
|
||||||
inherit pkgs;
|
description = "Nvf module";
|
||||||
modules = [cfg.settings];
|
class = "nvf";
|
||||||
|
specialArgs = {
|
||||||
|
inherit pkgs lib inputs;
|
||||||
|
};
|
||||||
|
modules = import ../../modules/modules.nix {inherit pkgs lib;};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
|
|
@ -55,7 +61,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = attrsOf anythingConcatLists;
|
type = nvfModule;
|
||||||
default = {};
|
default = {};
|
||||||
description = "Attribute set of nvf preferences.";
|
description = "Attribute set of nvf preferences.";
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
|
|
@ -78,7 +84,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
programs.nvf.finalPackage = neovimConfigured.neovim;
|
programs.nvf.finalPackage = cfg.settings.vim.build.finalPackage;
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
sessionVariables = mkIf cfg.defaultEditor {EDITOR = "nvim";};
|
sessionVariables = mkIf cfg.defaultEditor {EDITOR = "nvim";};
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,28 @@
|
||||||
# NixOS module
|
# NixOS module
|
||||||
packages: lib: {
|
{
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
|
}: {
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
inherit (inputs.self) packages;
|
||||||
inherit (lib) maintainers;
|
inherit (lib) maintainers;
|
||||||
inherit (lib.modules) mkIf mkOverride mkAliasOptionModule;
|
inherit (lib.modules) mkIf mkOverride mkAliasOptionModule;
|
||||||
inherit (lib.lists) optional;
|
inherit (lib.lists) optional;
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
inherit (lib.types) attrsOf anything bool;
|
inherit (lib.types) anything bool submoduleWith;
|
||||||
inherit (lib.nvim) neovimConfiguration;
|
|
||||||
inherit (lib.nvim.types) anythingConcatLists;
|
|
||||||
|
|
||||||
cfg = config.programs.nvf;
|
cfg = config.programs.nvf;
|
||||||
|
|
||||||
neovimConfigured = neovimConfiguration {
|
nvfModule = submoduleWith {
|
||||||
inherit pkgs;
|
description = "Nvf module";
|
||||||
modules = [cfg.settings];
|
class = "nvf";
|
||||||
|
specialArgs = {
|
||||||
|
inherit pkgs lib inputs;
|
||||||
|
};
|
||||||
|
modules = import ../../modules/modules.nix {inherit pkgs lib;};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
|
|
@ -55,7 +61,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = attrsOf anythingConcatLists;
|
type = nvfModule;
|
||||||
default = {};
|
default = {};
|
||||||
description = "Attribute set of nvf preferences.";
|
description = "Attribute set of nvf preferences.";
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
|
|
@ -78,7 +84,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
programs.nvf.finalPackage = neovimConfigured.neovim;
|
programs.nvf.finalPackage = cfg.settings.vim.build.finalPackage;
|
||||||
|
|
||||||
environment = {
|
environment = {
|
||||||
variables.EDITOR = mkIf cfg.defaultEditor (mkOverride 900 "nvim");
|
variables.EDITOR = mkIf cfg.defaultEditor (mkOverride 900 "nvim");
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,10 @@
|
||||||
nixConfig = import ../configuration.nix false;
|
nixConfig = import ../configuration.nix false;
|
||||||
maximalConfig = import ../configuration.nix true;
|
maximalConfig = import ../configuration.nix true;
|
||||||
in {
|
in {
|
||||||
flake.overlays.default = _final: prev: {
|
flake.overlays.default = final: _prev: {
|
||||||
inherit neovimConfiguration;
|
inherit neovimConfiguration;
|
||||||
neovim-nix = buildPkg prev [nixConfig];
|
neovim-nix = buildPkg final [nixConfig];
|
||||||
neovim-maximal = buildPkg prev [maximalConfig];
|
neovim-maximal = buildPkg final [maximalConfig];
|
||||||
devPkg = buildPkg pkgs [nixConfig {config.vim.languages.html.enable = pkgs.lib.mkForce true;}];
|
devPkg = buildPkg pkgs [nixConfig {config.vim.languages.html.enable = pkgs.lib.mkForce true;}];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,11 @@
|
||||||
in
|
in
|
||||||
pkgs.testers.lycheeLinkCheck {
|
pkgs.testers.lycheeLinkCheck {
|
||||||
inherit site;
|
inherit site;
|
||||||
|
|
||||||
remap = {
|
remap = {
|
||||||
"https://notashelf.github.io/nvf/" = site;
|
"https://notashelf.github.io/nvf/" = site;
|
||||||
};
|
};
|
||||||
|
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
exclude = [];
|
exclude = [];
|
||||||
include_mail = true;
|
include_mail = true;
|
||||||
|
|
@ -29,43 +31,39 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Build and open the built manual in your system browser
|
# Helper utility for building the HTML manual and opening it in the
|
||||||
docs-html-wrapped = pkgs.writeScriptBin "docs-html-wrapped" ''
|
# browser with $BROWSER or using xdg-open as a fallback tool.
|
||||||
#!${pkgs.stdenv.shell}
|
# Adapted from Home-Manager, available under the MIT license.
|
||||||
# use xdg-open to open the docs in the browser
|
docs-html-wrapped = let
|
||||||
${pkgs.xdg-utils}/bin/xdg-open ${docs.manual.html}
|
xdg-open = lib.getExe' pkgs.xdg-utils "xdg-open";
|
||||||
'';
|
docs-html = docs.manual.html + /share/doc/nvf;
|
||||||
|
in
|
||||||
|
pkgs.writeShellScriptBin "docs-html-wrapped" ''
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [[ ! -v BROWSER || -z $BROWSER ]]; then
|
||||||
|
for candidate in xdg-open open w3m; do
|
||||||
|
BROWSER="$(type -P $candidate || true)"
|
||||||
|
if [[ -x $BROWSER ]]; then
|
||||||
|
break;
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -v BROWSER || -z $BROWSER ]]; then
|
||||||
|
echo "$0: unable to start a web browser; please set \$BROWSER"
|
||||||
|
echo "$0: Trying xdg-open as a fallback"
|
||||||
|
${xdg-open} ${docs-html}/index.xhtml
|
||||||
|
else
|
||||||
|
echo "\$BROWSER is set. Attempting to open manual"
|
||||||
|
exec "$BROWSER" "${docs-html}/index.xhtml"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
# Exposed neovim configurations
|
# Exposed neovim configurations
|
||||||
nix = config.legacyPackages.neovim-nix;
|
nix = config.legacyPackages.neovim-nix;
|
||||||
maximal = config.legacyPackages.neovim-maximal;
|
maximal = config.legacyPackages.neovim-maximal;
|
||||||
default = config.legacyPackages.neovim-nix;
|
default = config.legacyPackages.neovim-nix;
|
||||||
|
|
||||||
# Published docker images
|
|
||||||
docker-nix = let
|
|
||||||
inherit (pkgs) bash gitFull buildEnv;
|
|
||||||
inherit (config.legacyPackages) neovim-nix;
|
|
||||||
in
|
|
||||||
pkgs.dockerTools.buildImage {
|
|
||||||
name = "nvf";
|
|
||||||
tag = "latest";
|
|
||||||
|
|
||||||
copyToRoot = buildEnv {
|
|
||||||
name = "neovim-root";
|
|
||||||
pathsToLink = ["/bin"];
|
|
||||||
paths = [
|
|
||||||
neovim-nix
|
|
||||||
gitFull
|
|
||||||
bash
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
|
||||||
Cmd = ["${neovim-nix}/bin/nvim"];
|
|
||||||
WorkingDir = "/home/neovim/demo";
|
|
||||||
Volumes = {"/home/neovim/demo" = {};};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
17
flake/templates/default.nix
Normal file
17
flake/templates/default.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
flake.templates = {
|
||||||
|
standalone = {
|
||||||
|
path = ./standalone;
|
||||||
|
description = "Standalone flake template for nvf";
|
||||||
|
welcomeText = ''
|
||||||
|
Template flake.nix has been created in flake.nix!
|
||||||
|
|
||||||
|
Note that this is a very basic example to bootstrap nvf for you. Please edit your
|
||||||
|
configuration as described in the nvf manual before using this template. The
|
||||||
|
configured packages will be ran with 'nix run .' or 'nix run .#neovimConfigured'
|
||||||
|
|
||||||
|
Happy editing!
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
64
flake/templates/standalone/flake.nix
Normal file
64
flake/templates/standalone/flake.nix
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
nvf.url = "github:notashelf/nvf";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = {
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
...
|
||||||
|
} @ inputs: let
|
||||||
|
# An abstraction over systems to easily provide the same package
|
||||||
|
# for multiple systems. This is preferable to abstraction libraries.
|
||||||
|
forEachSystem = nixpkgs.lib.genAttrs ["x86_64-linux"];
|
||||||
|
in {
|
||||||
|
packages = forEachSystem (system: let
|
||||||
|
pkgs = inputs.nixpkgs.legacyPackages.${system};
|
||||||
|
|
||||||
|
# A module to be evaluated via lib.evalModules inside nvf's module system.
|
||||||
|
# All options supported by nvf will go under config.vim to create the final
|
||||||
|
# wrapped package. You may also add some new *options* under options.* to
|
||||||
|
# expand the module system.
|
||||||
|
configModule = {
|
||||||
|
# You may browse available options for nvf on the online manual. Please see
|
||||||
|
# <https://notashelf.github.io/nvf/options.html>
|
||||||
|
config.vim = {
|
||||||
|
theme.enable = true;
|
||||||
|
|
||||||
|
# Language support and automatic configuration of companion plugins.
|
||||||
|
# Note that enabling, e.g., languages.<lang>.diagnostics will automatically
|
||||||
|
# enable top-level options such as enableLSP or enableExtraDiagnostics as
|
||||||
|
# they are needed.
|
||||||
|
languages = {
|
||||||
|
enableLSP = true;
|
||||||
|
enableFormat = true;
|
||||||
|
enableTreesitter = true;
|
||||||
|
enableExtraDiagnostics = true;
|
||||||
|
|
||||||
|
# Nix language and diagnostics.
|
||||||
|
nix.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Evaluate any and all modules to create the wrapped Neovim package.
|
||||||
|
neovimConfigured = inputs.nvf.lib.neovimConfiguration {
|
||||||
|
inherit pkgs;
|
||||||
|
|
||||||
|
modules = [
|
||||||
|
# Configuration module to be imported. You may define multiple modules
|
||||||
|
# or even import them from other files (e.g., ./modules/lsp.nix) to
|
||||||
|
# better modularize your configuration.
|
||||||
|
configModule
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
# Packages to be exposed under packages.<system>. Those can accessed
|
||||||
|
# directly from package outputs in other flakes if this flake is added
|
||||||
|
# as an input. You may run those packages with 'nix run .#<package>'
|
||||||
|
default = self.packages.${system}.neovim;
|
||||||
|
neovimConfigured = neovimConfigured.neovim;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
28
lib/dag.nix
28
lib/dag.nix
|
|
@ -24,7 +24,7 @@ in {
|
||||||
entryAfter, and entryBefore to a topologically sorted list of
|
entryAfter, and entryBefore to a topologically sorted list of
|
||||||
entries.
|
entries.
|
||||||
|
|
||||||
Internally this function uses the `toposort` function in
|
Internally this function uses the `topoSort` function in
|
||||||
`<nixpkgs/lib/lists.nix>` and its value is accordingly.
|
`<nixpkgs/lib/lists.nix>` and its value is accordingly.
|
||||||
|
|
||||||
Specifically, the result on success is
|
Specifically, the result on success is
|
||||||
|
|
@ -136,16 +136,26 @@ in {
|
||||||
entriesAfter = tag: entriesBetween tag [];
|
entriesAfter = tag: entriesBetween tag [];
|
||||||
entriesBefore = tag: before: entriesBetween tag before [];
|
entriesBefore = tag: before: entriesBetween tag before [];
|
||||||
|
|
||||||
# mkLuarcSection and mkVimrcSection take a section DAG
|
# mkLuarcSection takes a section DAG, containing 'name' and 'data' fields
|
||||||
# and return a string containing a comment to identify
|
# then returns a string containing a comment to identify the section, and
|
||||||
|
# the data contained within the section.
|
||||||
# the section, and the data contained within the section
|
# the section, and the data contained within the section
|
||||||
#
|
#
|
||||||
# all operations are done without any modifications
|
# All operations are done without any modifications to the inputted section
|
||||||
# to the inputted section data
|
# data, but if a non-string is passed to name or data, then it will try to
|
||||||
mkLuarcSection = section: ''
|
# coerce it into a string, which may fail. Setting data to "" or null will
|
||||||
-- SECTION: ${section.name}
|
# return an empty string.
|
||||||
${section.data}
|
#
|
||||||
'';
|
# section.data should never be null, though taking 'null' as a value that
|
||||||
|
# can "clear" the DAG might come in handy for filtering sections more easily.
|
||||||
|
# Or perhaps simply unsetting them from an user perspective.
|
||||||
|
mkLuarcSection = section:
|
||||||
|
if section.data == "" || section.data == null
|
||||||
|
then ""
|
||||||
|
else ''
|
||||||
|
-- SECTION: ${section.name}
|
||||||
|
${section.data}
|
||||||
|
'';
|
||||||
|
|
||||||
resolveDag = {
|
resolveDag = {
|
||||||
name,
|
name,
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
|
self,
|
||||||
inputs,
|
inputs,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
types = import ./types {inherit inputs lib;};
|
types = import ./types {inherit lib;};
|
||||||
|
|
||||||
config = import ./config.nix {inherit lib;};
|
config = import ./config.nix {inherit lib;};
|
||||||
binds = import ./binds.nix {inherit lib;};
|
binds = import ./binds.nix {inherit lib;};
|
||||||
dag = import ./dag.nix {inherit lib;};
|
dag = import ./dag.nix {inherit lib;};
|
||||||
|
|
@ -12,5 +12,5 @@
|
||||||
lists = import ./lists.nix {inherit lib;};
|
lists = import ./lists.nix {inherit lib;};
|
||||||
attrsets = import ./attrsets.nix {inherit lib;};
|
attrsets = import ./attrsets.nix {inherit lib;};
|
||||||
lua = import ./lua.nix {inherit lib;};
|
lua = import ./lua.nix {inherit lib;};
|
||||||
neovimConfiguration = import ../modules {inherit inputs lib;};
|
neovimConfiguration = import ../modules {inherit self inputs lib;};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,6 @@
|
||||||
inherit (lib.types) bool;
|
inherit (lib.types) bool;
|
||||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||||
in {
|
in {
|
||||||
# Converts a boolean to a yes/no string. This is used in lots of
|
|
||||||
# configuration formats.
|
|
||||||
diagnosticsToLua = {
|
diagnosticsToLua = {
|
||||||
lang,
|
lang,
|
||||||
config,
|
config,
|
||||||
|
|
@ -30,8 +28,8 @@ in {
|
||||||
|
|
||||||
mkEnable = desc:
|
mkEnable = desc:
|
||||||
mkOption {
|
mkOption {
|
||||||
description = "Turn on ${desc} for enabled languages by default";
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
default = false;
|
||||||
|
type = bool;
|
||||||
|
description = "Turn on ${desc} for enabled languages by default";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
# Convenience function that returns the given Nixpkgs standard library
|
# Convenience function that returns the given Nixpkgs standard library
|
||||||
# extended with our functions using `lib.extend`.
|
# extended with our functions using `lib.extend`.
|
||||||
inputs:
|
{
|
||||||
|
inputs,
|
||||||
|
self,
|
||||||
|
...
|
||||||
|
} @ args:
|
||||||
inputs.nixpkgs.lib.extend (self: super: {
|
inputs.nixpkgs.lib.extend (self: super: {
|
||||||
# WARNING: New functions should not be added here, but to files
|
# WARNING: New functions should not be added here, but to files
|
||||||
# imported by `./default.nix` under their own categories. If your
|
# imported by `./default.nix` under their own categories. If your
|
||||||
|
|
@ -12,7 +16,7 @@ inputs.nixpkgs.lib.extend (self: super: {
|
||||||
# E.g. for an input called `nvf`, `inputs.nvf.lib.nvim` will return the set
|
# E.g. for an input called `nvf`, `inputs.nvf.lib.nvim` will return the set
|
||||||
# below.
|
# below.
|
||||||
nvim = import ./. {
|
nvim = import ./. {
|
||||||
inherit inputs;
|
inherit (args) inputs self;
|
||||||
lib = self;
|
lib = self;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,57 +1,8 @@
|
||||||
{lib}: let
|
{lib}: let
|
||||||
inherit (lib.options) showOption showFiles getFiles mergeOneOption mergeEqualOption;
|
inherit (lib.options) mergeEqualOption;
|
||||||
inherit (lib.strings) isString isStringLike;
|
inherit (lib.strings) isString stringLength match;
|
||||||
inherit (lib.types) anything attrsOf listOf mkOptionType;
|
inherit (lib.types) listOf mkOptionType;
|
||||||
inherit (lib.nvim.types) anythingConcatLists;
|
|
||||||
inherit (builtins) typeOf isAttrs any head concatLists stringLength match;
|
|
||||||
in {
|
in {
|
||||||
# HACK: Does this break anything in our case?
|
|
||||||
# A modified version of the nixpkgs anything type that concatenates lists
|
|
||||||
# This isn't the default because the order in which the lists are concatenated depends on the order in which the modules are imported,
|
|
||||||
# which makes it non-deterministic
|
|
||||||
anythingConcatLists =
|
|
||||||
anything
|
|
||||||
// {
|
|
||||||
merge = loc: defs: let
|
|
||||||
getType = value:
|
|
||||||
if isAttrs value && isStringLike value
|
|
||||||
then "stringCoercibleSet"
|
|
||||||
else typeOf value;
|
|
||||||
|
|
||||||
# Throw an error if not all defs have the same type
|
|
||||||
checkType = getType (head defs).value;
|
|
||||||
commonType =
|
|
||||||
if any (def: getType def.value != checkType) defs
|
|
||||||
then throw "The option `${showOption loc}' has conflicting option types in ${showFiles (getFiles defs)}"
|
|
||||||
else checkType;
|
|
||||||
|
|
||||||
mergeFunctions = {
|
|
||||||
# Recursively merge attribute sets
|
|
||||||
set = (attrsOf anythingConcatLists).merge;
|
|
||||||
|
|
||||||
# Overridden behavior for lists, that concatenates lists
|
|
||||||
list = _: defs: concatLists (map (e: e.value) defs);
|
|
||||||
|
|
||||||
# This means it's a package, only accept a single definition
|
|
||||||
stringCoercibleSet = mergeOneOption;
|
|
||||||
|
|
||||||
# This works by passing the argument to the functions,
|
|
||||||
# and merging their returns values instead
|
|
||||||
lambda = loc: defs: arg:
|
|
||||||
anythingConcatLists.merge
|
|
||||||
(loc ++ ["<function body>"])
|
|
||||||
(map (def: {
|
|
||||||
inherit (def) file;
|
|
||||||
value = def.value arg;
|
|
||||||
})
|
|
||||||
defs);
|
|
||||||
};
|
|
||||||
in
|
|
||||||
# Merge the defs with the correct function from above, if available
|
|
||||||
# otherwise only allow equal values
|
|
||||||
(mergeFunctions.${commonType} or mergeEqualOption) loc defs;
|
|
||||||
};
|
|
||||||
|
|
||||||
mergelessListOf = elemType: let
|
mergelessListOf = elemType: let
|
||||||
super = listOf elemType;
|
super = listOf elemType;
|
||||||
in
|
in
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,11 @@
|
||||||
{
|
{lib}: let
|
||||||
inputs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
typesDag = import ./dag.nix {inherit lib;};
|
typesDag = import ./dag.nix {inherit lib;};
|
||||||
typesPlugin = import ./plugins.nix {inherit inputs lib;};
|
typesPlugin = import ./plugins.nix {inherit lib;};
|
||||||
typesLanguage = import ./languages.nix {inherit lib;};
|
typesLanguage = import ./languages.nix {inherit lib;};
|
||||||
customTypes = import ./custom.nix {inherit lib;};
|
customTypes = import ./custom.nix {inherit lib;};
|
||||||
in {
|
in {
|
||||||
inherit (typesDag) dagOf;
|
inherit (typesDag) dagOf;
|
||||||
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType;
|
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType;
|
||||||
inherit (typesLanguage) diagnostics mkGrammarOption;
|
inherit (typesLanguage) diagnostics mkGrammarOption;
|
||||||
inherit (customTypes) anythingConcatLists char hexColor mergelessListOf;
|
inherit (customTypes) char hexColor mergelessListOf;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,8 @@
|
||||||
{
|
{lib}: let
|
||||||
inputs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.options) mkOption;
|
inherit (lib.options) mkOption;
|
||||||
inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair;
|
inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair;
|
||||||
inherit (lib.strings) hasPrefix removePrefix;
|
inherit (lib.strings) hasPrefix removePrefix;
|
||||||
inherit (lib.types) submodule either package enum str lines attrsOf anything listOf nullOr;
|
inherit (lib.types) submodule either package enum str lines anything listOf nullOr;
|
||||||
|
|
||||||
# Get the names of all flake inputs that start with the given prefix.
|
# Get the names of all flake inputs that start with the given prefix.
|
||||||
fromInputs = {
|
fromInputs = {
|
||||||
|
|
@ -15,11 +11,8 @@
|
||||||
}:
|
}:
|
||||||
mapAttrs' (n: v: nameValuePair (removePrefix prefix n) {src = v;}) (filterAttrs (n: _: hasPrefix prefix n) inputs);
|
mapAttrs' (n: v: nameValuePair (removePrefix prefix n) {src = v;}) (filterAttrs (n: _: hasPrefix prefix n) inputs);
|
||||||
|
|
||||||
# Get the names of all flake inputs that start with the given prefix.
|
# Get the names of all npins
|
||||||
pluginInputNames = attrNames (fromInputs {
|
pluginInputNames = attrNames (lib.importJSON ../../npins/sources.json).pins;
|
||||||
inherit inputs;
|
|
||||||
prefix = "plugin-";
|
|
||||||
});
|
|
||||||
|
|
||||||
# You can either use the name of the plugin or a package.
|
# You can either use the name of the plugin or a package.
|
||||||
pluginType = nullOr (
|
pluginType = nullOr (
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
self,
|
||||||
inputs,
|
inputs,
|
||||||
lib,
|
lib,
|
||||||
}: {
|
}: {
|
||||||
|
|
@ -9,9 +10,8 @@
|
||||||
extraModules ? [],
|
extraModules ? [],
|
||||||
configuration ? {},
|
configuration ? {},
|
||||||
}: let
|
}: let
|
||||||
inherit (pkgs) vimPlugins;
|
inherit (lib.strings) toString;
|
||||||
inherit (lib.strings) isString toString;
|
inherit (lib.lists) concatLists;
|
||||||
inherit (lib.lists) filter map concatLists;
|
|
||||||
|
|
||||||
# import modules.nix with `check`, `pkgs` and `lib` as arguments
|
# import modules.nix with `check`, `pkgs` and `lib` as arguments
|
||||||
# check can be disabled while calling this file is called
|
# check can be disabled while calling this file is called
|
||||||
|
|
@ -21,7 +21,12 @@
|
||||||
# evaluate the extended library with the modules
|
# evaluate the extended library with the modules
|
||||||
# optionally with any additional modules passed by the user
|
# optionally with any additional modules passed by the user
|
||||||
module = lib.evalModules {
|
module = lib.evalModules {
|
||||||
specialArgs = extraSpecialArgs // {modulesPath = toString ./.;};
|
specialArgs =
|
||||||
|
extraSpecialArgs
|
||||||
|
// {
|
||||||
|
inherit self inputs;
|
||||||
|
modulesPath = toString ./.;
|
||||||
|
};
|
||||||
modules = concatLists [
|
modules = concatLists [
|
||||||
nvimModules
|
nvimModules
|
||||||
modules
|
modules
|
||||||
|
|
@ -36,102 +41,11 @@
|
||||||
extraModules))
|
extraModules))
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# alias to the internal configuration
|
|
||||||
vimOptions = module.config.vim;
|
|
||||||
|
|
||||||
noBuildPlug = {pname, ...} @ attrs: let
|
|
||||||
src = inputs."plugin-${attrs.pname}";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
version = src.shortRev or src.shortDirtyRev or "dirty";
|
|
||||||
outPath = src;
|
|
||||||
passthru.vimPlugin = false;
|
|
||||||
}
|
|
||||||
// attrs;
|
|
||||||
|
|
||||||
# build a vim plugin with the given name and arguments
|
|
||||||
# if the plugin is nvim-treesitter, warn the user to use buildTreesitterPlug
|
|
||||||
# instead
|
|
||||||
buildPlug = attrs: let
|
|
||||||
src = inputs."plugin-${attrs.pname}";
|
|
||||||
in
|
|
||||||
pkgs.vimUtils.buildVimPlugin (
|
|
||||||
{
|
|
||||||
version = src.shortRev or src.shortDirtyRev or "dirty";
|
|
||||||
inherit src;
|
|
||||||
}
|
|
||||||
// attrs
|
|
||||||
);
|
|
||||||
|
|
||||||
buildTreesitterPlug = grammars: vimPlugins.nvim-treesitter.withPlugins (_: grammars);
|
|
||||||
|
|
||||||
pluginBuilders = {
|
|
||||||
nvim-treesitter = buildTreesitterPlug vimOptions.treesitter.grammars;
|
|
||||||
flutter-tools-patched = buildPlug {
|
|
||||||
pname = "flutter-tools";
|
|
||||||
patches = [../patches/flutter-tools.patch];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
buildConfigPlugins = plugins:
|
|
||||||
map (
|
|
||||||
plug:
|
|
||||||
if (isString plug)
|
|
||||||
then pluginBuilders.${plug} or (noBuildPlug {pname = plug;})
|
|
||||||
else plug
|
|
||||||
) (filter (f: f != null) plugins);
|
|
||||||
|
|
||||||
# built (or "normalized") plugins that are modified
|
|
||||||
builtStartPlugins = buildConfigPlugins vimOptions.startPlugins;
|
|
||||||
builtOptPlugins = map (package: package // {optional = true;}) (buildConfigPlugins vimOptions.optPlugins);
|
|
||||||
|
|
||||||
# additional Lua and Python3 packages, mapped to their respective functions
|
|
||||||
# to conform to the format mnw expects. end user should
|
|
||||||
# only ever need to pass a list of packages, which are modified
|
|
||||||
# here
|
|
||||||
extraLuaPackages = ps: map (x: ps.${x}) vimOptions.luaPackages;
|
|
||||||
extraPython3Packages = ps: map (x: ps.${x}) vimOptions.python3Packages;
|
|
||||||
|
|
||||||
# Wrap the user's desired (unwrapped) Neovim package with arguments that'll be used to
|
|
||||||
# generate a wrapped Neovim package.
|
|
||||||
neovim-wrapped = inputs.mnw.lib.wrap pkgs {
|
|
||||||
neovim = vimOptions.package;
|
|
||||||
plugins = builtStartPlugins ++ builtOptPlugins;
|
|
||||||
appName = "nvf";
|
|
||||||
extraBinPath = vimOptions.extraPackages;
|
|
||||||
initLua = vimOptions.builtLuaConfigRC;
|
|
||||||
luaFiles = vimOptions.extraLuaFiles;
|
|
||||||
|
|
||||||
inherit (vimOptions) viAlias vimAlias withRuby withNodeJs withPython3;
|
|
||||||
inherit extraLuaPackages extraPython3Packages;
|
|
||||||
};
|
|
||||||
|
|
||||||
dummyInit = pkgs.writeText "nvf-init.lua" vimOptions.builtLuaConfigRC;
|
|
||||||
# Additional helper scripts for printing and displaying nvf configuration
|
|
||||||
# in your commandline.
|
|
||||||
printConfig = pkgs.writers.writeDashBin "nvf-print-config" "cat ${dummyInit}";
|
|
||||||
printConfigPath = pkgs.writers.writeDashBin "nvf-print-config-path" "echo -n ${dummyInit}";
|
|
||||||
in {
|
in {
|
||||||
inherit (module) options config;
|
inherit (module) options config;
|
||||||
inherit (module._module.args) pkgs;
|
inherit (module._module.args) pkgs;
|
||||||
|
|
||||||
# Expose wrapped neovim-package for userspace
|
# Expose wrapped neovim-package for userspace
|
||||||
# or module consumption.
|
# or module consumption.
|
||||||
neovim = pkgs.symlinkJoin {
|
neovim = module.config.vim.build.finalPackage;
|
||||||
name = "nvf-with-helpers";
|
|
||||||
paths = [neovim-wrapped printConfig printConfigPath];
|
|
||||||
postBuild = "echo Helpers added";
|
|
||||||
|
|
||||||
# Allow evaluating vimOptions, i.e., config.vim from the packages' passthru
|
|
||||||
# attribute. For example, packages.x86_64-linux.neovim.passthru.neovimConfig
|
|
||||||
# will return the configuration in full.
|
|
||||||
passthru.neovimConfig = vimOptions;
|
|
||||||
|
|
||||||
meta =
|
|
||||||
neovim-wrapped.meta
|
|
||||||
// {
|
|
||||||
description = "Wrapped Neovim package with helper scripts to print the config (path)";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
inherit (lib.nvim.config) batchRenameOptions;
|
inherit (lib.nvim.config) batchRenameOptions;
|
||||||
|
|
||||||
renamedVimOpts = batchRenameOptions ["vim"] ["vim" "options"] {
|
renamedVimOpts = batchRenameOptions ["vim"] ["vim" "options"] {
|
||||||
|
# 2024-12-01
|
||||||
colourTerm = "termguicolors";
|
colourTerm = "termguicolors";
|
||||||
mouseSupport = "mouse";
|
mouseSupport = "mouse";
|
||||||
cmdHeight = "cmdheight";
|
cmdHeight = "cmdheight";
|
||||||
|
|
@ -14,6 +15,10 @@
|
||||||
splitRight = "splitright";
|
splitRight = "splitright";
|
||||||
autoIndent = "autoindent";
|
autoIndent = "autoindent";
|
||||||
wordWrap = "wrap";
|
wordWrap = "wrap";
|
||||||
|
showSignColumn = "signcolumn";
|
||||||
|
|
||||||
|
# 2025-02-07
|
||||||
|
scrollOff = "scrolloff";
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
imports = concatLists [
|
imports = concatLists [
|
||||||
|
|
@ -35,23 +40,28 @@ in {
|
||||||
vim.autopairs.enable has been removed in favor of per-plugin modules.
|
vim.autopairs.enable has been removed in favor of per-plugin modules.
|
||||||
You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead.
|
You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead.
|
||||||
'')
|
'')
|
||||||
|
|
||||||
(mkRemovedOptionModule ["vim" "autopairs" "type"] ''
|
(mkRemovedOptionModule ["vim" "autopairs" "type"] ''
|
||||||
vim.autopairs.type has been removed in favor of per-plugin modules.
|
vim.autopairs.type has been removed in favor of per-plugin modules.
|
||||||
You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead.
|
You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead.
|
||||||
'')
|
'')
|
||||||
|
|
||||||
(mkRemovedOptionModule ["vim" "autocomplete" "enable"] ''
|
(mkRemovedOptionModule ["vim" "autocomplete" "enable"] ''
|
||||||
vim.autocomplete.enable has been removed in favor of per-plugin modules.
|
vim.autocomplete.enable has been removed in favor of per-plugin modules.
|
||||||
You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead.
|
You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead.
|
||||||
'')
|
'')
|
||||||
|
|
||||||
(mkRemovedOptionModule ["vim" "autocomplete" "type"] ''
|
(mkRemovedOptionModule ["vim" "autocomplete" "type"] ''
|
||||||
vim.autocomplete.type has been removed in favor of per-plugin modules.
|
vim.autocomplete.type has been removed in favor of per-plugin modules.
|
||||||
You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead.
|
You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead.
|
||||||
'')
|
'')
|
||||||
|
|
||||||
(mkRemovedOptionModule ["vim" "autocomplete" "sources"] ''
|
(mkRemovedOptionModule ["vim" "autocomplete" "sources"] ''
|
||||||
vim.autocomplete.sources has been removed in favor of per-plugin modules.
|
vim.autocomplete.sources has been removed in favor of per-plugin modules.
|
||||||
You can add nvim-cmp sources with vim.autocomplete.nvim-cmp.sources
|
You can add nvim-cmp sources with vim.autocomplete.nvim-cmp.sources
|
||||||
instead.
|
instead.
|
||||||
'')
|
'')
|
||||||
|
|
||||||
(mkRemovedOptionModule ["vim" "snippets" "vsnip" "enable"] ''
|
(mkRemovedOptionModule ["vim" "snippets" "vsnip" "enable"] ''
|
||||||
vim.snippets.vsnip.enable has been removed in favor of the more modern luasnip.
|
vim.snippets.vsnip.enable has been removed in favor of the more modern luasnip.
|
||||||
'')
|
'')
|
||||||
|
|
@ -84,9 +94,18 @@ in {
|
||||||
`tabstop` and `shiftwidth` manually in `vim.options` or per-filetype in a
|
`tabstop` and `shiftwidth` manually in `vim.options` or per-filetype in a
|
||||||
`ftplugin` directory added to your runtime path.
|
`ftplugin` directory added to your runtime path.
|
||||||
'')
|
'')
|
||||||
|
|
||||||
|
# 2024-12-02
|
||||||
|
(mkRenamedOptionModule ["vim" "enableEditorconfig"] ["vim" "globals" "editorconfig"])
|
||||||
|
|
||||||
|
# 2025-02-06
|
||||||
|
(mkRemovedOptionModule ["vim" "disableArrows"] ''
|
||||||
|
Top-level convenience options are now in the process of being removed from nvf as
|
||||||
|
their behaviour was abstract, and confusing. Please use 'vim.options' or 'vim.luaConfigRC'
|
||||||
|
to replicate previous behaviour.
|
||||||
|
'')
|
||||||
]
|
]
|
||||||
|
|
||||||
# 2024-12-1
|
|
||||||
# Migrated via batchRenameOptions. Further batch renames must be below this line.
|
# Migrated via batchRenameOptions. Further batch renames must be below this line.
|
||||||
renamedVimOpts
|
renamedVimOpts
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,13 @@
|
||||||
"completion"
|
"completion"
|
||||||
"dashboard"
|
"dashboard"
|
||||||
"debugger"
|
"debugger"
|
||||||
|
"diagnostics"
|
||||||
"filetree"
|
"filetree"
|
||||||
|
"formatter"
|
||||||
"git"
|
"git"
|
||||||
"languages"
|
"languages"
|
||||||
"lsp"
|
"lsp"
|
||||||
|
"mini"
|
||||||
"minimap"
|
"minimap"
|
||||||
"notes"
|
"notes"
|
||||||
"projects"
|
"projects"
|
||||||
|
|
@ -49,6 +52,7 @@
|
||||||
# using the configuration passed in `neovim` and `plugins` modules.
|
# using the configuration passed in `neovim` and `plugins` modules.
|
||||||
wrapper = map (p: ./wrapper + "/${p}") [
|
wrapper = map (p: ./wrapper + "/${p}") [
|
||||||
"build"
|
"build"
|
||||||
|
"environment"
|
||||||
"rc"
|
"rc"
|
||||||
"warnings"
|
"warnings"
|
||||||
"lazy"
|
"lazy"
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption literalMD;
|
inherit (lib.options) mkOption mkEnableOption literalMD;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
|
inherit (lib.attrsets) optionalAttrs;
|
||||||
inherit (lib.types) enum bool str int either;
|
inherit (lib.types) enum bool str int either;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.nvim.dag) entryAfter;
|
inherit (lib.nvim.dag) entryAfter;
|
||||||
|
|
@ -15,12 +16,6 @@
|
||||||
cfg = config.vim;
|
cfg = config.vim;
|
||||||
in {
|
in {
|
||||||
options.vim = {
|
options.vim = {
|
||||||
disableArrows = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = "Set to prevent arrow keys from moving cursor";
|
|
||||||
};
|
|
||||||
|
|
||||||
hideSearchHighlight = mkOption {
|
hideSearchHighlight = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
|
@ -53,15 +48,15 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
preventJunkFiles = mkOption {
|
preventJunkFiles = mkOption {
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = "Prevent swapfile and backupfile from being created";
|
|
||||||
};
|
|
||||||
|
|
||||||
showSignColumn = mkOption {
|
|
||||||
type = bool;
|
type = bool;
|
||||||
default = true;
|
default = true;
|
||||||
description = "Show the sign column";
|
example = false;
|
||||||
|
description = ''
|
||||||
|
Prevent swapfile and backupfile from being created.
|
||||||
|
|
||||||
|
`false` is the default Neovim behaviour. If you wish to create
|
||||||
|
backup and swapfiles, set this option to `false`.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
bell = mkOption {
|
bell = mkOption {
|
||||||
|
|
@ -70,12 +65,6 @@ in {
|
||||||
description = "Set how bells are handled. Options: on, visual or none";
|
description = "Set how bells are handled. Options: on, visual or none";
|
||||||
};
|
};
|
||||||
|
|
||||||
enableEditorconfig = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = "Follow editorconfig rules in current directory";
|
|
||||||
};
|
|
||||||
|
|
||||||
searchCase = mkOption {
|
searchCase = mkOption {
|
||||||
type = enum ["ignore" "smart" "sensitive"];
|
type = enum ["ignore" "smart" "sensitive"];
|
||||||
default = "sensitive";
|
default = "sensitive";
|
||||||
|
|
@ -106,63 +95,55 @@ in {
|
||||||
# Set options that were previously interpolated in 'luaConfigRC.basic' as vim.options (vim.o)
|
# Set options that were previously interpolated in 'luaConfigRC.basic' as vim.options (vim.o)
|
||||||
# and 'vim.globals' (vim.g). Future options, if possible, should be added here instead of the
|
# and 'vim.globals' (vim.g). Future options, if possible, should be added here instead of the
|
||||||
# luaConfigRC section below.
|
# luaConfigRC section below.
|
||||||
options = pushDownDefault {
|
options = pushDownDefault (lib.mergeAttrsList [
|
||||||
encoding = "utf-8";
|
{
|
||||||
hidden = true;
|
# Options that are always set, with a lower priority
|
||||||
expandtab = true;
|
encoding = "utf-8";
|
||||||
};
|
hidden = true;
|
||||||
|
expandtab = true;
|
||||||
|
|
||||||
globals = pushDownDefault {
|
# Junkfile Behaviour
|
||||||
editorconfig = cfg.enableEditorconfig;
|
swapfile = !cfg.preventJunkFiles;
|
||||||
};
|
backup = !cfg.preventJunkFiles;
|
||||||
|
writebackup = !cfg.preventJunkFiles;
|
||||||
|
}
|
||||||
|
|
||||||
# Options that are more difficult to set through 'vim.options'. Fear not, though
|
(optionalAttrs cfg.undoFile.enable {
|
||||||
# as the Lua DAG is still as powerful as it could be.
|
undofile = true;
|
||||||
|
undodir = cfg.undoFile.path;
|
||||||
|
})
|
||||||
|
|
||||||
|
(optionalAttrs (cfg.bell == "none") {
|
||||||
|
errorbells = false;
|
||||||
|
visualbell = false;
|
||||||
|
})
|
||||||
|
|
||||||
|
(optionalAttrs (cfg.bell == "on") {
|
||||||
|
visualbell = false;
|
||||||
|
})
|
||||||
|
|
||||||
|
(optionalAttrs (cfg.bell == "visual") {
|
||||||
|
visualbell = false;
|
||||||
|
})
|
||||||
|
|
||||||
|
(optionalAttrs (cfg.lineNumberMode == "relative") {
|
||||||
|
relativenumber = true;
|
||||||
|
})
|
||||||
|
|
||||||
|
(optionalAttrs (cfg.lineNumberMode == "number") {
|
||||||
|
number = true;
|
||||||
|
})
|
||||||
|
|
||||||
|
(optionalAttrs (cfg.lineNumberMode == "relNumber") {
|
||||||
|
number = true;
|
||||||
|
relativenumber = true;
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
|
||||||
|
# Options that are more difficult to set through 'vim.options'. Namely, appending values
|
||||||
|
# to pre-set Neovim options. Fear not, though as the Lua DAG is still as powerful as it
|
||||||
|
# could be.
|
||||||
luaConfigRC.basic = entryAfter ["globalsScript"] ''
|
luaConfigRC.basic = entryAfter ["globalsScript"] ''
|
||||||
-- Settings that are set for everything
|
|
||||||
vim.opt.shortmess:append("c")
|
|
||||||
|
|
||||||
${optionalString cfg.undoFile.enable ''
|
|
||||||
vim.o.undofile = true
|
|
||||||
vim.o.undodir = ${toLuaObject cfg.undoFile.path}
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString cfg.showSignColumn ''
|
|
||||||
vim.o.signcolumn = "yes"
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString cfg.preventJunkFiles ''
|
|
||||||
vim.o.swapfile = false
|
|
||||||
vim.o.backup = false
|
|
||||||
vim.o.writebackup = false
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString (cfg.bell == "none") ''
|
|
||||||
vim.o.errorbells = false
|
|
||||||
vim.o.visualbell = false
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString (cfg.bell == "on") ''
|
|
||||||
vim.o.visualbell = false
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString (cfg.bell == "visual") ''
|
|
||||||
vim.o.errorbells = false
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString (cfg.lineNumberMode == "relative") ''
|
|
||||||
vim.o.relativenumber = true
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString (cfg.lineNumberMode == "number") ''
|
|
||||||
vim.o.number = true
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString (cfg.lineNumberMode == "relNumber") ''
|
|
||||||
vim.o.number = true
|
|
||||||
vim.o.relativenumber = true
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString cfg.useSystemClipboard ''
|
${optionalString cfg.useSystemClipboard ''
|
||||||
vim.opt.clipboard:append("unnamedplus")
|
vim.opt.clipboard:append("unnamedplus")
|
||||||
''}
|
''}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
./basic.nix
|
./basic.nix
|
||||||
./debug.nix
|
./debug.nix
|
||||||
|
./highlight.nix
|
||||||
./spellcheck.nix
|
./spellcheck.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
119
modules/neovim/init/highlight.nix
Normal file
119
modules/neovim/init/highlight.nix
Normal file
|
|
@ -0,0 +1,119 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkOption;
|
||||||
|
inherit (lib.types) nullOr attrsOf listOf submodule bool ints str enum;
|
||||||
|
inherit (lib.strings) hasPrefix concatLines;
|
||||||
|
inherit (lib.attrsets) mapAttrsToList;
|
||||||
|
inherit (lib.nvim.dag) entryBetween;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
inherit (lib.nvim.types) hexColor;
|
||||||
|
|
||||||
|
mkColorOption = target:
|
||||||
|
mkOption {
|
||||||
|
type = nullOr hexColor;
|
||||||
|
default = null;
|
||||||
|
example = "#ebdbb2";
|
||||||
|
description = ''
|
||||||
|
The ${target} color to use. Written as color name or hex "#RRGGBB".
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
mkBoolOption = name:
|
||||||
|
mkOption {
|
||||||
|
type = nullOr bool;
|
||||||
|
default = null;
|
||||||
|
example = false;
|
||||||
|
description = "Whether to enable ${name}";
|
||||||
|
};
|
||||||
|
|
||||||
|
cfg = config.vim.highlight;
|
||||||
|
in {
|
||||||
|
options.vim.highlight = mkOption {
|
||||||
|
type = attrsOf (submodule {
|
||||||
|
# See :h nvim_set_hl
|
||||||
|
options = {
|
||||||
|
bg = mkColorOption "background";
|
||||||
|
fg = mkColorOption "foreground";
|
||||||
|
sp = mkColorOption "special";
|
||||||
|
blend = mkOption {
|
||||||
|
type = nullOr (ints.between 0 100);
|
||||||
|
default = null;
|
||||||
|
description = "Blend as an integer between 0 and 100";
|
||||||
|
};
|
||||||
|
bold = mkBoolOption "bold";
|
||||||
|
standout = mkBoolOption "standout";
|
||||||
|
underline = mkBoolOption "underline";
|
||||||
|
undercurl = mkBoolOption "undercurl";
|
||||||
|
underdouble = mkBoolOption "underdouble";
|
||||||
|
underdotted = mkBoolOption "underdotted";
|
||||||
|
underdashed = mkBoolOption "underdashed";
|
||||||
|
strikethrough = mkBoolOption "strikethrough";
|
||||||
|
italic = mkBoolOption "italic";
|
||||||
|
reverse = mkBoolOption "reverse";
|
||||||
|
nocombine = mkBoolOption "nocombine";
|
||||||
|
link = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = "The name of another highlight group to link to";
|
||||||
|
};
|
||||||
|
default = mkOption {
|
||||||
|
type = nullOr bool;
|
||||||
|
default = null;
|
||||||
|
description = "Don't override existing definition";
|
||||||
|
};
|
||||||
|
ctermfg = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = "The cterm foreground color to use";
|
||||||
|
};
|
||||||
|
ctermbg = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = "The cterm background color to use";
|
||||||
|
};
|
||||||
|
cterm = mkOption {
|
||||||
|
type = nullOr (listOf (enum [
|
||||||
|
"bold"
|
||||||
|
"underline"
|
||||||
|
"undercurl"
|
||||||
|
"underdouble"
|
||||||
|
"underdotted"
|
||||||
|
"underdashed"
|
||||||
|
"strikethrough"
|
||||||
|
"reverse"
|
||||||
|
"inverse"
|
||||||
|
"italic"
|
||||||
|
"standout"
|
||||||
|
"altfont"
|
||||||
|
"nocombine"
|
||||||
|
"NONE"
|
||||||
|
]));
|
||||||
|
default = null;
|
||||||
|
description = "The cterm arguments to use. See ':h highlight-args'";
|
||||||
|
};
|
||||||
|
force = mkBoolOption "force update";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
default = {};
|
||||||
|
example = {
|
||||||
|
SignColumn = {
|
||||||
|
bg = "#282828";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
description = "Custom highlights to apply";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
vim.luaConfigRC.highlight = let
|
||||||
|
highlights =
|
||||||
|
mapAttrsToList (
|
||||||
|
name: value: ''vim.api.nvim_set_hl(0, ${toLuaObject name}, ${toLuaObject value})''
|
||||||
|
)
|
||||||
|
cfg;
|
||||||
|
in
|
||||||
|
entryBetween ["lazyConfigs" "pluginConfigs" "extraPluginConfigs"] ["theme"] (concatLines highlights);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkRenamedOptionModule;
|
inherit (lib.modules) mkIf mkRenamedOptionModule;
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
inherit (lib.strings) concatLines;
|
inherit (lib.strings) concatLines concatStringsSep optionalString;
|
||||||
inherit (lib.attrsets) mapAttrsToList;
|
inherit (lib.attrsets) mapAttrsToList;
|
||||||
inherit (lib.types) listOf str attrsOf;
|
inherit (lib.types) listOf str attrsOf;
|
||||||
inherit (lib.nvim.lua) listToLuaTable;
|
inherit (lib.nvim.lua) listToLuaTable;
|
||||||
|
|
@ -124,7 +124,6 @@ in {
|
||||||
nvim --headless --clean \
|
nvim --headless --clean \
|
||||||
--cmd "mkspell $out/spell/$name.add.spl $spellfile" -Es -n
|
--cmd "mkspell $out/spell/$name.add.spl $spellfile" -Es -n
|
||||||
done
|
done
|
||||||
|
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
mkIf (cfg.extraSpellWords != {}) [
|
mkIf (cfg.extraSpellWords != {}) [
|
||||||
|
|
@ -133,10 +132,19 @@ in {
|
||||||
compileJoinedSpellfiles.outPath
|
compileJoinedSpellfiles.outPath
|
||||||
];
|
];
|
||||||
|
|
||||||
luaConfigRC.spellcheck = entryAfter ["basic"] ''
|
options = {
|
||||||
vim.opt.spell = true
|
spell = true;
|
||||||
vim.opt.spelllang = ${listToLuaTable cfg.languages}
|
|
||||||
|
|
||||||
|
# Workaround for Neovim's spelllang setup. It can be
|
||||||
|
# - a string, e.g., "en"
|
||||||
|
# - multiple strings, separated with commas, e.g., "en,de"
|
||||||
|
# toLuaObject cannot generate the correct type here, unless we take a string here.
|
||||||
|
spelllang = concatStringsSep "," cfg.languages;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Register an autocommand to disable spellchecking in buffers with given filetypes.
|
||||||
|
# If the list is empty, the autocommand does not need to be registered.
|
||||||
|
luaConfigRC.spellcheck = entryAfter ["basic"] (optionalString (cfg.ignoredFiletypes != []) ''
|
||||||
-- Disable spellchecking for certain filetypes
|
-- Disable spellchecking for certain filetypes
|
||||||
-- as configured by `vim.spellcheck.ignoredFiletypes`
|
-- as configured by `vim.spellcheck.ignoredFiletypes`
|
||||||
vim.api.nvim_create_augroup("nvf_autocmds", {clear = false})
|
vim.api.nvim_create_augroup("nvf_autocmds", {clear = false})
|
||||||
|
|
@ -147,7 +155,7 @@ in {
|
||||||
vim.opt_local.spell = false
|
vim.opt_local.spell = false
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
'';
|
'');
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,34 +26,6 @@
|
||||||
in {
|
in {
|
||||||
config = {
|
config = {
|
||||||
vim.keymaps = mkMerge [
|
vim.keymaps = mkMerge [
|
||||||
(
|
|
||||||
mkIf cfg.disableArrows [
|
|
||||||
{
|
|
||||||
key = "<up>";
|
|
||||||
mode = ["n" "i"];
|
|
||||||
action = "<nop>";
|
|
||||||
noremap = false;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<down>";
|
|
||||||
mode = ["n" "i"];
|
|
||||||
action = "<nop>";
|
|
||||||
noremap = false;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<left>";
|
|
||||||
mode = ["n" "i"];
|
|
||||||
action = "<nop>";
|
|
||||||
noremap = false;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<right>";
|
|
||||||
mode = ["n" "i"];
|
|
||||||
action = "<nop>";
|
|
||||||
noremap = false;
|
|
||||||
}
|
|
||||||
]
|
|
||||||
)
|
|
||||||
(
|
(
|
||||||
pipe cfg.maps
|
pipe cfg.maps
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -30,17 +30,19 @@
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = [
|
startPlugins = ["chatgpt-nvim"];
|
||||||
"chatgpt"
|
|
||||||
];
|
|
||||||
pluginRC.chagpt = entryAnywhere ''
|
pluginRC.chagpt = entryAnywhere ''
|
||||||
require("chatgpt").setup(${toLuaObject cfg.setupOpts})
|
require("chatgpt").setup(${toLuaObject cfg.setupOpts})
|
||||||
'';
|
'';
|
||||||
maps.normal = mkMerge [
|
|
||||||
(mkSetBinding mappings.chatGpt "<cmd>ChatGPT<CR>")
|
maps = {
|
||||||
maps
|
visual = maps;
|
||||||
];
|
normal = mkMerge [
|
||||||
maps.visual = maps;
|
(mkSetBinding mappings.chatGpt "<cmd>ChatGPT<CR>")
|
||||||
|
maps
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
120
modules/plugins/completion/blink-cmp/blink-cmp.nix
Normal file
120
modules/plugins/completion/blink-cmp/blink-cmp.nix
Normal file
|
|
@ -0,0 +1,120 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkEnableOption mkOption literalMD;
|
||||||
|
inherit (lib.types) listOf str either attrsOf submodule enum anything int nullOr;
|
||||||
|
inherit (lib.generators) mkLuaInline;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
||||||
|
inherit (lib.nvim.binds) mkMappingOption;
|
||||||
|
inherit (lib.nvim.config) mkBool;
|
||||||
|
|
||||||
|
keymapType = submodule {
|
||||||
|
freeformType = attrsOf (listOf (either str luaInline));
|
||||||
|
options = {
|
||||||
|
preset = mkOption {
|
||||||
|
type = enum ["default" "none" "super-tab" "enter"];
|
||||||
|
default = "none";
|
||||||
|
description = "keymap presets";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
providerType = submodule {
|
||||||
|
freeformType = anything;
|
||||||
|
options = {
|
||||||
|
module = mkOption {
|
||||||
|
type = str;
|
||||||
|
description = "module of the provider";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
options.vim.autocomplete.blink-cmp = {
|
||||||
|
enable = mkEnableOption "blink.cmp";
|
||||||
|
setupOpts = mkPluginSetupOption "blink.cmp" {
|
||||||
|
sources = {
|
||||||
|
default = mkOption {
|
||||||
|
type = listOf str;
|
||||||
|
default = ["lsp" "path" "snippets" "buffer"];
|
||||||
|
description = "Default list of sources to enable for completion.";
|
||||||
|
};
|
||||||
|
|
||||||
|
cmdline = mkOption {
|
||||||
|
type = nullOr (listOf str);
|
||||||
|
default = [];
|
||||||
|
description = "List of sources to enable for cmdline. Null means use default source list.";
|
||||||
|
};
|
||||||
|
|
||||||
|
providers = mkOption {
|
||||||
|
type = attrsOf providerType;
|
||||||
|
default = {};
|
||||||
|
description = "Settings for completion providers";
|
||||||
|
};
|
||||||
|
|
||||||
|
transform_items = mkOption {
|
||||||
|
type = nullOr luaInline;
|
||||||
|
default = mkLuaInline "function(_, items) return items end";
|
||||||
|
defaultText = ''
|
||||||
|
Our default does nothing. If you want blink.cmp's default, which
|
||||||
|
lowers the score for snippets, set this option to null.
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Function to use when transforming the items before they're returned
|
||||||
|
for all providers.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
completion = {
|
||||||
|
documentation = {
|
||||||
|
auto_show = mkBool true "Show documentation whenever an item is selected";
|
||||||
|
auto_show_delay_ms = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 200;
|
||||||
|
description = "Delay before auto show triggers";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
keymap = mkOption {
|
||||||
|
type = keymapType;
|
||||||
|
default = {};
|
||||||
|
description = "blink.cmp keymap";
|
||||||
|
example = literalMD ''
|
||||||
|
```nix
|
||||||
|
vim.autocomplete.blink-cmp.setupOpts.keymap = {
|
||||||
|
preset = "none";
|
||||||
|
|
||||||
|
"<Up>" = ["select_prev" "fallback"];
|
||||||
|
"<C-n>" = [
|
||||||
|
(lib.generators.mkLuaInline ''''
|
||||||
|
function(cmp)
|
||||||
|
if some_condition then return end -- runs the next command
|
||||||
|
return true -- doesn't run the next command
|
||||||
|
end,
|
||||||
|
'''')
|
||||||
|
"select_next"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
```
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
fuzzy = {
|
||||||
|
prebuilt_binaries = {
|
||||||
|
download = mkBool false ''
|
||||||
|
Auto-downloads prebuilt binaries. Do not enable, it doesn't work on nix
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
mappings = {
|
||||||
|
complete = mkMappingOption "Complete [blink.cmp]" "<C-Space>";
|
||||||
|
confirm = mkMappingOption "Confirm [blink.cmp]" "<CR>";
|
||||||
|
next = mkMappingOption "Next item [blink.cmp]" "<Tab>";
|
||||||
|
previous = mkMappingOption "Previous item [blink.cmp]" "<S-Tab>";
|
||||||
|
close = mkMappingOption "Close [blink.cmp]" "<C-e>";
|
||||||
|
scrollDocsUp = mkMappingOption "Scroll docs up [blink.cmp]" "<C-d>";
|
||||||
|
scrollDocsDown = mkMappingOption "Scroll docs down [blink.cmp]" "<C-f>";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
91
modules/plugins/completion/blink-cmp/config.nix
Normal file
91
modules/plugins/completion/blink-cmp/config.nix
Normal file
|
|
@ -0,0 +1,91 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.strings) optionalString;
|
||||||
|
inherit (lib.generators) mkLuaInline;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
inherit (builtins) concatStringsSep typeOf tryEval attrNames mapAttrs;
|
||||||
|
|
||||||
|
cfg = config.vim.autocomplete.blink-cmp;
|
||||||
|
cmpCfg = config.vim.autocomplete.nvim-cmp;
|
||||||
|
inherit (cfg) mappings;
|
||||||
|
|
||||||
|
getPluginName = plugin:
|
||||||
|
if typeOf plugin == "string"
|
||||||
|
then plugin
|
||||||
|
else if (plugin ? pname && (tryEval plugin.pname).success)
|
||||||
|
then plugin.pname
|
||||||
|
else plugin.name;
|
||||||
|
in {
|
||||||
|
vim = mkIf cfg.enable {
|
||||||
|
startPlugins = ["blink-compat"];
|
||||||
|
lazy.plugins = {
|
||||||
|
blink-cmp = {
|
||||||
|
package = "blink-cmp";
|
||||||
|
setupModule = "blink.cmp";
|
||||||
|
inherit (cfg) setupOpts;
|
||||||
|
|
||||||
|
# TODO: lazy disabled until lspconfig is lazy loaded
|
||||||
|
#
|
||||||
|
# event = ["InsertEnter" "CmdlineEnter"];
|
||||||
|
|
||||||
|
after = ''
|
||||||
|
${optionalString config.vim.lazy.enable
|
||||||
|
(concatStringsSep "\n" (map
|
||||||
|
(package: "require('lz.n').trigger_load(${toLuaObject (getPluginName package)})")
|
||||||
|
cmpCfg.sourcePlugins))}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
autocomplete = {
|
||||||
|
enableSharedCmpSources = true;
|
||||||
|
blink-cmp.setupOpts = {
|
||||||
|
sources = {
|
||||||
|
default = ["lsp" "path" "snippets" "buffer"] ++ (attrNames cmpCfg.sources);
|
||||||
|
providers =
|
||||||
|
mapAttrs (name: _: {
|
||||||
|
inherit name;
|
||||||
|
module = "blink.compat.source";
|
||||||
|
})
|
||||||
|
cmpCfg.sources;
|
||||||
|
};
|
||||||
|
snippets = mkIf config.vim.snippets.luasnip.enable {
|
||||||
|
preset = "luasnip";
|
||||||
|
};
|
||||||
|
|
||||||
|
keymap = {
|
||||||
|
${mappings.complete} = ["show" "fallback"];
|
||||||
|
${mappings.close} = ["hide" "fallback"];
|
||||||
|
${mappings.scrollDocsUp} = ["scroll_documentation_up" "fallback"];
|
||||||
|
${mappings.scrollDocsDown} = ["scroll_documentation_down" "fallback"];
|
||||||
|
${mappings.confirm} = ["accept" "fallback"];
|
||||||
|
|
||||||
|
${mappings.next} = [
|
||||||
|
"select_next"
|
||||||
|
"snippet_forward"
|
||||||
|
(mkLuaInline ''
|
||||||
|
function(cmp)
|
||||||
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||||
|
has_words_before = col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||||
|
|
||||||
|
if has_words_before then
|
||||||
|
return cmp.show()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
'')
|
||||||
|
"fallback"
|
||||||
|
];
|
||||||
|
${mappings.previous} = [
|
||||||
|
"select_prev"
|
||||||
|
"snippet_backward"
|
||||||
|
"fallback"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
6
modules/plugins/completion/blink-cmp/default.nix
Normal file
6
modules/plugins/completion/blink-cmp/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./blink-cmp.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
34
modules/plugins/completion/config.nix
Normal file
34
modules/plugins/completion/config.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||||
|
inherit (builtins) typeOf tryEval;
|
||||||
|
|
||||||
|
cfg = config.vim.autocomplete;
|
||||||
|
getPluginName = plugin:
|
||||||
|
if typeOf plugin == "string"
|
||||||
|
then plugin
|
||||||
|
else if (plugin ? pname && (tryEval plugin.pname).success)
|
||||||
|
then plugin.pname
|
||||||
|
else plugin.name;
|
||||||
|
in {
|
||||||
|
config.vim = mkIf cfg.enableSharedCmpSources {
|
||||||
|
startPlugins = ["rtp-nvim"];
|
||||||
|
lazy.plugins =
|
||||||
|
mapListToAttrs (package: {
|
||||||
|
name = getPluginName package;
|
||||||
|
value = {
|
||||||
|
inherit package;
|
||||||
|
lazy = true;
|
||||||
|
after = ''
|
||||||
|
local path = vim.fn.globpath(vim.o.packpath, 'pack/*/opt/${getPluginName package}')
|
||||||
|
require("rtp_nvim").source_after_plugin_dir(path)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
})
|
||||||
|
cfg.nvim-cmp.sourcePlugins;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./module.nix
|
||||||
|
./config.nix
|
||||||
|
|
||||||
./nvim-cmp
|
./nvim-cmp
|
||||||
|
./blink-cmp
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
7
modules/plugins/completion/module.nix
Normal file
7
modules/plugins/completion/module.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkEnableOption;
|
||||||
|
in {
|
||||||
|
options.vim.autocomplete = {
|
||||||
|
enableSharedCmpSources = mkEnableOption "sources shared by blink.cmp and nvim-cmp";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -24,114 +24,103 @@
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = ["rtp-nvim"];
|
lazy.plugins = {
|
||||||
lazy.plugins = mkMerge [
|
nvim-cmp = {
|
||||||
(mapListToAttrs (package: {
|
package = "nvim-cmp";
|
||||||
name = getPluginName package;
|
after = ''
|
||||||
value = {
|
${optionalString luasnipEnable "local luasnip = require('luasnip')"}
|
||||||
inherit package;
|
local cmp = require("cmp")
|
||||||
lazy = true;
|
|
||||||
after = ''
|
local kinds = require("cmp.types").lsp.CompletionItemKind
|
||||||
local path = vim.fn.globpath(vim.o.packpath, 'pack/*/opt/${getPluginName package}')
|
local deprio = function(kind)
|
||||||
require("rtp_nvim").source_after_plugin_dir(path)
|
return function(e1, e2)
|
||||||
|
if e1:get_kind() == kind then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
if e2:get_kind() == kind then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
cmp.setup(${toLuaObject cfg.setupOpts})
|
||||||
|
|
||||||
|
${optionalString config.vim.lazy.enable
|
||||||
|
(concatStringsSep "\n" (map
|
||||||
|
(package: "require('lz.n').trigger_load(${toLuaObject (getPluginName package)})")
|
||||||
|
cfg.sourcePlugins))}
|
||||||
|
'';
|
||||||
|
|
||||||
|
event = ["InsertEnter" "CmdlineEnter"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
autocomplete = {
|
||||||
|
enableSharedCmpSources = true;
|
||||||
|
|
||||||
|
nvim-cmp = {
|
||||||
|
sources = {
|
||||||
|
nvim-cmp = null;
|
||||||
|
buffer = "[Buffer]";
|
||||||
|
path = "[Path]";
|
||||||
|
};
|
||||||
|
|
||||||
|
sourcePlugins = ["cmp-buffer" "cmp-path"];
|
||||||
|
|
||||||
|
setupOpts = {
|
||||||
|
sources = map (s: {name = s;}) (attrNames cfg.sources);
|
||||||
|
|
||||||
|
window = mkIf borders.enable {
|
||||||
|
completion.border = borders.style;
|
||||||
|
documentation.border = borders.style;
|
||||||
|
};
|
||||||
|
|
||||||
|
formatting.format = cfg.format;
|
||||||
|
|
||||||
|
# `cmp` and `luasnip` are defined above, in the `nvim-cmp` section
|
||||||
|
mapping = {
|
||||||
|
${mappings.complete} = mkLuaInline "cmp.mapping.complete()";
|
||||||
|
${mappings.close} = mkLuaInline "cmp.mapping.abort()";
|
||||||
|
${mappings.scrollDocsUp} = mkLuaInline "cmp.mapping.scroll_docs(-4)";
|
||||||
|
${mappings.scrollDocsDown} = mkLuaInline "cmp.mapping.scroll_docs(4)";
|
||||||
|
${mappings.confirm} = mkLuaInline "cmp.mapping.confirm({ select = true })";
|
||||||
|
|
||||||
|
${mappings.next} = mkLuaInline ''
|
||||||
|
cmp.mapping(function(fallback)
|
||||||
|
local has_words_before = function()
|
||||||
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||||
|
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||||
|
end
|
||||||
|
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
${optionalString luasnipEnable ''
|
||||||
|
elseif luasnip.locally_jumpable(1) then
|
||||||
|
luasnip.jump(1)
|
||||||
|
''}
|
||||||
|
elseif has_words_before() then
|
||||||
|
cmp.complete()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
'';
|
||||||
|
|
||||||
|
${mappings.previous} = mkLuaInline ''
|
||||||
|
cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
${optionalString luasnipEnable ''
|
||||||
|
elseif luasnip.locally_jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
''}
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end)
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
})
|
|
||||||
cfg.sourcePlugins)
|
|
||||||
{
|
|
||||||
nvim-cmp = {
|
|
||||||
package = "nvim-cmp";
|
|
||||||
after = ''
|
|
||||||
${optionalString luasnipEnable "local luasnip = require('luasnip')"}
|
|
||||||
local cmp = require("cmp")
|
|
||||||
|
|
||||||
local kinds = require("cmp.types").lsp.CompletionItemKind
|
|
||||||
local deprio = function(kind)
|
|
||||||
return function(e1, e2)
|
|
||||||
if e1:get_kind() == kind then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if e2:get_kind() == kind then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
cmp.setup(${toLuaObject cfg.setupOpts})
|
|
||||||
|
|
||||||
${optionalString config.vim.lazy.enable
|
|
||||||
(concatStringsSep "\n" (map
|
|
||||||
(package: "require('lz.n').trigger_load(${toLuaObject (getPluginName package)})")
|
|
||||||
cfg.sourcePlugins))}
|
|
||||||
'';
|
|
||||||
|
|
||||||
event = ["InsertEnter" "CmdlineEnter"];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
autocomplete.nvim-cmp = {
|
|
||||||
sources = {
|
|
||||||
nvim-cmp = null;
|
|
||||||
buffer = "[Buffer]";
|
|
||||||
path = "[Path]";
|
|
||||||
};
|
|
||||||
|
|
||||||
sourcePlugins = ["cmp-buffer" "cmp-path"];
|
|
||||||
|
|
||||||
setupOpts = {
|
|
||||||
sources = map (s: {name = s;}) (attrNames cfg.sources);
|
|
||||||
|
|
||||||
window = mkIf borders.enable {
|
|
||||||
completion.border = borders.style;
|
|
||||||
documentation.border = borders.style;
|
|
||||||
};
|
|
||||||
|
|
||||||
formatting.format = cfg.format;
|
|
||||||
|
|
||||||
# `cmp` and `luasnip` are defined above, in the `nvim-cmp` section
|
|
||||||
mapping = {
|
|
||||||
${mappings.complete} = mkLuaInline "cmp.mapping.complete()";
|
|
||||||
${mappings.close} = mkLuaInline "cmp.mapping.abort()";
|
|
||||||
${mappings.scrollDocsUp} = mkLuaInline "cmp.mapping.scroll_docs(-4)";
|
|
||||||
${mappings.scrollDocsDown} = mkLuaInline "cmp.mapping.scroll_docs(4)";
|
|
||||||
${mappings.confirm} = mkLuaInline "cmp.mapping.confirm({ select = true })";
|
|
||||||
|
|
||||||
${mappings.next} = mkLuaInline ''
|
|
||||||
cmp.mapping(function(fallback)
|
|
||||||
local has_words_before = function()
|
|
||||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
|
||||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
|
||||||
end
|
|
||||||
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
${optionalString luasnipEnable ''
|
|
||||||
elseif luasnip.locally_jumpable(1) then
|
|
||||||
luasnip.jump(1)
|
|
||||||
''}
|
|
||||||
elseif has_words_before() then
|
|
||||||
cmp.complete()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
'';
|
|
||||||
|
|
||||||
${mappings.previous} = mkLuaInline ''
|
|
||||||
cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
${optionalString luasnipEnable ''
|
|
||||||
elseif luasnip.locally_jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
|
||||||
''}
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
3
modules/plugins/diagnostics/default.nix
Normal file
3
modules/plugins/diagnostics/default.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
imports = [./nvim-lint];
|
||||||
|
}
|
||||||
20
modules/plugins/diagnostics/nvim-lint/config.nix
Normal file
20
modules/plugins/diagnostics/nvim-lint/config.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
|
cfg = config.vim.diagnostics.nvim-lint;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = ["nvim-lint"];
|
||||||
|
pluginRC.nvim-lint = entryAnywhere ''
|
||||||
|
require("lint").setup(${toLuaObject cfg.setupOpts})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
6
modules/plugins/diagnostics/nvim-lint/default.nix
Normal file
6
modules/plugins/diagnostics/nvim-lint/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./nvim-lint.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
27
modules/plugins/diagnostics/nvim-lint/nvim-lint.nix
Normal file
27
modules/plugins/diagnostics/nvim-lint/nvim-lint.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
inherit (lib.types) attrsOf listOf str;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
in {
|
||||||
|
options.vim.diagnostics.nvim-lint = {
|
||||||
|
enable = mkEnableOption "asynchronous linter plugin for Neovim [nvim-lint]";
|
||||||
|
setupOpts = mkPluginSetupOption "nvim-lint" {
|
||||||
|
linters_by_ft = mkOption {
|
||||||
|
type = attrsOf (listOf str);
|
||||||
|
default = {};
|
||||||
|
example = {
|
||||||
|
text = ["vale"];
|
||||||
|
markdown = ["vale"];
|
||||||
|
};
|
||||||
|
|
||||||
|
description = ''
|
||||||
|
Map of filetype to formatters. This option takes a set of
|
||||||
|
`key = value` format where the `value` will be converted
|
||||||
|
to its Lua equivalent. You are responsible for passing the
|
||||||
|
correct Nix data types to generate a correct Lua value that
|
||||||
|
conform is able to accept.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
|
options,
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
|
|
@ -11,8 +11,7 @@
|
||||||
inherit (lib.nvim.binds) pushDownDefault;
|
inherit (lib.nvim.binds) pushDownDefault;
|
||||||
|
|
||||||
cfg = config.vim.filetree.nvimTree;
|
cfg = config.vim.filetree.nvimTree;
|
||||||
self = import ./nvimtree.nix {inherit pkgs lib;};
|
inherit (options.vim.filetree.nvimTree) mappings;
|
||||||
inherit (self.options.vim.filetree.nvimTree) mappings;
|
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
|
|
|
||||||
20
modules/plugins/formatter/conform-nvim/config.nix
Normal file
20
modules/plugins/formatter/conform-nvim/config.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
|
cfg = config.vim.formatter.conform-nvim;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = ["conform-nvim"];
|
||||||
|
pluginRC.conform-nvim = entryAnywhere ''
|
||||||
|
require("conform").setup(${toLuaObject cfg.setupOpts})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
56
modules/plugins/formatter/conform-nvim/conform-nvim.nix
Normal file
56
modules/plugins/formatter/conform-nvim/conform-nvim.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
|
inherit (lib.types) attrs enum;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
inherit (lib.nvim.lua) mkLuaInline;
|
||||||
|
in {
|
||||||
|
options.vim.formatter.conform-nvim = {
|
||||||
|
enable = mkEnableOption "lightweight yet powerful formatter plugin for Neovim [conform-nvim]";
|
||||||
|
setupOpts = mkPluginSetupOption "conform.nvim" {
|
||||||
|
formatters_by_ft = mkOption {
|
||||||
|
type = attrs;
|
||||||
|
default = {};
|
||||||
|
example = {lua = ["stylua"];};
|
||||||
|
description = ''
|
||||||
|
Map of filetype to formatters. This option takes a set of
|
||||||
|
`key = value` format where the `value will` be converted
|
||||||
|
to its Lua equivalent. You are responsible for passing the
|
||||||
|
correct Nix data types to generate a correct Lua value that
|
||||||
|
conform is able to accept.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
default_format_opts = mkOption {
|
||||||
|
type = attrs;
|
||||||
|
default = {lsp_format = "fallback";};
|
||||||
|
description = "Default values when calling `conform.format()`";
|
||||||
|
};
|
||||||
|
|
||||||
|
format_on_save = mkOption {
|
||||||
|
type = attrs;
|
||||||
|
default = {
|
||||||
|
lsp_format = "fallback";
|
||||||
|
timeout_ms = 500;
|
||||||
|
};
|
||||||
|
description = ''
|
||||||
|
Table that will be passed to `conform.format()`. If this
|
||||||
|
is set, Conform will run the formatter on save.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
format_after_save = mkOption {
|
||||||
|
type = attrs;
|
||||||
|
default = {lsp_format = "fallback";};
|
||||||
|
description = ''
|
||||||
|
Table that will be passed to `conform.format()`. If this
|
||||||
|
is set, Conform will run the formatter asynchronously after
|
||||||
|
save.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
6
modules/plugins/formatter/conform-nvim/default.nix
Normal file
6
modules/plugins/formatter/conform-nvim/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./conform-nvim.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
3
modules/plugins/formatter/default.nix
Normal file
3
modules/plugins/formatter/default.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
imports = [./conform-nvim];
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ in {
|
||||||
imports = [
|
imports = [
|
||||||
./gitsigns
|
./gitsigns
|
||||||
./vim-fugitive
|
./vim-fugitive
|
||||||
|
./git-conflict
|
||||||
];
|
];
|
||||||
|
|
||||||
options.vim.git = {
|
options.vim.git = {
|
||||||
|
|
@ -13,6 +14,7 @@ in {
|
||||||
Enabling this option will enable the following plugins:
|
Enabling this option will enable the following plugins:
|
||||||
* gitsigns
|
* gitsigns
|
||||||
* vim-fugitive
|
* vim-fugitive
|
||||||
|
* git-conflict
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
40
modules/plugins/git/git-conflict/config.nix
Normal file
40
modules/plugins/git/git-conflict/config.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
|
cfg = config.vim.git.git-conflict;
|
||||||
|
|
||||||
|
self = import ./git-conflict.nix {inherit lib config;};
|
||||||
|
gcMappingDefinitions = self.options.vim.git.git-conflict.mappings;
|
||||||
|
|
||||||
|
gcMappings = addDescriptionsToMappings cfg.mappings gcMappingDefinitions;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
{
|
||||||
|
vim = {
|
||||||
|
startPlugins = ["git-conflict-nvim"];
|
||||||
|
|
||||||
|
maps = {
|
||||||
|
normal = mkMerge [
|
||||||
|
(mkSetBinding gcMappings.ours "<Plug>(git-conflict-ours)")
|
||||||
|
(mkSetBinding gcMappings.theirs "<Plug>(git-conflict-theirs)")
|
||||||
|
(mkSetBinding gcMappings.both "<Plug>(git-conflict-both)")
|
||||||
|
(mkSetBinding gcMappings.none "<Plug>(git-conflict-none)")
|
||||||
|
(mkSetBinding gcMappings.prevConflict "<Plug>(git-conflict-prev-conflict)")
|
||||||
|
(mkSetBinding gcMappings.nextConflict "<Plug>(git-conflict-next-conflict)")
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
pluginRC.git-conflict = entryAnywhere ''
|
||||||
|
require('git-conflict').setup(${toLuaObject ({default_mappings = false;} // cfg.setupOpts)})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
}
|
||||||
6
modules/plugins/git/git-conflict/default.nix
Normal file
6
modules/plugins/git/git-conflict/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./config.nix
|
||||||
|
./git-conflict.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
23
modules/plugins/git/git-conflict/git-conflict.nix
Normal file
23
modules/plugins/git/git-conflict/git-conflict.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkEnableOption;
|
||||||
|
inherit (lib.nvim.binds) mkMappingOption;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
in {
|
||||||
|
options.vim.git.git-conflict = {
|
||||||
|
enable = mkEnableOption "git-conflict" // {default = config.vim.git.enable;};
|
||||||
|
setupOpts = mkPluginSetupOption "git-conflict" {};
|
||||||
|
|
||||||
|
mappings = {
|
||||||
|
ours = mkMappingOption "Choose Ours [Git-Conflict]" "<leader>co";
|
||||||
|
theirs = mkMappingOption "Choose Theirs [Git-Conflict]" "<leader>ct";
|
||||||
|
both = mkMappingOption "Choose Both [Git-Conflict]" "<leader>cb";
|
||||||
|
none = mkMappingOption "Choose None [Git-Conflict]" "<leader>c0";
|
||||||
|
prevConflict = mkMappingOption "Go to the previous Conflict [Git-Conflict]" "]x";
|
||||||
|
nextConflict = mkMappingOption "Go to the next Conflict [Git-Conflict]" "[x";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetExprBinding mkSetLuaBinding pushDownDefault;
|
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetExprBinding mkSetLuaBinding pushDownDefault;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
cfg = config.vim.git.gitsigns;
|
cfg = config.vim.git.gitsigns;
|
||||||
|
|
||||||
|
|
@ -70,7 +71,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
pluginRC.gitsigns = entryAnywhere ''
|
pluginRC.gitsigns = entryAnywhere ''
|
||||||
require('gitsigns').setup{}
|
require('gitsigns').setup(${toLuaObject cfg.setupOpts})
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
inherit (lib.options) mkEnableOption;
|
inherit (lib.options) mkEnableOption;
|
||||||
inherit (lib.modules) mkRenamedOptionModule;
|
inherit (lib.modules) mkRenamedOptionModule;
|
||||||
inherit (lib.nvim.binds) mkMappingOption;
|
inherit (lib.nvim.binds) mkMappingOption;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
(mkRenamedOptionModule ["vim" "git" "gitsigns" "codeActions" "vim" "gitsigns" "codeActions"] ["vim" "git" "gitsigns" "codeActions" "enable"])
|
(mkRenamedOptionModule ["vim" "git" "gitsigns" "codeActions" "vim" "gitsigns" "codeActions"] ["vim" "git" "gitsigns" "codeActions" "enable"])
|
||||||
|
|
@ -13,6 +14,7 @@ in {
|
||||||
|
|
||||||
options.vim.git.gitsigns = {
|
options.vim.git.gitsigns = {
|
||||||
enable = mkEnableOption "gitsigns" // {default = config.vim.git.enable;};
|
enable = mkEnableOption "gitsigns" // {default = config.vim.git.enable;};
|
||||||
|
setupOpts = mkPluginSetupOption "gitsigns" {};
|
||||||
|
|
||||||
codeActions.enable = mkEnableOption "gitsigns codeactions through null-ls";
|
codeActions.enable = mkEnableOption "gitsigns codeactions through null-ls";
|
||||||
|
|
||||||
|
|
|
||||||
22
modules/plugins/hydra/config.nix
Normal file
22
modules/plugins/hydra/config.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
cfg = config.vim.hydra;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = [];
|
||||||
|
lazy.plugins.hydra = {
|
||||||
|
package = "hydra.nvim";
|
||||||
|
setupModule = "hydra";
|
||||||
|
inherit (cfg) setupOpts;
|
||||||
|
|
||||||
|
event = ["DeferredUIEnter"];
|
||||||
|
cmd = ["MCstart" "MCvisual" "MCclear" "MCpattern" "MCvisualPattern" "MCunderCursor"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
6
modules/plugins/hydra/default.nix
Normal file
6
modules/plugins/hydra/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hydra.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
7
modules/plugins/hydra/hydra.nix
Normal file
7
modules/plugins/hydra/hydra.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkEnableOption;
|
||||||
|
in {
|
||||||
|
options.vim.utility.hydra = {
|
||||||
|
enable = mkEnableOption "utility for creating custom submodes and menus [nvimtools/hydra.nvim]";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -75,8 +75,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
extraServerPlugins = {
|
extraServerPlugins = {
|
||||||
omnisharp = ["omnisharp-extended"];
|
omnisharp = ["omnisharp-extended-lsp-nvim"];
|
||||||
csharp_ls = ["csharpls-extended"];
|
csharp_ls = ["csharpls-extended-lsp-nvim"];
|
||||||
};
|
};
|
||||||
|
|
||||||
cfg = config.vim.languages.csharp;
|
cfg = config.vim.languages.csharp;
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,6 @@ in {
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
(mkIf cfg.lsp.enable {
|
||||||
vim.lsp.lspconfig.enable = true;
|
vim.lsp.lspconfig.enable = true;
|
||||||
|
|
||||||
vim.lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig;
|
vim.lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -138,7 +137,7 @@ in {
|
||||||
vim.startPlugins =
|
vim.startPlugins =
|
||||||
if ftcfg.enableNoResolvePatch
|
if ftcfg.enableNoResolvePatch
|
||||||
then ["flutter-tools-patched"]
|
then ["flutter-tools-patched"]
|
||||||
else ["flutter-tools"];
|
else ["flutter-tools-nvim"];
|
||||||
|
|
||||||
vim.pluginRC.flutter-tools = entryAnywhere ''
|
vim.pluginRC.flutter-tools = entryAnywhere ''
|
||||||
require('flutter-tools').setup {
|
require('flutter-tools').setup {
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@ in {
|
||||||
./julia.nix
|
./julia.nix
|
||||||
./nu.nix
|
./nu.nix
|
||||||
./odin.nix
|
./odin.nix
|
||||||
|
./wgsl.nix
|
||||||
|
./ruby.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.vim.languages = {
|
options.vim.languages = {
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.elixir-tools.enable {
|
(mkIf cfg.elixir-tools.enable {
|
||||||
vim.startPlugins = ["elixir-tools"];
|
vim.startPlugins = ["elixir-tools-nvim"];
|
||||||
vim.pluginRC.elixir-tools = entryAnywhere ''
|
vim.pluginRC.elixir-tools = entryAnywhere ''
|
||||||
local elixir = require("elixir")
|
local elixir = require("elixir")
|
||||||
local elixirls = require("elixir.elixirls")
|
local elixirls = require("elixir.elixirls")
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,43 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
defaultFormat = "gofmt";
|
||||||
|
formats = {
|
||||||
|
gofmt = {
|
||||||
|
package = pkgs.go;
|
||||||
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.gofmt.with({
|
||||||
|
command = "${cfg.format.package}/bin/gofmt",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
gofumpt = {
|
||||||
|
package = pkgs.gofumpt;
|
||||||
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.gofumpt.with({
|
||||||
|
command = "${cfg.format.package}/bin/gofumpt",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
golines = {
|
||||||
|
package = pkgs.golines;
|
||||||
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.golines.with({
|
||||||
|
command = "${cfg.format.package}/bin/golines",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
defaultDebugger = "delve";
|
defaultDebugger = "delve";
|
||||||
debuggers = {
|
debuggers = {
|
||||||
delve = {
|
delve = {
|
||||||
|
|
@ -67,6 +104,22 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
format = {
|
||||||
|
enable = mkEnableOption "Go formatting" // {default = config.vim.languages.enableFormat;};
|
||||||
|
|
||||||
|
type = mkOption {
|
||||||
|
description = "Go formatter to use";
|
||||||
|
type = enum (attrNames formats);
|
||||||
|
default = defaultFormat;
|
||||||
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
description = "Go formatter package";
|
||||||
|
type = package;
|
||||||
|
default = formats.${cfg.format.type}.package;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
dap = {
|
dap = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
description = "Enable Go Debug Adapter via nvim-dap-go plugin";
|
description = "Enable Go Debug Adapter via nvim-dap-go plugin";
|
||||||
|
|
@ -99,6 +152,11 @@ in {
|
||||||
vim.lsp.lspconfig.sources.go-lsp = servers.${cfg.lsp.server}.lspConfig;
|
vim.lsp.lspconfig.sources.go-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.format.enable {
|
||||||
|
vim.lsp.null-ls.enable = true;
|
||||||
|
vim.lsp.null-ls.sources.go-format = formats.${cfg.format.type}.nullConfig;
|
||||||
|
})
|
||||||
|
|
||||||
(mkIf cfg.dap.enable {
|
(mkIf cfg.dap.enable {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = ["nvim-dap-go"];
|
startPlugins = ["nvim-dap-go"];
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ in {
|
||||||
cmd = ${
|
cmd = ${
|
||||||
if isList cfg.lsp.package
|
if isList cfg.lsp.package
|
||||||
then expToLua cfg.lsp.package
|
then expToLua cfg.lsp.package
|
||||||
else ''{"${cfg.lsp.package}/bin/haskell-language-server-wrapper"}''
|
else ''{"${cfg.lsp.package}/bin/haskell-language-server-wrapper", "--lsp"}''
|
||||||
},
|
},
|
||||||
on_attach = function(client, bufnr, ht)
|
on_attach = function(client, bufnr, ht)
|
||||||
default_on_attach(client, bufnr, ht)
|
default_on_attach(client, bufnr, ht)
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.strings) optionalString;
|
|
||||||
inherit (lib.types) either listOf package str;
|
inherit (lib.types) either listOf package str;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
|
|
@ -16,6 +15,12 @@
|
||||||
|
|
||||||
cfg = config.vim.languages.lua;
|
cfg = config.vim.languages.lua;
|
||||||
in {
|
in {
|
||||||
|
imports = [
|
||||||
|
(lib.mkRemovedOptionModule ["vim" "languages" "lua" "lsp" "neodev"] ''
|
||||||
|
neodev has been replaced by lazydev
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
|
||||||
options.vim.languages.lua = {
|
options.vim.languages.lua = {
|
||||||
enable = mkEnableOption "Lua language support";
|
enable = mkEnableOption "Lua language support";
|
||||||
treesitter = {
|
treesitter = {
|
||||||
|
|
@ -32,7 +37,7 @@ in {
|
||||||
default = pkgs.lua-language-server;
|
default = pkgs.lua-language-server;
|
||||||
};
|
};
|
||||||
|
|
||||||
neodev.enable = mkEnableOption "neodev.nvim integration, useful for neovim plugin developers";
|
lazydev.enable = mkEnableOption "lazydev.nvim integration, useful for neovim plugin developers";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -49,7 +54,6 @@ in {
|
||||||
lspconfig.lua_ls.setup {
|
lspconfig.lua_ls.setup {
|
||||||
capabilities = capabilities;
|
capabilities = capabilities;
|
||||||
on_attach = default_on_attach;
|
on_attach = default_on_attach;
|
||||||
${optionalString cfg.lsp.neodev.enable "before_init = require('neodev.lsp').before_init;"}
|
|
||||||
cmd = ${
|
cmd = ${
|
||||||
if isList cfg.lsp.package
|
if isList cfg.lsp.package
|
||||||
then expToLua cfg.lsp.package
|
then expToLua cfg.lsp.package
|
||||||
|
|
@ -59,10 +63,15 @@ in {
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.lsp.neodev.enable {
|
(mkIf cfg.lsp.lazydev.enable {
|
||||||
vim.startPlugins = ["neodev-nvim"];
|
vim.startPlugins = ["lazydev-nvim"];
|
||||||
vim.pluginRC.neodev = entryBefore ["lua-lsp"] ''
|
vim.pluginRC.lazydev = entryBefore ["lua-lsp"] ''
|
||||||
require("neodev").setup({})
|
require("lazydev").setup({
|
||||||
|
enabled = function(root_dir)
|
||||||
|
return not vim.uv.fs_stat(root_dir .. "/.luarc.json")
|
||||||
|
end,
|
||||||
|
library = { { path = "''${3rd}/luv/library", words = { "vim%.uv" } } },
|
||||||
|
})
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
]))
|
]))
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,14 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames concatLists;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList concatLists;
|
||||||
inherit (lib.types) bool enum either package listOf str;
|
inherit (lib.types) bool enum either package listOf str;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua toLuaObject;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
cfg = config.vim.languages.markdown;
|
cfg = config.vim.languages.markdown;
|
||||||
defaultServer = "marksman";
|
defaultServer = "marksman";
|
||||||
|
|
@ -45,6 +46,18 @@
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
prettierd = {
|
||||||
|
package = pkgs.prettierd;
|
||||||
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.prettierd.with({
|
||||||
|
filetypes = ${expToLua (concatLists [cfg.format.extraFiletypes ["markdown"]])},
|
||||||
|
command = "${cfg.format.package}/bin/prettierd",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
options.vim.languages.markdown = {
|
options.vim.languages.markdown = {
|
||||||
|
|
@ -98,6 +111,29 @@ in {
|
||||||
description = "Extra filetypes to format with the Markdown formatter";
|
description = "Extra filetypes to format with the Markdown formatter";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extensions = {
|
||||||
|
render-markdown-nvim = {
|
||||||
|
enable =
|
||||||
|
mkEnableOption ""
|
||||||
|
// {
|
||||||
|
description = ''
|
||||||
|
[render-markdown.nvim]: https://github.com/MeanderingProgrammer/render-markdown.nvim
|
||||||
|
|
||||||
|
Inline Markdown rendering with [render-markdown.nvim]
|
||||||
|
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
setupOpts = mkPluginSetupOption "render-markdown" {
|
||||||
|
auto_override_publish_diagnostics = mkOption {
|
||||||
|
description = "Automatically override the publish_diagnostics handler";
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
|
@ -115,5 +151,13 @@ in {
|
||||||
vim.lsp.null-ls.enable = true;
|
vim.lsp.null-ls.enable = true;
|
||||||
vim.lsp.null-ls.sources.markdown-format = formats.${cfg.format.type}.nullConfig;
|
vim.lsp.null-ls.sources.markdown-format = formats.${cfg.format.type}.nullConfig;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# Extensions
|
||||||
|
(mkIf cfg.extensions.render-markdown-nvim.enable {
|
||||||
|
vim.startPlugins = ["render-markdown-nvim"];
|
||||||
|
vim.pluginRC.render-markdown-nvim = entryAnywhere ''
|
||||||
|
require("render-markdown").setup(${toLuaObject cfg.extensions.render-markdown-nvim.setupOpts})
|
||||||
|
'';
|
||||||
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.types) enum either listOf package str;
|
inherit (lib.types) anything attrsOf enum either listOf nullOr package str;
|
||||||
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua toLuaObject;
|
||||||
inherit (lib.nvim.languages) diagnosticsToLua;
|
inherit (lib.nvim.languages) diagnosticsToLua;
|
||||||
|
|
||||||
cfg = config.vim.languages.nix;
|
cfg = config.vim.languages.nix;
|
||||||
|
|
@ -26,22 +26,6 @@
|
||||||
then expToLua package
|
then expToLua package
|
||||||
else ''{"${package}/bin/${defaultCmd}"}'';
|
else ''{"${package}/bin/${defaultCmd}"}'';
|
||||||
servers = {
|
servers = {
|
||||||
rnix = {
|
|
||||||
package = pkgs.rnix-lsp;
|
|
||||||
internalFormatter = cfg.format.type == "nixpkgs-fmt";
|
|
||||||
lspConfig = ''
|
|
||||||
lspconfig.rnix.setup{
|
|
||||||
capabilities = capabilities,
|
|
||||||
${
|
|
||||||
if (cfg.format.enable && cfg.format.type == "nixpkgs-fmt")
|
|
||||||
then useFormat
|
|
||||||
else noFormat
|
|
||||||
},
|
|
||||||
cmd = ${packageToCmd cfg.lsp.package "rnix-lsp"},
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
nil = {
|
nil = {
|
||||||
package = pkgs.nil;
|
package = pkgs.nil;
|
||||||
internalFormatter = true;
|
internalFormatter = true;
|
||||||
|
|
@ -75,6 +59,41 @@
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nixd = {
|
||||||
|
package = pkgs.nixd;
|
||||||
|
internalFormatter = true;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.nixd.setup{
|
||||||
|
capabilities = capabilities,
|
||||||
|
${
|
||||||
|
if cfg.format.enable
|
||||||
|
then useFormat
|
||||||
|
else noFormat
|
||||||
|
},
|
||||||
|
cmd = ${packageToCmd cfg.lsp.package "nixd"},
|
||||||
|
${optionalString cfg.format.enable ''
|
||||||
|
settings = {
|
||||||
|
nixd = {
|
||||||
|
${optionalString (cfg.format.type == "alejandra")
|
||||||
|
''
|
||||||
|
formatting = {
|
||||||
|
command = {"${cfg.format.package}/bin/alejandra", "--quiet"},
|
||||||
|
},
|
||||||
|
''}
|
||||||
|
${optionalString (cfg.format.type == "nixfmt")
|
||||||
|
''
|
||||||
|
formatting = {
|
||||||
|
command = {"${cfg.format.package}/bin/nixfmt"},
|
||||||
|
},
|
||||||
|
''}
|
||||||
|
options = ${toLuaObject cfg.lsp.options},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
''}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultFormat = "alejandra";
|
defaultFormat = "alejandra";
|
||||||
|
|
@ -155,6 +174,12 @@ in {
|
||||||
type = either package (listOf str);
|
type = either package (listOf str);
|
||||||
default = servers.${cfg.lsp.server}.package;
|
default = servers.${cfg.lsp.server}.package;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
options = mkOption {
|
||||||
|
type = nullOr (attrsOf anything);
|
||||||
|
default = null;
|
||||||
|
description = "Options to pass to nixd LSP server";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
format = {
|
format = {
|
||||||
|
|
@ -165,6 +190,7 @@ in {
|
||||||
type = enum (attrNames formats);
|
type = enum (attrNames formats);
|
||||||
default = defaultFormat;
|
default = defaultFormat;
|
||||||
};
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "Nix formatter package";
|
description = "Nix formatter package";
|
||||||
type = package;
|
type = package;
|
||||||
|
|
@ -188,20 +214,20 @@ in {
|
||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
assertion = cfg.format.type != "nixpkgs-fmt";
|
assertion = cfg.format.type != "nixpkgs-fmt";
|
||||||
message = "nixpkgs-fmt has been archived upstream. Please use one of the following instead: ${concatStringsSep ", " (attrNames formats)}";
|
message = ''
|
||||||
|
nixpkgs-fmt has been archived upstream. Please use one of the following available formatters:
|
||||||
|
${concatStringsSep ", " (attrNames formats)}
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
assertion = cfg.lsp.server != "rnix";
|
||||||
|
message = ''
|
||||||
|
rnix-lsp has been archived upstream. Please use one of the following available language servers:
|
||||||
|
${concatStringsSep ", " (attrNames servers)}
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
vim.pluginRC.nix = ''
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
|
||||||
pattern = "nix",
|
|
||||||
callback = function(opts)
|
|
||||||
local bo = vim.bo[opts.buf]
|
|
||||||
bo.tabstop = 2
|
|
||||||
bo.shiftwidth = 2
|
|
||||||
bo.softtabstop = 2
|
|
||||||
end
|
|
||||||
})
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(mkIf cfg.treesitter.enable {
|
(mkIf cfg.treesitter.enable {
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,24 @@
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ruff = {
|
||||||
|
package = pkgs.writeShellApplication {
|
||||||
|
name = "ruff";
|
||||||
|
runtimeInputs = [pkgs.ruff];
|
||||||
|
text = ''
|
||||||
|
ruff format -
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.ruff.with({
|
||||||
|
command = "${cfg.format.package}/bin/ruff",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultDebugger = "debugpy";
|
defaultDebugger = "debugpy";
|
||||||
|
|
|
||||||
152
modules/plugins/languages/ruby.nix
Normal file
152
modules/plugins/languages/ruby.nix
Normal file
|
|
@ -0,0 +1,152 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (builtins) attrNames;
|
||||||
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
||||||
|
inherit (lib.types) either listOf package str enum;
|
||||||
|
inherit (lib.nvim.languages) diagnosticsToLua;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.ruby;
|
||||||
|
|
||||||
|
defaultServer = "rubyserver";
|
||||||
|
servers = {
|
||||||
|
rubyserver = {
|
||||||
|
package = pkgs.rubyPackages.solargraph;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.solargraph.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = attach_keymaps,
|
||||||
|
flags = {
|
||||||
|
debounce_text_changes = 150,
|
||||||
|
},
|
||||||
|
cmd = { "${pkgs.solargraph}/bin/solargraph", "stdio" }
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# testing
|
||||||
|
|
||||||
|
defaultFormat = "rubocop";
|
||||||
|
formats = {
|
||||||
|
rubocop = {
|
||||||
|
package = pkgs.rubyPackages.rubocop;
|
||||||
|
nullConfig = ''
|
||||||
|
local conditional = function(fn)
|
||||||
|
local utils = require("null-ls.utils").make_conditional_utils()
|
||||||
|
return fn(utils)
|
||||||
|
end
|
||||||
|
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.rubocop.with({
|
||||||
|
command="${pkgs.bundler}/bin/bundle",
|
||||||
|
args = vim.list_extend(
|
||||||
|
{"exec", "rubocop", "-a" },
|
||||||
|
null_ls.builtins.formatting.rubocop._opts.args
|
||||||
|
),
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultDiagnosticsProvider = ["rubocop"];
|
||||||
|
diagnosticsProviders = {
|
||||||
|
rubocop = {
|
||||||
|
package = pkgs.rubyPackages.rubocop;
|
||||||
|
nullConfig = pkg: ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.diagnostics.rubocop.with({
|
||||||
|
command = "${lib.getExe pkg}",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
options.vim.languages.ruby = {
|
||||||
|
enable = mkEnableOption "Ruby language support";
|
||||||
|
|
||||||
|
treesitter = {
|
||||||
|
enable = mkEnableOption "Ruby treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||||
|
package = mkGrammarOption pkgs "ruby";
|
||||||
|
};
|
||||||
|
|
||||||
|
lsp = {
|
||||||
|
enable = mkEnableOption "Ruby LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
|
server = mkOption {
|
||||||
|
type = enum (attrNames servers);
|
||||||
|
default = defaultServer;
|
||||||
|
description = "Ruby LSP server to use";
|
||||||
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = either package (listOf str);
|
||||||
|
default = servers.${cfg.lsp.server}.package;
|
||||||
|
description = "Ruby LSP server package, or the command to run as a list of strings";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
format = {
|
||||||
|
enable = mkEnableOption "Ruby formatter support" // {default = config.vim.languages.enableFormat;};
|
||||||
|
|
||||||
|
type = mkOption {
|
||||||
|
type = enum (attrNames formats);
|
||||||
|
default = defaultFormat;
|
||||||
|
description = "Ruby formatter to use";
|
||||||
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = package;
|
||||||
|
default = formats.${cfg.format.type}.package;
|
||||||
|
description = "Ruby formatter package";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
extraDiagnostics = {
|
||||||
|
enable =
|
||||||
|
mkEnableOption "Ruby extra diagnostics support"
|
||||||
|
// {default = config.vim.languages.enableExtraDiagnostics;};
|
||||||
|
|
||||||
|
types = diagnostics {
|
||||||
|
langDesc = "Ruby";
|
||||||
|
inherit diagnosticsProviders;
|
||||||
|
inherit defaultDiagnosticsProvider;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.treesitter.enable {
|
||||||
|
vim.treesitter.enable = true;
|
||||||
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.lsp.enable {
|
||||||
|
vim.lsp.lspconfig.enable = true;
|
||||||
|
vim.lsp.lspconfig.sources.ruby-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.format.enable {
|
||||||
|
vim.lsp.null-ls.enable = true;
|
||||||
|
vim.lsp.null-ls.sources.ruby-format = formats.${cfg.format.type}.nullConfig;
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.extraDiagnostics.enable {
|
||||||
|
vim.lsp.null-ls.enable = true;
|
||||||
|
vim.lsp.null-ls.sources = diagnosticsToLua {
|
||||||
|
lang = "ruby";
|
||||||
|
config = cfg.extraDiagnostics.types;
|
||||||
|
inherit diagnosticsProviders;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
@ -82,7 +82,7 @@
|
||||||
ls_sources,
|
ls_sources,
|
||||||
null_ls.builtins.formatting.prettier.with({
|
null_ls.builtins.formatting.prettier.with({
|
||||||
command = "${cfg.format.package}/bin/prettier",
|
command = "${cfg.format.package}/bin/prettier",
|
||||||
filetypes = { "typescript" },
|
filetypes = { "typescript", "javascript" },
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
|
|
@ -230,7 +230,7 @@ in {
|
||||||
|
|
||||||
# Extensions
|
# Extensions
|
||||||
(mkIf cfg.extensions."ts-error-translator".enable {
|
(mkIf cfg.extensions."ts-error-translator".enable {
|
||||||
vim.startPlugins = ["ts-error-translator"];
|
vim.startPlugins = ["ts-error-translator-nvim"];
|
||||||
vim.pluginRC.ts-error-translator = entryAnywhere ''
|
vim.pluginRC.ts-error-translator = entryAnywhere ''
|
||||||
require("ts-error-translator").setup(${toLuaObject cfg.extensions.ts-error-translator.setupOpts})
|
require("ts-error-translator").setup(${toLuaObject cfg.extensions.ts-error-translator.setupOpts})
|
||||||
'';
|
'';
|
||||||
|
|
|
||||||
79
modules/plugins/languages/wgsl.nix
Normal file
79
modules/plugins/languages/wgsl.nix
Normal file
|
|
@ -0,0 +1,79 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (builtins) attrNames;
|
||||||
|
inherit (lib.lists) isList;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.nvim.lua) expToLua;
|
||||||
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
|
inherit (lib.options) literalExpression mkEnableOption mkOption;
|
||||||
|
inherit (lib.types) either enum listOf package str;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.wgsl;
|
||||||
|
|
||||||
|
defaultServer = "wgsl-analyzer";
|
||||||
|
servers = {
|
||||||
|
wgsl-analyzer = {
|
||||||
|
package = pkgs.wgsl-analyzer;
|
||||||
|
internalFormatter = true;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.wgsl_analyzer.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = default_on_attach,
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else "{'${cfg.lsp.package}/bin/wgsl_analyzer'}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
options.vim.languages.wgsl = {
|
||||||
|
enable = mkEnableOption "WGSL language support";
|
||||||
|
|
||||||
|
treesitter = {
|
||||||
|
enable = mkEnableOption "WGSL treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||||
|
package = mkGrammarOption pkgs "wgsl";
|
||||||
|
};
|
||||||
|
|
||||||
|
lsp = {
|
||||||
|
enable = mkEnableOption "WGSL LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
|
server = mkOption {
|
||||||
|
type = enum (attrNames servers);
|
||||||
|
default = defaultServer;
|
||||||
|
description = "WGSL LSP server to use";
|
||||||
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
description = "wgsl-analyzer package, or the command to run as a list of strings";
|
||||||
|
example = literalExpression "[(lib.getExe pkgs.wgsl-analyzer)]";
|
||||||
|
type = either package (listOf str);
|
||||||
|
default = pkgs.wgsl-analyzer;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.treesitter.enable {
|
||||||
|
vim.treesitter = {
|
||||||
|
enable = true;
|
||||||
|
grammars = [cfg.treesitter.package];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.lsp.enable {
|
||||||
|
vim = {
|
||||||
|
lsp.lspconfig = {
|
||||||
|
enable = true;
|
||||||
|
sources.wgsl_analyzer = servers.${cfg.lsp.server}.lspConfig;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
@ -8,10 +8,12 @@
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.modules) mkIf mkMerge mkDefault;
|
inherit (lib.modules) mkIf mkMerge mkDefault;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.types) either listOf package str enum;
|
inherit (lib.types) bool either listOf package str enum;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.zig;
|
||||||
|
|
||||||
defaultServer = "zls";
|
defaultServer = "zls";
|
||||||
servers = {
|
servers = {
|
||||||
zls = {
|
zls = {
|
||||||
|
|
@ -31,7 +33,35 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
cfg = config.vim.languages.zig;
|
# TODO: dap.adapter.lldb is duplicated when enabling the
|
||||||
|
# vim.languages.clang.dap module. This does not cause
|
||||||
|
# breakage... but could be cleaner.
|
||||||
|
defaultDebugger = "lldb-vscode";
|
||||||
|
debuggers = {
|
||||||
|
lldb-vscode = {
|
||||||
|
package = pkgs.lldb;
|
||||||
|
dapConfig = ''
|
||||||
|
dap.adapters.lldb = {
|
||||||
|
type = 'executable',
|
||||||
|
command = '${cfg.dap.package}/bin/lldb-dap',
|
||||||
|
name = 'lldb'
|
||||||
|
}
|
||||||
|
dap.configurations.zig = {
|
||||||
|
{
|
||||||
|
name = 'Launch',
|
||||||
|
type = 'lldb',
|
||||||
|
request = 'launch',
|
||||||
|
program = function()
|
||||||
|
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||||
|
end,
|
||||||
|
cwd = "''${workspaceFolder}",
|
||||||
|
stopOnEntry = false,
|
||||||
|
args = {},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
options.vim.languages.zig = {
|
options.vim.languages.zig = {
|
||||||
enable = mkEnableOption "Zig language support";
|
enable = mkEnableOption "Zig language support";
|
||||||
|
|
@ -56,6 +86,26 @@ in {
|
||||||
default = pkgs.zls;
|
default = pkgs.zls;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dap = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = config.vim.languages.enableDAP;
|
||||||
|
description = "Enable Zig Debug Adapter";
|
||||||
|
};
|
||||||
|
|
||||||
|
debugger = mkOption {
|
||||||
|
type = enum (attrNames debuggers);
|
||||||
|
default = defaultDebugger;
|
||||||
|
description = "Zig debugger to use";
|
||||||
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = package;
|
||||||
|
default = debuggers.${cfg.dap.debugger}.package;
|
||||||
|
description = "Zig debugger package.";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
|
@ -77,5 +127,12 @@ in {
|
||||||
globals.zig_fmt_autosave = mkDefault 0;
|
globals.zig_fmt_autosave = mkDefault 0;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.dap.enable {
|
||||||
|
vim = {
|
||||||
|
debugger.nvim-dap.enable = true;
|
||||||
|
debugger.nvim-dap.sources.zig-debugger = debuggers.${cfg.dap.debugger}.dapConfig;
|
||||||
|
};
|
||||||
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
cfg = config.vim.lsp;
|
cfg = config.vim.lsp;
|
||||||
usingNvimCmp = config.vim.autocomplete.nvim-cmp.enable;
|
usingNvimCmp = config.vim.autocomplete.nvim-cmp.enable;
|
||||||
|
usingBlinkCmp = config.vim.autocomplete.blink-cmp.enable;
|
||||||
self = import ./module.nix {inherit config lib pkgs;};
|
self = import ./module.nix {inherit config lib pkgs;};
|
||||||
|
|
||||||
mappingDefinitions = self.options.vim.lsp.mappings;
|
mappingDefinitions = self.options.vim.lsp.mappings;
|
||||||
|
|
@ -22,7 +23,7 @@
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
autocomplete.nvim-cmp = {
|
autocomplete.nvim-cmp = mkIf usingNvimCmp {
|
||||||
sources = {nvim_lsp = "[LSP]";};
|
sources = {nvim_lsp = "[LSP]";};
|
||||||
sourcePlugins = ["cmp-nvim-lsp"];
|
sourcePlugins = ["cmp-nvim-lsp"];
|
||||||
};
|
};
|
||||||
|
|
@ -170,6 +171,10 @@ in {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
''}
|
''}
|
||||||
|
|
||||||
|
${optionalString usingBlinkCmp ''
|
||||||
|
capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||||
|
''}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
|
|
@ -12,13 +13,29 @@ in {
|
||||||
config = mkIf (cfg.enable && cfg.lightbulb.enable) {
|
config = mkIf (cfg.enable && cfg.lightbulb.enable) {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = ["nvim-lightbulb"];
|
startPlugins = ["nvim-lightbulb"];
|
||||||
|
|
||||||
pluginRC.lightbulb = entryAnywhere ''
|
pluginRC.lightbulb = entryAnywhere ''
|
||||||
vim.api.nvim_command('autocmd CursorHold,CursorHoldI * lua require\'nvim-lightbulb\'.update_lightbulb()')
|
local nvim_lightbulb = require("nvim-lightbulb")
|
||||||
|
nvim_lightbulb.setup(${toLuaObject cfg.lightbulb.setupOpts})
|
||||||
-- Enable trouble diagnostics viewer
|
${optionalString cfg.lightbulb.autocmd.enable ''
|
||||||
require'nvim-lightbulb'.setup(${toLuaObject cfg.lightbulb.setupOpts})
|
vim.api.nvim_create_autocmd(${toLuaObject cfg.lightbulb.autocmd.events}, {
|
||||||
|
pattern = ${toLuaObject cfg.lightbulb.autocmd.pattern},
|
||||||
|
callback = function()
|
||||||
|
nvim_lightbulb.update_lightbulb()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
''}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
warnings = [
|
||||||
|
# This could have been an assertion, but the chances of collision is very low and asserting here
|
||||||
|
# might be too dramatic. Let's only warn the user, *in case* this occurs and is not intended. No
|
||||||
|
# error will be thrown if 'lightbulb.setupOpts.autocmd.enable' has not been set by the user.
|
||||||
|
(mkIf (cfg.lightbulb.autocmd.enable -> (cfg.lightbulb.setupOpts.autocmd.enabled or false)) ''
|
||||||
|
Both 'vim.lsp.lightbulb.autocmd.enable' and 'vim.lsp.lightbulb.setupOpts.autocmd.enable' are set
|
||||||
|
simultaneously. This might have performance implications due to frequent updates. Please set only
|
||||||
|
one option to handle nvim-lightbulb autocmd.
|
||||||
|
'')
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue