Compare commits

...

35 commits

Author SHA1 Message Date
Frothy
64e79a9f4c
lib: avoid filtering null values to be used as nil 2024-04-28 21:09:07 +03:00
fe9bcf224b
tabline/bufferline: convert to setupOpts
this is pretty much WIP and contains a bunch of bugs that I haven't tackled yet.
2024-04-28 21:09:06 +03:00
6e8bb14567
docs: fix alignment issues in README 2024-04-28 21:00:57 +03:00
2a37873f8a
docs: move maintenance notice to FAQ 2024-04-28 20:41:54 +03:00
a12a26e405
CI: use the correct path in pages 2024-04-28 20:35:31 +03:00
d2d2c2a227
CI: remove docker builds 2024-04-28 20:35:15 +03:00
fde298805c
Merge pull request #231 from NotAShelf/v0.6
v0.6
2024-04-28 17:29:40 +00:00
56a8476bc1
Merge pull request #269 from horriblename/fix-weird-luainline
fix treesitter.highlight.disable example
2024-04-28 12:56:18 +00:00
Ching Pei Yang
8c5a63e72c treesitter: cleanup unused 2024-04-28 12:23:59 +02:00
Ching Pei Yang
636eba77d7 treesitter: fix example 2024-04-28 12:23:41 +02:00
57b5585372
Merge pull request #268 from jacekpoz/v0.6
fix: repair logo path in README
2024-04-27 17:53:24 +00:00
jacekpoz
293b290f2c
fix: repair logo path in README 2024-04-27 19:39:28 +02:00
8ad6233c41
Merge pull request #266 from horriblename/no-apply-lua-inline
Do not auto apply mkLuaInline
2024-04-27 15:48:24 +00:00
cc0617b4d6
Merge pull request #267 from horriblename/disable-neocord
Disable neocord by default
2024-04-27 15:47:27 +00:00
Ching Pei Yang
053ca39e10
docs: fix typo 2024-04-27 17:09:18 +02:00
Ching Pei Yang
a5594fd7a2 config: disable neocord 2024-04-27 17:00:30 +02:00
Ching Pei Yang
f0631c2d26 fidget: do not apply mkLuaInline to str opts 2024-04-27 16:09:27 +02:00
Ching Pei Yang
0c4f7a544d lib: fix crash on non-attrset arg 2024-04-27 16:09:27 +02:00
Ching Pei Yang
c220da2af9 fidget: remove ineffectful option
whether you set clear_on_detach to true or false you still get the
default behaviour
2024-04-27 16:09:27 +02:00
89bdd80e20
meta: mark as release 2024-04-27 16:38:44 +03:00
1740b437c0
neovim/spellcheck: disable programming wordlist
errors as it cannot download its spellfile. needs to be fixed
2024-04-27 16:22:42 +03:00
aaf286dce4
modules: fix merge conflicts 2024-04-27 16:13:19 +03:00
b397dcb430
Merge branch 'main' into v0.6 2024-04-27 16:09:37 +03:00
5fa1ee5c2f
Merge pull request #265 from NotAShelf/rename
treewide: rename **neovim-flake** to **nvf**
2024-04-27 13:04:59 +00:00
40979a6d6a
docs: clean up remaining mentions of neovim-flake 2024-04-27 16:04:09 +03:00
97a64abeff
treewide: clean up references to neovim-flake 2024-04-27 15:51:22 +03:00
227f80ac9d
docs: rename all instances of neovim-flake to nvf 2024-04-27 15:44:37 +03:00
79f0d87ad2
Merge pull request #264 from horriblename/no-str-to-luainline
Remove str to luaInline coercion
2024-04-27 11:32:46 +00:00
Ching Pei Yang
500652d75e types/luaInline: do not coerce strings into luaInline 2024-04-27 02:12:35 +02:00
eb76f5fbd5
Merge pull request #247 from NotAShelf/dependabot/github_actions/peaceiris/actions-gh-pages-4
chore(deps): bump peaceiris/actions-gh-pages from 3 to 4
2024-04-09 04:45:12 +00:00
dependabot[bot]
7af67637c5
chore(deps): bump peaceiris/actions-gh-pages from 3 to 4
Bumps [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages) from 3 to 4.
- [Release notes](https://github.com/peaceiris/actions-gh-pages/releases)
- [Changelog](https://github.com/peaceiris/actions-gh-pages/blob/main/CHANGELOG.md)
- [Commits](https://github.com/peaceiris/actions-gh-pages/compare/v3...v4)

---
updated-dependencies:
- dependency-name: peaceiris/actions-gh-pages
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-08 19:45:46 +00:00
0ce5437c8f
docs: add notice of maintenance
we're still developing neovim-flake :)
2024-04-08 04:50:56 +03:00
9cb7239085
languages/css: add formatter support via prettier/prettierd 2024-02-28 00:35:29 +03:00
57446f7afb
Merge pull request #232 from FrothyMarrow/telescope-grep-opts
utility/telescope: provide configurable vimgrep options
2024-02-19 23:15:28 +00:00
Frothy
4e8ec4cd5b utility/telescope: provide configurable vimgrep options 2024-02-19 17:39:43 -05:00
63 changed files with 1404 additions and 607 deletions

170
.github/README.md vendored
View file

@ -1,48 +1,55 @@
<div align="center">
<img src=".github/assets/neovim-flake-logo-work.svg" alt="neovim-flake Logo" width="200">
<img src="assets/nvf-logo-work.svg" alt="nvf Logo" width="200">
<h1 nvf</h1>
</div>
<h1 align="center">❄️ neovim-flake</h1>
<div align="center">
<p>
<a href="https://github.com/NotAShelf/neovim-flake/releases/latest">
<img alt="Latest release" src="https://img.shields.io/github/v/release/NotAShelf/neovim-flake?style=for-the-badge&logo=nixos&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41" />
<p>
<a href="https://github.com/NotAShelf/nvf/releases/latest">
<img alt="Latest release" src="https://img.shields.io/github/v/release/NotAShelf/nvf?style=for-the-badge&logo=nixos&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41" />
</a>
<a href="https://github.com/NotAShelf/neovim-flake/pulse">
<img alt="Last commit" src="https://img.shields.io/github/last-commit/NotAShelf/neovim-flake?style=for-the-badge&logo=starship&color=8bd5ca&logoColor=D9E0EE&labelColor=302D41"/>
<a href="https://github.com/NotAShelf/nvf/pulse">
<img alt="Last commit" src="https://img.shields.io/github/last-commit/NotAShelf/nvf?style=for-the-badge&logo=starship&color=8bd5ca&logoColor=D9E0EE&labelColor=302D41"/>
</a>
<a href="https://github.com/NotAShelf/neovim-flake/blob/main/LICENSE">
<img alt="License" src="https://img.shields.io/github/license/NotAShelf/neovim-flake?style=for-the-badge&logo=nixos&color=ee999f&logoColor=D9E0EE&labelColor=302D41" />
<a href="https://github.com/NotAShelf/nvf/blob/main/LICENSE">
<img alt="License" src="https://img.shields.io/github/license/NotAShelf/nvf?style=for-the-badge&logo=nixos&color=ee999f&logoColor=D9E0EE&labelColor=302D41" />
</a>
<a href="https://github.com/NotAShelf/neovim-flake/stargazers">
<img alt="Stars" src="https://img.shields.io/github/stars/NotAShelf/neovim-flake?style=for-the-badge&logo=nixos&color=c69ff5&logoColor=D9E0EE&labelColor=302D41" />
<a href="https://github.com/NotAShelf/nvf/stargazers">
<img alt="Stars" src="https://img.shields.io/github/stars/NotAShelf/nvf?style=for-the-badge&logo=nixos&color=c69ff5&logoColor=D9E0EE&labelColor=302D41" />
</a>
<a href="https://github.com/NotAShelf/neovim-flake/issues">
<img alt="Issues" src="https://img.shields.io/github/issues/NotAShelf/neovim-flake?style=for-the-badge&logo=bilibili&color=F5E0DC&logoColor=D9E0EE&labelColor=302D41" />
<a href="https://github.com/NotAShelf/nvf/issues">
<img alt="Issues" src="https://img.shields.io/github/issues/NotAShelf/nvf?style=for-the-badge&logo=bilibili&color=F5E0DC&logoColor=D9E0EE&labelColor=302D41" />
</a>
<a href="https://github.com/NotAShelf/neovim-flake">
<img alt="Repo Size" src="https://img.shields.io/github/repo-size/NotAShelf/neovim-flake?color=%23DDB6F2&label=SIZE&logo=codesandbox&style=for-the-badge&logoColor=D9E0EE&labelColor=302D41" />
<a href="https://github.com/NotAShelf/nvf">
<img alt="Repo Size" src="https://img.shields.io/github/repo-size/NotAShelf/nvf?color=%23DDB6F2&label=SIZE&logo=codesandbox&style=for-the-badge&logoColor=D9E0EE&labelColor=302D41" />
</a>
</p>
</p>
</div>
<p align="center">
<img src="https://stars.medv.io/NotAShelf/neovim-flake.svg", title="stars"/>
<img src="https://stars.medv.io/NotAShelf/nvf.svg", title="stars"/>
</p>
<div align="center">
<a>
A highly modular, configurable, extensible and easy to use Neovim configuration
wrapper written in Nix. Designed for flexibility and ease of use, this flake
framework in Nix. Designed for flexibility and ease of use, this flake
allows you to easily configure your Neovim instance with a few lines of
Nix code.
</a>
</div>
</div>
---
<div align="center"><p>
[Get Started]: #get-started
[Documentation]: #documentation
[Help]: #help
[Contribute]: #contributing
[FAQ]: #faq
[Credits]: #credits
**[<kbd><br>Get Started<br></kbd>][Get Started]**
**[<kbd><br>Documentation<br></kbd>][Documentation]**
**[<kbd><br>Help<br></kbd>][Help]**
@ -52,13 +59,6 @@
</p></div>
[Get Started]: #get-started
[Documentation]: #documentation
[Help]: #help
[Contribute]: #contributing
[FAQ]: #faq
[Credits]: #credits
---
## Get Started
@ -69,7 +69,7 @@ If you would like to try out the configuration before even thinking about
installing it, you can run the following command
```console
nix run github:notashelf/neovim-flake
nix run github:notashelf/nvf
```
This will get you a feel for the base configuration and UI design.
@ -81,7 +81,7 @@ It is as simple as changing the target output to get a different
configuration. For example, to get a configuration with `tidal` support, run:
```console
nix run github:notashelf/neovim-flake#tidal
nix run github:notashelf/nvf#tidal
```
Similar instructions will apply for `nix profile install`. However, you are
@ -93,42 +93,29 @@ recommended to instead use the module system as described in the manual.
> configurations. Should you choose to try out the `maximal` configuration,
> using the binary cache as described in the manual is _strongly_ recommended.
### Docker
As of version 0.5, an image for the `nix` output is published to Dockerhub
and GitHub packages with each tagged release. If you do not have Nix installed
on your system, you may run neovim within a container using your favorite tool.
The following command will open the current directory in neovim with necessary
tools bootstrapped.
```console
docker run -v `pwd`:/home/neovim/demo --rm -it notashelf/neovim-flake:latest
```
The available registeres are `ghcr.io` and `dockerhub` for the time being.
Adjust to your liking.
## Documentation
See the [neovim-flake Manual](https://notashelf.github.io/neovim-flake/) for
See the [**nvf** Manual](https://notashelf.github.io/nvf/) for
detailed installation guides, configurations, available options, release notes
and more. Tips for installing userspace plugins is also contained in the
documentation.
If you want to dive right into trying **neovim-flake** you can get a fully
If you want to dive right into trying **nvf** you can get a fully
featured configuration with `nix` language support by running:
```console
nix run github:notashelf/neovim-flake
nix run github:notashelf/nvf#nix
```
Please create an issue on the [issue tracker](../../../issues) if you find
[Issues]: https://github.com/NotAShelf/nvf/issues
Please create an issue on the [issue tracker](issues) if you find
the documentation lacking or confusing. I also appreciate any contributions
to the documentation.
## Help
You can create an issue on the [issue tracker](../../../issues) to ask questions
You can create an issue on the [issue tracker](issues) to ask questions
or report bugs. I am not yet on spaces like matrix or IRC, so please use the issue
tracker for now.
@ -137,65 +124,32 @@ tracker for now.
I am always looking for new ways to help improve this flake. If you would like
to contribute, please read the [contributing guide](CONTRIBUTING.md) before
submitting a pull request. You can also create an issue on the
[issue tracker](../../../issues) before submitting a pull request if you would
[issue tracker](issues) before submitting a pull request if you would
like to discuss a feature or bug fix.
## Philosophy
The philosophy behind this flake configuration is to create an easily
configurable and reproducible Neovim environment. While it does sacrifice in
size (which I know some users will find _disagreeable_), it offers a lot of
flexibility and customizability in exchange for the large size of the flake
inputs. The "KISS" (Keep it simple, stupid) principle has mostly been abandoned
here, however, you _can_ ultimately leverage the flexibility of this flake to
declare a configuration that follows KISS principles, as it is very easy to
bring your own plugins and configurations from non-nix. What this flake is
meant to be does eventually fall into your hands. Whether you are a developer,
writer, or live coder, you can quickly craft a config that suits every project's
needs. Think of it like a distribution of Neovim that you have full control over.
A distribution that takes advantage of pinning vim plugins and third party
dependencies (such as tree-sitter grammars, language servers, and more).
One should never get a broken config when setting options. If setting multiple
options results in a broken Neovim, file an issue! Each plugin knows when another
plugin which allows for smart configuration of keybindings and automatic setup
of things like completion sources and languages.
## FAQ
**Q**: Why is this flake so big?
<br/>
**A**: I have sacrificed in size in order to provide a highly configurable and
reproducible Neovim environment. A binary cache is provided to eleminate the
need to build the flake from source, but it is still a large flake. If you do
not need all the features, you can use the default `nix` output instead of the
`maximal` output. This will reduce size by a lot, but you will lose some
language specific features.
<br/><br/>
**Q**: Will you try to make this flake smaller?
<br/>
**A**: Yes. As a matter of fact, I am actively working on making this flake
smaller. Unfortunately the process of providing everything possible by itself
makes the flake large. Best I can do is to optimize the flake as much as
possible by selecting plugins that are small and fast. And the binary cache, so
at least you don't have to build it from source.
<br/><br/>
**Q**: Will you use a plugin manager/language server installer?
<br/>
**A**: No. If you feel the need to ask that question, then you have missed the
whole point of using nix and ultimately this flake. The whole reason we use nix
is to be able to handle EVERYTHING declaratively, well including the LSP and
plugin installations.
<br/><br/>
**Q**: Can you add _X_?
<br/>
**A**: Maybe. Open an issue using the appropriate template and I will consider
it. I do not intend to add _every plugin that is in existence_, but I will
consider it, should it offer something useful to the flake.
**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 **nvf**. Use the [appropritate issue template](issues/new/choose) and I will
consider a module addition.
**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.
**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
implemented in the most comfortable way available to the end user. If you have
not noticed any activity on the main branch, consider taking a look at the [list
of branches](https://github.com/NotAShelf/nvf/branches=) or the [list of open
pull requests](https://github.com/NotAShelf/nvf)
## Credits
@ -207,7 +161,7 @@ Special thanks to
- [@FlafyDev](https://github.com/FlafyDev) - For getting the home-manager to work
- [@n3oney](https://github.com/n3oney) - For making custom keybinds finally possible
- [@horriblename](https://github.com/horriblename) - For actively implementing planned features and quality of life updates
- [@Yavko](https://github.com/Yavko) - For the amazing neovim-flake logo
- [@Yavko](https://github.com/Yavko) - For the amazing **nvf** logo
- [@FrothyMarrow](https://github.com/FrothyMarrow) - For seeing mistakes that I could not
and everyone who has submitted issues or pull requests!
@ -226,4 +180,14 @@ I am grateful for their previous work and inspiration, and I wholeheartedly
recommend checking their work out.
<br/>
## License
Following the [original neovim-flake](https://github.com/jordanisaacs/neovim-flake)
**nvf** has been made available under the **MIT License**. However, all assets
and documentation are published under the [CC BY License].
---
<div align="right">
<a href="#readme">Back to the Top</a>
</div>

395
.github/assets/LICENSE vendored Normal file
View file

@ -0,0 +1,395 @@
Attribution 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution 4.0 International Public License ("Public License"). To the
extent this Public License may be interpreted as a contract, You are
granted the Licensed Rights in consideration of Your acceptance of
these terms and conditions, and the Licensor grants You such rights in
consideration of benefits the Licensor receives from making the
Licensed Material available under these terms and conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
d. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
g. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
i. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's
License You apply must not prevent recipients of the Adapted
Material from complying with this Public License.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public licenses.
Notwithstanding, Creative Commons may elect to apply one of its public
licenses to material it publishes and in those instances will be
considered the “Licensor.” The text of the Creative Commons public
licenses is dedicated to the public domain under the CC0 Public Domain
Dedication. Except for the limited purpose of indicating that material
is shared under a Creative Commons public license or as otherwise
permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the public
licenses.
Creative Commons may be contacted at creativecommons.org.

View file

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View file

@ -48,4 +48,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: "${{ matrix.package }}"
path: result/share/doc/neovim-flake/
path: result/share/doc/nvf

View file

@ -1,50 +0,0 @@
name: "Publish Docker Image"
on:
workflow_dispatch:
push:
tags: ["v*"]
jobs:
build-docker-image:
name: "Build Docker Image"
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build Docker Image
run: nix build .#docker-nix --print-build-logs
- name: Load & Tag Built Docker Image
run: |
docker load -i result &&
docker tag neovim-flake:latest notashelf/neovim-flake:latest
- name: Log into DockerHub
uses: docker/login-action@master
with:
username: notashelf
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Push to DockerHub
run: docker push notashelf/neovim-flake:latest
- name: Log into ghcr
uses: docker/login-action@master
with:
registry: "ghcr.io"
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- name: Publish Docker Image (Github Packages)
run: docker push notashelf/neovim-flake:latest

View file

@ -33,10 +33,10 @@ jobs:
- name: Build
run: |
nix build '.#docs'
cp -r result/share/doc/neovim-flake public
cp -r result/share/doc/nvf public
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public

View file

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2023 NotAShelf
Copyright (c) 2023-2024 NotAShelf
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -31,7 +31,6 @@ inputs: let
spellcheck = {
enable = isMaximal;
programmingWordlist.enable = isMaximal;
};
lsp = {
@ -247,7 +246,7 @@ inputs: let
};
presence = {
neocord.enable = true;
neocord.enable = false;
};
};
};

View file

@ -86,12 +86,12 @@
transformOptions = opt:
recursiveUpdate opt {
# Clean up declaration sites to not refer to the neovim-flakee
# Clean up declaration sites to not refer to the nvf
# source tree.
declarations = map (decl:
if hasPrefix nvimPath (toString decl)
then
githubDeclaration "notashelf" "neovim-flake"
githubDeclaration "notashelf" "nvf"
(removePrefix "/" (removePrefix nvimPath (toString decl)))
else if decl == "lib/modules.nix"
then
@ -105,7 +105,7 @@
// builtins.removeAttrs args ["modules" "includeModuleSystemOptions"]);
nvimModuleDocs = buildOptionsDocs {
variablelistId = "neovim-flake-options";
variablelistId = "nvf-options";
modules =
import ../modules/modules.nix {
@ -117,7 +117,7 @@
# Generate the `man home-configuration.nix` package
nvf-configuration-manual =
pkgs.runCommand "neovim-flake-reference-manpage" {
pkgs.runCommand "nvf-reference-manpage" {
nativeBuildInputs = [pkgs.buildPackages.installShellFiles pkgs.nixos-render-docs];
allowedReferences = ["out"];
} ''
@ -130,21 +130,21 @@
--header ${./man/header.5} \
--footer ${./man/footer.5} \
${nvimModuleDocs.optionsJSON}/share/doc/nixos/options.json \
$out/share/man/man5/neovim-flake.5
$out/share/man/man5/nvf.5
cp ${./man/neovim-flake.1} $out/share/man/man1/neovim-flake.1
cp ${./man/nvf.1} $out/share/man/man1/nvf.1
'';
# Generate the HTML manual pages
neovim-flake-manual = pkgs.callPackage ./manual.nix {
nvf-manual = pkgs.callPackage ./manual.nix {
inherit revision manpageUrls;
outputPath = "share/doc/neovim-flake";
outputPath = "share/doc/nvf";
options = {
neovim-flake = nvimModuleDocs.optionsJSON;
nvf = nvimModuleDocs.optionsJSON;
};
};
html = neovim-flake-manual;
html = nvf-manual;
htmlOpenTool = pkgs.callPackage ./html-open-tool.nix {} {inherit html;};
in {
inherit (inputs) nmd;
@ -154,16 +154,16 @@ in {
# `nixosOptionsDoc` is more customizable.
json =
pkgs.runCommand "options.json" {
meta.description = "List of neovim-flake options in JSON format";
meta.description = "List of nvf options in JSON format";
} ''
mkdir -p $out/{share/doc,nix-support}
cp -a ${nvimModuleDocs.optionsJSON}/share/doc/nixos $out/share/doc/neovim-flake
cp -a ${nvimModuleDocs.optionsJSON}/share/doc/nixos $out/share/doc/nvf
substitute \
${nvimModuleDocs.optionsJSON}/nix-support/hydra-build-products \
$out/nix-support/hydra-build-products \
--replace \
'${nvimModuleDocs.optionsJSON}/share/doc/nixos' \
"$out/share/doc/neovim-flake"
"$out/share/doc/nvf"
'';
};

View file

@ -4,7 +4,7 @@
symlinkJoin,
}: {
html,
pathName ? "neovim-flake",
pathName ? "nvf",
projectName ? pathName,
name ? "${pathName}-help",
}: let

View file

@ -1,3 +1,3 @@
.SH "AUTHORS"
.PP
neovim-flake contributors
nvf contributors

View file

@ -1,4 +1,4 @@
.TH "neovim-flake" "5" "01/01/1980" "neovim-flake"
.TH "nvf" "5" "01/01/1980" "nvf"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
@ -6,8 +6,8 @@
.\" enable line breaks after slashes
.cflags 4 /
.SH "NAME"
neovim-flake configuration specification
nvf configuration specification
.SH "OPTIONS"
.PP
You can use the following options to configure neovim-flake:
You can use the following options to configure nvf:
.PP

View file

@ -1,6 +1,6 @@
.Dd January 1, 1980
.Dt neovim-flake 1
.Os neovim-flake
.Dt nvf 1
.Os nvf
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
@ -8,8 +8,8 @@
.\" enable line breaks after slashes
.cflags 4 /
.Sh NAME
.Nm neovim-flake
.Nd A highly modular, extensible and distro-agnostic Neovim distribution for Nix/NixOS.
.Nm nvf
.Nd A highly modular, extensible and distro-agnostic Neovim configuration framework for Nix/NixOS.
.
.Sh BUGS
.Pp
@ -18,16 +18,16 @@ Please report any bugs that you might encounter on the
.Sh SEE ALSO
.Pp
\fBneovim-flake\fR(5)
\fBnvf\fR(5)
.Sh AUTHOR
.Pp
\fBneovim-flake contributors\fR
\fBnvf contributors\fR
.RS 4
Author.
.RE
.Sh COPYRIGHT
.br
Copyright \(co 2023\(en2024 neovim-flake contributors
Copyright \(co 2023\(en2024 nvf contributors
.br

View file

@ -8,13 +8,13 @@
manpageUrls,
revision,
options,
outputPath ? "share/doc/neovim-flake",
outputPath ? "share/doc/nvf",
}:
stdenvNoCC.mkDerivation {
name = "neovim-flake-manual";
name = "nvf-manual";
src = builtins.path {
path = lib.sourceFilesBySuffices ./manual [".md"];
name = "neovim-flake-manual";
name = "nvf-manual";
};
nativeBuildInputs = [nixos-render-docs];
@ -31,7 +31,7 @@ stdenvNoCC.mkDerivation {
substituteInPlace ./options.md \
--subst-var-by \
OPTIONS_JSON \
${options.neovim-flake}/share/doc/nixos/options.json
${options.nvf}/share/doc/nixos/options.json
substituteInPlace ./manual.md \
--subst-var-by \

View file

@ -1,4 +1,4 @@
# Configuring neovim-flake {#ch-configuring}
# Configuring nvf {#ch-configuring}
```{=include=} chapters
configuring/custom-package.md

View file

@ -1,6 +1,7 @@
# Custom Neovim Package {#ch-custom-package}
As of v0.5, you may now specify the neovim package that will be wrapped with your configuration. This is done with the `vim.package` option.
As of v0.5, you may now specify the Neovim package that will be wrapped with
your configuration. This is done with the `vim.package` option.
```nix
{inputs, pkgs, ...}: {
@ -9,8 +10,9 @@ As of v0.5, you may now specify the neovim package that will be wrapped with you
}
```
The neovim-nightly-overlay always exposes an unwrapped package. If using a different source, you are highly
recommended to get an "unwrapped" version of the neovim package, similar to `neovim-unwrapped` in nixpkgs.
The neovim-nightly-overlay always exposes an unwrapped package. If using a
different source, you are highly recommended to get an "unwrapped" version of
the neovim package, similar to `neovim-unwrapped` in nixpkgs.
```nix
{ pkgs, ...}: {

View file

@ -1,21 +1,21 @@
# Custom Plugins {#ch-custom-plugins}
Neovim-flake, by default, exposes a wide variety of plugins as module options
for your convience and bundles necessary dependencies into neovim-flake's
runtime. In case a plugin is not available in neovim-flake, you may consider
making a pull request to neovim-flake to include it as a module or you may add
it to your configuration locally.
**nvf**, by default, exposes a wide variety of plugins as module options
for your convience and bundles necessary dependencies into **nvf**'s runtime.
In case a plugin is not available in **nvf**, you may consider making a pull
request to **nvf** to include it as a module or you may add it to your
configuration locally.
## Adding Plugins {#ch-adding-plugins}
There are multiple ways of adding custom plugins to your neovim-flake
configuration.
There are multiple ways of adding custom plugins to your **nvf** configuration.
You can use custom plugins, before they are implemented in the flake. To add a
plugin, you need to add it to your config's `vim.startPlugins` array.
plugin to the runtime, you need to add it to the `vim.startPlugins` list in
your configuration.
Adding a plugin to `startPlugins` will not allow you to configure the plugin
that you have addeed, but neovim-flake provides multiple way of configuring any
that you have adeed, but **nvf** provides multiple way of configuring any
custom plugins that you might have added to your configuration.
```{=include=} sections

View file

@ -1,8 +1,10 @@
# Configuring {#sec-configuring-plugins}
Just making the plugin to your neovim configuration available might not always be enough.
In that case, you can write custom vimscript or lua config, using `config.vim.configRC` or `config.vim.luaConfigRC`
respectively. These options are attribute sets, and you need to give the configuration you're adding some name, like this:
Just making the plugin to your Neovim configuration available might not always
be enough. In that case, you can write custom vimscript or lua config, using
either `config.vim.configRC` or `config.vim.luaConfigRC` respectively. Both of
these options are attribute sets, and you need to give the configuration you're
adding some name, like this:
```nix
{
@ -13,11 +15,12 @@ respectively. These options are attribute sets, and you need to give the configu
```
:::{.note}
If your configuration needs to be put in a specific place in the config, you can use functions from
`inputs.neovim-flake.lib.nvim.dag` to order it.
Refer to https://github.com/nix-community/home-manager/blob/master/modules/lib/dag.nix to find out more about
the DAG system.
If your configuration needs to be put in a specific place in the config, you
can use functions from `inputs.nvf.lib.nvim.dag` to order it. Refer to
https://github.com/nix-community/home-manager/blob/master/modules/lib/dag.nix
to find out more about the DAG system.
:::
Also, if you successfully made your plugin work, please make a PR to add it to the flake, or open an issue
with your findings so that we can make it available for everyone easily.
If you successfully made your plugin work, please feel free to create a PR to
add it to **nvf** or open an issue with your findings so that we can make it
available for everyone easily.

View file

@ -1,8 +1,8 @@
# New Method {#sec-new-method}
As of version **0.5**, we have a more extensive API for configuring plugins, under `vim.extraPlugins`.
Instead of using DAGs exposed by the library, you may use the extra plugin module as follows:
As of version **0.5**, we have a more extensive API for configuring plugins,
under `vim.extraPlugins`. Instead of using DAGs exposed by the library, you may
use the extra plugin module as follows:
```nix
{

View file

@ -1,12 +1,14 @@
# Old Method {#sec-old-method}
Prior to version 0.5, the method of adding new plugins was adding the plugin package to `vim.startPlugins` and add
its configuration as a DAG under `vim.configRC` or `vim.luaConfigRC`. Users who have not yet updated to 0.5, or prefer
a more hands-on approach may use the old method where the load order of the plugins is determined by DAGs.
Prior to version 0.5, the method of adding new plugins was adding the plugin
package to `vim.startPlugins` and add its configuration as a DAG under one of
`vim.configRC` or `vim.luaConfigRC`. Users who have not yet updated to 0.5, or
prefer a more hands-on approach may use the old method where the load order of
the plugins is determined by DAGs.
## Adding plugins {#sec-adding-plugins}
To add a plugin to neovim-flake's runtime, you may add it
To add a plugin to **nvf**'s runtime, you may add it
```nix
{pkgs, ...}: {
@ -16,13 +18,13 @@ To add a plugin to neovim-flake's runtime, you may add it
}
```
And to configure the added plugin, you can use the `luaConfigRC` option to provide configuration
as a DAG using the neovim-flake extended library.
And to configure the added plugin, you can use the `luaConfigRC` option to
provide configuration as a DAG using the **nvf** extended library.
```nix
{inputs, ...}: let
# assuming you have an input called neovim-flake pointing at the neovim-flake repo
inherit (inputs.neovim-flake.lib.nvim.dag) entryAnywhere;
# assuming you have an input called nvf pointing at the nvf repository
inherit (inputs.nvf.lib.nvim.dag) entryAnywhere;
in {
vim.luaConfigRC.aerial-nvim= entryAnywhere ''
require('aerial').setup {

View file

@ -1,13 +1,17 @@
# Using DAGs {#ch-using-dags}
We conform to the NixOS options types for the most part, however, a noteworthy addition
for certain options is the [**DAG (Directed acyclic graph)**](https://en.wikipedia.org/wiki/Directed_acyclic_graph)
type which is borrowed from home-manager's extended library. This type is most used for
topologically sorting strings. The DAG type allows the attribute set entries to express dependency
relations among themselves. This can, for example, be used to control the order of configuration
sections in your `configRC` or `luaConfigRC`.
We conform to the NixOS options types for the most part, however, a noteworthy
addition for certain options is the [**DAG
(Directed acyclic graph)**](https://en.wikipedia.org/wiki/Directed_acyclic_graph)
type which is borrowed from home-manager's extended library. This type is most
used for topologically sorting strings. The DAG type allows the attribute set
entries to express dependency relations among themselves. This can, for
example, be used to control the order of configuration sections in your
`configRC` or `luaConfigRC`.
The below section, mostly taken from the [home-manager manual](https://raw.githubusercontent.com/nix-community/home-manager/master/docs/manual/writing-modules/types.md) explains the overal usage logic of the DAG typee
The below section, mostly taken from the [home-manager
manual](https://raw.githubusercontent.com/nix-community/home-manager/master/docs/manual/writing-modules/types.md)
explains in more detail the overall usage logic of the DAG type.
## entryAnywhere {#sec-types-dag-entryAnywhere}

View file

@ -1,7 +1,9 @@
# Language Support {#ch-languages}
Language specific support means there is a combination of language specific plugins, `treesitter` support, `nvim-lspconfig` language servers, and `null-ls`
integration. This gets you capabilities ranging from autocompletion to formatting to diagnostics. The following languages have sections under the `vim.languages`
Language specific support means there is a combination of language specific
plugins, `treesitter` support, `nvim-lspconfig` language servers, and `null-ls`
integration. This gets you capabilities ranging from autocompletion to formatting
to diagnostics. The following languages have sections under the `vim.languages`
attribute.
- Rust: [vim.languages.rust.enable](#opt-vim.languages.rust.enable)

View file

@ -1,15 +1,17 @@
# LSP Custom Packages/Command {#sec-languages-custom-lsp-packages}
In any of the `opt.languages.<language>.lsp.package` options you can provide your own LSP package, or provide
the command to launch the language server, as a list of strings.
You can use this to skip automatic installation of a language server, and instead
use the one found in your `$PATH` during runtime, for example:
In any of the `opt.languages.<language>.lsp.package` options you can provide
your own LSP package, or provide the command to launch the language server, as
a list of strings. You can use this to skip automatic installation of a language
server, and instead use the one found in your `$PATH` during runtime, for
example:
```nix
vim.languages.java = {
lsp = {
enable = true;
# this expects jdt-language-server to be in your PATH
# or in `vim.extraPackages`
package = ["jdt-language-server" "-data" "~/.cache/jdtls/workspace"];
};
}

View file

@ -1,10 +1,9 @@
# Default Configs {#ch-default-configs}
While you can configure neovim-flake yourself using the builder, you can also use the pre-built configs that are available.
While you can configure **nvf** yourself using the builder, you can also use the pre-built configs that are available.
Here are a few default configurations you can use.
```{=include=} chapters
default-configs/maximal.md
default-configs/nix.md
default-configs/tidal.md
```

View file

@ -1,13 +1,13 @@
# Maximal {#sec-default-maximal}
```bash
$ nix shell github:notashelf/neovim-flake#maximal test.nix
$ nix shell github:notashelf/nvf#maximal test.nix
```
It is the same fully configured neovim as with the [Nix](#sec-default-nix) config, but with every supported language enabled.
:::{.note}
Running the maximal config will download _a lot_ of packages as it is downloading language servers, formatters, and more.
It is the same fully configured Neovim as with the [Nix](#sec-default-nix)
configuration, but with every supported language enabled.
::: {.note}
Running the maximal config will download _a lot_ of packages as it is
downloading language servers, formatters, and more.
:::

View file

@ -1,7 +1,9 @@
# Nix {#sec-default-nix}
```bash
$ nix run github:notashelf/neovim-flake#nix test.nix
$ nix run github:notashelf/nvf#nix test.nix
```
Enables all the of neovim plugins, with language support for specifically Nix. This lets you see what a fully configured neovim setup looks like without downloading a whole bunch of language servers and associated tools.
Enables all the of Neovim plugins, with language support for specifically Nix.
This lets you see what a fully configured neovim setup looks like without
downloading a whole bunch of language servers and associated tools.

View file

@ -1,12 +0,0 @@
# Tidal Cycles {#sec-default-tidal}
```bash
$ nix run github:notashelf/neovim-flake#tidal file.tidal
```
Utilizing [vim-tidal](https://github.com/tidalcycles/vim-tidal) and mitchmindtree's fantastic
[tidalcycles.nix](https://github.com/mitchmindtree/tidalcycles.nix) start playing with tidal cycles in a single command.
In your tidal file, type a cycle e.g. `d1 $ s "drum"` and then press _ctrl+enter_. Super collider with superdirt, and a
modified GHCI with tidal will start up and begin playing. Note, you need jack enabled on your system. If you are using
pipewire, its as easy as setting `services.pipewire.jack.enable = true` in your configuration.

View file

@ -1,14 +1,14 @@
# Hacking neovim-flake {#ch-hacking}
# Hacking nvf {#ch-hacking}
neovim-flake is designed for developers as much as it is for the end user. I would like any potential contributor
**nvf** is designed for developers as much as it is for the end user. I would like any potential contributor
to be able to propagate their desired changes into the repository without the extra effort. As such, below are guides
(and guidelines) to streamline the contribution process and ensure that your valuable input seamlessly integrates
into neovim-flake's development without leaving question marks in your head.
into **nvf**'s development without leaving question marks in your head.
This section is mainly directed towards those who wish to contribute code into neovim-flake. If you wish to instead
This section is mainly directed towards those who wish to contribute code into **nvf**. If you wish to instead
report a bug or discuss a potential feature implementation, first look among the
already [open issues](https://github.com/notashelf/neovim-flake/issues) and if no matching issue exists you may open
a [new issue](https://github.com/notashelf/neovim-flake/issues/new) and describe your problem/request. While creating an
already [open issues](https://github.com/notashelf/nvf/issues) and if no matching issue exists you may open
a [new issue](https://github.com/notashelf/nvf/issues/new) and describe your problem/request. While creating an
issue, please try to include as much information as you can, ideally also include relevant context in which an issue
occurs or a feature should be implemented.

View file

@ -1,6 +1,6 @@
# Adding Plugins {#sec-additional-plugins}
To add a new neovim plugin, first add the source url in the inputs section of `flake.nix`
To add a new Neovim plugin, first add the source url in the inputs section of `flake.nix`
with the prefix `plugin-`
```nix
@ -17,7 +17,7 @@ with the prefix `plugin-`
}
```
The addition of the `plugin-` prefix will allow neovim-flake to autodiscover the
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`

View file

@ -1,10 +1,16 @@
# Getting Started {#sec-contrib-getting-started}
You naturally would like to start by forking the repository. If you are new to git, have a look at GitHub's
[Fork a repo guide](https://help.github.com/articles/fork-a-repo/) for instructions on how you can do this. Once you have a fork of neovim-flake
you should create a branch starting at the most recent `main` branch.
Give your branch a reasonably descriptive name, suffixed by its type - i.e `feature/debugger` or `fix/pesky-bug`.
You, naturally, would like to start by forking the repository to get started. If
you are new to Git and GitHub, do have a look at GitHub's [Fork a repo guide](https://help.github.com/articles/fork-a-repo/)
for instructions on how you can do this. Once you have a fork of **nvf**, you
should create a separate branch based on the msot recent `main` branch. Give
your branch a reasonably descriptive name (e.g. `feature/debugger` or
`fix/pesky-bug`) and you are ready to work on your changes
Implement your changes and commit them to the newly created branch and when you are happy with the result and positive
that it fulfills [Guidelines](#sec-guidelines). Once you are confident everything is in order, push the branch to GitHub and
[create a pull request](https://help.github.com/articles/creating-a-pull-request), following the template that you will be prompted to fill.
Implement your changes and commit them to the newly created branch and when you
are happy with the result, and positive that it fullfills our [Contributing
Guidelines](#sec-guidelines), push the branch to GitHub and [create a pull
request](https://help.github.com/articles/creating-a-pull-request). The default
pull request template available on the **nvf** repository will guide you through
the rest of the process, and we'll gently nudge you in the correct direction if
there are any mistakes.

View file

@ -1,55 +1,65 @@
# Guidelines {#sec-guidelines}
If your contribution tightly follows the guidelines, then there is a good chance it will be merged without too much
trouble. Some of the guidelines will be strictly enforced, others will remain as gentle nudges towards the correct
direction. As we have no automated system enforcing those guidelines, please try to double check your changes before
making your pull request in order to avoid "faulty" code slipping by.
If your contribution tightly follows the guidelines, then there is a good chance
it will be merged without too much trouble. Some of the guidelines will be
strictly enforced, others will remain as gentle nudges towards the correct
direction. As we have no automated system enforcing those guidelines, please
try to double check your changes before making your pull request in order to
avoid "faulty" code slipping by.
If you are uncertain how these rules affect the change you would like to make then feel free to start a
discussion in the [discussions tab](https://github.com/NotAShelf/neovim-flake/discussions) ideally (but not necessarily)
before you start developing.
If you are uncertain how these rules affect the change you would like to make
then feel free to start a discussion in the [discussions tab](https://github.com/NotAShelf/nvf/discussions)
ideally (but not necessarily) before you start developing.
## Adding Documentation {#sec-guidelines-documentation}
Most, if not all, changes warrant changes to the documentation. Module options should be documented with
[Nixpkgs-flavoured Markdown](https://nixos.org/manual/nixpkgs/unstable/#sec-contributing-markup), albeit with exceptions.
:::{.note}
As of v0.5, neovim-flake is itself documented using full markdown in both module options and the manual. With
v0.6, this manual has also been converted to markdown in full.
Most, if not all, changes warrant changes to the documentation. Module options
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 both module
options and the manual. With **v0.6**, this manual has also been converted to
markdown in full.
:::
The HTML version of this manual containing both the module option descriptions and the documentation of neovim-flake
(such as this page) can be generated and opened by typing the following in a shell within a clone of the
neovim-flake Git repository:
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 by typing the following in a shell within a clone of the **nvf** Git
repository:
```console
$ nix build .#docs-html
$ xdg-open $PWD/result/share/doc/neovim-flake/index.html
$ xdg-open $PWD/result/share/doc/nvf/index.html
```
## Formatting Code {#sec-guidelines-formatting}
Make sure your code is formatted as described in [code-style section](#sec-guidelines-code-style). To maintain consistency throughout
the project you are encouraged to browse through existing code and adopt its style also in new code.
Make sure your code is formatted as described in [code-style
section](#sec-guidelines-code-style). To maintain consistency throughout the
project you are encouraged to browse through existing code and adopt its style
also in new code.
## Formatting Commits {#sec-guidelines-commit-message-style}
Similar to [code style guidelines](#sec-guidelines-code-style) we encourage a consistent commit message format as described
in [commit style guidelines](#sec-guidelines-commit-style).
Similar to [code style guidelines](#sec-guidelines-code-style) we encourage a
consistent commit message format as described in [commit style
guidelines](#sec-guidelines-commit-style).
## Commit Style {#sec-guidelines-commit-style}
The commits in your pull request should be reasonably self-contained. Which means each and every commit in
a pull request should make sense both on its own and in general context. That is, a second commit should not resolve
an issue that is introduced in an earlier commit. In particular, you will be asked to amend any commit that
introduces syntax errors or similar problems even if they are fixed in a later commit.
The commits in your pull request should be reasonably self-contained. Which
means each and every commit in a pull request should make sense both on its
own and in general context. That is, a second commit should not resolve an
issue that is introduced in an earlier commit. In particular, you will be
asked to amend any commit that introduces syntax errors or similar problems
even if they are fixed in a later commit.
The commit messages should follow the [seven rules](https://chris.beams.io/posts/git-commit/#seven-rule),
except for "Capitalize the subject line". We also ask you to include the affected code component or module in
the first line. A commit message ideally, but not necessarily, follow the given template from home-manager's own documentation
The commit messages should follow the [seven
rules](https://chris.beams.io/posts/git-commit/#seven-rule), except for
"Capitalize the subject line". We also ask you to include the affected code
component or module in the first line. A commit message ideally, but not
necessarily, follow the given template from home-manager's own documentation
```
{component}: {description}
@ -57,15 +67,18 @@ the first line. A commit message ideally, but not necessarily, follow the given
{long description}
```
where `{component}` refers to the code component (or module) your change affects, `{description}` is a very brief
description of your change, and `{long description}` is an optional clarifying description. As a rare exception, if
there is no clear component, or your change affects many components, then the `{component}` part is optional.
See [example commit message](#sec-guidelines-ex-commit-message) for a commit message that fulfills these requirements.
where `{component}` refers to the code component (or module) your change
affects, `{description}` is a very brief description of your change, and
`{long description}` is an optional clarifying description. As a rare
exception, if there is no clear component, or your change affects many
components, then the `{component}` part is optional. See [example commit
message](#sec-guidelines-ex-commit-message) for a commit message that
fulfills these requirements.
## Example Commit {#sec-guidelines-ex-commit-message}
The commit [69f8e47e9e74c8d3d060ca22e18246b7f7d988ef](https://github.com/nix-community/home-manager/commit/69f8e47e9e74c8d3d060ca22e18246b7f7d988ef)
in home-manager contains the commit message
in home-manager contains the following commit message.
```
starship: allow running in Emacs if vterm is used
@ -74,38 +87,43 @@ The vterm buffer is backed by libvterm and can handle Starship prompts
without issues.
```
Similarly, if you are contributing to neovim-flake, you would include the scope of the commit followed by
the description
Similarly, if you are contributing to **nvf**, you would include the scope of
the commit followed by the description:
```
languages/ruby: init module
Adds a language module for Ruby, and adds appropriate formatters and TS grammers
Adds a language module for Ruby, adds appropriate formatters and Treesitter grammers
```
Long description can be ommitted if the change is too simple to warrant it. A minor fix in spelling or a formatting
change does not warrant long description, however, a module addition or removal does as you would like to provide the
relevant context, e.g. the reasoning behind it, for your commit.
Long description can be ommitted if the change is too simple to warrant it. A
minor fix in spelling or a formatting change does not warrant long description,
however, a module addition or removal does as you would like to provide the
relevant context, i.e. the reasoning behind it, for your commit.
Finally, when adding a new module, say `modules/foo.nix`, we use the fixed commit format `foo: add module`.
You can, of course, still include a long description if you wish.
Finally, when adding a new module, say `modules/foo.nix`, we use the fixed
commit format `foo: add module`. You can, of course, still include a long
description if you wish.
In case of nested modules, i.e `modules/languages/java.nix` you are recommended to contain the parent as well - for
example `languages/java: some major change`.
In case of nested modules, i.e `modules/languages/java.nix` you are recommended
to contain the parent as well - for example `languages/java: some major change`.
## Code Style {#sec-guidelines-code-style}
**Treewide**
Keep lines at a reasonable width, ideally 80 characters or less. This also applies to string literals and module
descriptions and documentation.
### Treewide {#sec-code-style-treewide}
**Nix**
neovim-flake is formatted by the [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 the project repository before submitting your
pull request.
Keep lines at a reasonable width, ideally 80 characters or less. This also applies
to string literals and module descriptions and documentation.
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 was structured.
### Nix {#sec-code-style-nix}
**nvf** is formatted by the [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 the project repository before submitting your pull request.
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 was structured.
Please use one line code for attribute sets that contain only one subset.
For example:
@ -128,8 +146,8 @@ module = {
}
```
If you move a line down after the merge operator, Alejandra will automatically unfold the whole merged attrset
for you, which we **do not** want.
If you move a line down after the merge operator, Alejandra will automatically
unfold the whole merged attrset for you, which we **do not** want.
```nix
module = {
@ -139,13 +157,12 @@ module = {
}
```
For lists, it is mostly up to your own discretion how you want to format them, but please try to unfold lists if
they contain multiple items and especially if they are to include comments.
For lists, it is mostly up to your own discretion how you want to format them,
but please try to unfold lists if they contain multiple items and especially
if they are to include comments.
```nix
# this is ok
acceptableList = [
item1 # comment
item2
@ -157,10 +174,12 @@ acceptableList = [
listToBeAvoided = [item1 item2 /* comment */ item3 item4];
# this is ok
acceptableList = [item1];
acceptableList = [item1 item2];
# this is not ok
listToBeAvoided = [
# this is also ok if the list is expected to contain more elements
acceptableList= [
item1
item2
# more items if needed...
];
```

View file

@ -1,8 +1,9 @@
# Keybinds {#sec-keybinds}
As of 0.4, there exists an API for writing your own keybinds and a couple of useful utility functions are available in
the [extended standard library](https://github.com/NotAShelf/neovim-flake/tree/main/lib). The following section contains
a general overview to how you may utilize said functions.
As of 0.4, there exists an API for writing your own keybinds and a couple of
useful utility functions are available in the [extended standard
library](https://github.com/NotAShelf/nvf/tree/main/lib). The following
section contains a general overview to how you may utilize said functions.
## Custom Key Mappings Support for a Plugin {#sec-custom-key-mappings}
@ -36,44 +37,58 @@ An example, simple keybinding, can look like this:
```
There are many settings available in the options. Please refer to the
[documentation](https://notashelf.github.io/neovim-flake/options.html#opt-vim.maps.command._name_.action)
[documentation](https://notashelf.github.io/nvf/options.html#opt-vim.maps.command._name_.action)
to see a list of them.
`neovim-flake` provides a list of helper commands, so that you don't have to write the mapping attribute sets every
time:
**nvf** provides a list of helper commands, so that you don't have to write the
mapping attribute sets every time:
- `mkBinding = key: action: desc:` - makes a basic binding, with `silent` set to true.
- `mkExprBinding = key: action: desc:` - makes an expression binding, with `lua`, `silent`, and `expr` set to true.
- `mkLuaBinding = key: action: desc:` - makes an expression binding, with `lua`, and `silent` set to true.
- `mkBinding = key: action: desc:` - makes a basic binding, with `silent` set
to true.
- `mkExprBinding = key: action: desc:` - makes an expression binding, with
`lua`, `silent`, and `expr` set to true.
- `mkLuaBinding = key: action: desc:` - makes an expression binding, with
`lua`, and `silent` set to true.
Note that the Lua in these bindings is actual Lua, not pasted into a `:lua` command.
Therefore, you either pass in a function like `require('someplugin').some_function`, without actually calling it,
or you define your own function, like `function() require('someplugin').some_function() end`.
Do note that the Lua in these bindings is actual Lua, and not pasted into a
`:lua` command. Therefore, you should either pass in a function like
`require('someplugin').some_function`, without actually calling it, or you
should define your own functions, for example
Additionally, to not have to repeat the descriptions, there's another utility function with its own set of functions:
```lua
function()
require('someplugin').some_function()
end
```
Utility function that takes two attrsets:
Additionally, to not have to repeat the descriptions, there's another utility
function with its own set of functions: Utility function that takes two
attribute sets:
- `{ someKey = "some_value" }`
- `{ someKey = { description = "Some Description"; }; }`
and merges them into `{ someKey = { value = "some_value"; description = "Some Description"; }; }`
```
```nix
addDescriptionsToMappings = actualMappings: mappingDefinitions:
```
This function can be used in combination with the same `mkBinding` functions as above, except they only take two
arguments - `binding` and `action`, and have different names:
This function can be used in combination with the same `mkBinding` functions as
above, except they only take two arguments - `binding` and `action`, and have
different names:
- `mkSetBinding = binding: action:` - makes a basic binding, with `silent` set to true.
- `mkSetExprBinding = binding: action:` - makes an expression binding, with `lua`, `silent`, and `expr` set to true.
- `mkSetLuaBinding = binding: action:` - makes an expression binding, with `lua`, and `silent` set to true.
- `mkSetBinding = binding: action:` - makes a basic binding, with `silent`
set to true.
- `mkSetExprBinding = binding: action:` - makes an expression binding, with
`lua`, `silent`, and `expr` set to true.
- `mkSetLuaBinding = binding: action:` - makes an expression binding, with
`lua`, and `silent` set to true.
You can read the source code of some modules to see them in action, but their usage should look something like this:
You can read the source code of some modules to see them in action, but their
usage should look something like this:
```nix
# plugindefinition.nix
{lib, ...}: with lib; {
options.vim.plugin = {
@ -96,15 +111,13 @@ You can read the source code of some modules to see them in action, but their us
};
}
```
```nix
# config.nix
{
pkgs,
config,
pkgs,
lib,
...
}:
@ -158,9 +171,8 @@ in {
```
:::{.note}
If you have come across a plugin that has an API that doesn't seem to easily allow custom keybindings,
don't be scared to implement a draft PR. We'll help you get it done.
::: {.note}
If you have come across a plugin that has an API that doesn't seem to easily
allow custom keybindings, don't be scared to implement a draft PR. We'll help
you get it done.
:::

View file

@ -1,11 +1,15 @@
# Testing Changes {#sec-testing-changes}
Once you have made your changes, you will need to test them throughly. If it is a module, add your module option to
`configuration.nix` (located in the root of this project) inside `neovimConfiguration`. Enable it, and then run the
maximal configuration with `nix run .#maximal -Lv` to check for build errors. If neovim opens in the current directory
without any error messages (you can check the output of `:messages` inside neovim to see if there are any errors), then
your changes are good to go. Open your pull request, and it will be reviewed as soon as posssible.
Once you have made your changes, you will need to test them throughly. If it is
a module, add your module option to `configuration.nix` (located in the root of
this project) inside `neovimConfiguration`. Enable it, and then run the maximal
configuration with `nix run .#maximal -Lv` to check for build errors. If neovim
opens in the current directory without any error messages (you can check the
output of `:messages` inside neovim to see if there are any errors), then your
changes are good to go. Open your pull request, and it will be reviewed as soon
as posssible.
If it is not a new module, but a change to an existing one, then make sure the module you have changed is enabled in the
maximal configuration by editing `configuration.nix`, and then run it with `nix run .#maximal -Lv`. Same procedure as
adding a new module will apply here.
If it is not a new module, but a change to an existing one, then make sure the
module you have changed is enabled in the maximal configuration by editing
`configuration.nix`, and then run it with `nix run .#maximal -Lv`. Same procedure
as adding a new module will apply here.

View file

@ -1,6 +1,6 @@
# Installing neovim-flake {#ch-installation}
# Installing nvf {#ch-installation}
There are multiple ways of installing neovim-flake on your system. You may either choose
There are multiple ways of installing nvf on your system. You may either choose
the standalone installation method, which does not depend on a module system and may
be done on any system that has the Nix package manager or the appropriate modules
for NixOS and home-manager as described in the [module installation section](#ch-module-installation)

View file

@ -1,7 +1,7 @@
# Standalone Installation {#ch-standalone-installation}
It is possible to install neovim-flake without depending on NixOS or home-manager as the parent
module system, using the `neovimConfiguration` function exposed by neovim-flake extended library.
It is possible to install **nvf** without depending on NixOS or home-manager as the parent
module system, using the `neovimConfiguration` function exposed by **nvf** extended library.
It takes in the configuration as a module, and returns an attribute set as a result.
```nix

View file

@ -1,7 +1,9 @@
# Home Manager Module {#ch-hm-module}
# Home-Manager Module {#ch-hm-module}
The Home Manager module allows us to customize the different `vim` options from inside the home-manager configuration
and it is the preferred way of configuring neovim-flake, both on NixOS and non-NixOS systems.
The home-manager module allows us to customize the different `vim` options from
inside the home-manager configuration without having to call for the wrapper
yourself. It is the recommended way to use **nvf** alongside the NixOS module
depending on your needs.
To use it, we first add the input flake.
@ -9,8 +11,8 @@ To use it, we first add the input flake.
{
inputs = {
obsidian-nvim.url = "github:epwalsh/obsidian.nvim";
neovim-flake = {
url = "github:notashelf/neovim-flake";
nvf = {
url = "github:notashelf/nvf";
# you can override input nixpkgs
inputs.nixpkgs.follows = "nixpkgs";
# you can also override individual plugins
@ -25,41 +27,41 @@ Followed by importing the home-manager module somewhere in your configuration.
```nix
{
# assuming neovim-flake is in your inputs and inputs is in the argset
imports = [ inputs.neovim-flake.homeManagerModules.default ];
# assuming nvf is in your inputs and inputs is in the argset
# see example below
imports = [ inputs.nvf.homeManagerModules.default ];
}
```
An example installation for neovim-flake under standalone home-manager
would look like this:
## Example Installation {#sec-example-installation-hm}
```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
neovim-flake.url = "github:notashelf/neovim-flake";
nvf.url = "github:notashelf/nvf";
};
outputs = { nixpkgs, home-manager, neovim-flake ... }: let
outputs = { nixpkgs, home-manager, nvf, ... }: let
system = "x86_64-linux"; in {
# ↓ this is the home-manager output in the flake schema
homeConfigurations."yourUsername»" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
# ↓ this is your home output in the flake schema, expected by home-manager
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration
modules = [
neovim-flake.homeManagerModules.default # <- this imports the home-manager module that provides the options
./home.nix # your home-manager configuration, probably where you will want to add programs.neovim-flake options
nvf.homeManagerModules.default # <- this imports the home-manager module that provides the options
./home.nix # <- your home entrypoint
];
};
};
}
```
Once the module is imported, we will be able to define the following options (and much more) from inside the
home-manager configuration.
Once the module is properly imported by your host, you will be able to use the
`programs.nvf` module option anywhere in your configuration in order to
configure **nvf**.
```nix{
programs.neovim-flake = {
programs.nvf = {
enable = true;
# your settings need to go into the settings attribute set
# most settings are documented in the appendix
@ -74,6 +76,8 @@ home-manager configuration.
}
```
:::{.note}
You may find all avaliable options in the [appendix](https://notashelf.github.io/neovim-flake/options)
::: {.note}
**nvf** exposes a lot of options, most of which are not referenced in the
installation sections of the manual. You may find all avaliable options
in the [appendix](https://notashelf.github.io/nvf/options)
:::

View file

@ -1,3 +1,82 @@
# NixOS Module {#ch-nixos-module}
This artice is a stub. It will be written as the NixOS module is finalized.
The NixOS module allows us to customize the different `vim` options from inside
the NixOS configuration without having to call for the wrapper yourself. It is
the recommended way to use **nvf** alongside the home-manager module depending
on your needs.
To use it, we first add the input flake.
```nix
{
inputs = {
obsidian-nvim.url = "github:epwalsh/obsidian.nvim";
nvf = {
url = "github:notashelf/nvf";
# you can override input nixpkgs
inputs.nixpkgs.follows = "nixpkgs";
# you can also override individual plugins
# for example:
inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs
};
};
}
```
Followed by importing the NixOS module somewhere in your configuration.
```nix
{
# assuming nvf is in your inputs and inputs is in the argset
# see example below
imports = [ inputs.nvf.nixosModules.default ];
}
```
## Example Installation {#sec-example-installation-nixos}
```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nvf.url = "github:notashelf/nvf";
};
outputs = { nixpkgs, nvf, ... }: let
system = "x86_64-linux"; in {
# ↓ this is your host output in the flake schema
nixosConfigurations."yourUsername»" = nixpkgs.lib.nixosSystem {
modules = [
nvf.nixosModules.default # <- this imports the NixOS module that provides the options
./configuration.nix # <- your host entrypoint
];
};
};
}
```
Once the module is properly imported by your host, you will be able to use the
`programs.nvf` module option anywhere in your configuration in order to
configure **nvf**.
```nix{
programs.nvf = {
enable = true;
# your settings need to go into the settings attribute set
# most settings are documented in the appendix
settings = {
vim.viAlias = false;
vim.vimAlias = true;
vim.lsp = {
enable = true;
};
};
};
}
```
::: {.note}
**nvf** exposes a lot of options, most of which are not referenced in the
installation sections of the manual. You may find all avaliable options
in the [appendix](https://notashelf.github.io/nvf/options)
:::

View file

@ -1,35 +1,54 @@
# Standalone Installation (home-manager) {#ch-standalone-home-manager}
# Standalone Installation on Home-Manager {#ch-standalone-hm}
The following is an example of a barebones vim configuration with the default theme enabled.
Your built Neoevim configuration can be exposed as a flake output to make it
easier to share across machines, repositories and so on. Or it can be added to
your system packages to make it available across your system.
The following is an example installation of `nvf` as a standalone package with
the default theme enabled. You may use other options inside `config.vim` in
`configModule`, but this example will not cover that.
```nix
{
inputs.neovim-flake = {
url = "github:notashelf/neovim-flake";
inputs.nixpkgs.follows = "nixpkgs";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
nvf.url = "github:notashelf/nvf";
};
outputs = {nixpkgs, neovim-flake, ...}: let
outputs = {nixpkgs, home-manager, nvf, ...}: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
configModule = {
# Add any custom options (and feel free to upstream them!)
# options = ...
# 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 = neovim-flake.lib.neovimConfiguration {
customNeovim = nvf.lib.neovimConfiguration {
modules = [configModule];
inherit pkgs;
};
in {
# this is an example nixosConfiguration using the built neovim package
# this will make the package available as a flake input
packages.${system}.my-neovim = customNeovim.neovim;
# this is an example home-manager configuration
# using the built neovim package
homeConfigurations = {
yourHostName = home-manager.lib.nixosSystem {
# TODO
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration {
# ...
modules = [
./home.nix
# this will make wrapped neovim available in your system packages
{environment.systemPackages = [customNeovim.neovim];}
];
# ...
};
};
};

View file

@ -1,33 +1,41 @@
# Standalone Installation (NixOS) {#ch-standalone-nixos}
# Standalone Installation on NixOS {#ch-standalone-nixos}
The following is an example of a barebones vim configuration with the default theme enabled.
Your built Neoevim configuration can be exposed as a flake output to make it
easier to share across machines, repositories and so on. Or it can be added to
your system packages to make it available across your system.
The following is an example installation of `nvf` as a standalone package with
the default theme enabled. You may use other options inside `config.vim` in
`configModule`, but this example will not cover that.
```nix
{
inputs.neovim-flake = {
url = "github:notashelf/neovim-flake";
inputs.nixpkgs.follows = "nixpkgs";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
nvf.url = "github:notashelf/nvf";
};
outputs = {nixpkgs, neovim-flake, ...}: let
outputs = {nixpkgs, nvf, ...}: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
configModule = {
# Add any custom options (and feel free to upstream them!)
# options = ...
# 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 = neovim-flake.lib.neovimConfiguration {
customNeovim = nvf.lib.neovimConfiguration {
modules = [configModule];
inherit pkgs;
};
in {
# this will make the package available as a flake input
packages.${system}.neovim = customNeovim.neovim;
packages.${system}.my-neovim = customNeovim.neovim;
# this is an example nixosConfiguration using the built neovim package
nixosConfigurations = {
@ -45,7 +53,3 @@ The following is an example of a barebones vim configuration with the default th
};
}
```
Your built neovim configuration can be exposed as a flake output, or be added to your system packages to make
it available across your system. You may also consider passing the flake output to home-manager to make it available
to a specific user.

View file

@ -1,4 +1,4 @@
# neovim-flake-manual {#neovim-flake-manual}
# nvf manual {#nvf-manual}
## Version @NVF_VERSION@

View file

@ -1,11 +1,11 @@
# Neovim Flake Configuration Options {#ch-options}
Below are the options provided by neovim-flake provided in no particular order.
Below are the options provided by nvf provided in no particular order.
They may include useful comments and warnings, or examples on how a module option
is meant to be used.
```{=include=} options
id-prefix: opt-
list-id: neovim-flake-options
list-id: nvf-options
source: @OPTIONS_JSON@
```

View file

@ -1,7 +1,7 @@
# Preface {#ch-preface}
If you noticed a bug caused by neovim-flake then please consider reporting it over
[the neovim-flake issue tracker](https://github.com/notashelf/neovim-flake/issues).
If you noticed a bug caused by **nvf** then please consider reporting it over
[the issue tracker](https://github.com/notashelf/nvf/issues).
Bugfixes, feature additions and upstreamed changes from your local configurations
are always welcome in the [the neovim-flake pull requests tab](https://github.com/notashelf/neovim-flake/pulls).
are always welcome in the [the pull requests tab](https://github.com/notashelf/nvf/pulls).

View file

@ -1,6 +1,6 @@
# Try it out {#ch-try-it-out}
Thanks to the portability of Nix, you can try out neovim-flake without actually installing it to your machine.
Thanks to the portability of Nix, you can try out nvf without actually installing it to your machine.
Below are the commands you may run to try out different configurations provided by this flake. As of v0.5, three
configurations are provided:
@ -11,8 +11,8 @@ configurations are provided:
You may try out any of the provided configurations using the `nix run` command on a system where Nix is installed.
```console
$ cachix use neovim-flake # Optional: it'll save you CPU resources and time
$ nix run github:notashelf/neovim-flake#nix # will run the default minimal configuration
$ cachix use nvf # Optional: it'll save you CPU resources and time
$ nix run github:notashelf/nvf#nix # will run the default minimal configuration
```
Do keep in mind that this is **susceptible to garbage collection** meaning it will be removed from your Nix store
@ -21,9 +21,9 @@ once you garbage collect.
## Using Prebuilt Configs {#sec-using-prebuild-configs}
```console
$ nix run github:notashelf/neovim-flake#nix
$ nix run github:notashelf/neovim-flake#tidal
$ nix run github:notashelf/neovim-flake#maximal
$ nix run github:notashelf/nvf#nix
$ nix run github:notashelf/nvf#tidal
$ nix run github:notashelf/nvf#maximal
```
### Available Configs {#sec-available-configs}

View file

@ -1,6 +1,7 @@
# Release Notes {#ch-release-notes}
This section lists the release notes for tagged version of neovim-flake and current main.
This section lists the release notes for tagged version of **nvf** and
the current main current main branch
```{=include=} chapters
rl-0.1.md

View file

@ -27,19 +27,33 @@
};
homeManagerModules = {
neovim-flake = {
neovim-flake =
nixpkgs.lib.warn ''
homeManagerModules.neovim-flake has been deprecated.
Plese use the homeManagereModules.nvf instead
''
self.homeManagerModules.nvf;
nvf = {
imports = [(import ./flake/modules/home-manager.nix self.packages inputs)];
};
default = self.homeManagerModules.neovim-flake;
default = self.homeManagerModules.nvf;
};
nixosModules = {
neovim-flake = {
neovim-flake =
nixpkgs.lib.warn ''
nixosModules.neovim-flake has been deprecated.
Please use the nixosModules.nvf instead
''
self.nixosModules.neovim-flake;
nvf = {
imports = [(import ./flake/modules/nixos.nix self.packages inputs)];
};
default = self.nixosModules.neovim-flake;
default = self.nixosModules.nvf;
};
};

View file

@ -33,7 +33,7 @@
inherit (config.legacyPackages) neovim-nix;
in
dockerTools.buildImage {
name = "neovim-flake";
name = "nvf";
tag = "latest";
copyToRoot = buildEnv {

View file

@ -58,7 +58,7 @@ in rec {
# Convert a list of lua expressions to a lua table. The difference to listToLuaTable is that the elements here are expected to be lua expressions already, whereas listToLuaTable converts from nix types to lua first
luaTable = items: ''{${concatStringsSep "," items}}'';
isLuaInline = {_type ? null, ...}: _type == "lua-inline";
isLuaInline = object: (object._type or null) == "lua-inline";
toLuaObject = args:
if isAttrs args
@ -77,8 +77,7 @@ in rec {
else "[${toLuaObject n}] = " + (toLuaObject v))
(filterAttrs
(
_: v:
(v != null) && (toLuaObject v != "{}")
_: v: (toLuaObject v != "{}")
)
args)))
+ "}"

View file

@ -9,7 +9,7 @@ nixpkgsLib.extend (self: super: {
# Makes our custom functions available under `lib.nvim` where stdlib-extended.nix is imported
# with the appropriate arguments. For end-users, a `lib` output will be accessible from the flake.
# E.g. for an input called `neovim-flake`, `inputs.neovim-flake.lib.nvim` will return the set
# E.g. for an input called `nvf`, `inputs.nvf.lib.nvim` will return the set
# below.
nvim = import ./. {
inherit inputs;

View file

@ -66,14 +66,7 @@ in {
luaInline = lib.mkOptionType {
name = "luaInline";
check = x: lib.nvim.lua.isLuaInline x || builtins.isString x;
merge = loc: defs: let
val =
if isString loc
then lib.generators.mkLuaInline loc
else loc;
in
lib.mergeOneOption val defs;
check = x: lib.nvim.lua.isLuaInline x;
};
/*

View file

@ -34,7 +34,7 @@
"rich-presence"
"session"
"snippets"
"spellcheck"
# "spellcheck" # FIXME: see neovim/init/spellcheck.nix
"statusline"
"tabline"
"terminal"

View file

@ -16,7 +16,7 @@ in {
];
options.vim.spellcheck = {
enable = mkEnableOption "neovim's built-in spellchecking";
enable = mkEnableOption "Neovim's built-in spellchecking";
languages = mkOption {
type = listOf str;
default = ["en"];
@ -27,7 +27,7 @@ in {
To add your own language files, you may place your `spell`
directory in either `~/.config/nvim` or the
[additionalRuntimePaths](#opt-vim.additionalRuntimePaths)
directory provided by neovim-flake.
directory provided by **nvf**.
'';
};
@ -38,11 +38,15 @@ in {
description = ''
A list of filetypes for which spellchecking will be disabled.
You may use `echo &filetype` in neovim to find out the
You may use `echo &filetype` in Neovim to find out the
filetype for a specific buffer.
'';
};
/*
# FIXME: This needs to be revisited. It tries to install
# the spellfile to an user directory, but it cannot do so
# as we sanitize runtime paths.
programmingWordlist.enable = mkEnableOption ''
vim-dirtytalk, a wordlist for programmers containing
common programming terms.
@ -50,6 +54,7 @@ in {
Setting this value as `true` has the same effect
as setting {option}`vim.spellCheck.enable`
'';
*/
};
config = mkIf cfg.enable {

View file

@ -37,6 +37,33 @@
'';
};
};
defaultFormat = "prettier";
formats = {
prettier = {
package = pkgs.nodePackages.prettier;
nullConfig = ''
table.insert(
ls_sources,
null_ls.builtins.formatting.prettier.with({
command = "${cfg.format.package}/bin/prettier",
})
)
'';
};
prettierd = {
package = pkgs.prettierd;
nullConfig = ''
table.insert(
ls_sources,
null_ls.builtins.formatting.prettier.with({
command = "${cfg.format.package}/bin/prettierd",
})
)
'';
};
};
in {
options.vim.languages.css = {
enable = mkEnableOption "CSS language support";
@ -63,6 +90,22 @@ in {
default = servers.${cfg.lsp.server}.package;
};
};
format = {
enable = mkEnableOption "CSS formatting" // {default = config.vim.languages.enableFormat;};
type = mkOption {
description = "CSS formatter to use";
type = enum (attrNames formats);
default = defaultFormat;
};
package = mkOption {
description = "CSS formatter package";
type = package;
default = formats.${cfg.format.type}.package;
};
};
};
config = mkIf cfg.enable (mkMerge [
@ -73,7 +116,12 @@ in {
(mkIf cfg.lsp.enable {
vim.lsp.lspconfig.enable = true;
vim.lsp.lspconfig.sources.tailwindcss-lsp = servers.${cfg.lsp.server}.lspConfig;
vim.lsp.lspconfig.sources.css-lsp = servers.${cfg.lsp.server}.lspConfig;
})
(mkIf cfg.format.enable {
vim.lsp.null-ls.enable = true;
vim.lsp.null-ls.sources.css-format = formats.${cfg.format.type}.nullConfig;
})
]);
}

View file

@ -55,7 +55,7 @@ in {
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.lsp.enable {
vim.lsp.lspconfig.enable = true;
vim.lsp.lspconfig.sources.css-lsp = servers.${cfg.lsp.server}.lspConfig;
vim.lsp.lspconfig.sources.tailwindcss-lsp = servers.${cfg.lsp.server}.lspConfig;
})
]);
}

View file

@ -7,10 +7,12 @@ in {
imports =
[
(mkRemovedOptionModule ["vim" "presence" "presence-nvim"] ''
The option vim.presence.presence-nvim has been deprecated in favor of the new neocord module.
Options provided by the plugin remain mostly the same, but manual migration is required.
The option vim.presence.presence-nvim has been deprecated in favor of the new
neocord module. Options provided by the plugin remain mostly the same, but manual
migration is required.
Please see neocord documentation and the neovim-flake options for more info
Please see neocord documentation and options page on the **nvf** manual
for mor einformation
'')
]
++ (map

View file

@ -6,101 +6,30 @@
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.binds) mkLuaBinding mkBinding pushDownDefault;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.tabline.nvimBufferline;
self = import ./nvim-bufferline.nix {inherit lib;};
inherit (self.options.vim.tabline.nvimBufferline) mappings;
in {
config = mkIf cfg.enable (
let
mouse = {
right = "'vertical sbuffer %d'";
close = ''
function(bufnum)
require("bufdelete").bufdelete(bufnum, false)
end
'';
config = mkIf cfg.enable {
vim = {
startPlugins = [
(assert config.vim.visuals.nvimWebDevicons.enable; "nvim-bufferline-lua")
"bufdelete-nvim"
];
binds.whichKey.register = pushDownDefault {
"<leader>b" = "+Buffer";
"<leader>bm" = "BufferLineMove";
"<leader>bs" = "BufferLineSort";
"<leader>bsi" = "BufferLineSortById";
};
in {
vim = {
startPlugins = [
(assert config.vim.visuals.nvimWebDevicons.enable; "nvim-bufferline-lua")
"bufdelete-nvim"
];
maps.normal = mkMerge [
(mkLuaBinding cfg.mappings.closeCurrent "require(\"bufdelete\").bufdelete" mappings.closeCurrent.description)
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
(mkBinding cfg.mappings.cyclePrevious ":BufferLineCyclePrev<CR>" mappings.cyclePrevious.description)
(mkBinding cfg.mappings.pick ":BufferLinePick<CR>" mappings.pick.description)
(mkBinding cfg.mappings.sortByExtension ":BufferLineSortByExtension<CR>" mappings.sortByExtension.description)
(mkBinding cfg.mappings.sortByDirectory ":BufferLineSortByDirectory<CR>" mappings.sortByDirectory.description)
(mkLuaBinding cfg.mappings.sortById "function() require(\"bufferline\").sort_buffers_by(function (buf_a, buf_b) return buf_a.id < buf_b.id end) end" mappings.sortById.description)
(mkBinding cfg.mappings.moveNext ":BufferLineMoveNext<CR>" mappings.moveNext.description)
(mkBinding cfg.mappings.movePrevious ":BufferLineMovePrev<CR>" mappings.movePrevious.description)
];
binds.whichKey.register = pushDownDefault {
"<leader>b" = "+Buffer";
"<leader>bm" = "BufferLineMove";
"<leader>bs" = "BufferLineSort";
"<leader>bsi" = "BufferLineSortById";
};
luaConfigRC.nvimBufferline = entryAnywhere ''
require("bufferline").setup{
options = {
mode = "buffers",
numbers = "both",
close_command = ${mouse.close},
right_mouse_command = ${mouse.right},
indicator = {
style = 'icon',
indicator_icon = '',
},
buffer_close_icon = '󰅖',
modified_icon = '',
close_icon = '',
left_trunc_marker = '',
right_trunc_marker = '',
max_name_length = 18,
max_prefix_length = 15,
tab_size = 18,
show_buffer_icons = true,
show_buffer_close_icons = true,
show_close_icon = true,
show_tab_indicators = true,
persist_buffer_sort = true,
--separator_style = "thin",
separator_style = { " ", " " },
enforce_regular_tabs = true,
always_show_bufferline = true,
offsets = {
{filetype = "NvimTree", text = "File Explorer", text_align = "center"}
},
sort_by = 'extension',
diagnostics = "nvim_lsp", -- TODO: use coc if it's enabled
diagnostics_update_in_insert = true,
diagnostics_indicator = function(count, level, diagnostics_dict, context)
local s = ""
for e, n in pairs(diagnostics_dict) do
local sym = e == "error" and ""
or (e == "warning" and "" or "" )
if(sym ~= "") then
s = s .. " " .. n .. sym
end
end
return s
end,
numbers = function(opts)
return string.format('%s·%s', opts.raise(opts.id), opts.lower(opts.ordinal))
end,
}
}
'';
};
}
);
luaConfigRC.nvimBufferline = entryAnywhere ''
require("bufferline").setup({options = ${toLuaObject cfg.setupOpts}})
'';
};
};
}

View file

@ -1,6 +1,8 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption;
inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) enum bool either nullOr str int listOf;
inherit (lib.nvim.binds) mkMappingOption;
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
in {
options.vim.tabline.nvimBufferline = {
enable = mkEnableOption "neovim bufferline";
@ -16,5 +18,319 @@ in {
moveNext = mkMappingOption "Move next buffer" "<leader>bmn";
movePrevious = mkMappingOption "Move previous buffer" "<leader>bmp";
};
setupOpts = mkPluginSetupOption "Bufferline-nvim" {
mode = mkOption {
type = enum ["tabs" "buffers"];
default = "tabs";
description = "Mode to use for bufferline";
};
themable = mkOption {
type = bool;
default = true;
description = ''
Whether or not highlight groups to be overriden.
While false, bufferline.nvim sets highlights as default
'';
};
numbers = mkOption {
type = either (enum ["none" "ordinal" "buffer_id" "both"]) luaInline;
default = lib.generators.mkLuaInline ''
function(opts)
return string.format('%s·%s', opts.raise(opts.id), opts.lower(opts.ordinal))
end
'';
description = "Whether or not to show buffer numbers";
};
close_command = mkOption {
type = either str luaInline;
default = lib.generators.mkLuaInline ''
function(bufnum)
require("bufdelete").bufdelete(bufnum, false)
end
'';
description = "Command to run when closing a buffer";
};
right_mouse_command = mkOption {
type = nullOr (either str luaInline);
default = "vertical sbuffer %d";
description = "Command to run when right clicking a buffer";
};
middle_mouse_command = mkOption {
type = nullOr (either str luaInline);
default = null;
description = "Command to run when middle clicking a buffer";
};
indicator = {
icon = mkOption {
type = nullOr str;
default = null;
description = ''
The indicatotor icon to use for current buffer.
::: {.warning}
This **must** be ommitted while style is not `icon`
:::
'';
};
style = mkOption {
type = enum ["icon" "underline" "none"];
default = "underline";
description = "Style for indicator";
};
};
buffer_close_icon = mkOption {
type = str;
default = " 󰅖 ";
description = "Icon for close button";
};
modified_icon = mkOption {
type = str;
default = " ";
description = "Icon for modified buffer";
};
close_icon = mkOption {
type = str;
default = " ";
description = "Icon for close button";
};
left_trunc_marker = mkOption {
type = str;
default = "";
description = "Icon for left truncation";
};
right_trunc_marker = mkOption {
type = str;
default = "";
description = "Icon for right truncation";
};
name_formatter = mkOption {
type = nullOr luaInline;
default = null;
description = ''
`name_formatter` can be used to change the buffer's label in the
bufferline.
::: {.note}
Some names can/will break the bufferline so use this at your
discretion knowing that it has some limitations that will
**NOT** be fixed.
:::
'';
};
max_name_length = mkOption {
type = int;
default = 18;
description = "Max name length";
};
max_prefix_length = mkOption {
type = int;
default = 15;
description = "Length of prefix used when a buffer is de-duplicated";
};
truncate_names = mkOption {
type = bool;
default = true;
description = "Truncate names";
};
diagnostics = mkOption {
type = enum [false "nvim_lsp" "coc"];
default = "nvim_lsp";
description = "Diagnostics provider to be used in buffer LSP indicators";
};
diagnostics_update_in_insert = mkOption {
type = bool;
default = false;
description = ''
Whether to update diagnostics while in insert mode.
Setting this to true has performance implications, but they may be
negligible depending on your setup. Set it to true if you know what
you are doing.
'';
};
diagnostics_indicator = mkOption {
type = nullOr luaInline;
default = lib.generators.mkLuaInline ''
function(count, level, diagnostics_dict, context)
local s = " "
for e, n in pairs(diagnostics_dict) do
local sym = e == "error" and " "
or (e == "warning" and " " or " " )
s = s .. n .. sym
end
return s
end
'';
description = ''
Function to get the diagnostics indicator.
The function should return a string to be used as the indicator.
Can be set to nil to keep the buffer name highlight, but delete the
highlighting.
'';
};
custom_filter = mkOption {
type = nullOr luaInline;
default = null;
example = literalExpression lib.generators.mkLuaInline ''
custom_filter = function(buf_number, buf_numbers)
-- filter out filetypes you don't want to see
if vim.bo[buf_number].filetype ~= "<i-dont-want-to-see-this>" then
return true
end
-- filter out by buffer name
if vim.fn.bufname(buf_number) ~= "<buffer-name-I-dont-want>" then
return true
end
-- filter out based on arbitrary rules
-- e.g. filter out vim wiki buffer from tabline in your work repo
if vim.fn.getcwd() == "<work-repo>" and vim.bo[buf_number].filetype ~= "wiki" then
return true
end
-- filter out by it's index number in list (don't show first buffer)
if buf_numbers[1] ~= buf_number then
return true
end
end
'';
description = ''
Custom filter function for filtering out buffers.
::: {.note}
This will be called a lot, so you are encouraged to keep it as
short and lightweight as possible unless you are fully aware
of the performance implications.
:::
'';
};
color_icons = mkOption {
type = bool;
default = true;
description = "Whether or not to add filetype icon highlights";
};
show_buffer_icons = mkOption {
type = bool;
default = true;
description = "Whether or not to show buffer icons";
};
show_buffer_close_icons = mkOption {
type = bool;
default = true;
description = "Whether or not to show buffer close icons";
};
show_close_icon = mkOption {
type = bool;
default = true;
description = "Whether or not to show close icon";
};
show_tab_indicators = mkOption {
type = bool;
default = true;
description = "Whether or not to show tab indicators";
};
show_duplicate_prefix = mkOption {
type = bool;
default = true;
description = "Whether or not to show duplicate prefix";
};
duplicates_across_groups = mkOption {
type = bool;
default = true;
description = "Whether to consider duplicate paths in different groups as duplicates";
};
persist_buffer_sort = mkOption {
type = bool;
default = true;
description = "Whether or not custom sorted buffers should persist";
};
move_wraps_at_ends = mkOption {
type = bool;
default = false;
description = "Whether or not the move command \"wraps\" at the first or last position";
};
seperator_style = mkOption {
type = either (enum ["thick" "thin" "slope" "slant"]) (listOf str);
default = [" " " "];
description = ''
Style of the buffer separator.
Can be either one of the suspported values, or a list containing
**at most** two elements for `focused` and `unfocused` respectively.
'';
};
enforce_regular_tabs = mkOption {
type = bool;
default = false;
description = "Whether to enforce regular tabs";
};
always_show_bufferline = mkOption {
type = bool;
default = true;
description = "Whether to always show bufferline";
};
auto_toggle_bufferline = mkOption {
type = bool;
default = false;
description = "Whether to auto toggle bufferline";
};
hover = {
enabled = mkEnableOption "hover" // {default = true;};
delay = mkOption {
type = int;
default = 200;
description = "Delay for hover, in ms";
};
reveal = mkOption {
type = listOf str;
default = ["close"];
description = "Reveal hover window";
};
};
sort_by = mkOption {
type = either (enum ["insert_after_current" "insert_at_end" "id" "extension" "relative_directory" "directory" "tabs"]) luaInline;
default = "extension";
description = "Method to sort buffers by. Must be one of the supported valuees, or an inline Lua value.";
};
};
};
}

View file

@ -6,7 +6,6 @@
}: let
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) optional optionals;
inherit (lib.trivial) boolToString;
inherit (lib.nvim.binds) mkSetBinding addDescriptionsToMappings;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.dag) entryBefore entryAfter;

View file

@ -27,7 +27,7 @@ in {
description = ''
List of treesitter grammars to install.
For languages already supported by neovim-flake, you may
For languages already supported by nvf, you may
use the {option}`vim.language.<lang>.treesitter` options, which
will automatically add the required grammars to this.
'';
@ -39,6 +39,7 @@ in {
description = ''
Whether to add the default grammars to the list of grammars
to install.
This option is only relevant if treesitter has been enabled.
'';
};
@ -96,7 +97,7 @@ in {
example = literalMD ''
```lua
-- Disable slow treesitter highlight for large files
disable = function(lang, buf)
function(lang, buf)
local max_filesize = 1000 * 1024 -- 1MB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then

View file

@ -7,8 +7,8 @@
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.attrsets) mapAttrs;
inherit (lib.strings) toUpper;
inherit (lib.types) int float bool str enum listOf attrsOf;
inherit (lib.nvim.types) mkPluginSetupOption;
inherit (lib.types) int float bool str enum listOf attrsOf anything;
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
inherit (lib.generators) mkLuaInline;
in {
imports = [
@ -42,30 +42,14 @@ in {
type = bool;
default = false;
};
clear_on_detach = mkOption {
description = "Clear notification group when LSP server detaches";
type = bool;
default = true;
apply = clear:
if clear
then
mkLuaInline ''
function(client_id)
local client = vim.lsp.get_client_by_id(client_id)
return client and client.name or nil
end
''
else null;
};
notification_group = mkOption {
description = "How to get a progress message's notification group key";
type = str;
default = ''
type = luaInline;
default = mkLuaInline ''
function(msg)
return msg.lsp_client.name
end
'';
apply = mkLuaInline;
};
ignore = mkOption {
description = "Ignore LSP servers by name";
@ -172,33 +156,29 @@ in {
};
format_message = mkOption {
description = "How to format a progress message";
type = str;
default = ''
type = luaInline;
default = mkLuaInline ''
require("fidget.progress.display").default_format_message
'';
apply = mkLuaInline;
};
format_annote = mkOption {
description = "How to format a progress annotation";
type = str;
default = ''
type = luaInline;
default = mkLuaInline ''
function(msg) return msg.title end
'';
apply = mkLuaInline;
};
format_group_name = mkOption {
description = "How to format a progress notification group's name";
type = str;
default = ''
type = luaInline;
default = mkLuaInline ''
function(group) return tostring(group) end
'';
apply = mkLuaInline;
};
overrides = mkOption {
description = "Override options from the default notification config";
type = attrsOf str;
default = {rust_analyzer = "{ name = 'rust-analyzer' }";};
apply = mapAttrs (key: lua: mkLuaInline lua);
type = attrsOf (attrsOf anything);
default = {rust_analyzer = {name = "rust-analyzer";};};
};
};
@ -240,21 +220,19 @@ in {
};
configs = mkOption {
description = "How to configure notification groups when instantiated";
type = attrsOf str;
default = {default = "require('fidget.notification').default_config";};
apply = mapAttrs (key: lua: mkLuaInline lua);
type = attrsOf luaInline;
default = {default = mkLuaInline "require('fidget.notification').default_config";};
};
redirect = mkOption {
description = "Conditionally redirect notifications to another backend";
type = str;
default = ''
type = luaInline;
default = mkLuaInline ''
function(msg, level, opts)
if opts and opts.on_open then
return require("fidget.integration.nvim-notify").delegate(msg, level, opts)
end
end
'';
apply = mkLuaInline;
};
view = {
@ -280,13 +258,12 @@ in {
};
render_message = mkOption {
description = "How to render notification messages";
type = str;
default = ''
type = luaInline;
default = mkLuaInline ''
function(msg, cnt)
return cnt == 1 and msg or string.format("(%dx) %s", cnt, msg)
end
'';
apply = mkLuaInline;
};
};
@ -386,11 +363,10 @@ in {
};
path = mkOption {
description = "Where Fidget writes its logs to";
type = str;
default = ''
type = luaInline;
default = mkLuaInline ''
string.format("%s/fidget.nvim.log", vim.fn.stdpath("cache"))
'';
apply = mkLuaInline;
};
};
};

View file

@ -0,0 +1,53 @@
{
pkgs,
lib,
...
}: let
inherit (lib) mkMappingOption mkEnableOption mkOption types;
in {
options.vim.telescope = {
mappings = {
findProjects = mkMappingOption "Find files [Telescope]" "<leader>fp";
findFiles = mkMappingOption "Find files [Telescope]" "<leader>ff";
liveGrep = mkMappingOption "Live grep [Telescope]" "<leader>fg";
buffers = mkMappingOption "Buffers [Telescope]" "<leader>fb";
helpTags = mkMappingOption "Help tags [Telescope]" "<leader>fh";
open = mkMappingOption "Open [Telescope]" "<leader>ft";
gitCommits = mkMappingOption "Git commits [Telescope]" "<leader>fvcw";
gitBufferCommits = mkMappingOption "Git buffer commits [Telescope]" "<leader>fvcb";
gitBranches = mkMappingOption "Git branches [Telescope]" "<leader>fvb";
gitStatus = mkMappingOption "Git status [Telescope]" "<leader>fvs";
gitStash = mkMappingOption "Git stash [Telescope]" "<leader>fvx";
lspDocumentSymbols = mkMappingOption "LSP Document Symbols [Telescope]" "<leader>flsb";
lspWorkspaceSymbols = mkMappingOption "LSP Workspace Symbols [Telescope]" "<leader>flsw";
lspReferences = mkMappingOption "LSP References [Telescope]" "<leader>flr";
lspImplementations = mkMappingOption "LSP Implementations [Telescope]" "<leader>fli";
lspDefinitions = mkMappingOption "LSP Definitions [Telescope]" "<leader>flD";
lspTypeDefinitions = mkMappingOption "LSP Type Definitions [Telescope]" "<leader>flt";
diagnostics = mkMappingOption "Diagnostics [Telescope]" "<leader>fld";
treesitter = mkMappingOption "Treesitter [Telescope]" "<leader>fs";
};
enable = mkEnableOption "telescope.nvim: multi-purpose search and picker utility";
vimgrep_arguments = mkOption {
description = "Arguments to use for the grep command";
type = types.listOf types.str;
default = [
"${pkgs.ripgrep}/bin/rg"
"--color=never"
"--no-heading"
"--with-filename"
"--line-number"
"--column"
"--smart-case"
"--hidden"
"--no-ignore"
];
};
};
}

View file

@ -12,11 +12,14 @@ in {
type = package;
default = pkgs.neovim-unwrapped;
description = ''
The neovim package to use.
The neovim package to use for the wrapper. This
corresponds to the package that will be wrapped
with your plugins and settings.
::: {.warning}
You will need to use an unwrapped package for this
option to work as intended.
option to work as intended. Using an already wrapped
package here may yield undesirable results.
:::
'';
};
@ -74,8 +77,7 @@ in {
set up after builtin plugins.
This option takes a special type that allows you to order
your custom plugins using neovim-flake's modified DAG
library.
your custom plugins using nvf's modified DAG library.
'';
example = literalExpression ''

View file

@ -102,7 +102,7 @@ in {
If this option is passed as a DAG, it will be resolved
according to the DAG resolution rules (e.g. entryBefore
or entryAfter) as per the neovim-flake library.
or entryAfter) as per the **nvf** extended library.
'';
example = literalMD ''
@ -182,7 +182,7 @@ in {
If this option is passed as a DAG, it will be resolved
according to the DAG resolution rules (e.g. entryBefore
or entryAfter) as per the neovim-flake library.
or entryAfter) as per the **nvf** extended library.
'';
example = literalMD ''

View file

@ -1,4 +1,4 @@
{
"release": "v0.6",
"isReleaseBranch": false
"isReleaseBranch": true
}