Merge pull request #237 from FrothyMarrow/unstable-wrapper

wrapper: migrate to `makeNeovimUnstable` wrapper
This commit is contained in:
NotAShelf 2024-03-01 16:44:02 +03:00 committed by Ching Pei Yang
commit 42016d8e04
182 changed files with 2304 additions and 2010 deletions

128
.github/README.md vendored
View file

@ -1,5 +1,5 @@
<div align="center"> <div align="center">
<img src="../assets/neovim-flake-logo-work.svg" alt="neovim-flake Logo" width="200"> <img src=".github/assets/neovim-flake-logo-work.svg" alt="neovim-flake Logo" width="200">
</div> </div>
<h1 align="center">❄️ neovim-flake</h1> <h1 align="center">❄️ neovim-flake</h1>
<div align="center"> <div align="center">
@ -30,7 +30,10 @@
<div align="center"> <div align="center">
<a> <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 allows you to easily configure your Neovim instance with a few lines of Nix code. A highly modular, configurable, extensible and easy to use Neovim configuration
wrapper written 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> </a>
</div> </div>
@ -62,106 +65,137 @@
### Using `nix` CLI ### Using `nix` CLI
If you would like to try out the configuration before even thinking about installing it, you can run the following command If you would like to try out the configuration before even thinking about
installing it, you can run the following command
```console ```console
nix run github:notashelf/neovim-flake nix run github:notashelf/neovim-flake
``` ```
This will get you a feel for the base configuration and UI design. The flake exposes `#nix` as the default package, providing minimal language support and various This will get you a feel for the base configuration and UI design.
utilities.You may also use `#nix`, `#tidal` or `#maximal` to get try out different configurations. The flake exposes `#nix` as the default package, providing minimal
language support and various utilities.You may also use `#nix`,
`#tidal` or `#maximal` to get try out different configurations.
It is as simple as changing the target output to get a different configuration. For example, to get a configuration with `tidal` support, run: 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 ```console
nix run github:notashelf/neovim-flake#tidal nix run github:notashelf/neovim-flake#tidal
``` ```
Similar instructions will apply for `nix profile install`. However, you are recommended to instead use the module system as described in the manual. Similar instructions will apply for `nix profile install`. However, you are
recommended to instead use the module system as described in the manual.
> [!NOTE] > [!NOTE]
> The `maximal` configuration is _massive_ and will take a while to build. To get a feel for the configuration, use the default `nix` or `tidal` configurations. > The `maximal` configuration is _massive_ and will take a while to build.
> Should you choose to try out the `maximal` configuration, using the binary cache as described in the manual is _strongly_ recommended. > To get a feel for the configuration, use the default `nix` or `tidal`
> configurations. Should you choose to try out the `maximal` configuration,
> using the binary cache as described in the manual is _strongly_ recommended.
### Docker ### 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 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. 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. The following command will open the current directory in neovim with necessary
tools bootstrapped.
```console ```console
docker run -v `pwd`:/home/neovim/demo --rm -it notashelf/neovim-flake:latest 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. The available registeres are `ghcr.io` and `dockerhub` for the time being.
Adjust to your liking.
## Documentation ## Documentation
See the [neovim-flake Manual](https://notashelf.github.io/neovim-flake/) for detailed installation guides, configurations, available options, release notes See the [neovim-flake Manual](https://notashelf.github.io/neovim-flake/) for
and more. 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 featured configuration with `nix` If you want to dive right into trying **neovim-flake** you can get a fully
language support by running: featured configuration with `nix` language support by running:
```console ```console
nix run github:notashelf/neovim-flake nix run github:notashelf/neovim-flake
``` ```
Please create an issue on the [issue tracker](../../../issues) if you find the documentation lacking or confusing. Please create an issue on the [issue tracker](../../../issues) if you find
I also appreciate any contributions to the documentation. the documentation lacking or confusing. I also appreciate any contributions
to the documentation.
## Help ## Help
You can create an issue on the [issue tracker](../../../issues) to ask questions or report bugs. You can create an issue on the [issue tracker](../../../issues) to ask questions
I am not yet on spaces like matrix or IRC, so please use the issue tracker for now. or report bugs. I am not yet on spaces like matrix or IRC, so please use the issue
tracker for now.
## Contributing ## Contributing
I am always looking for new ways to help improve this flake. If you would like to contribute, please read I am always looking for new ways to help improve this flake. If you would like
the [contributing guide](CONTRIBUTING.md) before submitting a pull request. You can also create an to contribute, please read the [contributing guide](CONTRIBUTING.md) before
issue on the [issue tracker](../../../issues) before submitting a pull request if you would like to discuss submitting a pull request. You can also create an issue on the
a feature or bug fix. [issue tracker](../../../issues) before submitting a pull request if you would
like to discuss a feature or bug fix.
## Philosophy ## Philosophy
The philosophy behind this flake configuration is to create an easily configurable and reproducible Neovim environment. The philosophy behind this flake configuration is to create an easily
While it does sacrifice in size (which I know some users will find _disagreeable_), it offers a lot of flexibility and customizability in configurable and reproducible Neovim environment. While it does sacrifice 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_ size (which I know some users will find _disagreeable_), it offers a lot of
ultimately leverage the flexibility of this flake to declare a configuration that follows KISS principles, as it is very easy to bring your flexibility and customizability in exchange for the large size of the flake
own plugins and configurations from non-nix. What this flake is meant to be does eventually fall into your hands. Whether you are a inputs. The "KISS" (Keep it simple, stupid) principle has mostly been abandoned
developer, writer, or live coder, you can quickly craft a config that suits every project's need. Think of it like a distribution of Neovim that you have here, however, you _can_ ultimately leverage the flexibility of this flake to
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). 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.
One should never get a broken config when setting options. If setting multiple options results in a broken Neovim, file an issue! A distribution that takes advantage of pinning vim plugins and third party
Each plugin knows when another plugin which allows for smart configuration of keybindings and automatic setup of things dependencies (such as tree-sitter grammars, language servers, and more).
like completion sources and languages.
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 ## FAQ
**Q**: Why is this flake so big? **Q**: Why is this flake so big?
<br/> <br/>
**A**: I have sacrificed in size in order to provide a highly configurable and reproducible Neovim environment. A binary cache is provided to **A**: I have sacrificed in size in order to provide a highly configurable and
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 reproducible Neovim environment. A binary cache is provided to eleminate the
instead of the `maximal` output. This will reduce size by a lot, but you will lose some language specific features. 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/> <br/><br/>
**Q**: Will you try to make this flake smaller? **Q**: Will you try to make this flake smaller?
<br/> <br/>
**A**: Yes. As a matter of fact, I am actively working on making this flake smaller. Unfortunately the process of providing everything **A**: Yes. As a matter of fact, I am actively working on making this flake
possible by itself makes the flake large. Best I can do is to optimize the flake as much as possible by selecting plugins that smaller. Unfortunately the process of providing everything possible by itself
are small and fast. And the binary cache, so at least you don't have to build it from source. 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/> <br/><br/>
**Q**: Will you use a plugin manager/language server installer? **Q**: Will you use a plugin manager/language server installer?
<br/> <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. **A**: No. If you feel the need to ask that question, then you have missed the
The whole reason we use nix is to be able to handle EVERYTHING declaratively, well including the LSP and plugin installations. 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/> <br/><br/>
**Q**: Can you add _X_? **Q**: Can you add _X_?
<br/> <br/>
**A**: Maybe. Open an issue using the appropriate template and I will consider it. I do not intend to **A**: Maybe. Open an issue using the appropriate template and I will consider
add _every plugin that is in existence_, but I will consider it, should it offer something useful to the flake. 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.
## Credits ## Credits
@ -180,14 +214,16 @@ and everyone who has submitted issues or pull requests!
### Inspiration ### Inspiration
This configuration borrows from and is based on a few other configurations, including: This configuration borrows from and is based on a few other configurations,
including:
- [@jordanisaacs's](https://github.com/jordanisaacs) [neovim-flake](https://github.com/jordanisaacs/neovim-flake) that this flake is originally based on. - [@jordanisaacs's](https://github.com/jordanisaacs) [neovim-flake](https://github.com/jordanisaacs/neovim-flake) that this flake is originally based on.
- [@sioodmy's](https://github.com/sioodmy) [dotfiles](https://github.com/sioodmy/dotfiles) that inspired the design choices. - [@sioodmy's](https://github.com/sioodmy) [dotfiles](https://github.com/sioodmy/dotfiles) that inspired the design choices.
- [@wiltaylor's](https://github.com/wiltaylor) [neovim-flake](https://github.com/wiltaylor/neovim-flake) for plugin and design ideas. - [@wiltaylor's](https://github.com/wiltaylor) [neovim-flake](https://github.com/wiltaylor/neovim-flake) for plugin and design ideas.
- [@gvolpe's](https://github.com/gvolpe) [neovim-flake](https://github.com/gvolpe/neovim-flake) for plugin, design and nix concepts. - [@gvolpe's](https://github.com/gvolpe) [neovim-flake](https://github.com/gvolpe/neovim-flake) for plugin, design and nix concepts.
I am grateful for their previous work and inspiration, and I wholeheartedly recommend checking their work out. I am grateful for their previous work and inspiration, and I wholeheartedly
recommend checking their work out.
<br/> <br/>
--- ---

View file

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View file

@ -3,11 +3,11 @@
"alpha-nvim": { "alpha-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705520464, "lastModified": 1708891191,
"narHash": "sha256-Yz5ZqxjaargJjnbmH1L43EwYp5J5w5RPREG7/smdRQc=", "narHash": "sha256-kTVPKZ/e1us/uHfSwFwR38lFYN8EotJq2jKz6xm/eqg=",
"owner": "goolord", "owner": "goolord",
"repo": "alpha-nvim", "repo": "alpha-nvim",
"rev": "4b36c1ca9ea475bdc006896657cf1ccc486aeffa", "rev": "41283fb402713fc8b327e60907f74e46166f4cfd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -19,11 +19,11 @@
"bufdelete-nvim": { "bufdelete-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1703393686, "lastModified": 1708814161,
"narHash": "sha256-O0JRhx6UJzeZTG+XwGi/6DLaoX8hfqxwSt0W9yQXhBw=", "narHash": "sha256-ljUNfmpImtxFCS19HC9kFlaLlqaPDltKtnx1+/6Y33U=",
"owner": "famiu", "owner": "famiu",
"repo": "bufdelete.nvim", "repo": "bufdelete.nvim",
"rev": "0b9c0f182b09c51170bb9f252f15de7695e4d507", "rev": "f6bcea78afb3060b198125256f897040538bcb81",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -35,11 +35,11 @@
"catppuccin": { "catppuccin": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706227543, "lastModified": 1711706907,
"narHash": "sha256-br32TBzK++QK6RqlMjyN4vmNi1cgNgDca8byZqV3oUQ=", "narHash": "sha256-GQjxE8lQj52pheJtHCS+9v2lsJY7wMj2IXVCoNRmQSQ=",
"owner": "catppuccin", "owner": "catppuccin",
"repo": "nvim", "repo": "nvim",
"rev": "afab7ec2a79c7127627dede79c0018b6e45663d0", "rev": "aebe43db9cb26e1c70fc5b2fd4158169c405e720",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -51,11 +51,11 @@
"ccc": { "ccc": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1702716924, "lastModified": 1711976559,
"narHash": "sha256-nWe7uYWPZ1LjQRVynYnPomb4EFfyh919Jsh07UPSdvg=", "narHash": "sha256-rSOjeklOdIPQvxNfUBG9Hm001cIlBgrPYcnm7afc9TE=",
"owner": "uga-rosa", "owner": "uga-rosa",
"repo": "ccc.nvim", "repo": "ccc.nvim",
"rev": "ec6e23fd2c0bf4ffcf71c1271acdcee6e2c6f49c", "rev": "46b8a38a3bc287f27789800d3d26480d093d65b5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -99,11 +99,11 @@
"cinnamon-nvim": { "cinnamon-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1670143364, "lastModified": 1711005384,
"narHash": "sha256-JglXQhoPgN9sQ3yuv0+VQxmKMvoQTu5lbGLSRaQkytI=", "narHash": "sha256-LNikkGldBpUsfyH8ThtX7RS1p/z3JzSPonT9qUU84jw=",
"owner": "declancm", "owner": "declancm",
"repo": "cinnamon.nvim", "repo": "cinnamon.nvim",
"rev": "c406ffda3a0302f32c23b24ab756ea20467d6578", "rev": "559fe02fae00ffd78377e9c242b2faa25a428592",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -243,11 +243,11 @@
"copilot-lua": { "copilot-lua": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1704638182, "lastModified": 1709095198,
"narHash": "sha256-8/EPnigWaY2P4ZlVyu42DOQVOjRPgSCtmdOVbl2ACN8=", "narHash": "sha256-JX3sdsnOnjkY7r9fCtC2oauo0PXF3SQ+SHUo8ifBvAc=",
"owner": "zbirenbaum", "owner": "zbirenbaum",
"repo": "copilot.lua", "repo": "copilot.lua",
"rev": "b03617a6dc4bc88b65ab5deac1631da9a9c2dcaf", "rev": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -259,11 +259,11 @@
"crates-nvim": { "crates-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706141227, "lastModified": 1710361360,
"narHash": "sha256-vkq1N6XvJOSsIbCCcAk1+9ReRMF4it/mofq55JhwQRY=", "narHash": "sha256-wfwSHuP05PEqCbpEG7GStGElMLkrDEbPW7V6p1EANGU=",
"owner": "Saecki", "owner": "Saecki",
"repo": "crates.nvim", "repo": "crates.nvim",
"rev": "f2a169840e97a8ed2048abb507d2742c3895c85b", "rev": "b4f4987ccdb1cc3899ee541ef4375c73c48c4570",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -275,11 +275,11 @@
"dashboard-nvim": { "dashboard-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1699578883, "lastModified": 1712122933,
"narHash": "sha256-LNjYIRL5xZyLgFkoTu3K5USOfk1mtaXe5RhKBAbzYRw=", "narHash": "sha256-s2PDyOnE3jVk+RCp0aaV2vVJGkO394iDhQTEHRcb9kY=",
"owner": "glepnir", "owner": "glepnir",
"repo": "dashboard-nvim", "repo": "dashboard-nvim",
"rev": "63df28409d940f9cac0a925df09d3dc369db9841", "rev": "7c0c09d55118a2afeb8874e885f87ae80d8ff452",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -324,11 +324,11 @@
"dracula": { "dracula": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705994462, "lastModified": 1708834650,
"narHash": "sha256-yGV/bA7+Xi+LBi4Iz/SZDVl0KWoo+IO9kgfSIgTk0Ow=", "narHash": "sha256-I3rtbJYv1D+kniOLL9hmTF3ucp/qSNewnO2GmYAERko=",
"owner": "Mofiqul", "owner": "Mofiqul",
"repo": "dracula.nvim", "repo": "dracula.nvim",
"rev": "a6cb758d4b182d9f2b7e742910078d94877c1059", "rev": "8d8bddb8814c3e7e62d80dda65a9876f97eb699c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -340,11 +340,11 @@
"dressing-nvim": { "dressing-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706209758, "lastModified": 1710299803,
"narHash": "sha256-P8XlaiNNbOtkOS2un+pfCOOayOzJ/8uLQFrcFlSW7tQ=", "narHash": "sha256-9AwOFTRvhWFo7USgoFYfceiojZM62IXPpBs8CnSqc18=",
"owner": "stevearc", "owner": "stevearc",
"repo": "dressing.nvim", "repo": "dressing.nvim",
"rev": "0e88293ce3459f4bb310125f3366304af6dc7990", "rev": "18e5beb3845f085b6a33c24112b37988f3f93c06",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -356,11 +356,11 @@
"elixir-ls": { "elixir-ls": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705860624, "lastModified": 1711286188,
"narHash": "sha256-pd/ZkDpzlheEJfX7X6fFWY4Y5B5Y2EnJMBtuNHPuUJw=", "narHash": "sha256-OIB5f+FBOPsTWKGWyoU+/NQDMsJXBdj1v7UclbTP5ZY=",
"owner": "elixir-lsp", "owner": "elixir-lsp",
"repo": "elixir-ls", "repo": "elixir-ls",
"rev": "d10ce2cfe3acf475949e9a21984d18be579d7ec4", "rev": "3e71900e0d0891f9f95e35d9a52b16c6a773a259",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -372,11 +372,11 @@
"elixir-tools": { "elixir-tools": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1703976612, "lastModified": 1710172806,
"narHash": "sha256-6QdjqugY2kouDVzQa4bxFb9dp9vVantueO+6nnbnOwo=", "narHash": "sha256-pVDeS9oCFzA9t9J/JfYG/RfdMoSmaaERd5nUgL9KHyM=",
"owner": "elixir-tools", "owner": "elixir-tools",
"repo": "elixir-tools.nvim", "repo": "elixir-tools.nvim",
"rev": "163522196c962fa87cac0df2a0d1ad332e1e0755", "rev": "4d003f4b41ab9b4f8b569104fa7818f048ed4e25",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -388,11 +388,11 @@
"fidget-nvim": { "fidget-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1707329128, "lastModified": 1710942727,
"narHash": "sha256-mMLAhAbIs33RoU9c8COchbWRr2NM231zJn6TtwJmI+4=", "narHash": "sha256-8pBg8uQto5UzNBRhjFFMMmWLnmpYsG0L1mDa+FN8tpU=",
"owner": "j-hui", "owner": "j-hui",
"repo": "fidget.nvim", "repo": "fidget.nvim",
"rev": "ad8873c16faa123fe3f9fd6539c41dfb0f97a9e9", "rev": "933db4596e4bab1b09b6d48a10e21819e4cc458f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -422,11 +422,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1704982712, "lastModified": 1712014858,
"narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "07f6395285469419cf9d078f59b5b49993198c00", "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -440,11 +440,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1705309234, "lastModified": 1710146030,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -471,11 +471,11 @@
"flutter-tools": { "flutter-tools": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705943990, "lastModified": 1711622317,
"narHash": "sha256-g/cgFJ8kwBk1gNVaio+s1sa5KqpC/LMf06/6+MOPZk4=", "narHash": "sha256-TQRz2MHg6qnzZGUDVFUoaZJiTBwQ3Hjqvc8AAeVS93Y=",
"owner": "akinsho", "owner": "akinsho",
"repo": "flutter-tools.nvim", "repo": "flutter-tools.nvim",
"rev": "271eec9edb0f1a2bf30ad449ec3b4eeb2c88af05", "rev": "4f18033c3b78aa5450e538d81dfbbb3e67aeadec",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -503,11 +503,11 @@
"gitsigns-nvim": { "gitsigns-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706282483, "lastModified": 1712162672,
"narHash": "sha256-jVzZPD9RdM0Ie3nWuZgv+XVhwWzLJ2QODrIGRCENWjo=", "narHash": "sha256-uEHuKccCAYpLGVJovz2PY2Q7THA47z8TA5CHWexBv3E=",
"owner": "lewis6991", "owner": "lewis6991",
"repo": "gitsigns.nvim", "repo": "gitsigns.nvim",
"rev": "fb9fd5312476b51a42a98122616e1c448d823d5c", "rev": "b45ff86f5618d1421a88c12d4feb286b80a1e2d3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -535,11 +535,11 @@
"gruvbox": { "gruvbox": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1704132908, "lastModified": 1706538659,
"narHash": "sha256-p/y65ub1qL+5g0ZiWzaTyQeiP7LtVfsdcdJ0eb0A7Og=", "narHash": "sha256-jWnrRy/PT7D0UcPGL+XTbKHWvS0ixvbyqPtTzG9HY84=",
"owner": "ellisonleao", "owner": "ellisonleao",
"repo": "gruvbox.nvim", "repo": "gruvbox.nvim",
"rev": "4176b0b720db0c90ab4030e5c1b4893faf41fd51", "rev": "6e4027ae957cddf7b193adfaec4a8f9e03b4555f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -599,11 +599,11 @@
"image-nvim": { "image-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1707861531, "lastModified": 1711809713,
"narHash": "sha256-mh3J3lW2Co2uA7YJzSGum0ZmpJBP0ZzBWUvJLAI9bHw=", "narHash": "sha256-4xsyVDZOFidvLqwfWRB7BPMOejWk3/uhsnUsCNG/hpU=",
"owner": "3rd", "owner": "3rd",
"repo": "image.nvim", "repo": "image.nvim",
"rev": "4c6cb5ad93ee93d8d7b7c84e1eb291cee99f0a0e", "rev": "a0b756d589c1623ebbfe344666e6d7c49bdc9d71",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -615,11 +615,11 @@
"indent-blankline": { "indent-blankline": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705027513, "lastModified": 1710388427,
"narHash": "sha256-T0tbTyD9+J7OWcvfrPolrXbjGiXzEXhTtgC9Xj3ANFc=", "narHash": "sha256-Xp8ZQBz0in2MX3l0bnLUsSbH0lDPE+QvdmFpBFry5yY=",
"owner": "lukas-reineke", "owner": "lukas-reineke",
"repo": "indent-blankline.nvim", "repo": "indent-blankline.nvim",
"rev": "12e92044d313c54c438bd786d11684c88f6f78cd", "rev": "3d08501caef2329aba5121b753e903904088f7e6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -647,11 +647,11 @@
"leap-nvim": { "leap-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706284537, "lastModified": 1711935259,
"narHash": "sha256-kA6Lkfx7RHPUZjhxx4tc0gsAdhrfFvp6yY5qO+ZXUtM=", "narHash": "sha256-HcuNaKyf+rmhg3t4BQXiRlyeavwyhy16pfPn1Y1l09k=",
"owner": "ggandor", "owner": "ggandor",
"repo": "leap.nvim", "repo": "leap.nvim",
"rev": "14eda5bb233354933baa99b6d40bef3a40dbeaae", "rev": "7a9407d17fab3a1c3cfe201965d680a408776152",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -663,11 +663,11 @@
"lsp-lines": { "lsp-lines": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1698584731, "lastModified": 1709989705,
"narHash": "sha256-3DWM2mTnm6b7J4cYUwCKBGHkXw/dQDO0ZTJXkTl06aE=", "narHash": "sha256-opViLzbwtyUgDoaVKz4z6SN06N8jCQ0YmoqPIht8e64=",
"owner": "~whynothugo", "owner": "~whynothugo",
"repo": "lsp_lines.nvim", "repo": "lsp_lines.nvim",
"rev": "cf2306dd332e34a3e91075b40bdd4f6db824b2ee", "rev": "6f3defec73f7c87939e800e9afa5d0571b19b401",
"type": "sourcehut" "type": "sourcehut"
}, },
"original": { "original": {
@ -679,11 +679,11 @@
"lsp-signature": { "lsp-signature": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1701211782, "lastModified": 1710647656,
"narHash": "sha256-4GcTfu7MRpZUi5dqewaddSvaOezRl9ROKrR7wnnLnKE=", "narHash": "sha256-O7y7pcCvF0xUFamG+wMLe4mC6hUQ679rJV+ZUoWB0oY=",
"owner": "ray-x", "owner": "ray-x",
"repo": "lsp_signature.nvim", "repo": "lsp_signature.nvim",
"rev": "fed2c8389c148ff1dfdcdca63c2b48d08a50dea0", "rev": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -727,11 +727,11 @@
"lualine": { "lualine": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706181415, "lastModified": 1710998293,
"narHash": "sha256-LMMcRY4qnGywdK6Bl4YeAEKLhnRuOZ2txn4oYoso2gI=", "narHash": "sha256-+2fi58GolO3e0O7+kl+idNeFuTfJA1b5yCBdY2RnVjA=",
"owner": "hoob3rt", "owner": "hoob3rt",
"repo": "lualine.nvim", "repo": "lualine.nvim",
"rev": "7d131a8d3ba5016229e8a1d08bf8782acea98852", "rev": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -759,11 +759,11 @@
"minimap-vim": { "minimap-vim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1696276849, "lastModified": 1710689313,
"narHash": "sha256-bPW/wDCvItpl0VIQCgz5AEYfx1aAnIMhB1S/tJN5/80=", "narHash": "sha256-GR8VAHla5HWry1TAZQv0Xp7iG256vIGeQcBGMxyt310=",
"owner": "wfxr", "owner": "wfxr",
"repo": "minimap.vim", "repo": "minimap.vim",
"rev": "701f4cf4b60a3e1685d2da484282f3a3d8bf9db6", "rev": "395378137e6180762d5b963ca9ad5ac2db5d3283",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -812,11 +812,11 @@
"neocord": { "neocord": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1704948184, "lastModified": 1711651358,
"narHash": "sha256-HnaMKTNjMuDwHDvxHH5kd4ysa5WU+MlbdD9jH/iJcU8=", "narHash": "sha256-ZZF7ttn/6QIsaub1m0LV0ZirvNVXyFh+WDc39wi4UsM=",
"owner": "IogaMaster", "owner": "IogaMaster",
"repo": "neocord", "repo": "neocord",
"rev": "9b624d5189f699ab454e9515262c13965395b8dd", "rev": "6269823e78a2d2d8c3954068da196879cf2f0fe6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -828,11 +828,11 @@
"neodev-nvim": { "neodev-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706249139, "lastModified": 1711715247,
"narHash": "sha256-BRsZdc1TO88pCoehDv7ervBjaeOpcmSGm/RZAInhI9Q=", "narHash": "sha256-mAJOMVN7/xO7ykVNAeTeX+z2A/7yB8zdqlEKHL6Pb74=",
"owner": "folke", "owner": "folke",
"repo": "neodev.nvim", "repo": "neodev.nvim",
"rev": "64b2a51b02c6f2ae177c745e4d8bc801a339fe09", "rev": "ce9a2e8eaba5649b553529c5498acb43a6c317cd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -867,11 +867,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1708807242, "lastModified": 1711703276,
"narHash": "sha256-sRTRkhMD4delO/hPxxi+XwLqPn8BuUq6nnj4JqLwOu0=", "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "73de017ef2d18a04ac4bfd0c02650007ccb31c2a", "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -884,11 +884,11 @@
"nixpkgs-lib": { "nixpkgs-lib": {
"locked": { "locked": {
"dir": "lib", "dir": "lib",
"lastModified": 1703961334, "lastModified": 1711703276,
"narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -966,11 +966,11 @@
"noice-nvim": { "noice-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705952416, "lastModified": 1711471279,
"narHash": "sha256-lNCdwB0B5arbTEIHdDoQ19/vQ0UT89AQFwZM+RHqOTg=", "narHash": "sha256-y6gHNkWVsIuwBf7MblCTKTZSqjGDxqeFeQZWexzwk94=",
"owner": "folke", "owner": "folke",
"repo": "noice.nvim", "repo": "noice.nvim",
"rev": "bf67d70bd7265d075191e7812d8eb42b9791f737", "rev": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -982,27 +982,28 @@
"none-ls": { "none-ls": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706069423, "lastModified": 1708525772,
"narHash": "sha256-s+Hp0Yzge7FKKDez4DO8uytsNORIqeNWYOLSO7kSZbo=", "narHash": "sha256-VCDUKiy9C3Bu9suf2bI6XSis1+j01oFC3GFPyQxi74c=",
"owner": "nvimtools", "owner": "nvimtools",
"repo": "none-ls.nvim", "repo": "none-ls.nvim",
"rev": "a311c7cc8f17543143a7482cdbe3a384c371d56a", "rev": "bb680d752cec37949faca7a1f509e2fe67ab418a",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nvimtools", "owner": "nvimtools",
"repo": "none-ls.nvim", "repo": "none-ls.nvim",
"rev": "bb680d752cec37949faca7a1f509e2fe67ab418a",
"type": "github" "type": "github"
} }
}, },
"nui-nvim": { "nui-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1704411133, "lastModified": 1710740032,
"narHash": "sha256-SWG0IQDNXrgWK1ApQSpc2oPKNYgTPend877DQ6FuqUc=", "narHash": "sha256-Zr5CNx6BIM6naCXW8YBc/Oj1qOtWV/3tuMoaaZjoSZA=",
"owner": "MunifTanjim", "owner": "MunifTanjim",
"repo": "nui.nvim", "repo": "nui.nvim",
"rev": "35da9ca1de0fc4dda96c2e214d93d363c145f418", "rev": "cbd2668414331c10039278f558630ed19b93e69b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1014,11 +1015,11 @@
"nvim-autopairs": { "nvim-autopairs": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705959312, "lastModified": 1710930065,
"narHash": "sha256-4sZoZfg6ORbEwbvjIRnaDrKtVnoHpx7cAOcxn1Er6pg=", "narHash": "sha256-H4mJ43Eyo36noIqYZ0lyqM7WPwgIKqi96OjW5F3pfvU=",
"owner": "windwp", "owner": "windwp",
"repo": "nvim-autopairs", "repo": "nvim-autopairs",
"rev": "096d0baecc34f6c5d8a6dd25851e9d5ad338209b", "rev": "dbfc1c34bed415906395db8303c71039b3a3ffb4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1030,11 +1031,11 @@
"nvim-bufferline-lua": { "nvim-bufferline-lua": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706180994, "lastModified": 1709805539,
"narHash": "sha256-/iGzUDJaodkUyWpwim8UtwaRuarfu/Nk6wxVApk+QxY=", "narHash": "sha256-drvgwupiyRAoShL2enXEYUumkYJnG+QtIkBIVqVZK+U=",
"owner": "akinsho", "owner": "akinsho",
"repo": "nvim-bufferline.lua", "repo": "nvim-bufferline.lua",
"rev": "d6cb9b7cac52887bcac65f8698e67479553c0748", "rev": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1046,11 +1047,11 @@
"nvim-cmp": { "nvim-cmp": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1702541213, "lastModified": 1712041554,
"narHash": "sha256-BtAYRYn6m788zAq/mNnbAzAxp1TGf9QkRE0hSOp9sdc=", "narHash": "sha256-DBxQTmwuEGj2g7LP7d1PJk/SyO0iJq2CIIHsFh0QJ4I=",
"owner": "hrsh7th", "owner": "hrsh7th",
"repo": "nvim-cmp", "repo": "nvim-cmp",
"rev": "538e37ba87284942c1d76ed38dd497e54e65b891", "rev": "ce16de5665c766f39c271705b17fff06f7bcb84f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1126,11 +1127,11 @@
"nvim-dap": { "nvim-dap": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705151920, "lastModified": 1711382674,
"narHash": "sha256-9Rc4dxbgN1LxoXPXHTi+V92MA0fEn5PveqCSMHbgn98=", "narHash": "sha256-HoLnYeA18TpHM1SJ3NOY53ZAyBo2y2EoUbAIr7TqtQI=",
"owner": "mfussenegger", "owner": "mfussenegger",
"repo": "nvim-dap", "repo": "nvim-dap",
"rev": "9adbfdca13afbe646d09a8d7a86d5d031fb9c5a5", "rev": "405df1dcc2e395ab5173a9c3d00e03942c023074",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1142,11 +1143,11 @@
"nvim-dap-ui": { "nvim-dap-ui": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705942789, "lastModified": 1710867604,
"narHash": "sha256-4tYSdxPj+/hxd8KNzCU6Lvf+ACxpKgYyGOlF+Jwzxa8=", "narHash": "sha256-KAwCt8E3lC0fzXQ9GpPsdb9wdWC6G2P4C/YFQFY9AAM=",
"owner": "rcarriga", "owner": "rcarriga",
"repo": "nvim-dap-ui", "repo": "nvim-dap-ui",
"rev": "d845ebd798ad1cf30aa4abd4c4eff795cdcfdd4f", "rev": "edfa93f60b189e5952c016eee262d0685d838450",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1190,11 +1191,11 @@
"nvim-lspconfig": { "nvim-lspconfig": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705757419, "lastModified": 1712139869,
"narHash": "sha256-StYsN9C2rV471JkncUR1PFeXs0S15ZGTF1DigSbwOHI=", "narHash": "sha256-DMhB4L/0FjYbhNx7SwFnyFVa4PLVLlwB4uiNbiKUmEo=",
"owner": "neovim", "owner": "neovim",
"repo": "nvim-lspconfig", "repo": "nvim-lspconfig",
"rev": "8917d2c830e04bf944a699b8c41f097621283828", "rev": "96e5711040df23583591391ce49e556b8cd248d8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1206,11 +1207,11 @@
"nvim-navbuddy": { "nvim-navbuddy": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1694669446, "lastModified": 1711239174,
"narHash": "sha256-zy1Tq8M5UITNAwtAlFYaUFlHnIZ5LWD9ZLaZcy7ulQ8=", "narHash": "sha256-EZXzFjGsZHkb2Ui5uvOottPHA8X15F6xyikab4dBlYk=",
"owner": "SmiteshP", "owner": "SmiteshP",
"repo": "nvim-navbuddy", "repo": "nvim-navbuddy",
"rev": "f137a3466a6cd1965cdcc5398daff54e66eebbe5", "rev": "f34237e8a41ebc6e2716af2ebf49854d8c5289c8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1251,14 +1252,30 @@
"type": "github" "type": "github"
} }
}, },
"nvim-nio": {
"flake": false,
"locked": {
"lastModified": 1712067294,
"narHash": "sha256-bjYtZygrL05qB2dM7Q8lJor81VYO+u8/JWQqfZ19Wzk=",
"owner": "nvim-neotest",
"repo": "nvim-nio",
"rev": "173f285eebb410199273fa178aa517fd2d7edd80",
"type": "github"
},
"original": {
"owner": "nvim-neotest",
"repo": "nvim-nio",
"type": "github"
}
},
"nvim-notify": { "nvim-notify": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705342184, "lastModified": 1708161547,
"narHash": "sha256-WhC80NnWXEAYHLORpUPIXb2s1ERJxyK3l2L9oke68mo=", "narHash": "sha256-xJYPOX4YLcWojMCdP1RO22/7FMrbcBQxqxrcVCE2TrU=",
"owner": "rcarriga", "owner": "rcarriga",
"repo": "nvim-notify", "repo": "nvim-notify",
"rev": "80b67b265530632505193553d05127ae7fe09ddd", "rev": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1270,11 +1287,11 @@
"nvim-session-manager": { "nvim-session-manager": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705767424, "lastModified": 1708284146,
"narHash": "sha256-BTVhCevq40A7yOYp2fLg6N9A+yarIWJM83Z2bfvlQuU=", "narHash": "sha256-+TDWY8mprJfUp9ZFKbz83to7XW8iiovja22jHms+N1A=",
"owner": "Shatur", "owner": "Shatur",
"repo": "neovim-session-manager", "repo": "neovim-session-manager",
"rev": "b8a22f2c88429a11272117a901db66055abf3e7f", "rev": "d8e1ba3bbcf3fdc6a887bcfbd94c48ae4707b457",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1286,11 +1303,11 @@
"nvim-surround": { "nvim-surround": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705526094, "lastModified": 1709063002,
"narHash": "sha256-CGAQtBxhiP6AUQzwdra5AOpsNu+oeLO2hCJnmL61jgE=", "narHash": "sha256-uInXJq+TrfKM9WfOlUAYxbDad9mwf7DK5lETyTu+ShM=",
"owner": "kylechui", "owner": "kylechui",
"repo": "nvim-surround", "repo": "nvim-surround",
"rev": "0c02c52182a9c2a7fa7e122b4037f6408e98434a", "rev": "84a26afce16cffa7e3322cfa80a42cddf60616eb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1302,11 +1319,11 @@
"nvim-tree-lua": { "nvim-tree-lua": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705818283, "lastModified": 1711866287,
"narHash": "sha256-EKAzWIT2Qs65Il1pwgpkFsCogFViapUiSHcZgVy+QsY=", "narHash": "sha256-AMbUthY+49wREBr7EQSZ/tH8hT4gixPfcPT+ZzssUKw=",
"owner": "nvim-tree", "owner": "nvim-tree",
"repo": "nvim-tree.lua", "repo": "nvim-tree.lua",
"rev": "7bdb220d0fe604a77361e92cdbc7af1b8a412126", "rev": "d8d3a1590a05b2d8b5eb26e2ed1c6052b1b47a77",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1318,11 +1335,11 @@
"nvim-treesitter-context": { "nvim-treesitter-context": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706217055, "lastModified": 1711099836,
"narHash": "sha256-QhmTXikUIye+xxLw52ttRJz9T0bfhn/ks5VSQd8tDo0=", "narHash": "sha256-iDBFUMUjGJXzEioZ4cTydDYHRR30GF6z9W0M7IZUasc=",
"owner": "nvim-treesitter", "owner": "nvim-treesitter",
"repo": "nvim-treesitter-context", "repo": "nvim-treesitter-context",
"rev": "9c06b115abc57c99cf0aa81dc29490f5001f57a1", "rev": "f19766163c18515fb4d3c12d572bf9cba6cdb990",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1334,11 +1351,11 @@
"nvim-ts-autotag": { "nvim-ts-autotag": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706174398, "lastModified": 1707265789,
"narHash": "sha256-C3FOh11eF5Blzh6vsFSA6AB7opXl5Gocdti1QhFZ2vM=", "narHash": "sha256-cPIEIjcYxX3ZkOyou2mYlHMdhBxCoVTpJVXZtiWe9Ks=",
"owner": "windwp", "owner": "windwp",
"repo": "nvim-ts-autotag", "repo": "nvim-ts-autotag",
"rev": "a65b202cfd08e0e69e531eab737205ff5bc082a4", "rev": "531f48334c422222aebc888fd36e7d109cb354cd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1350,11 +1367,11 @@
"nvim-web-devicons": { "nvim-web-devicons": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706072160, "lastModified": 1711417099,
"narHash": "sha256-w038PU9i1onEBo3x4bo1kDz9Fo46Whd8ZJhyIqxz3I8=", "narHash": "sha256-G8URFQdABLf3ptj+9kwSFGXly9D+4lkt3SXfbhVDH6g=",
"owner": "nvim-tree", "owner": "nvim-tree",
"repo": "nvim-web-devicons", "repo": "nvim-web-devicons",
"rev": "b427ac5f9dff494f839e81441fb3f04a58cbcfbc", "rev": "3ee60deaa539360518eaab93a6c701fe9f4d82ef",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1366,11 +1383,11 @@
"obsidian-nvim": { "obsidian-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706230460, "lastModified": 1711994732,
"narHash": "sha256-jl03+C9/L081eza6XwK05GiGZI0U82wqQBMwTjtedv8=", "narHash": "sha256-RD5EhYv2AZvCywxQYKkPjZPY/jEjl2rEofMVCHO6SJQ=",
"owner": "epwalsh", "owner": "epwalsh",
"repo": "obsidian.nvim", "repo": "obsidian.nvim",
"rev": "194f9fc798ac0f73dbac2e83fc3d5c99b8f70e78", "rev": "d70f3289399c25153b7f503b838afbf981124a37",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1382,11 +1399,11 @@
"onedark": { "onedark": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705931596, "lastModified": 1706527208,
"narHash": "sha256-jjvZ2z93xd1Yng8g6+cdsXhLkm2lC7DSUHiFYC+Gg5k=", "narHash": "sha256-1+aO8vrUGEe/NIVI1C1xJyuQVPQZ1s510lopkEVP7No=",
"owner": "navarasu", "owner": "navarasu",
"repo": "onedark.nvim", "repo": "onedark.nvim",
"rev": "14e5de43cf1ff761c280d1ff5b9980897f5b46c7", "rev": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1398,11 +1415,11 @@
"orgmode-nvim": { "orgmode-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706216082, "lastModified": 1712161945,
"narHash": "sha256-M9AI3LlJvs6ZqQPeYr+rqRFu4gYVZbLFV3PUuZ77ReE=", "narHash": "sha256-44dTemgSevEdiluUanGLySo7WbvKrXW+n2dUwUO4cqY=",
"owner": "nvim-orgmode", "owner": "nvim-orgmode",
"repo": "orgmode", "repo": "orgmode",
"rev": "ab045e3084d5987e8939d25d69b09baaf762278c", "rev": "ddcfbb1e52b2ff5b90469eb13214676931a66e09",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1431,11 +1448,11 @@
"plenary-nvim": { "plenary-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705841956, "lastModified": 1711369325,
"narHash": "sha256-awRAI1ov9OBt6VuNxk/qjPTSPBYsMJzURKVV+IA7kok=", "narHash": "sha256-wM/FuK24NPEyaWntwT+mi2SuPExC/abXDK9c2WvgUBk=",
"owner": "nvim-lua", "owner": "nvim-lua",
"repo": "plenary.nvim", "repo": "plenary.nvim",
"rev": "663246936325062427597964d81d30eaa42ab1e4", "rev": "8aad4396840be7fc42896e3011751b7609ca4119",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1567,6 +1584,7 @@
"nvim-navbuddy": "nvim-navbuddy", "nvim-navbuddy": "nvim-navbuddy",
"nvim-navic": "nvim-navic", "nvim-navic": "nvim-navic",
"nvim-neoclip": "nvim-neoclip", "nvim-neoclip": "nvim-neoclip",
"nvim-nio": "nvim-nio",
"nvim-notify": "nvim-notify", "nvim-notify": "nvim-notify",
"nvim-session-manager": "nvim-session-manager", "nvim-session-manager": "nvim-session-manager",
"nvim-surround": "nvim-surround", "nvim-surround": "nvim-surround",
@ -1608,11 +1626,11 @@
"rose-pine": { "rose-pine": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1707703907, "lastModified": 1711769966,
"narHash": "sha256-jmDGDlCurGAG85SglAwmQr943kVr8KUr11zpPejQliQ=", "narHash": "sha256-GVYCkyFdVgye/8pEXPT8Y+4YyLmivgX/IHht/G1DdEA=",
"owner": "rose-pine", "owner": "rose-pine",
"repo": "neovim", "repo": "neovim",
"rev": "f01ce3a71748a92997d266cfe2c985decd18c601", "rev": "19055dfe90bfa46a1e5b0a706d13980bdffa2dee",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1681,11 +1699,11 @@
"smartcolumn": { "smartcolumn": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1703592909, "lastModified": 1710067624,
"narHash": "sha256-c5tENO4LJaSRELxuCOp/aI94ifhKjqd8J2chJbxfFdc=", "narHash": "sha256-DHIeDNUF9n9s14GVeojIwc5QUPwJMYYl3gRvhvO/rdE=",
"owner": "m4xshen", "owner": "m4xshen",
"repo": "smartcolumn.nvim", "repo": "smartcolumn.nvim",
"rev": "a52915d6d9abf9972e249ebcffcc651cf9b062dd", "rev": "cefb17be095ad5526030a21bb2a80553cae09127",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1791,11 +1809,11 @@
"telescope": { "telescope": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706154992, "lastModified": 1712065014,
"narHash": "sha256-uagWtwd/L07RRUpSu+kVv0qD+neySSmSrIeFBJ0gZiM=", "narHash": "sha256-8Bp1E9JY1MByjRCcON1HJLYRswLx63lmz20rGrJW7Wc=",
"owner": "nvim-telescope", "owner": "nvim-telescope",
"repo": "telescope.nvim", "repo": "telescope.nvim",
"rev": "1bfbb1fb5c56d2dbe33216fcb2ebe82e499aa06c", "rev": "4626aaa2bcfdacf55fd6d44b430e2df81b2403ff",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1848,11 +1866,11 @@
"todo-comments": { "todo-comments": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705847650, "lastModified": 1711553769,
"narHash": "sha256-DiyieXXx7iYGWkpeOvduJf0n7dnpaQ7rXmaWvZQaCyE=", "narHash": "sha256-BJNU01iTRDNrPv48fgiJRS+ouaHkoqw2AYXKDRgDzfw=",
"owner": "folke", "owner": "folke",
"repo": "todo-comments.nvim", "repo": "todo-comments.nvim",
"rev": "833d8dd8b07eeda37a09e99460f72a02616935cb", "rev": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1864,11 +1882,11 @@
"toggleterm-nvim": { "toggleterm-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1705944058, "lastModified": 1707733615,
"narHash": "sha256-y+83w0D2jD68QJpBCYXLqUUxVu9MTBZ+nJutYD7jAoQ=", "narHash": "sha256-FJyDxQm2vs9R4WkqAbh6ryCvEABfrLSKRrAGo/qI5jM=",
"owner": "akinsho", "owner": "akinsho",
"repo": "toggleterm.nvim", "repo": "toggleterm.nvim",
"rev": "b49df5cdce67a8964d1b027dae94bde212092b51", "rev": "193786e0371e3286d3bc9aa0079da1cd41beaa62",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1880,11 +1898,11 @@
"tokyonight": { "tokyonight": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706078362, "lastModified": 1711665767,
"narHash": "sha256-qHuX21iC8edV5K0RgHin4PowMtKBXWXQgvHjx2SPTKE=", "narHash": "sha256-ItCmSUMMTe8iQeneIJLuWedVXsNgm+FXNtdrrdJ/1oE=",
"owner": "folke", "owner": "folke",
"repo": "tokyonight.nvim", "repo": "tokyonight.nvim",
"rev": "e3301873c1e96903daebb98cc9b5926810bf73dd", "rev": "9bf9ec53d5e87b025e2404069b71e7ebdc3a13e5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1896,11 +1914,11 @@
"trouble": { "trouble": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1697626811, "lastModified": 1711693365,
"narHash": "sha256-8nLghiueYOtWY7OGVxow9A2G/5lgt+Kt5D8q1xeJvVg=", "narHash": "sha256-kIQ72fqAsiMF9jq0MzC6peaHJddYn5PRNXfYFHTQB5Q=",
"owner": "folke", "owner": "folke",
"repo": "trouble.nvim", "repo": "trouble.nvim",
"rev": "f1168feada93c0154ede4d1fe9183bf69bac54ea", "rev": "b9cf677f20bb2faa2dacfa870b084e568dca9572",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1945,11 +1963,11 @@
"vim-dirtytalk": { "vim-dirtytalk": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1697142601, "lastModified": 1711553630,
"narHash": "sha256-ezbcgCvOXhPSpsOZpCI2QIaFFaRGZAFbuAluMvB7Jjk=", "narHash": "sha256-1cLseaHfWgyAvzHcK93nl9sy66J/zvlnK7P4vnIthmY=",
"owner": "psliwka", "owner": "psliwka",
"repo": "vim-dirtytalk", "repo": "vim-dirtytalk",
"rev": "f5b0d51a7d822177814e7edc116ca484f852665f", "rev": "d2929ffff8639b2b4b4bb7c2b6c04575c1322d2f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1961,11 +1979,11 @@
"vim-illuminate": { "vim-illuminate": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706241276, "lastModified": 1707016059,
"narHash": "sha256-8stuFv+PzjmFKib1Y7kwK4C1db5dlDyptuaz9iU+ptM=", "narHash": "sha256-KNIu4cNyZddZSRS8KZ0U0T8uSSLJu8iqNLQN8e+Bv94=",
"owner": "RRethy", "owner": "RRethy",
"repo": "vim-illuminate", "repo": "vim-illuminate",
"rev": "97c1265ff0b67064b6cfdc15bafc50202a537ae2", "rev": "305bf07b919ac526deb5193280379e2f8b599926",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1977,11 +1995,11 @@
"vim-markdown": { "vim-markdown": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1698870120, "lastModified": 1709279705,
"narHash": "sha256-d3GDuMlnhweAajSc284wWN/h0teu5uFG6NQTWa+dcxo=", "narHash": "sha256-eKwWdyvMZ7FV3FvOtqWVD7pulXNnhbEEjHq7MYg1woU=",
"owner": "preservim", "owner": "preservim",
"repo": "vim-markdown", "repo": "vim-markdown",
"rev": "46add6c3017d3e4035dc10ffa9cb54221d8dfe1a", "rev": "a657e697376909c41475a686eeef7fc7a4972d94",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -2094,11 +2112,11 @@
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
"lastModified": 1706288111, "lastModified": 1712017348,
"narHash": "sha256-CvSS/BMm86Uzjeb8pEkWa3qnuzMiPPmT8hf5lDOP6TE=", "narHash": "sha256-At+mk7gHMk2kbisQhkts8cYkz7XhIRei9+zT3wP8bT8=",
"owner": "mitchellh", "owner": "mitchellh",
"repo": "zig-overlay", "repo": "zig-overlay",
"rev": "7f5d4cbecf3aa75ac8afaef8a20723b3a57f7d20", "rev": "63bdd97bf1c93a1da1c658ec9ab974fef52a7280",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -46,7 +46,7 @@
default = self'.devShells.lsp; default = self'.devShells.lsp;
nvim-nix = pkgs.mkShell {nativeBuildInputs = [config.packages.nix];}; nvim-nix = pkgs.mkShell {nativeBuildInputs = [config.packages.nix];};
lsp = pkgs.mkShell { lsp = pkgs.mkShell {
nativeBuildInputs = with pkgs; [nil statix deadnix]; nativeBuildInputs = with pkgs; [nil statix deadnix alejandra];
}; };
}; };
}; };
@ -117,7 +117,8 @@
}; };
none-ls = { none-ls = {
url = "github:nvimtools/none-ls.nvim"; # https://github.com/nvimtools/none-ls.nvim/issues/58
url = "github:nvimtools/none-ls.nvim/bb680d752cec37949faca7a1f509e2fe67ab418a";
flake = false; flake = false;
}; };
@ -589,5 +590,11 @@
url = "github:tpope/vim-repeat"; url = "github:tpope/vim-repeat";
flake = false; flake = false;
}; };
nvim-nio = {
# (required nvim-dap-ui)
url = "github:nvim-neotest/nvim-nio";
flake = false;
};
}; };
} }

View file

@ -1,6 +1,6 @@
{lib}: let {lib}: let
inherit (lib.options) mkOption; inherit (lib.options) mkOption;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf mkDefault;
inherit (lib.types) nullOr str; inherit (lib.types) nullOr str;
inherit (lib.attrsets) isAttrs mapAttrs; inherit (lib.attrsets) isAttrs mapAttrs;
@ -65,6 +65,8 @@
mkSetLuaBinding = binding: action: mkSetLuaBinding = binding: action:
mkLuaBinding binding.value action binding.description; mkLuaBinding binding.value action binding.description;
pushDownDefault = attr: mapAttrs (_name: value: mkDefault value) attr;
}; };
in in
binds binds

View file

@ -8,13 +8,16 @@
# - the addition of the function `entryBefore` indicating a "wanted # - the addition of the function `entryBefore` indicating a "wanted
# by" relationship. # by" relationship.
{lib}: let {lib}: let
inherit (lib) all filterAttrs nvim mapAttrs toposort; inherit (builtins) isAttrs attrValues attrNames elem all;
inherit (lib.attrsets) filterAttrs mapAttrs;
inherit (lib.lists) toposort;
inherit (lib.nvim.dag) isEntry entryBetween;
in { in {
empty = {}; empty = {};
isEntry = e: e ? data && e ? after && e ? before; isEntry = e: e ? data && e ? after && e ? before;
isDag = dag: isDag = dag:
builtins.isAttrs dag && all nvim.dag.isEntry (builtins.attrValues dag); isAttrs dag && all isEntry (attrValues dag);
/* /*
Takes an attribute set containing entries built by entryAnywhere, Takes an attribute set containing entries built by entryAnywhere,
@ -76,8 +79,8 @@ in {
*/ */
topoSort = dag: let topoSort = dag: let
dagBefore = dag: name: dagBefore = dag: name:
builtins.attrNames attrNames
(filterAttrs (_n: v: builtins.elem name v.before) dag); (filterAttrs (_n: v: elem name v.before) dag);
normalizedDag = normalizedDag =
mapAttrs (n: v: { mapAttrs (n: v: {
name = n; name = n;
@ -85,8 +88,8 @@ in {
after = v.after ++ dagBefore dag n; after = v.after ++ dagBefore dag n;
}) })
dag; dag;
before = a: b: builtins.elem a.name b.after; before = a: b: elem a.name b.after;
sorted = toposort before (builtins.attrValues normalizedDag); sorted = toposort before (attrValues normalizedDag);
in in
if sorted ? result if sorted ? result
then { then {
@ -100,8 +103,8 @@ in {
entryBetween = before: after: data: {inherit data before after;}; entryBetween = before: after: data: {inherit data before after;};
# Create a DAG entry with no particular dependency information. # Create a DAG entry with no particular dependency information.
entryAnywhere = nvim.dag.entryBetween [] []; entryAnywhere = entryBetween [] [];
entryAfter = nvim.dag.entryBetween []; entryAfter = entryBetween [];
entryBefore = before: nvim.dag.entryBetween before []; entryBefore = before: entryBetween before [];
} }

View file

@ -1,32 +1,37 @@
# From home-manager: https://github.com/nix-community/home-manager/blob/master/modules/lib/booleans.nix # From home-manager: https://github.com/nix-community/home-manager/blob/master/modules/lib/booleans.nix
{lib}: { {lib}: let
inherit (builtins) isString getAttr;
inherit (lib.options) mkOption;
inherit (lib.attrsets) listToAttrs;
inherit (lib.types) bool;
in {
# Converts a boolean to a yes/no string. This is used in lots of # Converts a boolean to a yes/no string. This is used in lots of
# configuration formats. # configuration formats.
diagnosticsToLua = { diagnosticsToLua = {
lang, lang,
config, config,
diagnostics, diagnosticsProviders,
}: }:
lib.listToAttrs listToAttrs
(map (v: let (map (v: let
type = type =
if builtins.isString v if isString v
then v then v
else builtins.getAttr v.type; else getAttr v.type;
package = package =
if builtins.isString v if isString v
then diagnostics.${type}.package then diagnosticsProviders.${type}.package
else v.package; else v.package;
in { in {
name = "${lang}-diagnostics-${type}"; name = "${lang}-diagnostics-${type}";
value = diagnostics.${type}.nullConfig package; value = diagnosticsProviders.${type}.nullConfig package;
}) })
config); config);
mkEnable = desc: mkEnable = desc:
lib.mkOption { mkOption {
description = "Turn on ${desc} for enabled languages by default"; description = "Turn on ${desc} for enabled languages by default";
type = lib.types.bool; type = bool;
default = false; default = false;
}; };
} }

View file

@ -1,7 +1,9 @@
# Helpers for converting values to lua # Helpers for converting values to lua
{lib}: let {lib}: let
inherit (lib) mapAttrsToList filterAttrs concatStringsSep concatMapStringsSep stringToCharacters boolToString; inherit (builtins) hasAttr head throw typeOf isList isAttrs isBool isInt isString isPath isFloat toJSON;
inherit (builtins) hasAttr head throw typeOf; inherit (lib.attrsets) mapAttrsToList filterAttrs;
inherit (lib.strings) concatStringsSep concatMapStringsSep stringToCharacters;
inherit (lib.trivial) boolToString;
in rec { in rec {
# Convert a null value to lua's nil # Convert a null value to lua's nil
nullString = value: nullString = value:
@ -11,29 +13,29 @@ in rec {
# convert an expression to lua # convert an expression to lua
expToLua = exp: expToLua = exp:
if builtins.isList exp if isList exp
then listToLuaTable exp # if list, convert to lua table then listToLuaTable exp # if list, convert to lua table
else if builtins.isAttrs exp else if isAttrs exp
then attrsetToLuaTable exp # if attrs, convert to table then attrsetToLuaTable exp # if attrs, convert to table
else if builtins.isBool exp else if isBool exp
then lib.boolToString exp # if bool, convert to string then boolToString exp # if bool, convert to string
else if builtins.isInt exp else if isInt exp
then builtins.toString exp # if int, convert to string then toString exp # if int, convert to string
else if exp == null else if exp == null
then "nil" then "nil"
else (builtins.toJSON exp); # otherwise jsonify the value and print as is else (toJSON exp); # otherwise jsonify the value and print as is
# convert list to a lua table # convert list to a lua table
listToLuaTable = list: listToLuaTable = list:
"{ " + (builtins.concatStringsSep ", " (map expToLua list)) + " }"; "{ " + (concatStringsSep ", " (map expToLua list)) + " }";
# convert attrset to a lua table # convert attrset to a lua table
attrsetToLuaTable = attrset: attrsetToLuaTable = attrset:
"{ " "{ "
+ ( + (
builtins.concatStringsSep ", " concatStringsSep ", "
( (
lib.mapAttrsToList ( mapAttrsToList (
name: value: name: value:
name name
+ " = " + " = "
@ -44,10 +46,10 @@ 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 # 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: ''{${builtins.concatStringsSep "," items}}''; luaTable = items: ''{${concatStringsSep "," items}}'';
toLuaObject = args: toLuaObject = args:
if builtins.isAttrs args if isAttrs args
then then
if hasAttr "__raw" args if hasAttr "__raw" args
then args.__raw then args.__raw
@ -68,19 +70,19 @@ in rec {
) )
args))) args)))
+ "}" + "}"
else if builtins.isList args else if isList args
then "{" + concatMapStringsSep "," toLuaObject args + "}" then "{" + concatMapStringsSep "," toLuaObject args + "}"
else if builtins.isString args else if isString args
then then
# This should be enough! # This should be enough!
builtins.toJSON args toJSON args
else if builtins.isPath args else if isPath args
then builtins.toJSON (toString args) then toJSON (toString args)
else if builtins.isBool args else if isBool args
then "${boolToString args}" then "${boolToString args}"
else if builtins.isFloat args else if isFloat args
then "${toString args}" then "${toString args}"
else if builtins.isInt args else if isInt args
then "${toString args}" then "${toString args}"
else if (args == null) else if (args == null)
then "nil" then "nil"

View file

@ -15,13 +15,13 @@ with lib; let
in { in {
diagnostics = { diagnostics = {
langDesc, langDesc,
diagnostics, diagnosticsProviders,
defaultDiagnostics, defaultDiagnosticsProvider,
}: }:
mkOption { mkOption {
description = "List of ${langDesc} diagnostics to enable"; description = "List of ${langDesc} diagnostics to enable";
type = with types; listOf (either (enum (attrNames diagnostics)) (submodule diagnosticSubmodule)); type = with types; listOf (either (enum (attrNames diagnosticsProviders)) (submodule diagnosticSubmodule));
default = defaultDiagnostics; default = defaultDiagnosticsProvider;
}; };
mkGrammarOption = pkgs: grammar: mkGrammarOption = pkgs: grammar:

View file

@ -99,6 +99,7 @@ with lib; let
"highlight-undo" "highlight-undo"
"nvim-docs-view" "nvim-docs-view"
"image-nvim" "image-nvim"
"nvim-nio"
]; ];
# You can either use the name of the plugin or a package. # You can either use the name of the plugin or a package.
pluginType = with types; pluginType = with types;

View file

@ -1,5 +1,5 @@
let let
inherit (builtins) isInt isBool toJSON; inherit (builtins) isInt isBool toJSON toString;
in rec { in rec {
# yes? no. # yes? no.
yesNo = value: yesNo = value:
@ -16,7 +16,7 @@ in rec {
# convert a literal value to a vim compliant value # convert a literal value to a vim compliant value
valToVim = val: valToVim = val:
if (isInt val) if (isInt val)
then (builtins.toString val) then (toString val)
else else
( (
if (isBool val) if (isBool val)

View file

@ -4,12 +4,15 @@
... ...
}: let }: let
inherit (builtins) concatStringsSep; inherit (builtins) concatStringsSep;
inherit (lib) optionalString mkIf nvim; inherit (lib.modules) mkIf;
inherit (lib.lists) optionals;
inherit (lib.strings) optionalString;
inherit (lib.nvim.dag) entryAfter;
cfg = config.vim; cfg = config.vim;
in { in {
config = { config = {
vim.startPlugins = ["plenary-nvim"] ++ lib.optionals (cfg.spellChecking.enableProgrammingWordList) ["vim-dirtytalk"]; vim.startPlugins = ["plenary-nvim"] ++ optionals (cfg.spellChecking.enableProgrammingWordList) ["vim-dirtytalk"];
vim.maps.normal = vim.maps.normal =
mkIf cfg.disableArrows { mkIf cfg.disableArrows {
@ -57,7 +60,7 @@ in {
}; };
}; };
vim.configRC.basic = nvim.dag.entryAfter ["globalsScript"] '' vim.configRC.basic = entryAfter ["globalsScript"] ''
" Settings that are set for everything " Settings that are set for everything
set encoding=utf-8 set encoding=utf-8
set mouse=${cfg.mouseSupport} set mouse=${cfg.mouseSupport}

View file

@ -3,12 +3,12 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkEnableOption mkOption; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) types; inherit (lib.types) package path str bool int listOf enum nullOr;
in { in {
options.vim = { options.vim = {
package = mkOption { package = mkOption {
type = types.package; type = package;
default = pkgs.neovim-unwrapped; default = pkgs.neovim-unwrapped;
description = '' description = ''
The neovim package to use. You will need to use an unwrapped package for this option to work as intended. The neovim package to use. You will need to use an unwrapped package for this option to work as intended.
@ -18,13 +18,13 @@ in {
debugMode = { debugMode = {
enable = mkEnableOption "debug mode"; enable = mkEnableOption "debug mode";
level = mkOption { level = mkOption {
type = types.int; type = int;
default = 20; default = 20;
description = "Set the debug level"; description = "Set the debug level";
}; };
logFile = mkOption { logFile = mkOption {
type = types.path; type = path;
default = "/tmp/nvim.log"; default = "/tmp/nvim.log";
description = "Set the log file"; description = "Set the log file";
}; };
@ -33,7 +33,7 @@ in {
enableLuaLoader = mkEnableOption "experimental Lua module loader to speed up the start up process"; enableLuaLoader = mkEnableOption "experimental Lua module loader to speed up the start up process";
leaderKey = mkOption { leaderKey = mkOption {
type = with types; nullOr str; type = nullOr str;
default = null; default = null;
description = "The leader key to be used internally"; description = "The leader key to be used internally";
}; };
@ -42,7 +42,7 @@ in {
enable = mkEnableOption "neovim's built-in spellchecking"; enable = mkEnableOption "neovim's built-in spellchecking";
enableProgrammingWordList = mkEnableOption "vim-dirtytalk, a wordlist for programmers, that includes programming words"; enableProgrammingWordList = mkEnableOption "vim-dirtytalk, a wordlist for programmers, that includes programming words";
languages = mkOption { languages = mkOption {
type = with types; listOf str; type = listOf str;
description = "The languages to be used for spellchecking"; description = "The languages to be used for spellchecking";
default = ["en"]; default = ["en"];
example = ["en" "de"]; example = ["en" "de"];
@ -50,55 +50,55 @@ in {
}; };
colourTerm = mkOption { colourTerm = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "Set terminal up for 256 colours"; description = "Set terminal up for 256 colours";
}; };
disableArrows = mkOption { disableArrows = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = "Set to prevent arrow keys from moving cursor"; description = "Set to prevent arrow keys from moving cursor";
}; };
hideSearchHighlight = mkOption { hideSearchHighlight = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = "Hide search highlight so it doesn't stay highlighted"; description = "Hide search highlight so it doesn't stay highlighted";
}; };
scrollOffset = mkOption { scrollOffset = mkOption {
type = types.int; type = int;
default = 8; default = 8;
description = "Start scrolling this number of lines from the top or bottom of the page."; description = "Start scrolling this number of lines from the top or bottom of the page.";
}; };
wordWrap = mkOption { wordWrap = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "Enable word wrapping."; description = "Enable word wrapping.";
}; };
syntaxHighlighting = mkOption { syntaxHighlighting = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "Enable syntax highlighting"; description = "Enable syntax highlighting";
}; };
mapLeaderSpace = mkOption { mapLeaderSpace = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "Map the space key to leader key"; description = "Map the space key to leader key";
}; };
useSystemClipboard = mkOption { useSystemClipboard = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = "Make use of the clipboard for default yank and paste operations. Don't use * and +"; description = "Make use of the clipboard for default yank and paste operations. Don't use * and +";
}; };
mouseSupport = mkOption { mouseSupport = mkOption {
type = with types; enum ["a" "n" "v" "i" "c"]; type = enum ["a" "n" "v" "i" "c"];
default = "a"; default = "a";
description = '' description = ''
Set modes for mouse support. Set modes for mouse support.
@ -112,7 +112,7 @@ in {
}; };
lineNumberMode = mkOption { lineNumberMode = mkOption {
type = with types; enum ["relative" "number" "relNumber" "none"]; type = enum ["relative" "number" "relNumber" "none"];
default = "relNumber"; default = "relNumber";
description = '' description = ''
How line numbers are displayed. Available options are How line numbers are displayed. Available options are
@ -121,78 +121,78 @@ in {
}; };
preventJunkFiles = mkOption { preventJunkFiles = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = "Prevent swapfile, backupfile from being created"; description = "Prevent swapfile, backupfile from being created";
}; };
tabWidth = mkOption { tabWidth = mkOption {
type = types.int; type = int;
default = 4; default = 4;
description = "Set the width of tabs"; description = "Set the width of tabs";
}; };
autoIndent = mkOption { autoIndent = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "Enable auto indent"; description = "Enable auto indent";
}; };
cmdHeight = mkOption { cmdHeight = mkOption {
type = types.int; type = int;
default = 1; default = 1;
description = "Height of the command pane"; description = "Height of the command pane";
}; };
updateTime = mkOption { updateTime = mkOption {
type = types.int; type = int;
default = 300; default = 300;
description = "The number of milliseconds till Cursor Hold event is fired"; description = "The number of milliseconds till Cursor Hold event is fired";
}; };
showSignColumn = mkOption { showSignColumn = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "Show the sign column"; description = "Show the sign column";
}; };
bell = mkOption { bell = mkOption {
type = types.enum ["none" "visual" "on"]; type = enum ["none" "visual" "on"];
default = "none"; default = "none";
description = "Set how bells are handled. Options: on, visual or none"; description = "Set how bells are handled. Options: on, visual or none";
}; };
mapTimeout = mkOption { mapTimeout = mkOption {
type = types.int; type = int;
default = 500; default = 500;
description = "Timeout in ms that neovim will wait for mapped action to complete"; description = "Timeout in ms that neovim will wait for mapped action to complete";
}; };
splitBelow = mkOption { splitBelow = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "New splits will open below instead of on top"; description = "New splits will open below instead of on top";
}; };
splitRight = mkOption { splitRight = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "New splits will open to the right"; description = "New splits will open to the right";
}; };
enableEditorconfig = mkOption { enableEditorconfig = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "Follow editorconfig rules in current directory"; description = "Follow editorconfig rules in current directory";
}; };
cursorlineOpt = mkOption { cursorlineOpt = mkOption {
type = types.enum ["line" "screenline" "number" "both"]; type = enum ["line" "screenline" "number" "both"];
default = "line"; default = "line";
description = "Highlight the text line of the cursor with CursorLine hl-CursorLine"; description = "Highlight the text line of the cursor with CursorLine hl-CursorLine";
}; };
searchCase = mkOption { searchCase = mkOption {
type = types.enum ["ignore" "smart" "sensitive"]; type = enum ["ignore" "smart" "sensitive"];
default = "sensitive"; default = "sensitive";
description = "Set the case sensitivity of search"; description = "Set the case sensitivity of search";
}; };

View file

@ -1,5 +1,5 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.options) mkEnableOption mkOption; inherit (lib.options) mkEnableOption mkOption literalMD;
inherit (lib.nvim.binds) mkMappingOption; inherit (lib.nvim.binds) mkMappingOption;
inherit (lib.types) enum attrsOf nullOr str; inherit (lib.types) enum attrsOf nullOr str;
in { in {
@ -52,7 +52,7 @@ in {
''; '';
type = str; type = str;
default = "nvim_cmp_menu_map"; default = "nvim_cmp_menu_map";
example = lib.literalMD '' example = literalMD ''
```lua ```lua
function(entry, vim_item) function(entry, vim_item)
return vim_item return vim_item

View file

@ -4,10 +4,16 @@
... ...
}: let }: let
inherit (builtins) attrValues attrNames map mapAttrs toJSON isString concatStringsSep filter; inherit (builtins) attrValues attrNames map mapAttrs toJSON isString concatStringsSep filter;
inherit (lib) mkOption types mapAttrsFlatten filterAttrs optionalString getAttrs literalExpression; inherit (lib.options) mkOption literalExpression mdDoc;
inherit (lib) nvim; inherit (lib.attrsets) filterAttrs getAttrs;
inherit (nvim.lua) toLuaObject; inherit (lib.strings) optionalString;
inherit (nvim.vim) valToVim; inherit (lib.misc) mapAttrsFlatten;
inherit (lib.trivial) showWarnings;
inherit (lib.types) bool str listOf oneOf attrsOf nullOr attrs submodule unspecified lines;
inherit (lib.nvim.types) dagOf pluginsOpt extraPluginType;
inherit (lib.nvim.dag) entryAnywhere entryAfter topoSort;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.vim) valToVim;
cfg = config.vim; cfg = config.vim;
@ -22,7 +28,7 @@
mkBool = value: description: mkBool = value: description:
mkOption { mkOption {
type = types.bool; type = bool;
default = value; default = value;
inherit description; inherit description;
}; };
@ -54,7 +60,7 @@
"Whether to use the 'noremap' variant of the command, ignoring any custom mappings on the defined action. It is highly advised to keep this on, which is the default."; "Whether to use the 'noremap' variant of the command, ignoring any custom mappings on the defined action. It is highly advised to keep this on, which is the default.";
desc = mkOption { desc = mkOption {
type = types.nullOr types.str; type = nullOr str;
default = null; default = null;
description = "A description of this keybind, to be shown in which-key, if you have it enabled."; description = "A description of this keybind, to be shown in which-key, if you have it enabled.";
}; };
@ -94,17 +100,17 @@
}) })
maps); maps);
mapOption = types.submodule { mapOption = submodule {
options = options =
mapConfigOptions mapConfigOptions
// { // {
action = mkOption { action = mkOption {
type = types.str; type = str;
description = "The action to execute."; description = "The action to execute.";
}; };
lua = mkOption { lua = mkOption {
type = types.bool; type = bool;
description = '' description = ''
If true, `action` is considered to be lua code. If true, `action` is considered to be lua code.
Thus, it will not be wrapped in `""`. Thus, it will not be wrapped in `""`.
@ -117,13 +123,13 @@
mapOptions = mode: mapOptions = mode:
mkOption { mkOption {
description = "Mappings for ${mode} mode"; description = "Mappings for ${mode} mode";
type = types.attrsOf mapOption; type = attrsOf mapOption;
default = {}; default = {};
}; };
in { in {
options = { options = {
assertions = lib.mkOption { assertions = mkOption {
type = with types; listOf unspecified; type = listOf unspecified;
internal = true; internal = true;
default = []; default = [];
example = literalExpression '' example = literalExpression ''
@ -139,9 +145,9 @@ in {
warnings = mkOption { warnings = mkOption {
internal = true; internal = true;
default = []; default = [];
type = with types; listOf str; type = listOf str;
example = ["The `foo' service is deprecated and will go away soon!"]; example = ["The `foo' service is deprecated and will go away soon!"];
description = lib.mdDoc '' description = mdDoc ''
This option allows modules to show warnings to users during This option allows modules to show warnings to users during
the evaluation of the system configuration. the evaluation of the system configuration.
''; '';
@ -150,46 +156,46 @@ in {
vim = { vim = {
viAlias = mkOption { viAlias = mkOption {
description = "Enable vi alias"; description = "Enable vi alias";
type = types.bool; type = bool;
default = true; default = true;
}; };
vimAlias = mkOption { vimAlias = mkOption {
description = "Enable vim alias"; description = "Enable vim alias";
type = types.bool; type = bool;
default = true; default = true;
}; };
configRC = mkOption { configRC = mkOption {
description = "vimrc contents"; description = "vimrc contents";
type = types.oneOf [(nvim.types.dagOf types.lines) types.str]; type = oneOf [(dagOf lines) str];
default = {}; default = {};
}; };
luaConfigRC = mkOption { luaConfigRC = mkOption {
description = "vim lua config"; description = "vim lua config";
type = types.oneOf [(nvim.types.dagOf types.lines) types.str]; type = oneOf [(dagOf lines) str];
default = {}; default = {};
}; };
builtConfigRC = mkOption { builtConfigRC = mkOption {
internal = true; internal = true;
type = types.lines; type = lines;
description = "The built config for neovim after resolving the DAG"; description = "The built config for neovim after resolving the DAG";
}; };
startPlugins = nvim.types.pluginsOpt { startPlugins = pluginsOpt {
default = []; default = [];
description = "List of plugins to startup."; description = "List of plugins to startup.";
}; };
optPlugins = nvim.types.pluginsOpt { optPlugins = pluginsOpt {
default = []; default = [];
description = "List of plugins to optionally load"; description = "List of plugins to optionally load";
}; };
extraPlugins = mkOption { extraPlugins = mkOption {
type = types.attrsOf nvim.types.extraPluginType; type = attrsOf extraPluginType;
default = {}; default = {};
description = '' description = ''
List of plugins and related config. List of plugins and related config.
@ -210,7 +216,7 @@ in {
}; };
luaPackages = mkOption { luaPackages = mkOption {
type = types.listOf types.str; type = listOf str;
default = []; default = [];
description = '' description = ''
List of lua packages to install. List of lua packages to install.
@ -220,11 +226,11 @@ in {
globals = mkOption { globals = mkOption {
default = {}; default = {};
description = "Set containing global variable values"; description = "Set containing global variable values";
type = types.attrs; type = attrs;
}; };
maps = mkOption { maps = mkOption {
type = types.submodule { type = submodule {
options = { options = {
normal = mapOptions "normal"; normal = mapOptions "normal";
insert = mapOptions "insert"; insert = mapOptions "insert";
@ -289,12 +295,12 @@ in {
mapResult, mapResult,
}: let }: let
# When the value is a string, default it to dag.entryAnywhere # When the value is a string, default it to dag.entryAnywhere
finalDag = lib.mapAttrs (_: value: finalDag = mapAttrs (_: value:
if isString value if isString value
then nvim.dag.entryAnywhere value then entryAnywhere value
else value) else value)
dag; dag;
sortedDag = nvim.dag.topoSort finalDag; sortedDag = topoSort finalDag;
result = result =
if sortedDag ? result if sortedDag ? result
then mapResult sortedDag.result then mapResult sortedDag.result
@ -305,7 +311,7 @@ in {
vim = { vim = {
startPlugins = map (x: x.package) (attrValues cfg.extraPlugins); startPlugins = map (x: x.package) (attrValues cfg.extraPlugins);
configRC = { configRC = {
globalsScript = nvim.dag.entryAnywhere (concatStringsSep "\n" globalsScript); globalsScript = entryAnywhere (concatStringsSep "\n" globalsScript);
luaScript = let luaScript = let
mkSection = r: '' mkSection = r: ''
@ -319,7 +325,7 @@ in {
inherit mapResult; inherit mapResult;
}; };
in in
nvim.dag.entryAfter ["globalsScript"] luaConfig; entryAfter ["globalsScript"] luaConfig;
extraPluginConfigs = let extraPluginConfigs = let
mkSection = r: '' mkSection = r: ''
@ -332,7 +338,7 @@ in {
setup, setup,
... ...
}: }:
nvim.dag.entryAfter after setup) entryAfter after setup)
cfg.extraPlugins; cfg.extraPlugins;
pluginConfig = resolveDag { pluginConfig = resolveDag {
name = "extra plugins config"; name = "extra plugins config";
@ -340,7 +346,7 @@ in {
inherit mapResult; inherit mapResult;
}; };
in in
nvim.dag.entryAfter ["luaScript"] pluginConfig; entryAfter ["luaScript"] pluginConfig;
# This is probably not the right way to set the config. I'm not sure how it should look like. # This is probably not the right way to set the config. I'm not sure how it should look like.
mappings = let mappings = let
@ -359,7 +365,7 @@ in {
]; ];
mapConfig = wrapLuaConfig (concatStringsSep "\n" (map (v: concatStringsSep "\n" v) maps)); mapConfig = wrapLuaConfig (concatStringsSep "\n" (map (v: concatStringsSep "\n" v) maps));
in in
nvim.dag.entryAfter ["globalsScript"] mapConfig; entryAfter ["globalsScript"] mapConfig;
}; };
builtConfigRC = let builtConfigRC = let
@ -368,7 +374,7 @@ in {
baseSystemAssertWarn = baseSystemAssertWarn =
if failedAssertions != [] if failedAssertions != []
then throw "\nFailed assertions:\n${concatStringsSep "\n" (map (x: "- ${x}") failedAssertions)}" then throw "\nFailed assertions:\n${concatStringsSep "\n" (map (x: "- ${x}") failedAssertions)}"
else lib.showWarnings config.warnings; else showWarnings config.warnings;
mkSection = r: '' mkSection = r: ''
" SECTION: ${r.name} " SECTION: ${r.name}

View file

@ -1,5 +1,5 @@
{lib, ...}: let {lib, ...}: let
inherit (lib) mkEnableOption; inherit (lib.options) mkEnableOption;
in { in {
options.vim.dashboard.dashboard-nvim = { options.vim.dashboard.dashboard-nvim = {
enable = mkEnableOption "Fancy and Blazing Fast start screen plugin of neovim [dashboard.nvim]"; enable = mkEnableOption "Fancy and Blazing Fast start screen plugin of neovim [dashboard.nvim]";

View file

@ -49,7 +49,7 @@ in {
]; ];
}) })
(mkIf (cfg.enable && cfg.ui.enable) { (mkIf (cfg.enable && cfg.ui.enable) {
vim.startPlugins = ["nvim-dap-ui"]; vim.startPlugins = ["nvim-dap-ui" "nvim-nio"];
vim.luaConfigRC.nvim-dap-ui = entryAfter ["nvim-dap"] ('' vim.luaConfigRC.nvim-dap-ui = entryAfter ["nvim-dap"] (''
local dapui = require("dapui") local dapui = require("dapui")

View file

@ -6,8 +6,9 @@ inputs: {
extraSpecialArgs ? {}, extraSpecialArgs ? {},
}: let }: let
inherit (builtins) map filter isString toString getAttr; inherit (builtins) map filter isString toString getAttr;
inherit (pkgs) wrapNeovim vimPlugins; inherit (pkgs) wrapNeovimUnstable vimPlugins;
inherit (pkgs.vimUtils) buildVimPlugin; inherit (pkgs.vimUtils) buildVimPlugin;
inherit (pkgs.neovimUtils) makeNeovimConfig;
extendedLib = import ../lib/stdlib-extended.nix lib; extendedLib = import ../lib/stdlib-extended.nix lib;
@ -57,21 +58,22 @@ inputs: {
(f: f != null) (f: f != null)
plugins); plugins);
neovim = wrapNeovim vimOptions.package { plugins =
(buildConfigPlugins vimOptions.startPlugins)
++ (map (package: {
plugin = package;
optional = false;
})
(buildConfigPlugins
vimOptions.optPlugins));
neovim = wrapNeovimUnstable vimOptions.package (makeNeovimConfig {
inherit (vimOptions) viAlias; inherit (vimOptions) viAlias;
inherit (vimOptions) vimAlias; inherit (vimOptions) vimAlias;
inherit extraLuaPackages; inherit extraLuaPackages;
inherit plugins;
configure = { customRC = vimOptions.builtConfigRC;
customRC = vimOptions.builtConfigRC; });
packages.myVimPackage = {
start = buildConfigPlugins vimOptions.startPlugins;
opt = buildConfigPlugins vimOptions.optPlugins;
};
};
};
in { in {
inherit (module) options config; inherit (module) options config;
inherit (module._module.args) pkgs; inherit (module._module.args) pkgs;

View file

@ -33,7 +33,7 @@ in {
vim.luaConfigRC.nvimtreelua = entryAnywhere '' vim.luaConfigRC.nvimtreelua = entryAnywhere ''
${ ${
lib.optionalString cfg.disableNetrw '' optionalString cfg.disableNetrw ''
-- disable netrew completely -- disable netrew completely
vim.g.loaded_netrw = 1 vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1 vim.g.loaded_netrwPlugin = 1

View file

@ -3,29 +3,30 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkEnableOption mkOption types literalExpression; inherit (lib.options) mkEnableOption mkOption literalExpression;
inherit (lib.types) nullOr str bool int listOf enum attrs oneOf addCheck submodule;
in { in {
options.vim.filetree.nvimTree = { options.vim.filetree.nvimTree = {
enable = mkEnableOption "filetree via nvim-tree.lua"; enable = mkEnableOption "filetree via nvim-tree.lua";
mappings = { mappings = {
toggle = mkOption { toggle = mkOption {
type = types.nullOr types.str; type = nullOr str;
default = "<leader>t"; default = "<leader>t";
description = "Toggle NvimTree"; description = "Toggle NvimTree";
}; };
refresh = mkOption { refresh = mkOption {
type = types.nullOr types.str; type = nullOr str;
default = "<leader>tr"; default = "<leader>tr";
description = "Refresh NvimTree"; description = "Refresh NvimTree";
}; };
findFile = mkOption { findFile = mkOption {
type = types.nullOr types.str; type = nullOr str;
default = "<leader>tg"; default = "<leader>tg";
description = "Find file in NvimTree"; description = "Find file in NvimTree";
}; };
focus = mkOption { focus = mkOption {
type = types.nullOr types.str; type = nullOr str;
default = "<leader>tf"; default = "<leader>tf";
description = "Focus NvimTree"; description = "Focus NvimTree";
}; };
@ -34,19 +35,19 @@ in {
disableNetrw = mkOption { disableNetrw = mkOption {
default = false; default = false;
description = "Disables netrw and replaces it with tree"; description = "Disables netrw and replaces it with tree";
type = types.bool; type = bool;
}; };
hijackNetrw = mkOption { hijackNetrw = mkOption {
default = true; default = true;
description = "Prevents netrw from automatically opening when opening directories"; description = "Prevents netrw from automatically opening when opening directories";
type = types.bool; type = bool;
}; };
autoreloadOnWrite = mkOption { autoreloadOnWrite = mkOption {
default = true; default = true;
description = "Auto reload tree on write"; description = "Auto reload tree on write";
type = types.bool; type = bool;
}; };
updateFocusedFile = mkOption { updateFocusedFile = mkOption {
@ -55,16 +56,16 @@ in {
until it finds the file. until it finds the file.
''; '';
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
enable = mkOption { enable = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = "update focused file"; description = "update focused file";
}; };
updateRoot = mkOption { updateRoot = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = '' description = ''
Update the root directory of the tree if the file is not under current Update the root directory of the tree if the file is not under current
@ -75,7 +76,7 @@ in {
}; };
ignoreList = mkOption { ignoreList = mkOption {
type = with types; listOf str; type = listOf str;
default = []; default = [];
description = '' description = ''
List of buffer names and filetypes that will not update the root dir List of buffer names and filetypes that will not update the root dir
@ -93,26 +94,26 @@ in {
sorter = mkOption { sorter = mkOption {
default = "name"; default = "name";
description = "How files within the same directory are sorted."; description = "How files within the same directory are sorted.";
type = types.enum ["name" "extension" "modification_time" "case_sensitive" "suffix" "filetype"]; type = enum ["name" "extension" "modification_time" "case_sensitive" "suffix" "filetype"];
}; };
foldersFirst = mkOption { foldersFirst = mkOption {
default = true; default = true;
description = "Sort folders before files. Has no effect when `sort.sorter` is a function."; description = "Sort folders before files. Has no effect when `sort.sorter` is a function.";
type = types.bool; type = bool;
}; };
}; };
hijackCursor = mkOption { hijackCursor = mkOption {
default = false; default = false;
description = "Hijack the cursor in the tree to put it at the start of the filename"; description = "Hijack the cursor in the tree to put it at the start of the filename";
type = types.bool; type = bool;
}; };
hijackUnnamedBufferWhenOpening = mkOption { hijackUnnamedBufferWhenOpening = mkOption {
default = false; default = false;
description = "Open nvimtree in place of the unnamed buffer if it's empty."; description = "Open nvimtree in place of the unnamed buffer if it's empty.";
type = types.bool; type = bool;
}; };
rootDirs = mkOption { rootDirs = mkOption {
@ -120,7 +121,7 @@ in {
description = '' description = ''
Preferred root directories. Only relevant when `updateFocusedFile.updateRoot` is `true` Preferred root directories. Only relevant when `updateFocusedFile.updateRoot` is `true`
''; '';
type = with types; listOf str; type = listOf str;
}; };
preferStartupRoot = mkOption { preferStartupRoot = mkOption {
@ -129,11 +130,11 @@ in {
Prefer startup root directory when updating root directory of the tree. Prefer startup root directory when updating root directory of the tree.
Only relevant when `update_focused_file.update_root` is `true` Only relevant when `update_focused_file.update_root` is `true`
''; '';
type = types.bool; type = bool;
}; };
syncRootWithCwd = mkOption { syncRootWithCwd = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = '' description = ''
Changes the tree root directory on `DirChanged` and refreshes the tree. Changes the tree root directory on `DirChanged` and refreshes the tree.
@ -145,13 +146,13 @@ in {
reloadOnBufEnter = mkOption { reloadOnBufEnter = mkOption {
default = false; default = false;
type = types.bool; type = bool;
description = "Automatically reloads the tree on `BufEnter` nvim-tree."; description = "Automatically reloads the tree on `BufEnter` nvim-tree.";
}; };
respectBufCwd = mkOption { respectBufCwd = mkOption {
default = false; default = false;
type = types.bool; type = bool;
description = "Will change cwd of nvim-tree to that of new buffer's when opening nvim-tree."; description = "Will change cwd of nvim-tree to that of new buffer's when opening nvim-tree.";
}; };
@ -163,10 +164,10 @@ in {
autoOpen = false; autoOpen = false;
}; };
type = types.submodule { type = submodule {
options = { options = {
enable = mkOption { enable = mkOption {
type = types.bool; type = bool;
description = '' description = ''
Enable the `hijack_directories` feature. Disable this option if you use vim-dirvish or dirbuf.nvim. Enable the `hijack_directories` feature. Disable this option if you use vim-dirvish or dirbuf.nvim.
If `hijack_netrw` and `disable_netrw` are `false`, this feature will be disabled. If `hijack_netrw` and `disable_netrw` are `false`, this feature will be disabled.
@ -174,7 +175,7 @@ in {
}; };
autoOpen = mkOption { autoOpen = mkOption {
type = types.bool; type = bool;
description = '' description = ''
Opens the tree if the tree was previously closed. Opens the tree if the tree was previously closed.
''; '';
@ -187,7 +188,7 @@ in {
args = mkOption { args = mkOption {
default = []; default = [];
description = "Optional argument list."; description = "Optional argument list.";
type = with types; listOf str; type = listOf str;
}; };
cmd = mkOption { cmd = mkOption {
@ -198,7 +199,7 @@ in {
then "${pkgs.xdg-utils}/bin/xdg-open" then "${pkgs.xdg-utils}/bin/xdg-open"
else throw "NvimTree: No default system open command for this platform, please set `vim.filetree.nvimTree.systemOpen.cmd`"; else throw "NvimTree: No default system open command for this platform, please set `vim.filetree.nvimTree.systemOpen.cmd`";
description = "The open command itself"; description = "The open command itself";
type = types.str; type = str;
}; };
}; };
@ -210,13 +211,13 @@ in {
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
enable = mkEnableOption "diagnostics view in the signcolumn."; enable = mkEnableOption "diagnostics view in the signcolumn.";
debounceDelay = mkOption { debounceDelay = mkOption {
description = "Idle milliseconds between diagnostic event and update."; description = "Idle milliseconds between diagnostic event and update.";
type = types.int; type = int;
default = 50; default = 50;
}; };
@ -226,7 +227,7 @@ in {
}; };
showOnOpenDirs = mkOption { showOnOpenDirs = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = '' description = ''
Show diagnostics icons on directories that are open. Show diagnostics icons on directories that are open.
@ -237,26 +238,26 @@ in {
icons = mkOption { icons = mkOption {
description = "Icons for diagnostic severity."; description = "Icons for diagnostic severity.";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
hint = mkOption { hint = mkOption {
description = "Icon used for `hint` diagnostic."; description = "Icon used for `hint` diagnostic.";
type = types.str; type = str;
default = ""; default = "";
}; };
info = mkOption { info = mkOption {
description = "Icon used for `info` diagnostic."; description = "Icon used for `info` diagnostic.";
type = types.str; type = str;
default = ""; default = "";
}; };
warning = mkOption { warning = mkOption {
description = "Icon used for `warning` diagnostic."; description = "Icon used for `warning` diagnostic.";
type = types.str; type = str;
default = ""; default = "";
}; };
error = mkOption { error = mkOption {
description = "Icon used for `error` diagnostic."; description = "Icon used for `error` diagnostic.";
type = types.str; type = str;
default = ""; default = "";
}; };
}; };
@ -266,17 +267,17 @@ in {
severity = mkOption { severity = mkOption {
description = "Severity for which the diagnostics will be displayed. See `:help diagnostic-severity`"; description = "Severity for which the diagnostics will be displayed. See `:help diagnostic-severity`";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
min = mkOption { min = mkOption {
description = "Minimum severity."; description = "Minimum severity.";
type = types.enum ["HINT" "INFO" "WARNING" "ERROR"]; type = enum ["HINT" "INFO" "WARNING" "ERROR"];
default = "HINT"; default = "HINT";
}; };
max = mkOption { max = mkOption {
description = "Maximum severity."; description = "Maximum severity.";
type = types.enum ["HINT" "INFO" "WARNING" "ERROR"]; type = enum ["HINT" "INFO" "WARNING" "ERROR"];
default = "ERROR"; default = "ERROR";
}; };
}; };
@ -290,19 +291,19 @@ in {
enable = mkEnableOption "Git integration with icons and colors."; enable = mkEnableOption "Git integration with icons and colors.";
showOnDirs = mkOption { showOnDirs = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "Show git icons on parent directories."; description = "Show git icons on parent directories.";
}; };
showOnOpenDirs = mkOption { showOnOpenDirs = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "Show git icons on directories that are open."; description = "Show git icons on directories that are open.";
}; };
disableForDirs = mkOption { disableForDirs = mkOption {
type = with types; listOf str; type = listOf str;
default = []; default = [];
description = '' description = ''
Disable git integration when git top-level matches these paths. Disable git integration when git top-level matches these paths.
@ -311,7 +312,7 @@ in {
}; };
timeout = mkOption { timeout = mkOption {
type = types.int; type = int;
default = 400; default = 400;
description = '' description = ''
Kills the git process after some time if it takes too long. Kills the git process after some time if it takes too long.
@ -323,18 +324,18 @@ in {
modified = mkOption { modified = mkOption {
description = "Indicate which file have unsaved modification."; description = "Indicate which file have unsaved modification.";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
enable = mkEnableOption "Modified files with icons and color highlight."; enable = mkEnableOption "Modified files with icons and color highlight.";
showOnDirs = mkOption { showOnDirs = mkOption {
type = types.bool; type = bool;
description = "Show modified icons on parent directories."; description = "Show modified icons on parent directories.";
default = true; default = true;
}; };
showOnOpenDirs = mkOption { showOnOpenDirs = mkOption {
type = types.bool; type = bool;
description = "Show modified icons on directories that are open."; description = "Show modified icons on directories that are open.";
default = true; default = true;
}; };
@ -351,22 +352,22 @@ in {
performance. performance.
''; '';
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
enable = mkOption { enable = mkOption {
description = "Enable filesystem watchers."; description = "Enable filesystem watchers.";
type = types.bool; type = bool;
default = true; default = true;
}; };
debounceDelay = mkOption { debounceDelay = mkOption {
description = "Idle milliseconds between filesystem change and action."; description = "Idle milliseconds between filesystem change and action.";
type = types.int; type = int;
default = 50; default = 50;
}; };
ignoreDirs = mkOption { ignoreDirs = mkOption {
type = with types; listOf str; type = listOf str;
default = []; default = [];
description = '' description = ''
List of vim regex for absolute directory paths that will not be watched. List of vim regex for absolute directory paths that will not be watched.
@ -385,22 +386,22 @@ in {
view = mkOption { view = mkOption {
description = "Window / buffer setup."; description = "Window / buffer setup.";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
centralizeSelection = mkOption { centralizeSelection = mkOption {
description = "If true, reposition the view so that the current node is initially centralized when entering nvim-tree."; description = "If true, reposition the view so that the current node is initially centralized when entering nvim-tree.";
type = types.bool; type = bool;
default = false; default = false;
}; };
cursorline = mkOption { cursorline = mkOption {
description = "Enable cursorline in nvim-tree window."; description = "Enable cursorline in nvim-tree window.";
type = types.bool; type = bool;
default = true; default = true;
}; };
debounceDelay = mkOption { debounceDelay = mkOption {
type = types.int; type = int;
default = 15; default = 15;
description = '' description = ''
Idle milliseconds before some reload / refresh operations. Idle milliseconds before some reload / refresh operations.
@ -416,7 +417,7 @@ in {
A table (an attribute set in our case, see example) indicates that the view should be dynamically sized based on the A table (an attribute set in our case, see example) indicates that the view should be dynamically sized based on the
longest line. longest line.
''; '';
type = with types; oneOf [int attrs]; type = oneOf [int attrs];
default = 30; default = 30;
example = literalExpression '' example = literalExpression ''
{ {
@ -429,7 +430,7 @@ in {
side = mkOption { side = mkOption {
description = "Side of the tree."; description = "Side of the tree.";
type = types.enum ["left" "right"]; type = enum ["left" "right"];
default = "left"; default = "left";
}; };
@ -438,13 +439,13 @@ in {
Preserves window proportions when opening a file. Preserves window proportions when opening a file.
If `false`, the height and width of windows other than nvim-tree will be equalized. If `false`, the height and width of windows other than nvim-tree will be equalized.
''; '';
type = types.bool; type = bool;
default = false; default = false;
}; };
number = mkOption { number = mkOption {
description = "Print the line number in front of each line."; description = "Print the line number in front of each line.";
type = types.bool; type = bool;
default = false; default = false;
}; };
@ -454,13 +455,13 @@ in {
If the option `view.number` is also `true`, the number on the cursor line If the option `view.number` is also `true`, the number on the cursor line
will be the line number instead of `0`. will be the line number instead of `0`.
''; '';
type = types.bool; type = bool;
default = false; default = false;
}; };
signcolumn = mkOption { signcolumn = mkOption {
description = ''Show diagnostic sign column. Value can be `"yes"`, `"auto"` or`"no"`.''; description = ''Show diagnostic sign column. Value can be `"yes"`, `"auto"` or`"no"`.'';
type = types.enum ["yes" "auto" "no"]; type = enum ["yes" "auto" "no"];
default = "yes"; default = "yes";
}; };
@ -468,23 +469,23 @@ in {
description = "Configuration options for floating window."; description = "Configuration options for floating window.";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
enable = mkOption { enable = mkOption {
description = "If true, tree window will be floating."; description = "If true, tree window will be floating.";
type = types.bool; type = bool;
default = false; default = false;
}; };
quitOnFocusLoss = mkOption { quitOnFocusLoss = mkOption {
description = "Close the floating tree window when it loses focus."; description = "Close the floating tree window when it loses focus.";
type = types.bool; type = bool;
default = true; default = true;
}; };
openWinConfig = mkOption { openWinConfig = mkOption {
description = "Floating window config. See `:h nvim_open_win()` for more details."; description = "Floating window config. See `:h nvim_open_win()` for more details.";
type = types.attrs; type = attrs;
default = { default = {
relative = "editor"; relative = "editor";
border = "rounded"; border = "rounded";
@ -505,23 +506,23 @@ in {
addTrailing = mkOption { addTrailing = mkOption {
default = false; default = false;
description = "Appends a trailing slash to folder names."; description = "Appends a trailing slash to folder names.";
type = types.bool; type = bool;
}; };
groupEmpty = mkOption { groupEmpty = mkOption {
default = false; default = false;
description = "Compact folders that only contain a single folder into one node in the file tree."; description = "Compact folders that only contain a single folder into one node in the file tree.";
type = types.bool; type = bool;
}; };
fullName = mkOption { fullName = mkOption {
default = false; default = false;
description = "Display node whose name length is wider than the width of nvim-tree window in floating window."; description = "Display node whose name length is wider than the width of nvim-tree window in floating window.";
type = types.bool; type = bool;
}; };
highlightGit = mkOption { highlightGit = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = '' description = ''
Enable file highlight for git attributes using `NvimTreeGit` highlight groups. Enable file highlight for git attributes using `NvimTreeGit` highlight groups.
@ -531,7 +532,7 @@ in {
}; };
highlightOpenedFiles = mkOption { highlightOpenedFiles = mkOption {
type = types.enum ["none" "icon" "name" "all"]; type = enum ["none" "icon" "name" "all"];
default = "none"; default = "none";
description = '' description = ''
Highlight icons and/or names for bufloaded() files using the Highlight icons and/or names for bufloaded() files using the
@ -540,7 +541,7 @@ in {
}; };
highlightModified = mkOption { highlightModified = mkOption {
type = types.enum ["none" "icon" "name" "all"]; type = enum ["none" "icon" "name" "all"];
default = "none"; default = "none";
description = '' description = ''
Highlight modified files in the tree using `NvimTreeNormal` highlight group. Highlight modified files in the tree using `NvimTreeNormal` highlight group.
@ -549,7 +550,7 @@ in {
}; };
rootFolderLabel = mkOption { rootFolderLabel = mkOption {
type = with types; oneOf [str bool]; type = oneOf [str bool];
default = false; default = false;
example = ''"":~:s?$?/..?"''; example = ''"":~:s?$?/..?"'';
description = '' description = ''
@ -566,7 +567,7 @@ in {
}; };
indentWidth = mkOption { indentWidth = mkOption {
type = with types; addCheck int (x: x >= 1); type = addCheck int (x: x >= 1);
default = 2; default = 2;
description = "Number of spaces for an each tree nesting level. Minimum 1."; description = "Number of spaces for an each tree nesting level. Minimum 1.";
}; };
@ -574,17 +575,17 @@ in {
indentMarkers = mkOption { indentMarkers = mkOption {
description = "Configuration options for tree indent markers."; description = "Configuration options for tree indent markers.";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
enable = mkEnableOption "Display indent markers when folders are open."; enable = mkEnableOption "Display indent markers when folders are open.";
inlineArrows = mkOption { inlineArrows = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "Display folder arrows in the same column as indent marker when using `renderer.icons.show.folder_arrow`"; description = "Display folder arrows in the same column as indent marker when using `renderer.icons.show.folder_arrow`";
}; };
icons = mkOption { icons = mkOption {
type = types.attrs; type = attrs;
description = "Individual elements of the indent markers"; description = "Individual elements of the indent markers";
default = { default = {
corner = ""; corner = "";
@ -599,13 +600,13 @@ in {
}; };
specialFiles = mkOption { specialFiles = mkOption {
type = with types; listOf str; type = listOf str;
default = ["Cargo.toml" "README.md" "readme.md" "Makefile" "MAKEFILE" "flake.nix"]; # ;) default = ["Cargo.toml" "README.md" "readme.md" "Makefile" "MAKEFILE" "flake.nix"]; # ;)
description = "A list of filenames that gets highlighted with `NvimTreeSpecialFile"; description = "A list of filenames that gets highlighted with `NvimTreeSpecialFile";
}; };
symlinkDestination = mkOption { symlinkDestination = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "Whether to show the destination of the symlink."; description = "Whether to show the destination of the symlink.";
}; };
@ -613,53 +614,53 @@ in {
icons = mkOption { icons = mkOption {
description = "Configuration options for icons."; description = "Configuration options for icons.";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
webdevColors = mkOption { webdevColors = mkOption {
type = types.bool; type = bool;
description = " Use the webdev icon colors, otherwise `NvimTreeFileIcon`"; description = " Use the webdev icon colors, otherwise `NvimTreeFileIcon`";
default = true; default = true;
}; };
gitPlacement = mkOption { gitPlacement = mkOption {
type = types.enum ["before" "after" "signcolumn"]; type = enum ["before" "after" "signcolumn"];
description = "Place where the git icons will be rendered. `signcolumn` requires `view.signcolumn` to be enabled."; description = "Place where the git icons will be rendered. `signcolumn` requires `view.signcolumn` to be enabled.";
default = "before"; default = "before";
}; };
modifiedPlacement = mkOption { modifiedPlacement = mkOption {
type = types.enum ["before" "after" "signcolumn"]; type = enum ["before" "after" "signcolumn"];
description = "Place where the modified icons will be rendered. `signcolumn` requires `view.signcolumn` to be enabled."; description = "Place where the modified icons will be rendered. `signcolumn` requires `view.signcolumn` to be enabled.";
default = "after"; default = "after";
}; };
padding = mkOption { padding = mkOption {
type = types.str; type = str;
description = "Inserted between icon and filename"; description = "Inserted between icon and filename";
default = " "; default = " ";
}; };
symlinkArrow = mkOption { symlinkArrow = mkOption {
type = types.str; type = str;
description = "Used as a separator between symlinks' source and target."; description = "Used as a separator between symlinks' source and target.";
default = " "; default = " ";
}; };
show = { show = {
file = mkOption { file = mkOption {
type = types.bool; type = bool;
description = "Show an icon before the file name. `nvim-web-devicons` will be used if available."; description = "Show an icon before the file name. `nvim-web-devicons` will be used if available.";
default = true; default = true;
}; };
folder = mkOption { folder = mkOption {
type = types.bool; type = bool;
description = "Show an icon before the folder name."; description = "Show an icon before the folder name.";
default = true; default = true;
}; };
folderArrow = mkOption { folderArrow = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = '' description = ''
Show a small arrow before the folder node. Arrow will be a part of the Show a small arrow before the folder node. Arrow will be a part of the
@ -668,7 +669,7 @@ in {
}; };
git = mkOption { git = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = '' description = ''
Show a git status icon, see `renderer.icons.gitPlacement` Show a git status icon, see `renderer.icons.gitPlacement`
@ -677,7 +678,7 @@ in {
}; };
modified = mkOption { modified = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = '' description = ''
Show a modified icon, see `renderer.icons.modifiedPlacement` Show a modified icon, see `renderer.icons.modifiedPlacement`
@ -692,29 +693,29 @@ in {
to appear in the signcolumn. to appear in the signcolumn.
''; '';
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
default = mkOption { default = mkOption {
type = types.str; type = str;
description = "Glyph for files. Will be overridden by `nvim-web-devicons` if available."; description = "Glyph for files. Will be overridden by `nvim-web-devicons` if available.";
default = ""; default = "";
}; };
symlink = mkOption { symlink = mkOption {
type = types.str; type = str;
description = "Glyph for symlinks."; description = "Glyph for symlinks.";
default = ""; default = "";
}; };
modified = mkOption { modified = mkOption {
type = types.str; type = str;
description = "Icon to display for modified files."; description = "Icon to display for modified files.";
default = ""; default = "";
}; };
# TODO: hardcode each attribute # TODO: hardcode each attribute
folder = mkOption { folder = mkOption {
type = types.attrs; type = attrs;
description = "Glyphs for directories. Recommended to use the defaults unless you know what you are doing."; description = "Glyphs for directories. Recommended to use the defaults unless you know what you are doing.";
default = { default = {
default = ""; default = "";
@ -729,7 +730,7 @@ in {
}; };
git = mkOption { git = mkOption {
type = types.attrs; type = attrs;
description = "Glyphs for git status."; description = "Glyphs for git status.";
default = { default = {
unstaged = ""; unstaged = "";
@ -759,22 +760,22 @@ in {
noBuffer = false; noBuffer = false;
exclude = []; exclude = [];
}; };
type = types.submodule { type = submodule {
options = { options = {
gitIgnored = mkOption { gitIgnored = mkOption {
type = types.bool; type = bool;
description = "Ignore files based on `.gitignore`. Requires git.enable` to be `true`"; description = "Ignore files based on `.gitignore`. Requires git.enable` to be `true`";
default = false; default = false;
}; };
dotfiles = mkOption { dotfiles = mkOption {
type = types.bool; type = bool;
description = "Do not show dotfiles: files starting with a `.`"; description = "Do not show dotfiles: files starting with a `.`";
default = false; default = false;
}; };
gitClean = mkOption { gitClean = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = '' description = ''
@ -784,13 +785,13 @@ in {
}; };
noBuffer = mkOption { noBuffer = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = "Do not show files that have no `buflisted()` buffer."; description = "Do not show files that have no `buflisted()` buffer.";
}; };
exclude = mkOption { exclude = mkOption {
type = with types; listOf str; type = listOf str;
default = []; default = [];
description = "List of directories or files to exclude from filtering: always show them."; description = "List of directories or files to exclude from filtering: always show them.";
}; };
@ -804,10 +805,10 @@ in {
cmd = "${pkgs.glib}/bin/gio trash"; cmd = "${pkgs.glib}/bin/gio trash";
}; };
type = types.submodule { type = submodule {
options = { options = {
cmd = mkOption { cmd = mkOption {
type = types.str; type = str;
description = "The command used to trash items"; description = "The command used to trash items";
}; };
}; };
@ -817,10 +818,10 @@ in {
actions = mkOption { actions = mkOption {
description = "Configuration for various actions."; description = "Configuration for various actions.";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
useSystemClipboard = mkOption { useSystemClipboard = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = '' description = ''
A boolean value that toggle the use of system clipboard when copy/paste A boolean value that toggle the use of system clipboard when copy/paste
@ -833,16 +834,16 @@ in {
changeDir = mkOption { changeDir = mkOption {
description = "vim `change-directory` behaviour"; description = "vim `change-directory` behaviour";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
enable = mkOption { enable = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "Change the working directory when changing directories in the tree."; description = "Change the working directory when changing directories in the tree.";
}; };
global = mkOption { global = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = '' description = ''
Use `:cd` instead of `:lcd` when changing directories. Use `:cd` instead of `:lcd` when changing directories.
@ -851,7 +852,7 @@ in {
}; };
restrictAboveCwd = mkOption { restrictAboveCwd = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = '' description = ''
Restrict changing to a directory above the global current working directory. Restrict changing to a directory above the global current working directory.
@ -865,10 +866,10 @@ in {
expandAll = mkOption { expandAll = mkOption {
description = "Configuration for expand_all behaviour."; description = "Configuration for expand_all behaviour.";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
maxFolderDiscovery = mkOption { maxFolderDiscovery = mkOption {
type = types.int; type = int;
default = 300; default = 300;
description = '' description = ''
Limit the number of folders being explored when expanding every folders. Limit the number of folders being explored when expanding every folders.
@ -876,7 +877,7 @@ in {
''; '';
}; };
exclude = mkOption { exclude = mkOption {
type = with types; listOf str; type = listOf str;
description = "A list of directories that should not be expanded automatically."; description = "A list of directories that should not be expanded automatically.";
default = [".git" "target" "build" "result"]; default = [".git" "target" "build" "result"];
}; };
@ -888,10 +889,10 @@ in {
filePopup = mkOption { filePopup = mkOption {
description = "Configuration for file_popup behaviour."; description = "Configuration for file_popup behaviour.";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
openWinConfig = mkOption { openWinConfig = mkOption {
type = types.attrs; type = attrs;
default = { default = {
col = 1; col = 1;
row = 1; row = 1;
@ -909,22 +910,22 @@ in {
openFile = mkOption { openFile = mkOption {
description = "Configuration options for opening a file from nvim-tree."; description = "Configuration options for opening a file from nvim-tree.";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
quitOnOpen = mkOption { quitOnOpen = mkOption {
type = types.bool; type = bool;
description = "Closes the explorer when opening a file."; description = "Closes the explorer when opening a file.";
default = false; default = false;
}; };
eject = mkOption { eject = mkOption {
type = types.bool; type = bool;
description = "Prevent new opened file from opening in the same window as the tree."; description = "Prevent new opened file from opening in the same window as the tree.";
default = false; default = false;
}; };
resizeWindow = mkOption { resizeWindow = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = "Resizes the tree when opening a file. Previously `view.auto_resize`"; description = "Resizes the tree when opening a file. Previously `view.auto_resize`";
@ -933,16 +934,16 @@ in {
windowPicker = mkOption { windowPicker = mkOption {
description = "window_picker"; description = "window_picker";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
enable = mkOption { enable = mkOption {
type = types.bool; type = bool;
description = "Enable the window picker. If this feature is not enabled, files will open in window from which you last opened the tree."; description = "Enable the window picker. If this feature is not enabled, files will open in window from which you last opened the tree.";
default = false; default = false;
}; };
picker = mkOption { picker = mkOption {
type = types.str; type = str;
default = "default"; default = "default";
description = '' description = ''
Change the default window picker, can be a string `"default"` or a function. Change the default window picker, can be a string `"default"` or a function.
@ -959,20 +960,20 @@ in {
}; };
chars = mkOption { chars = mkOption {
type = types.str; type = str;
description = "A string of chars used as identifiers by the window picker."; description = "A string of chars used as identifiers by the window picker.";
default = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; default = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
}; };
exclude = { exclude = {
filetype = mkOption { filetype = mkOption {
type = with types; listOf str; type = listOf str;
description = "A list of filetypes to exclude from the window picker."; description = "A list of filetypes to exclude from the window picker.";
default = ["notify" "packer" "qf" "diff" "fugitive" "fugitiveblame"]; default = ["notify" "packer" "qf" "diff" "fugitive" "fugitiveblame"];
}; };
buftype = mkOption { buftype = mkOption {
type = with types; listOf str; type = listOf str;
description = "A list of buftypes to exclude from the window picker."; description = "A list of buftypes to exclude from the window picker.";
default = ["nofile" "terminal" "help"]; default = ["nofile" "terminal" "help"];
}; };
@ -986,7 +987,7 @@ in {
removeFile = { removeFile = {
closeWindow = mkOption { closeWindow = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "Close any window displaying a file when removing the file from the tree"; description = "Close any window displaying a file when removing the file from the tree";
}; };
@ -1004,16 +1005,16 @@ in {
The filter can be cleared with the `F` key by default. The filter can be cleared with the `F` key by default.
''; '';
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
prefix = mkOption { prefix = mkOption {
type = types.str; type = str;
description = "Prefix of the filter displayed in the buffer."; description = "Prefix of the filter displayed in the buffer.";
default = "[FILTER]: "; default = "[FILTER]: ";
}; };
alwaysShowFolders = mkOption { alwaysShowFolders = mkOption {
type = types.bool; type = bool;
description = "Whether to filter folders or not."; description = "Whether to filter folders or not.";
default = true; default = true;
}; };
@ -1024,15 +1025,15 @@ in {
tab = mkOption { tab = mkOption {
description = "Configuration for tab behaviour."; description = "Configuration for tab behaviour.";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
sync = mkOption { sync = mkOption {
description = "Configuration for syncing nvim-tree across tabs."; description = "Configuration for syncing nvim-tree across tabs.";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
open = mkOption { open = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = '' description = ''
Opens the tree automatically when switching tabpage or opening a new Opens the tree automatically when switching tabpage or opening a new
@ -1041,7 +1042,7 @@ in {
}; };
close = mkOption { close = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = '' description = ''
Closes the tree across all tabpages when the tree is closed. Closes the tree across all tabpages when the tree is closed.
@ -1049,7 +1050,7 @@ in {
}; };
ignore = mkOption { ignore = mkOption {
type = with types; listOf str; type = listOf str;
default = []; default = [];
description = '' description = ''
List of filetypes or buffer names on new tab that will prevent List of filetypes or buffer names on new tab that will prevent
@ -1066,16 +1067,16 @@ in {
notify = mkOption { notify = mkOption {
description = "Configuration for notifications."; description = "Configuration for notifications.";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
threshold = mkOption { threshold = mkOption {
type = types.enum ["ERROR" "WARNING" "INFO" "DEBUG"]; type = enum ["ERROR" "WARNING" "INFO" "DEBUG"];
description = "Specify minimum notification level, uses the values from `vim.log.levels`"; description = "Specify minimum notification level, uses the values from `vim.log.levels`";
default = "INFO"; default = "INFO";
}; };
absolutePath = mkOption { absolutePath = mkOption {
type = types.bool; type = bool;
description = "Whether to use absolute paths or item names in fs action notifications."; description = "Whether to use absolute paths or item names in fs action notifications.";
default = true; default = true;
}; };
@ -1086,17 +1087,17 @@ in {
ui = mkOption { ui = mkOption {
description = "General UI configuration."; description = "General UI configuration.";
default = {}; default = {};
type = types.submodule { type = submodule {
options = { options = {
confirm = { confirm = {
remove = mkOption { remove = mkOption {
type = types.bool; type = bool;
description = "Prompt before removing."; description = "Prompt before removing.";
default = true; default = true;
}; };
trash = mkOption { trash = mkOption {
type = types.bool; type = bool;
description = "Prompt before trash."; description = "Prompt before trash.";
default = true; default = true;
}; };
@ -1109,7 +1110,7 @@ in {
openOnSetup = mkOption { openOnSetup = mkOption {
default = true; default = true;
description = "Open when vim is started on a directory"; description = "Open when vim is started on a directory";
type = types.bool; type = bool;
}; };
}; };
} }

View file

@ -9,6 +9,7 @@
inherit (lib.lists) isList; inherit (lib.lists) isList;
inherit (lib.types) enum either package listOf str bool; inherit (lib.types) enum either package listOf str bool;
inherit (lib.nvim.lua) expToLua; inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.types) diagnostics mkGrammarOption;
cfg = config.vim.languages.bash; cfg = config.vim.languages.bash;
@ -45,8 +46,8 @@
}; };
}; };
defaultDiagnostics = ["shellcheck"]; defaultDiagnosticsProvider = ["shellcheck"];
diagnostics = { diagnosticsProviders = {
shellcheck = { shellcheck = {
package = pkgs.shellcheck; package = pkgs.shellcheck;
nullConfig = pkg: '' nullConfig = pkg: ''
@ -65,7 +66,7 @@ in {
treesitter = { treesitter = {
enable = mkEnableOption "Bash treesitter" // {default = config.vim.languages.enableTreesitter;}; enable = mkEnableOption "Bash treesitter" // {default = config.vim.languages.enableTreesitter;};
package = lib.nvim.types.mkGrammarOption pkgs "bash"; package = mkGrammarOption pkgs "bash";
}; };
lsp = { lsp = {
@ -106,10 +107,10 @@ in {
extraDiagnostics = { extraDiagnostics = {
enable = mkEnableOption "extra Bash diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;}; enable = mkEnableOption "extra Bash diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
types = lib.nvim.types.diagnostics { types = diagnostics {
langDesc = "Bash"; langDesc = "Bash";
inherit diagnostics; inherit diagnosticsProviders;
inherit defaultDiagnostics; inherit defaultDiagnosticsProvider;
}; };
}; };
}; };

View file

@ -7,9 +7,10 @@
inherit (lib.lists) isList; inherit (lib.lists) isList;
inherit (lib.modules) mkIf mkMerge; inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.lua) expToLua; inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.languages) diagnosticsToLua;
cfg = config.vim.languages.bash; cfg = config.vim.languages.bash;
diagnostics = { diagnosticsProviders = {
shellcheck = { shellcheck = {
package = pkgs.shellcheck; package = pkgs.shellcheck;
nullConfig = pkg: '' nullConfig = pkg: ''
@ -72,10 +73,10 @@ in {
(mkIf cfg.extraDiagnostics.enable { (mkIf cfg.extraDiagnostics.enable {
vim.lsp.null-ls.enable = true; vim.lsp.null-ls.enable = true;
vim.lsp.null-ls.sources = lib.nvim.languages.diagnosticsToLua { vim.lsp.null-ls.sources = diagnosticsToLua {
lang = "bash"; lang = "bash";
config = cfg.extraDiagnostics.types; config = cfg.extraDiagnostics.types;
inherit diagnostics; inherit diagnosticsProviders;
}; };
}) })
]); ]);

View file

@ -1,19 +1,27 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (builtins) attrNames; inherit (builtins) attrNames;
inherit (lib) isList nvim optionalString mkEnableOption mkOption types mkIf mkMerge; inherit (lib.lists) isList;
inherit (lib.strings) optionalString;
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) bool enum package either listOf str nullOr;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.dag) entryAnywhere;
packageToCmd = package: defaultCmd:
if isList cfg.lsp.package
then expToLua cfg.lsp.package
else ''{ "${cfg.lsp.package}/bin/${defaultCmd}" }'';
cfg = config.vim.languages.clang; cfg = config.vim.languages.clang;
defaultServer = "ccls"; defaultServer = "ccls";
packageToCmd = package: defaultCmd:
if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package
else ''{ "${cfg.lsp.package}/bin/${defaultCmd}" }'';
servers = { servers = {
ccls = { ccls = {
package = pkgs.ccls; package = pkgs.ccls;
@ -79,14 +87,14 @@ in {
C syntax for headers. Can fix treesitter errors, see: C syntax for headers. Can fix treesitter errors, see:
https://www.reddit.com/r/neovim/comments/orfpcd/question_does_the_c_parser_from_nvimtreesitter/ https://www.reddit.com/r/neovim/comments/orfpcd/question_does_the_c_parser_from_nvimtreesitter/
''; '';
type = types.bool; type = bool;
default = false; default = false;
}; };
treesitter = { treesitter = {
enable = mkEnableOption "C/C++ treesitter" // {default = config.vim.languages.enableTreesitter;}; enable = mkEnableOption "C/C++ treesitter" // {default = config.vim.languages.enableTreesitter;};
cPackage = nvim.types.mkGrammarOption pkgs "c"; cPackage = mkGrammarOption pkgs "c";
cppPackage = nvim.types.mkGrammarOption pkgs "cpp"; cppPackage = mkGrammarOption pkgs "cpp";
}; };
lsp = { lsp = {
@ -94,20 +102,20 @@ in {
server = mkOption { server = mkOption {
description = "The clang LSP server to use"; description = "The clang LSP server to use";
type = with types; enum (attrNames servers); type = enum (attrNames servers);
default = defaultServer; default = defaultServer;
}; };
package = mkOption { package = mkOption {
description = "clang LSP server package, or the command to run as a list of strings"; description = "clang LSP server package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]''; example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]'';
type = with types; either package (listOf str); type = either package (listOf str);
default = servers.${cfg.lsp.server}.package; default = servers.${cfg.lsp.server}.package;
}; };
opts = mkOption { opts = mkOption {
description = "Options to pass to clang LSP server"; description = "Options to pass to clang LSP server";
type = with types; nullOr str; type = nullOr str;
default = null; default = null;
}; };
}; };
@ -115,17 +123,17 @@ in {
dap = { dap = {
enable = mkOption { enable = mkOption {
description = "Enable clang Debug Adapter"; description = "Enable clang Debug Adapter";
type = types.bool; type = bool;
default = config.vim.languages.enableDAP; default = config.vim.languages.enableDAP;
}; };
debugger = mkOption { debugger = mkOption {
description = "clang debugger to use"; description = "clang debugger to use";
type = with types; enum (attrNames debuggers); type = enum (attrNames debuggers);
default = defaultDebugger; default = defaultDebugger;
}; };
package = mkOption { package = mkOption {
description = "clang debugger package."; description = "clang debugger package.";
type = types.package; type = package;
default = debuggers.${cfg.dap.debugger}.package; default = debuggers.${cfg.dap.debugger}.package;
}; };
}; };
@ -133,7 +141,7 @@ in {
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
(mkIf cfg.cHeader { (mkIf cfg.cHeader {
vim.configRC.c-header = nvim.dag.entryAnywhere "let g:c_syntax_for_h = 1"; vim.configRC.c-header = entryAnywhere "let g:c_syntax_for_h = 1";
}) })
(mkIf cfg.treesitter.enable { (mkIf cfg.treesitter.enable {

View file

@ -5,7 +5,12 @@
... ...
}: let }: let
inherit (builtins) attrNames; inherit (builtins) attrNames;
inherit (lib) mkEnableOption mkOption mkIf mkMerge isList types nvim; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
inherit (lib.types) enum either listOf package str;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.lua) expToLua;
cfg = config.vim.languages.css; cfg = config.vim.languages.css;
@ -25,7 +30,7 @@
on_attach = default_on_attach; on_attach = default_on_attach;
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/vscode-css-language-server", "--stdio"}'' else ''{"${cfg.lsp.package}/bin/vscode-css-language-server", "--stdio"}''
} }
} }
@ -39,7 +44,7 @@ in {
treesitter = { treesitter = {
enable = mkEnableOption "CSS treesitter" // {default = config.vim.languages.enableTreesitter;}; enable = mkEnableOption "CSS treesitter" // {default = config.vim.languages.enableTreesitter;};
package = nvim.types.mkGrammarOption pkgs "css"; package = mkGrammarOption pkgs "css";
}; };
lsp = { lsp = {
@ -47,14 +52,14 @@ in {
server = mkOption { server = mkOption {
description = "CSS LSP server to use"; description = "CSS LSP server to use";
type = with types; enum (attrNames servers); type = enum (attrNames servers);
default = defaultServer; default = defaultServer;
}; };
package = mkOption { package = mkOption {
description = "CSS LSP server package, or the command to run as a list of strings"; description = "CSS LSP server package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]''; example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]'';
type = with types; either package (listOf str); type = either package (listOf str);
default = servers.${cfg.lsp.server}.package; default = servers.${cfg.lsp.server}.package;
}; };
}; };

View file

@ -1,11 +1,17 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (builtins) attrNames; inherit (builtins) attrNames;
inherit (lib) isList nvim getExe mkEnableOption mkOption types mkMerge mkIf; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.meta) getExe;
inherit (lib.lists) isList;
inherit (lib.types) bool enum either listOf package str;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.lua) expToLua;
cfg = config.vim.languages.go; cfg = config.vim.languages.go;
@ -19,13 +25,14 @@
on_attach = default_on_attach; on_attach = default_on_attach;
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/gopls", "serve"}'' else ''{"${cfg.lsp.package}/bin/gopls", "serve"}''
}, },
} }
''; '';
}; };
}; };
defaultDebugger = "delve"; defaultDebugger = "delve";
debuggers = { debuggers = {
delve = { delve = {
@ -73,7 +80,7 @@ in {
treesitter = { treesitter = {
enable = mkEnableOption "Go treesitter" // {default = config.vim.languages.enableTreesitter;}; enable = mkEnableOption "Go treesitter" // {default = config.vim.languages.enableTreesitter;};
package = nvim.types.mkGrammarOption pkgs "go"; package = mkGrammarOption pkgs "go";
}; };
lsp = { lsp = {
@ -81,14 +88,14 @@ in {
server = mkOption { server = mkOption {
description = "Go LSP server to use"; description = "Go LSP server to use";
type = with types; enum (attrNames servers); type = enum (attrNames servers);
default = defaultServer; default = defaultServer;
}; };
package = mkOption { package = mkOption {
description = "Go LSP server package, or the command to run as a list of strings"; description = "Go LSP server package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]''; example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]'';
type = with types; either package (listOf str); type = either package (listOf str);
default = servers.${cfg.lsp.server}.package; default = servers.${cfg.lsp.server}.package;
}; };
}; };
@ -96,17 +103,17 @@ in {
dap = { dap = {
enable = mkOption { enable = mkOption {
description = "Enable Go Debug Adapter"; description = "Enable Go Debug Adapter";
type = types.bool; type = bool;
default = config.vim.languages.enableDAP; default = config.vim.languages.enableDAP;
}; };
debugger = mkOption { debugger = mkOption {
description = "Go debugger to use"; description = "Go debugger to use";
type = with types; enum (attrNames debuggers); type = enum (attrNames debuggers);
default = defaultDebugger; default = defaultDebugger;
}; };
package = mkOption { package = mkOption {
description = "Go debugger package."; description = "Go debugger package.";
type = types.package; type = package;
default = debuggers.${cfg.dap.debugger}.package; default = debuggers.${cfg.dap.debugger}.package;
}; };
}; };

View file

@ -1,27 +1,26 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (lib) mkEnableOption mkOption types nvim mkIf mkMerge optional; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.types) bool;
inherit (lib.lists) optional;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.languages.html; cfg = config.vim.languages.html;
in { in {
options.vim.languages.html = { options.vim.languages.html = {
enable = mkEnableOption "HTML language support"; enable = mkEnableOption "HTML language support";
treesitter = { treesitter = {
enable = mkOption { enable = mkEnableOption "HTML treesitter support" // {default = config.vim.languages.enableTreesitter;};
description = "Enable HTML treesitter"; package = mkGrammarOption pkgs "html";
type = types.bool;
default = config.vim.languages.enableTreesitter;
};
package = nvim.types.mkGrammarOption pkgs "html";
autotagHtml = mkOption { autotagHtml = mkOption {
description = "Enable autoclose/autorename of html tags (nvim-ts-autotag)"; description = "Enable autoclose/autorename of html tags (nvim-ts-autotag)";
type = types.bool; type = bool;
default = true; default = true;
}; };
}; };
@ -29,14 +28,18 @@ in {
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
(mkIf cfg.treesitter.enable { (mkIf cfg.treesitter.enable {
vim.treesitter.enable = true; vim = {
vim.treesitter.grammars = [cfg.treesitter.package]; startPlugins = optional cfg.treesitter.autotagHtml "nvim-ts-autotag";
vim.startPlugins = optional cfg.treesitter.autotagHtml "nvim-ts-autotag"; treesitter = {
enable = true;
grammars = [cfg.treesitter.package];
};
vim.luaConfigRC.html-autotag = mkIf cfg.treesitter.autotagHtml (nvim.dag.entryAnywhere '' luaConfigRC.html-autotag = mkIf cfg.treesitter.autotagHtml (entryAnywhere ''
require('nvim-ts-autotag').setup() require('nvim-ts-autotag').setup()
''); '');
};
}) })
]); ]);
} }

View file

@ -1,10 +1,16 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge getExe; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.meta) getExe;
inherit (lib.lists) isList;
inherit (lib.types) either listOf package str;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.lua) expToLua;
cfg = config.vim.languages.java; cfg = config.vim.languages.java;
in { in {
@ -13,16 +19,15 @@ in {
treesitter = { treesitter = {
enable = mkEnableOption "Java treesitter" // {default = config.vim.languages.enableTreesitter;}; enable = mkEnableOption "Java treesitter" // {default = config.vim.languages.enableTreesitter;};
package = nvim.types.mkGrammarOption pkgs "java"; package = mkGrammarOption pkgs "java";
}; };
lsp = { lsp = {
enable = mkEnableOption "Java LSP support (java-language-server)" // {default = config.vim.languages.enableLSP;}; enable = mkEnableOption "Java LSP support (java-language-server)" // {default = config.vim.languages.enableLSP;};
package = mkOption { package = mkOption {
description = "java language server package, or the command to run as a list of strings"; description = "java language server package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]''; example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
type = with types; either package (listOf str); type = either package (listOf str);
default = pkgs.jdt-language-server; default = pkgs.jdt-language-server;
}; };
}; };
@ -37,7 +42,7 @@ in {
on_attach = default_on_attach, on_attach = default_on_attach,
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package then expToLua cfg.lsp.package
else ''{"${getExe cfg.lsp.package}", "-data", vim.fn.stdpath("cache").."/jdtls/workspace"}'' else ''{"${getExe cfg.lsp.package}", "-data", vim.fn.stdpath("cache").."/jdtls/workspace"}''
}, },
} }

View file

@ -1,10 +1,18 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge optionalString getExe; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.meta) getExe;
inherit (lib.lists) isList;
inherit (lib.strings) optionalString;
inherit (lib.types) either listOf package str;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.dag) entryBefore;
cfg = config.vim.languages.lua; cfg = config.vim.languages.lua;
in { in {
@ -12,14 +20,15 @@ in {
enable = mkEnableOption "Lua language support"; enable = mkEnableOption "Lua language support";
treesitter = { treesitter = {
enable = mkEnableOption "Lua Treesitter support" // {default = config.vim.languages.enableTreesitter;}; enable = mkEnableOption "Lua Treesitter support" // {default = config.vim.languages.enableTreesitter;};
package = nvim.types.mkGrammarOption pkgs "lua"; package = mkGrammarOption pkgs "lua";
}; };
lsp = { lsp = {
enable = mkEnableOption "Lua LSP support via LuaLS" // {default = config.vim.languages.enableLSP;}; enable = mkEnableOption "Lua LSP support via LuaLS" // {default = config.vim.languages.enableLSP;};
package = mkOption { package = mkOption {
description = "LuaLS package, or the command to run as a list of strings"; description = "LuaLS package, or the command to run as a list of strings";
type = with types; either package (listOf str); type = either package (listOf str);
default = pkgs.lua-language-server; default = pkgs.lua-language-server;
}; };
@ -43,7 +52,7 @@ in {
${optionalString cfg.lsp.neodev.enable "before_init = require('neodev.lsp').before_init;"} ${optionalString cfg.lsp.neodev.enable "before_init = require('neodev.lsp').before_init;"}
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package then expToLua cfg.lsp.package
else ''{"${getExe cfg.lsp.package}"}'' else ''{"${getExe cfg.lsp.package}"}''
}; };
} }
@ -52,7 +61,7 @@ in {
(mkIf cfg.lsp.neodev.enable { (mkIf cfg.lsp.neodev.enable {
vim.startPlugins = ["neodev-nvim"]; vim.startPlugins = ["neodev-nvim"];
vim.luaConfigRC.neodev = nvim.dag.entryBefore ["lua-lsp"] '' vim.luaConfigRC.neodev = entryBefore ["lua-lsp"] ''
require("neodev").setup({}) require("neodev").setup({})
''; '';
}) })

View file

@ -4,7 +4,9 @@
lib, lib,
... ...
}: let }: let
inherit (lib) nvim mkIf mkMerge isList; inherit (lib.nvim.lua) expToLua;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
cfg = config.vim.languages.markdown; cfg = config.vim.languages.markdown;
servers = { servers = {
@ -16,7 +18,7 @@
on_attach = default_on_attach; on_attach = default_on_attach;
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/marksman", "server"}'' else ''{"${cfg.lsp.package}/bin/marksman", "server"}''
}, },
} }
@ -27,13 +29,11 @@ in {
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
(mkIf cfg.treesitter.enable { (mkIf cfg.treesitter.enable {
vim.treesitter.enable = true; vim.treesitter.enable = true;
vim.treesitter.grammars = [cfg.treesitter.mdPackage cfg.treesitter.mdInlinePackage]; vim.treesitter.grammars = [cfg.treesitter.mdPackage cfg.treesitter.mdInlinePackage];
}) })
(mkIf cfg.lsp.enable { (mkIf cfg.lsp.enable {
vim.lsp.lspconfig.enable = true; vim.lsp.lspconfig.enable = true;
vim.lsp.lspconfig.sources.markdown-lsp = servers.${cfg.lsp.server}.lspConfig; vim.lsp.lspconfig.sources.markdown-lsp = servers.${cfg.lsp.server}.lspConfig;
}) })
]); ]);

View file

@ -1,11 +1,15 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (builtins) attrNames; inherit (builtins) attrNames;
inherit (lib) mkEnableOption mkOption types nvim isList; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.lists) isList;
inherit (lib.types) bool enum either package listOf str;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.types) mkGrammarOption;
cfg = config.vim.languages.markdown; cfg = config.vim.languages.markdown;
defaultServer = "marksman"; defaultServer = "marksman";
@ -18,7 +22,7 @@
on_attach = default_on_attach; on_attach = default_on_attach;
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/marksman", "server"}'' else ''{"${cfg.lsp.package}/bin/marksman", "server"}''
}, },
} }
@ -32,11 +36,11 @@ in {
treesitter = { treesitter = {
enable = mkOption { enable = mkOption {
description = "Enable Markdown treesitter"; description = "Enable Markdown treesitter";
type = types.bool; type = bool;
default = config.vim.languages.enableTreesitter; default = config.vim.languages.enableTreesitter;
}; };
mdPackage = nvim.types.mkGrammarOption pkgs "markdown"; mdPackage = mkGrammarOption pkgs "markdown";
mdInlinePackage = nvim.types.mkGrammarOption pkgs "markdown-inline"; mdInlinePackage = mkGrammarOption pkgs "markdown-inline";
}; };
lsp = { lsp = {
@ -44,14 +48,14 @@ in {
server = mkOption { server = mkOption {
description = "Markdown LSP server to use"; description = "Markdown LSP server to use";
type = with types; enum (attrNames servers); type = enum (attrNames servers);
default = defaultServer; default = defaultServer;
}; };
package = mkOption { package = mkOption {
description = "Markdown LSP server package, or the command to run as a list of strings"; description = "Markdown LSP server package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]''; example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]'';
type = with types; either package (listOf str); type = either package (listOf str);
default = servers.${cfg.lsp.server}.package; default = servers.${cfg.lsp.server}.package;
}; };
}; };

View file

@ -1,11 +1,17 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (builtins) attrNames; inherit (builtins) attrNames;
inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
inherit (lib.types) enum either listOf package str;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.lua) expToLua;
cfg = config.vim.languages.nim; cfg = config.vim.languages.nim;
defaultServer = "nimlsp"; defaultServer = "nimlsp";
@ -18,7 +24,7 @@
on_attach = default_on_attach; on_attach = default_on_attach;
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package then expToLua cfg.lsp.package
else '' else ''
{"${cfg.lsp.package}/bin/nimlsp"} {"${cfg.lsp.package}/bin/nimlsp"}
'' ''
@ -47,41 +53,37 @@ in {
enable = mkEnableOption "Nim language support"; enable = mkEnableOption "Nim language support";
treesitter = { treesitter = {
enable = mkOption { enable = mkEnableOption "Nim treesitter" // {default = config.vim.languages.enableTreesitter;};
description = "Enable Nim treesitter"; package = mkGrammarOption pkgs "nim";
type = types.bool;
default = config.vim.languages.enableTreesitter;
};
package = nvim.types.mkGrammarOption pkgs "nim";
}; };
lsp = { lsp = {
enable = mkEnableOption "Nim LSP support" // {default = config.vim.languages.enableLSP;}; enable = mkEnableOption "Nim LSP support" // {default = config.vim.languages.enableLSP;};
server = mkOption { server = mkOption {
description = "Nim LSP server to use"; description = "Nim LSP server to use";
type = types.str; type = str;
default = defaultServer; default = defaultServer;
}; };
package = mkOption { package = mkOption {
description = "Nim LSP server package, or the command to run as a list of strings"; description = "Nim LSP server package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.nimlsp]''; example = ''[lib.getExe pkgs.nimlsp]'';
type = with types; either package (listOf str); type = either package (listOf str);
default = servers.${cfg.lsp.server}.package; default = servers.${cfg.lsp.server}.package;
}; };
}; };
format = { format = {
enable = mkEnableOption "Nim formatting" // {default = config.vim.languages.enableFormat;}; enable = mkEnableOption "Nim formatting" // {default = config.vim.languages.enableFormat;};
type = mkOption { type = mkOption {
description = "Nim formatter to use"; description = "Nim formatter to use";
type = with types; enum (attrNames formats); type = enum (attrNames formats);
default = defaultFormat; default = defaultFormat;
}; };
package = mkOption { package = mkOption {
description = "Nim formatter package"; description = "Nim formatter package";
type = types.package; type = package;
default = formats.${cfg.format.type}.package; default = formats.${cfg.format.type}.package;
}; };
}; };

View file

@ -1,11 +1,19 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (builtins) attrNames; inherit (builtins) attrNames;
inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge optionalString; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
inherit (lib.strings) optionalString;
inherit (lib.types) enum either listOf package str;
inherit (lib.nvim.types) mkGrammarOption diagnostics;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.languages) diagnosticsToLua;
cfg = config.vim.languages.nix; cfg = config.vim.languages.nix;
@ -15,7 +23,7 @@
defaultServer = "nil"; defaultServer = "nil";
packageToCmd = package: defaultCmd: packageToCmd = package: defaultCmd:
if isList package if isList package
then lib.nvim.lua.expToLua package then expToLua package
else ''{"${package}/bin/${defaultCmd}"}''; else ''{"${package}/bin/${defaultCmd}"}'';
servers = { servers = {
rnix = { rnix = {
@ -82,14 +90,15 @@
) )
''; '';
}; };
nixpkgs-fmt = { nixpkgs-fmt = {
package = pkgs.nixpkgs-fmt; package = pkgs.nixpkgs-fmt;
# Never need to use null-ls for nixpkgs-fmt # Never need to use null-ls for nixpkgs-fmt
}; };
}; };
defaultDiagnostics = ["statix" "deadnix"]; defaultDiagnosticsProvider = ["statix" "deadnix"];
diagnostics = { diagnosticsProviders = {
statix = { statix = {
package = pkgs.statix; package = pkgs.statix;
nullConfig = pkg: '' nullConfig = pkg: ''
@ -101,6 +110,7 @@
) )
''; '';
}; };
deadnix = { deadnix = {
package = pkgs.deadnix; package = pkgs.deadnix;
nullConfig = pkg: '' nullConfig = pkg: ''
@ -118,26 +128,22 @@ in {
enable = mkEnableOption "Nix language support"; enable = mkEnableOption "Nix language support";
treesitter = { treesitter = {
enable = mkOption { enable = mkEnableOption "Nix treesitter" // {default = config.vim.languages.enableTreesitter;};
description = "Enable Nix treesitter"; package = mkGrammarOption pkgs "nix";
type = types.bool;
default = config.vim.languages.enableTreesitter;
};
package = nvim.types.mkGrammarOption pkgs "nix";
}; };
lsp = { lsp = {
enable = mkEnableOption "Nix LSP support" // {default = config.vim.languages.enableLSP;}; enable = mkEnableOption "Nix LSP support" // {default = config.vim.languages.enableLSP;};
server = mkOption { server = mkOption {
description = "Nix LSP server to use"; description = "Nix LSP server to use";
type = types.str; type = str;
default = defaultServer; default = defaultServer;
}; };
package = mkOption { package = mkOption {
description = "Nix LSP server package, or the command to run as a list of strings"; description = "Nix LSP server package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]''; example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
type = with types; either package (listOf str); type = either package (listOf str);
default = servers.${cfg.lsp.server}.package; default = servers.${cfg.lsp.server}.package;
}; };
}; };
@ -147,33 +153,30 @@ in {
type = mkOption { type = mkOption {
description = "Nix formatter to use"; description = "Nix formatter to use";
type = with types; enum (attrNames formats); type = enum (attrNames formats);
default = defaultFormat; default = defaultFormat;
}; };
package = mkOption { package = mkOption {
description = "Nix formatter package"; description = "Nix formatter package";
type = types.package; type = package;
default = formats.${cfg.format.type}.package; default = formats.${cfg.format.type}.package;
}; };
}; };
extraDiagnostics = { extraDiagnostics = {
enable = mkOption { enable = mkEnableOption "extra Nix diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
description = "Enable extra Nix diagnostics";
type = types.bool; types = diagnostics {
default = config.vim.languages.enableExtraDiagnostics;
};
types = lib.nvim.types.diagnostics {
langDesc = "Nix"; langDesc = "Nix";
inherit diagnostics; inherit diagnosticsProviders;
inherit defaultDiagnostics; inherit defaultDiagnosticsProvider;
}; };
}; };
}; };
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
{ {
vim.configRC.nix = nvim.dag.entryAnywhere '' vim.configRC.nix = entryAnywhere ''
autocmd filetype nix setlocal tabstop=2 shiftwidth=2 softtabstop=2 autocmd filetype nix setlocal tabstop=2 shiftwidth=2 softtabstop=2
''; '';
} }
@ -195,10 +198,10 @@ in {
(mkIf cfg.extraDiagnostics.enable { (mkIf cfg.extraDiagnostics.enable {
vim.lsp.null-ls.enable = true; vim.lsp.null-ls.enable = true;
vim.lsp.null-ls.sources = lib.nvim.languages.diagnosticsToLua { vim.lsp.null-ls.sources = diagnosticsToLua {
lang = "nix"; lang = "nix";
config = cfg.extraDiagnostics.types; config = cfg.extraDiagnostics.types;
inherit diagnostics; inherit diagnosticsProviders;
}; };
}) })
]); ]);

View file

@ -1,11 +1,17 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (builtins) attrNames; inherit (builtins) attrNames;
inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge getExe; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
inherit (lib.types) enum either listOf package str;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.lua) expToLua;
cfg = config.vim.languages.php; cfg = config.vim.languages.php;
@ -19,7 +25,7 @@
on_attach = default_on_attach, on_attach = default_on_attach,
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package then expToLua cfg.lsp.package
else '' else ''
{ {
"${getExe cfg.lsp.package}", "${getExe cfg.lsp.package}",
@ -39,7 +45,7 @@
on_attach = default_on_attach, on_attach = default_on_attach,
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package then expToLua cfg.lsp.package
else '' else ''
{ {
"${getExe cfg.lsp.package}", "${getExe cfg.lsp.package}",
@ -65,7 +71,7 @@ in {
treesitter = { treesitter = {
enable = mkEnableOption "PHP treesitter" // {default = config.vim.languages.enableTreesitter;}; enable = mkEnableOption "PHP treesitter" // {default = config.vim.languages.enableTreesitter;};
package = nvim.types.mkGrammarOption pkgs "php"; package = mkGrammarOption pkgs "php";
}; };
lsp = { lsp = {
@ -73,14 +79,14 @@ in {
server = mkOption { server = mkOption {
description = "PHP LSP server to use"; description = "PHP LSP server to use";
type = with types; enum (attrNames servers); type = enum (attrNames servers);
default = defaultServer; default = defaultServer;
}; };
package = mkOption { package = mkOption {
description = "PHP LSP server package, or the command to run as a list of strings"; description = "PHP LSP server package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]''; example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]'';
type = with types; either package (listOf str); type = either package (listOf str);
default = servers.${cfg.lsp.server}.package; default = servers.${cfg.lsp.server}.package;
}; };
}; };

View file

@ -1,11 +1,16 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (builtins) attrNames; inherit (builtins) attrNames;
inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge getExe literalExpression; inherit (lib.options) mkEnableOption mkOption literalExpression;
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
inherit (lib.types) enum either listOf package str bool;
inherit (lib.nvim.lua) expToLua;
cfg = config.vim.languages.python; cfg = config.vim.languages.python;
@ -19,7 +24,7 @@
on_attach = default_on_attach; on_attach = default_on_attach;
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/pyright-langserver", "--stdio"}'' else ''{"${cfg.lsp.package}/bin/pyright-langserver", "--stdio"}''
} }
} }
@ -40,6 +45,7 @@
) )
''; '';
}; };
isort = { isort = {
package = pkgs.isort; package = pkgs.isort;
nullConfig = '' nullConfig = ''
@ -51,6 +57,7 @@
) )
''; '';
}; };
black-and-isort = { black-and-isort = {
package = pkgs.writeShellApplication { package = pkgs.writeShellApplication {
name = "black"; name = "black";
@ -140,7 +147,7 @@ in {
enable = mkEnableOption "Python treesitter" // {default = config.vim.languages.enableTreesitter;}; enable = mkEnableOption "Python treesitter" // {default = config.vim.languages.enableTreesitter;};
package = mkOption { package = mkOption {
description = "Python treesitter grammar to use"; description = "Python treesitter grammar to use";
type = types.package; type = package;
default = pkgs.vimPlugins.nvim-treesitter.builtGrammars.python; default = pkgs.vimPlugins.nvim-treesitter.builtGrammars.python;
}; };
}; };
@ -150,14 +157,14 @@ in {
server = mkOption { server = mkOption {
description = "Python LSP server to use"; description = "Python LSP server to use";
type = with types; enum (attrNames servers); type = enum (attrNames servers);
default = defaultServer; default = defaultServer;
}; };
package = mkOption { package = mkOption {
description = "python LSP server package, or the command to run as a list of strings"; description = "python LSP server package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]''; example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
type = with types; either package (listOf str); type = either package (listOf str);
default = servers.${cfg.lsp.server}.package; default = servers.${cfg.lsp.server}.package;
}; };
}; };
@ -167,13 +174,13 @@ in {
type = mkOption { type = mkOption {
description = "Python formatter to use"; description = "Python formatter to use";
type = with types; enum (attrNames formats); type = enum (attrNames formats);
default = defaultFormat; default = defaultFormat;
}; };
package = mkOption { package = mkOption {
description = "Python formatter package"; description = "Python formatter package";
type = types.package; type = package;
default = formats.${cfg.format.type}.package; default = formats.${cfg.format.type}.package;
}; };
}; };
@ -182,25 +189,28 @@ in {
dap = { dap = {
enable = mkOption { enable = mkOption {
description = "Enable Python Debug Adapter"; description = "Enable Python Debug Adapter";
type = types.bool; type = bool;
default = config.vim.languages.enableDAP; default = config.vim.languages.enableDAP;
}; };
debugger = mkOption { debugger = mkOption {
description = "Python debugger to use"; description = "Python debugger to use";
type = with types; enum (attrNames debuggers); type = enum (attrNames debuggers);
default = defaultDebugger; default = defaultDebugger;
}; };
package = mkOption { package = mkOption {
type = package;
default = debuggers.${cfg.dap.debugger}.package;
example = literalExpression "with pkgs; python39.withPackages (ps: with ps; [debugpy])";
description = '' description = ''
Python debugger package. Python debugger package.
This is a python package with debugpy installed, see https://nixos.wiki/wiki/Python#Install_Python_Packages. This is a python package with debugpy installed, see https://nixos.wiki/wiki/Python#Install_Python_Packages.
''; '';
example = literalExpression "with pkgs; python39.withPackages (ps: with ps; [debugpy])";
type = types.package;
default = debuggers.${cfg.dap.debugger}.package;
}; };
}; };
}; };
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
(mkIf cfg.treesitter.enable { (mkIf cfg.treesitter.enable {
vim.treesitter.enable = true; vim.treesitter.enable = true;

View file

@ -1,10 +1,18 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge optionalString boolToString optionals; inherit (lib.modules) mkIf mkMerge;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.strings) optionalString;
inherit (lib.trivial) boolToString;
inherit (lib.lists) isList optionals;
inherit (lib.types) bool package str listOf either;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.languages.rust; cfg = config.vim.languages.rust;
in { in {
@ -13,31 +21,30 @@ in {
treesitter = { treesitter = {
enable = mkEnableOption "Rust treesitter" // {default = config.vim.languages.enableTreesitter;}; enable = mkEnableOption "Rust treesitter" // {default = config.vim.languages.enableTreesitter;};
package = nvim.types.mkGrammarOption pkgs "rust"; package = mkGrammarOption pkgs "rust";
}; };
crates = { crates = {
enable = mkEnableOption "crates-nvim, tools for managing dependencies"; enable = mkEnableOption "crates-nvim, tools for managing dependencies";
codeActions = mkOption { codeActions = mkOption {
description = "Enable code actions through null-ls"; description = "Enable code actions through null-ls";
type = types.bool; type = bool;
default = true; default = true;
}; };
}; };
lsp = { lsp = {
enable = mkEnableOption "Rust LSP support (rust-analyzer with extra tools)" // {default = config.vim.languages.enableLSP;}; enable = mkEnableOption "Rust LSP support (rust-analyzer with extra tools)" // {default = config.vim.languages.enableLSP;};
package = mkOption { package = mkOption {
description = "rust-analyzer package, or the command to run as a list of strings"; description = "rust-analyzer package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]''; example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
type = with types; either package (listOf str); type = either package (listOf str);
default = pkgs.rust-analyzer; default = pkgs.rust-analyzer;
}; };
opts = mkOption { opts = mkOption {
description = "Options to pass to rust analyzer"; description = "Options to pass to rust analyzer";
type = types.str; type = str;
default = ""; default = "";
}; };
}; };
@ -45,12 +52,13 @@ in {
dap = { dap = {
enable = mkOption { enable = mkOption {
description = "Rust Debug Adapter support"; description = "Rust Debug Adapter support";
type = types.bool; type = bool;
default = config.vim.languages.enableDAP; default = config.vim.languages.enableDAP;
}; };
package = mkOption { package = mkOption {
description = "lldb pacakge"; description = "lldb pacakge";
type = types.package; type = package;
default = pkgs.lldb; default = pkgs.lldb;
}; };
}; };
@ -58,89 +66,95 @@ in {
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
(mkIf cfg.crates.enable { (mkIf cfg.crates.enable {
vim.lsp.null-ls.enable = mkIf cfg.crates.codeActions true; vim = {
startPlugins = ["crates-nvim"];
vim.startPlugins = ["crates-nvim"]; lsp.null-ls.enable = mkIf cfg.crates.codeActions true;
autocomplete.sources = {"crates" = "[Crates]";};
vim.autocomplete.sources = {"crates" = "[Crates]";}; luaConfigRC.rust-crates = entryAnywhere ''
vim.luaConfigRC.rust-crates = nvim.dag.entryAnywhere '' require('crates').setup {
require('crates').setup { null_ls = {
null_ls = { enabled = ${boolToString cfg.crates.codeActions},
enabled = ${boolToString cfg.crates.codeActions}, name = "crates.nvim",
name = "crates.nvim", }
} }
} '';
''; };
}) })
(mkIf cfg.treesitter.enable { (mkIf cfg.treesitter.enable {
vim.treesitter.enable = true; vim.treesitter.enable = true;
vim.treesitter.grammars = [cfg.treesitter.package]; vim.treesitter.grammars = [cfg.treesitter.package];
}) })
(mkIf (cfg.lsp.enable || cfg.dap.enable) { (mkIf (cfg.lsp.enable || cfg.dap.enable) {
vim.startPlugins = ["rust-tools"] ++ optionals cfg.dap.enable [cfg.dap.package]; vim = {
startPlugins = ["rust-tools"] ++ optionals cfg.dap.enable [cfg.dap.package];
vim.lsp.lspconfig.enable = true; lsp.lspconfig = {
vim.lsp.lspconfig.sources.rust-lsp = '' enable = true;
local rt = require('rust-tools') sources.rust-lsp = ''
rust_on_attach = function(client, bufnr) local rt = require('rust-tools')
default_on_attach(client, bufnr) rust_on_attach = function(client, bufnr)
local opts = { noremap=true, silent=true, buffer = bufnr } default_on_attach(client, bufnr)
vim.keymap.set("n", "<leader>ris", rt.inlay_hints.set, opts) local opts = { noremap=true, silent=true, buffer = bufnr }
vim.keymap.set("n", "<leader>riu", rt.inlay_hints.unset, opts) vim.keymap.set("n", "<leader>ris", rt.inlay_hints.set, opts)
vim.keymap.set("n", "<leader>rr", rt.runnables.runnables, opts) vim.keymap.set("n", "<leader>riu", rt.inlay_hints.unset, opts)
vim.keymap.set("n", "<leader>rp", rt.parent_module.parent_module, opts) vim.keymap.set("n", "<leader>rr", rt.runnables.runnables, opts)
vim.keymap.set("n", "<leader>rm", rt.expand_macro.expand_macro, opts) vim.keymap.set("n", "<leader>rp", rt.parent_module.parent_module, opts)
vim.keymap.set("n", "<leader>rc", rt.open_cargo_toml.open_cargo_toml, opts) vim.keymap.set("n", "<leader>rm", rt.expand_macro.expand_macro, opts)
vim.keymap.set("n", "<leader>rg", function() rt.crate_graph.view_crate_graph("x11", nil) end, opts) vim.keymap.set("n", "<leader>rc", rt.open_cargo_toml.open_cargo_toml, opts)
${optionalString cfg.dap.enable '' vim.keymap.set("n", "<leader>rg", function() rt.crate_graph.view_crate_graph("x11", nil) end, opts)
vim.keymap.set("n", "<leader>rd", ":RustDebuggables<cr>", opts) ${optionalString cfg.dap.enable ''
vim.keymap.set( vim.keymap.set("n", "<leader>rd", ":RustDebuggables<cr>", opts)
"n", "${config.vim.debugger.nvim-dap.mappings.continue}", vim.keymap.set(
function() "n", "${config.vim.debugger.nvim-dap.mappings.continue}",
local dap = require("dap") function()
if dap.status() == "" then local dap = require("dap")
vim.cmd "RustDebuggables" if dap.status() == "" then
else vim.cmd "RustDebuggables"
dap.continue() else
end dap.continue()
end, end
opts end,
) opts
''} )
end ''}
local rustopts = { end
tools = { local rustopts = {
autoSetHints = true, tools = {
hover_with_actions = false, autoSetHints = true,
inlay_hints = { hover_with_actions = false,
only_current_line = false, inlay_hints = {
} only_current_line = false,
}, }
server = { },
capabilities = capabilities, server = {
on_attach = rust_on_attach, capabilities = capabilities,
cmd = ${ on_attach = rust_on_attach,
if isList cfg.lsp.package cmd = ${
then nvim.lua.expToLua cfg.lsp.package if isList cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/rust-analyzer"}'' then expToLua cfg.lsp.package
}, else ''{"${cfg.lsp.package}/bin/rust-analyzer"}''
settings = {
${cfg.lsp.opts}
}
},
${optionalString cfg.dap.enable ''
dap = {
adapter = {
type = "executable",
command = "${cfg.dap.package}/bin/lldb-vscode",
name = "rt_lldb",
}, },
}, settings = {
''} ${cfg.lsp.opts}
} }
rt.setup(rustopts) },
'';
${optionalString cfg.dap.enable ''
dap = {
adapter = {
type = "executable",
command = "${cfg.dap.package}/bin/lldb-vscode",
name = "rt_lldb",
},
},
''}
}
rt.setup(rustopts)
'';
};
};
}) })
]); ]);
} }

View file

@ -1,11 +1,17 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (builtins) attrNames; inherit (builtins) attrNames;
inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
inherit (lib.types) enum either listOf package str;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.languages) diagnosticsToLua;
inherit (lib.nvim.types) diagnostics;
cfg = config.vim.languages.sql; cfg = config.vim.languages.sql;
sqlfluffDefault = pkgs.sqlfluff; sqlfluffDefault = pkgs.sqlfluff;
@ -23,7 +29,7 @@
end, end,
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package then expToLua cfg.lsp.package
else ''{ "${cfg.lsp.package}/bin/sqls", "-config", string.format("%s/config.yml", vim.fn.getcwd()) }'' else ''{ "${cfg.lsp.package}/bin/sqls", "-config", string.format("%s/config.yml", vim.fn.getcwd()) }''
} }
} }
@ -47,8 +53,8 @@
}; };
}; };
defaultDiagnostics = ["sqlfluff"]; defaultDiagnosticsProvider = ["sqlfluff"];
diagnostics = { diagnosticsProviders = {
sqlfluff = { sqlfluff = {
package = sqlfluffDefault; package = sqlfluffDefault;
nullConfig = pkg: '' nullConfig = pkg: ''
@ -68,7 +74,7 @@ in {
dialect = mkOption { dialect = mkOption {
description = "SQL dialect for sqlfluff (if used)"; description = "SQL dialect for sqlfluff (if used)";
type = types.str; type = str;
default = "ansi"; default = "ansi";
}; };
@ -77,7 +83,7 @@ in {
package = mkOption { package = mkOption {
description = "SQL treesitter grammar to use"; description = "SQL treesitter grammar to use";
type = types.package; type = package;
default = pkgs.vimPlugins.nvim-treesitter.builtGrammars.sql; default = pkgs.vimPlugins.nvim-treesitter.builtGrammars.sql;
}; };
}; };
@ -87,14 +93,14 @@ in {
server = mkOption { server = mkOption {
description = "SQL LSP server to use"; description = "SQL LSP server to use";
type = with types; enum (attrNames servers); type = enum (attrNames servers);
default = defaultServer; default = defaultServer;
}; };
package = mkOption { package = mkOption {
description = "SQL LSP server package, or the command to run as a list of strings"; description = "SQL LSP server package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]''; example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
type = with types; either package (listOf str); type = either package (listOf str);
default = servers.${cfg.lsp.server}.package; default = servers.${cfg.lsp.server}.package;
}; };
}; };
@ -104,13 +110,13 @@ in {
type = mkOption { type = mkOption {
description = "SQL formatter to use"; description = "SQL formatter to use";
type = with types; enum (attrNames formats); type = enum (attrNames formats);
default = defaultFormat; default = defaultFormat;
}; };
package = mkOption { package = mkOption {
description = "SQL formatter package"; description = "SQL formatter package";
type = types.package; type = package;
default = formats.${cfg.format.type}.package; default = formats.${cfg.format.type}.package;
}; };
}; };
@ -118,10 +124,10 @@ in {
extraDiagnostics = { extraDiagnostics = {
enable = mkEnableOption "extra SQL diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;}; enable = mkEnableOption "extra SQL diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
types = lib.nvim.types.diagnostics { types = diagnostics {
langDesc = "SQL"; langDesc = "SQL";
inherit diagnostics; inherit diagnosticsProviders;
inherit defaultDiagnostics; inherit defaultDiagnosticsProvider;
}; };
}; };
}; };
@ -133,10 +139,14 @@ in {
}) })
(mkIf cfg.lsp.enable { (mkIf cfg.lsp.enable {
vim.startPlugins = ["sqls-nvim"]; vim = {
startPlugins = ["sqls-nvim"];
vim.lsp.lspconfig.enable = true; lsp.lspconfig = {
vim.lsp.lspconfig.sources.sql-lsp = servers.${cfg.lsp.server}.lspConfig; enable = true;
sources.sql-lsp = servers.${cfg.lsp.server}.lspConfig;
};
};
}) })
(mkIf cfg.format.enable { (mkIf cfg.format.enable {
@ -146,10 +156,10 @@ in {
(mkIf cfg.extraDiagnostics.enable { (mkIf cfg.extraDiagnostics.enable {
vim.lsp.null-ls.enable = true; vim.lsp.null-ls.enable = true;
vim.lsp.null-ls.sources = lib.nvim.languages.diagnosticsToLua { vim.lsp.null-ls.sources = diagnosticsToLua {
lang = "sql"; lang = "sql";
config = cfg.extraDiagnostics.types; config = cfg.extraDiagnostics.types;
inherit diagnostics; inherit diagnosticsProviders;
}; };
}) })
]); ]);

View file

@ -1,11 +1,18 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (builtins) attrNames; inherit (builtins) attrNames;
inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
inherit (lib.meta) getExe;
inherit (lib.types) enum either listOf package str;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.languages) diagnosticsToLua;
inherit (lib.nvim.types) mkGrammarOption diagnostics;
cfg = config.vim.languages.svelte; cfg = config.vim.languages.svelte;
@ -19,7 +26,7 @@
on_attach = attach_keymaps, on_attach = attach_keymaps,
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/svelteserver", "--stdio"}'' else ''{"${cfg.lsp.package}/bin/svelteserver", "--stdio"}''
} }
} }
@ -44,15 +51,15 @@
}; };
# TODO: specify packages # TODO: specify packages
defaultDiagnostics = ["eslint_d"]; defaultDiagnosticsProvider = ["eslint_d"];
diagnostics = { diagnosticsProviders = {
eslint_d = { eslint_d = {
package = pkgs.nodePackages.eslint_d; package = pkgs.nodePackages.eslint_d;
nullConfig = pkg: '' nullConfig = pkg: ''
table.insert( table.insert(
ls_sources, ls_sources,
null_ls.builtins.diagnostics.eslint_d.with({ null_ls.builtins.diagnostics.eslint_d.with({
command = "${lib.getExe pkg}", command = "${getExe pkg}",
}) })
) )
''; '';
@ -65,7 +72,7 @@ in {
treesitter = { treesitter = {
enable = mkEnableOption "Svelte treesitter" // {default = config.vim.languages.enableTreesitter;}; enable = mkEnableOption "Svelte treesitter" // {default = config.vim.languages.enableTreesitter;};
sveltePackage = nvim.types.mkGrammarOption pkgs "svelte"; sveltePackage = mkGrammarOption pkgs "svelte";
}; };
lsp = { lsp = {
@ -73,14 +80,14 @@ in {
server = mkOption { server = mkOption {
description = "Svelte LSP server to use"; description = "Svelte LSP server to use";
type = with types; enum (attrNames servers); type = enum (attrNames servers);
default = defaultServer; default = defaultServer;
}; };
package = mkOption { package = mkOption {
description = "Svelte LSP server package, or the command to run as a list of strings"; description = "Svelte LSP server package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]''; example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
type = with types; either package (listOf str); type = either package (listOf str);
default = servers.${cfg.lsp.server}.package; default = servers.${cfg.lsp.server}.package;
}; };
}; };
@ -90,13 +97,13 @@ in {
type = mkOption { type = mkOption {
description = "Svelte formatter to use"; description = "Svelte formatter to use";
type = with types; enum (attrNames formats); type = enum (attrNames formats);
default = defaultFormat; default = defaultFormat;
}; };
package = mkOption { package = mkOption {
description = "Svelte formatter package"; description = "Svelte formatter package";
type = types.package; type = package;
default = formats.${cfg.format.type}.package; default = formats.${cfg.format.type}.package;
}; };
}; };
@ -104,10 +111,10 @@ in {
extraDiagnostics = { extraDiagnostics = {
enable = mkEnableOption "extra Svelte diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;}; enable = mkEnableOption "extra Svelte diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
types = lib.nvim.types.diagnostics { types = diagnostics {
langDesc = "Svelte"; langDesc = "Svelte";
inherit diagnostics; inherit diagnosticsProviders;
inherit defaultDiagnostics; inherit defaultDiagnosticsProvider;
}; };
}; };
}; };
@ -130,10 +137,10 @@ in {
(mkIf cfg.extraDiagnostics.enable { (mkIf cfg.extraDiagnostics.enable {
vim.lsp.null-ls.enable = true; vim.lsp.null-ls.enable = true;
vim.lsp.null-ls.sources = lib.nvim.languages.diagnosticsToLua { vim.lsp.null-ls.sources = diagnosticsToLua {
lang = "svelte"; lang = "svelte";
config = cfg.extraDiagnostics.types; config = cfg.extraDiagnostics.types;
inherit diagnostics; inherit diagnosticsProviders;
}; };
}) })
]); ]);

View file

@ -5,7 +5,11 @@
... ...
}: let }: let
inherit (builtins) attrNames; inherit (builtins) attrNames;
inherit (lib) mkEnableOption mkOption mkIf mkMerge isList types nvim; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
inherit (lib.types) enum either listOf package str;
inherit (lib.nvim.lua) expToLua;
cfg = config.vim.languages.tailwind; cfg = config.vim.languages.tailwind;
@ -19,7 +23,7 @@
on_attach = default_on_attach; on_attach = default_on_attach;
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/tailwindcss-language-server", "--stdio"}'' else ''{"${cfg.lsp.package}/bin/tailwindcss-language-server", "--stdio"}''
} }
} }
@ -35,14 +39,14 @@ in {
server = mkOption { server = mkOption {
description = "Tailwindcss LSP server to use"; description = "Tailwindcss LSP server to use";
type = with types; enum (attrNames servers); type = enum (attrNames servers);
default = defaultServer; default = defaultServer;
}; };
package = mkOption { package = mkOption {
description = "Tailwindcss LSP server package, or the command to run as a list of strings"; description = "Tailwindcss LSP server package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]''; example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]'';
type = with types; either package (listOf str); type = either package (listOf str);
default = servers.${cfg.lsp.server}.package; default = servers.${cfg.lsp.server}.package;
}; };
}; };

View file

@ -1,10 +1,13 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (lib) nvim mkEnableOption mkOption types mkIf mkMerge; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.types) package;
inherit (lib.nvim.types) mkGrammarOption;
cfg = config.vim.languages.terraform; cfg = config.vim.languages.terraform;
in { in {
@ -13,7 +16,7 @@ in {
treesitter = { treesitter = {
enable = mkEnableOption "Terraform treesitter" // {default = config.vim.languages.enableTreesitter;}; enable = mkEnableOption "Terraform treesitter" // {default = config.vim.languages.enableTreesitter;};
package = nvim.types.mkGrammarOption pkgs "terraform"; package = mkGrammarOption pkgs "terraform";
}; };
lsp = { lsp = {
@ -21,7 +24,7 @@ in {
package = mkOption { package = mkOption {
description = "terraform-ls package"; description = "terraform-ls package";
type = with types; package; type = package;
default = pkgs.terraform-ls; default = pkgs.terraform-ls;
}; };
}; };

View file

@ -4,7 +4,7 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf; inherit (lib.modules) mkIf;
cfg = config.vim.tidal; cfg = config.vim.tidal;
in { in {

View file

@ -3,20 +3,21 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkEnableOption mkOption types; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) int bool;
in { in {
options.vim.tidal = { options.vim.tidal = {
enable = mkEnableOption "tidalcycles tools and plugins"; enable = mkEnableOption "tidalcycles tools and plugins";
flash = mkOption { flash = mkOption {
description = ''When sending a paragraph or a single line, vim-tidal will "flash" the selection for some milliseconds''; description = ''When sending a paragraph or a single line, vim-tidal will "flash" the selection for some milliseconds'';
type = types.int; type = int;
default = 150; default = 150;
}; };
openSC = mkOption { openSC = mkOption {
description = "Automatically run the supercollider CLI, sclang, alongside the Tidal GHCI terminal."; description = "Automatically run the supercollider CLI, sclang, alongside the Tidal GHCI terminal.";
type = types.bool; type = bool;
default = true; default = true;
}; };
}; };

View file

@ -1,11 +1,18 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (builtins) attrNames; inherit (builtins) attrNames;
inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
inherit (lib.meta) getExe;
inherit (lib.types) enum either listOf package str;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.types) mkGrammarOption diagnostics;
inherit (lib.nvim.languages) diagnosticsToLua;
cfg = config.vim.languages.ts; cfg = config.vim.languages.ts;
@ -19,7 +26,7 @@
on_attach = attach_keymaps, on_attach = attach_keymaps,
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/typescript-language-server", "--stdio"}'' else ''{"${cfg.lsp.package}/bin/typescript-language-server", "--stdio"}''
} }
} }
@ -34,7 +41,7 @@
on_attach = attach_keymaps, on_attach = attach_keymaps,
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/deno", "lsp"}'' else ''{"${cfg.lsp.package}/bin/deno", "lsp"}''
} }
} }
@ -70,15 +77,15 @@
}; };
# TODO: specify packages # TODO: specify packages
defaultDiagnostics = ["eslint_d"]; defaultDiagnosticsProvider = ["eslint_d"];
diagnostics = { diagnosticsProviders = {
eslint_d = { eslint_d = {
package = pkgs.nodePackages.eslint_d; package = pkgs.nodePackages.eslint_d;
nullConfig = pkg: '' nullConfig = pkg: ''
table.insert( table.insert(
ls_sources, ls_sources,
null_ls.builtins.diagnostics.eslint_d.with({ null_ls.builtins.diagnostics.eslint_d.with({
command = "${lib.getExe pkg}", command = "${getExe pkg}",
}) })
) )
''; '';
@ -90,8 +97,8 @@ in {
treesitter = { treesitter = {
enable = mkEnableOption "Typescript/Javascript treesitter" // {default = config.vim.languages.enableTreesitter;}; enable = mkEnableOption "Typescript/Javascript treesitter" // {default = config.vim.languages.enableTreesitter;};
tsPackage = nvim.types.mkGrammarOption pkgs "tsx"; tsPackage = mkGrammarOption pkgs "tsx";
jsPackage = nvim.types.mkGrammarOption pkgs "javascript"; jsPackage = mkGrammarOption pkgs "javascript";
}; };
lsp = { lsp = {
@ -99,14 +106,14 @@ in {
server = mkOption { server = mkOption {
description = "Typescript/Javascript LSP server to use"; description = "Typescript/Javascript LSP server to use";
type = with types; enum (attrNames servers); type = enum (attrNames servers);
default = defaultServer; default = defaultServer;
}; };
package = mkOption { package = mkOption {
description = "Typescript/Javascript LSP server package, or the command to run as a list of strings"; description = "Typescript/Javascript LSP server package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]''; example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
type = with types; either package (listOf str); type = either package (listOf str);
default = servers.${cfg.lsp.server}.package; default = servers.${cfg.lsp.server}.package;
}; };
}; };
@ -116,13 +123,13 @@ in {
type = mkOption { type = mkOption {
description = "Typescript/Javascript formatter to use"; description = "Typescript/Javascript formatter to use";
type = with types; enum (attrNames formats); type = enum (attrNames formats);
default = defaultFormat; default = defaultFormat;
}; };
package = mkOption { package = mkOption {
description = "Typescript/Javascript formatter package"; description = "Typescript/Javascript formatter package";
type = types.package; type = package;
default = formats.${cfg.format.type}.package; default = formats.${cfg.format.type}.package;
}; };
}; };
@ -130,10 +137,10 @@ in {
extraDiagnostics = { extraDiagnostics = {
enable = mkEnableOption "extra Typescript/Javascript diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;}; enable = mkEnableOption "extra Typescript/Javascript diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
types = lib.nvim.types.diagnostics { types = diagnostics {
langDesc = "Typescript/Javascript"; langDesc = "Typescript/Javascript";
inherit diagnostics; inherit diagnosticsProviders;
inherit defaultDiagnostics; inherit defaultDiagnosticsProvider;
}; };
}; };
}; };
@ -156,10 +163,10 @@ in {
(mkIf cfg.extraDiagnostics.enable { (mkIf cfg.extraDiagnostics.enable {
vim.lsp.null-ls.enable = true; vim.lsp.null-ls.enable = true;
vim.lsp.null-ls.sources = lib.nvim.languages.diagnosticsToLua { vim.lsp.null-ls.sources = diagnosticsToLua {
lang = "ts"; lang = "ts";
config = cfg.extraDiagnostics.types; config = cfg.extraDiagnostics.types;
inherit diagnostics; inherit diagnosticsProviders;
}; };
}) })
]); ]);

View file

@ -1,10 +1,15 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
inherit (lib.types) either listOf package str;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.types) mkGrammarOption;
cfg = config.vim.languages.zig; cfg = config.vim.languages.zig;
in { in {
@ -13,7 +18,7 @@ in {
treesitter = { treesitter = {
enable = mkEnableOption "Zig treesitter" // {default = config.vim.languages.enableTreesitter;}; enable = mkEnableOption "Zig treesitter" // {default = config.vim.languages.enableTreesitter;};
package = nvim.types.mkGrammarOption pkgs "zig"; package = mkGrammarOption pkgs "zig";
}; };
lsp = { lsp = {
@ -22,13 +27,13 @@ in {
package = mkOption { package = mkOption {
description = "ZLS package, or the command to run as a list of strings"; description = "ZLS package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]''; example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
type = with types; either package (listOf str); type = either package (listOf str);
default = pkgs.zls; default = pkgs.zls;
}; };
zigPackage = mkOption { zigPackage = mkOption {
description = "Zig package used by ZLS"; description = "Zig package used by ZLS";
type = types.package; type = package;
default = pkgs.zig; default = pkgs.zig;
}; };
}; };
@ -47,7 +52,7 @@ in {
on_attach=default_on_attach, on_attach=default_on_attach,
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/zls"}'' else ''{"${cfg.lsp.package}/bin/zls"}''
}, },
settings = { settings = {

View file

@ -4,7 +4,11 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib) addDescriptionsToMappings mkIf optional boolToString optionalString; inherit (lib.modules) mkIf;
inherit (lib.lists) optional;
inherit (lib.strings) optionalString;
inherit (lib.trivial) boolToString;
inherit (lib.nvim.binds) addDescriptionsToMappings;
cfg = config.vim.lsp; cfg = config.vim.lsp;
usingNvimCmp = config.vim.autocomplete.enable && config.vim.autocomplete.type == "nvim-cmp"; usingNvimCmp = config.vim.autocomplete.enable && config.vim.autocomplete.type == "nvim-cmp";
@ -15,99 +19,102 @@
mkBinding = binding: action: "vim.api.nvim_buf_set_keymap(bufnr, 'n', '${binding.value}', '<cmd>lua ${action}<CR>', {noremap=true, silent=true, desc='${binding.description}'})"; mkBinding = binding: action: "vim.api.nvim_buf_set_keymap(bufnr, 'n', '${binding.value}', '<cmd>lua ${action}<CR>', {noremap=true, silent=true, desc='${binding.description}'})";
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim.startPlugins = optional usingNvimCmp "cmp-nvim-lsp"; vim = {
startPlugins = optional usingNvimCmp "cmp-nvim-lsp";
vim.autocomplete.sources = {"nvim_lsp" = "[LSP]";}; autocomplete.sources = {"nvim_lsp" = "[LSP]";};
vim.luaConfigRC.lsp-setup = ''
vim.g.formatsave = ${boolToString cfg.formatOnSave};
local attach_keymaps = function(client, bufnr) luaConfigRC.lsp-setup = ''
${mkBinding mappings.goToDeclaration "vim.lsp.buf.declaration()"} vim.g.formatsave = ${boolToString cfg.formatOnSave};
${mkBinding mappings.goToDefinition "vim.lsp.buf.definition()"}
${mkBinding mappings.goToType "vim.lsp.buf.type_definition()"}
${mkBinding mappings.listImplementations "vim.lsp.buf.implementation()"}
${mkBinding mappings.listReferences "vim.lsp.buf.references()"}
${mkBinding mappings.nextDiagnostic "vim.diagnostic.goto_next()"}
${mkBinding mappings.previousDiagnostic "vim.diagnostic.goto_prev()"}
${mkBinding mappings.openDiagnosticFloat "vim.diagnostic.open_float()"}
${mkBinding mappings.documentHighlight "vim.lsp.buf.document_highlight()"}
${mkBinding mappings.listDocumentSymbols "vim.lsp.buf.document_symbol()"}
${mkBinding mappings.addWorkspaceFolder "vim.lsp.buf.add_workspace_folder()"}
${mkBinding mappings.removeWorkspaceFolder "vim.lsp.buf.remove_workspace_folder()"}
${mkBinding mappings.listWorkspaceFolders "print(vim.inspect(vim.lsp.buf.list_workspace_folders()))"}
${mkBinding mappings.listWorkspaceSymbols "vim.lsp.buf.workspace_symbol()"}
${mkBinding mappings.hover "vim.lsp.buf.hover()"}
${mkBinding mappings.signatureHelp "vim.lsp.buf.signature_help()"}
${mkBinding mappings.renameSymbol "vim.lsp.buf.rename()"}
${mkBinding mappings.codeAction "vim.lsp.buf.code_action()"}
${mkBinding mappings.format "vim.lsp.buf.format()"}
${mkBinding mappings.toggleFormatOnSave "vim.b.disableFormatSave = not vim.b.disableFormatSave"}
end
-- Enable formatting local attach_keymaps = function(client, bufnr)
local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) ${mkBinding mappings.goToDeclaration "vim.lsp.buf.declaration()"}
${mkBinding mappings.goToDefinition "vim.lsp.buf.definition()"}
${mkBinding mappings.goToType "vim.lsp.buf.type_definition()"}
${mkBinding mappings.listImplementations "vim.lsp.buf.implementation()"}
${mkBinding mappings.listReferences "vim.lsp.buf.references()"}
${mkBinding mappings.nextDiagnostic "vim.diagnostic.goto_next()"}
${mkBinding mappings.previousDiagnostic "vim.diagnostic.goto_prev()"}
${mkBinding mappings.openDiagnosticFloat "vim.diagnostic.open_float()"}
${mkBinding mappings.documentHighlight "vim.lsp.buf.document_highlight()"}
${mkBinding mappings.listDocumentSymbols "vim.lsp.buf.document_symbol()"}
${mkBinding mappings.addWorkspaceFolder "vim.lsp.buf.add_workspace_folder()"}
${mkBinding mappings.removeWorkspaceFolder "vim.lsp.buf.remove_workspace_folder()"}
${mkBinding mappings.listWorkspaceFolders "print(vim.inspect(vim.lsp.buf.list_workspace_folders()))"}
${mkBinding mappings.listWorkspaceSymbols "vim.lsp.buf.workspace_symbol()"}
${mkBinding mappings.hover "vim.lsp.buf.hover()"}
${mkBinding mappings.signatureHelp "vim.lsp.buf.signature_help()"}
${mkBinding mappings.renameSymbol "vim.lsp.buf.rename()"}
${mkBinding mappings.codeAction "vim.lsp.buf.code_action()"}
${mkBinding mappings.format "vim.lsp.buf.format()"}
${mkBinding mappings.toggleFormatOnSave "vim.b.disableFormatSave = not vim.b.disableFormatSave"}
end
format_callback = function(client, bufnr) -- Enable formatting
if vim.g.formatsave then local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
${
if config.vim.lsp.null-ls.enable
then ''
if vim.b.disableFormatSave then
return
end
local function is_null_ls_formatting_enabled(bufnr) format_callback = function(client, bufnr)
local file_type = vim.api.nvim_buf_get_option(bufnr, "filetype") if vim.g.formatsave then
local generators = require("null-ls.generators").get_available( vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
file_type, vim.api.nvim_create_autocmd("BufWritePre", {
require("null-ls.methods").internal.FORMATTING group = augroup,
) buffer = bufnr,
return #generators > 0 callback = function()
end ${
if config.vim.lsp.null-ls.enable
then ''
if vim.b.disableFormatSave then
return
end
if is_null_ls_formatting_enabled(bufnr) then local function is_null_ls_formatting_enabled(bufnr)
vim.lsp.buf.format({ local file_type = vim.api.nvim_buf_get_option(bufnr, "filetype")
bufnr = bufnr, local generators = require("null-ls.generators").get_available(
filter = function(client) file_type,
return client.name == "null-ls" require("null-ls.methods").internal.FORMATTING
end )
}) return #generators > 0
else end
vim.lsp.buf.format({
bufnr = bufnr, if is_null_ls_formatting_enabled(bufnr) then
}) vim.lsp.buf.format({
end bufnr = bufnr,
'' filter = function(client)
else " return client.name == "null-ls"
end
})
else
vim.lsp.buf.format({
bufnr = bufnr,
})
end
''
else "
vim.lsp.buf.format({ vim.lsp.buf.format({
bufnr = bufnr, bufnr = bufnr,
}) })
" "
} }
end, end,
}) })
end
end end
end
${optionalString (config.vim.ui.breadcrumbs.enable) ''local navic = require("nvim-navic")''} ${optionalString (config.vim.ui.breadcrumbs.enable) ''local navic = require("nvim-navic")''}
default_on_attach = function(client, bufnr) default_on_attach = function(client, bufnr)
attach_keymaps(client, bufnr) attach_keymaps(client, bufnr)
format_callback(client, bufnr) format_callback(client, bufnr)
${optionalString (config.vim.ui.breadcrumbs.enable) '' ${optionalString (config.vim.ui.breadcrumbs.enable) ''
-- let navic attach to buffers -- let navic attach to buffers
if client.server_capabilities.documentSymbolProvider then if client.server_capabilities.documentSymbolProvider then
navic.attach(client, bufnr) navic.attach(client, bufnr)
end
''}
end end
''}
end
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()
${optionalString usingNvimCmp "capabilities = require('cmp_nvim_lsp').default_capabilities()"} ${optionalString usingNvimCmp "capabilities = require('cmp_nvim_lsp').default_capabilities()"}
''; '';
};
}; };
} }

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
# nvim lsp support # nvim lsp support
./config.nix ./config.nix

View file

@ -3,20 +3,21 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf nvim; inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf (cfg.enable && cfg.lightbulb.enable) { config = mkIf (cfg.enable && cfg.lightbulb.enable) {
vim.startPlugins = ["nvim-lightbulb"]; vim = {
startPlugins = ["nvim-lightbulb"];
vim.configRC.lightbulb = nvim.dag.entryAnywhere '' luaConfigRC.lightbulb = entryAnywhere ''
autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb() vim.api.nvim_command('autocmd CursorHold,CursorHoldI * lua require\'nvim-lightbulb\'.update_lightbulb()')
'';
vim.luaConfigRC.lightbulb = nvim.dag.entryAnywhere '' -- Enable trouble diagnostics viewer
-- Enable trouble diagnostics viewer require'nvim-lightbulb'.setup()
require'nvim-lightbulb'.setup() '';
''; };
}; };
} }

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./lightbulb.nix ./lightbulb.nix
./config.nix ./config.nix

View file

@ -1,9 +1,5 @@
{ {lib, ...}: let
config, inherit (lib.options) mkEnableOption;
lib,
...
}: let
inherit (lib) mkEnableOption;
in { in {
options.vim.lsp = { options.vim.lsp = {
lightbulb = { lightbulb = {

View file

@ -3,25 +3,29 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf nvim optionalString; inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.strings) optionalString;
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf (cfg.enable && cfg.lspSignature.enable) { config = mkIf (cfg.enable && cfg.lspSignature.enable) {
vim.startPlugins = [ vim = {
"lsp-signature" startPlugins = [
]; "lsp-signature"
];
vim.luaConfigRC.lsp-signature = nvim.dag.entryAnywhere '' luaConfigRC.lsp-signature = entryAnywhere ''
-- Enable lsp signature viewer -- Enable lsp signature viewer
require("lsp_signature").setup({ require("lsp_signature").setup({
${optionalString (config.vim.ui.borders.plugins.lsp-signature.enable) '' ${optionalString config.vim.ui.borders.plugins.lsp-signature.enable ''
bind = true, -- This is mandatory, otherwise border config won't get registered. bind = true, -- This is mandatory, otherwise border config won't get registered.
handler_opts = { handler_opts = {
border = "${config.vim.ui.borders.plugins.lsp-signature.style}" border = "${config.vim.ui.borders.plugins.lsp-signature.style}"
} }
''} ''}
}) })
''; '';
};
}; };
} }

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./lsp-signature.nix ./lsp-signature.nix
./config.nix ./config.nix

View file

@ -1,13 +1,9 @@
{ {lib, ...}: let
config, inherit (lib.options) mkEnableOption;
lib,
...
}: let
inherit (lib) mkEnableOption;
in { in {
options.vim.lsp = { options.vim.lsp = {
lspSignature = { lspSignature = {
enable = mkEnableOption "lsp signature viewer"; enable = mkEnableOption "lsp signature viewer [lsp-signature]";
}; };
}; };
} }

View file

@ -1,32 +1,35 @@
{ {
pkgs,
config, config,
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf mkMerge nvim optionalString mapAttrs; inherit (lib.modules) mkIf mkMerge;
inherit (lib.strings) optionalString;
inherit (lib.attrsets) mapAttrs;
inherit (lib.nvim.dag) entryAfter;
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf cfg.lspconfig.enable (mkMerge [ config = mkIf cfg.lspconfig.enable (mkMerge [
{ {
vim.lsp.enable = true; vim = {
lsp.enable = true;
vim.startPlugins = ["nvim-lspconfig"]; startPlugins = ["nvim-lspconfig"];
vim.luaConfigRC.lspconfig = nvim.dag.entryAfter ["lsp-setup"] '' luaConfigRC.lspconfig = entryAfter ["lsp-setup"] ''
local lspconfig = require('lspconfig') local lspconfig = require('lspconfig')
${ ${
# TODO: make border style configurable optionalString config.vim.ui.borders.enable ''
optionalString (config.vim.ui.borders.enable) '' require('lspconfig.ui.windows').default_options.border = '${config.vim.ui.borders.globalStyle}'
require('lspconfig.ui.windows').default_options.border = '${config.vim.ui.borders.globalStyle}' ''
'' }
} '';
''; };
} }
{ {
vim.luaConfigRC = mapAttrs (_: v: (nvim.dag.entryAfter ["lspconfig"] v)) cfg.lspconfig.sources; vim.luaConfigRC = mapAttrs (_: v: (entryAfter ["lspconfig"] v)) cfg.lspconfig.sources;
} }
]); ]);
} }

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./config.nix ./config.nix
./lspconfig.nix ./lspconfig.nix

View file

@ -1,17 +1,13 @@
{ {lib, ...}: let
pkgs, inherit (lib.options) mkEnableOption mkOption;
config, inherit (lib.types) attrsOf str;
lib,
...
}: let
inherit (lib) mkEnableOption mkOption types;
in { in {
options.vim.lsp.lspconfig = { options.vim.lsp.lspconfig = {
enable = mkEnableOption "nvim-lspconfig, also enabled automatically"; enable = mkEnableOption "nvim-lspconfig, also enabled automatically";
sources = mkOption { sources = mkOption {
description = "nvim-lspconfig sources"; description = "nvim-lspconfig sources";
type = with types; attrsOf str; type = attrsOf str;
default = {}; default = {};
}; };
}; };

View file

@ -1,16 +1,16 @@
{ {
pkgs,
config, config,
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf nvim; inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf (cfg.enable && cfg.lspkind.enable) { config = mkIf (cfg.enable && cfg.lspkind.enable) {
vim.startPlugins = ["lspkind"]; vim.startPlugins = ["lspkind"];
vim.luaConfigRC.lspkind = nvim.dag.entryAnywhere '' vim.luaConfigRC.lspkind = entryAnywhere ''
local lspkind = require'lspkind' local lspkind = require'lspkind'
local lspkind_opts = { local lspkind_opts = {
mode = '${cfg.lspkind.mode}' mode = '${cfg.lspkind.mode}'

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./config.nix ./config.nix
./lspkind.nix ./lspkind.nix

View file

@ -1,12 +1,6 @@
{ {lib, ...}: let
pkgs, inherit (lib.options) mkEnableOption mkOption;
config, inherit (lib.types) enum;
lib,
...
}: let
inherit (lib) mkEnableOption mkOption types;
cfg = config.vim.lsp;
in { in {
options.vim.lsp = { options.vim.lsp = {
lspkind = { lspkind = {
@ -14,7 +8,7 @@ in {
mode = mkOption { mode = mkOption {
description = "Defines how annotations are shown"; description = "Defines how annotations are shown";
type = with types; enum ["text" "text_symbol" "symbol_text" "symbol"]; type = enum ["text" "text_symbol" "symbol_text" "symbol"];
default = "symbol_text"; default = "symbol_text";
}; };
}; };

View file

@ -3,13 +3,14 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf nvim; inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAfter;
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf (cfg.enable && cfg.lsplines.enable) { config = mkIf (cfg.enable && cfg.lsplines.enable) {
vim.startPlugins = ["lsp-lines"]; vim.startPlugins = ["lsp-lines"];
vim.luaConfigRC.lsplines = nvim.dag.entryAfter ["lspconfig"] '' vim.luaConfigRC.lsplines = entryAfter ["lspconfig"] ''
require("lsp_lines").setup() require("lsp_lines").setup()
vim.diagnostic.config({ vim.diagnostic.config({

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./config.nix ./config.nix
./lsplines.nix ./lsplines.nix

View file

@ -1,9 +1,11 @@
{lib, ...}: let {lib, ...}: let
inherit (lib) mkEnableOption; inherit (lib.options) mkEnableOption;
in { in {
options.vim.lsp = { options.vim.lsp = {
lsplines = { lsplines = {
enable = mkEnableOption "diagnostics using virtual lines on top of the real line of code. [lsp_lines]"; enable = mkEnableOption ''
diagnostics using virtual lines on top of the real line of code. [lsp_lines]
'';
}; };
}; };
} }

View file

@ -3,7 +3,10 @@
lib, lib,
... ...
}: let }: let
inherit (lib) addDescriptionsToMappings mkIf mkSetLuaBinding mkMerge nvim optionalString; inherit (lib.modules) mkIf mkMerge;
inherit (lib.strings) optionalString;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding;
cfg = config.vim.lsp; cfg = config.vim.lsp;
self = import ./lspsaga.nix {inherit lib;}; self = import ./lspsaga.nix {inherit lib;};
@ -12,38 +15,39 @@
mappings = addDescriptionsToMappings cfg.lspsaga.mappings mappingDefinitions; mappings = addDescriptionsToMappings cfg.lspsaga.mappings mappingDefinitions;
in { in {
config = mkIf (cfg.enable && cfg.lspsaga.enable) { config = mkIf (cfg.enable && cfg.lspsaga.enable) {
vim.startPlugins = ["lspsaga"]; vim = {
startPlugins = ["lspsaga"];
vim.maps.visual = mkSetLuaBinding mappings.codeAction "require('lspsaga.codeaction').range_code_action"; maps = {
visual = mkSetLuaBinding mappings.codeAction "require('lspsaga.codeaction').range_code_action";
normal = mkMerge [
(mkSetLuaBinding mappings.lspFinder "require('lspsaga.provider').lsp_finder")
(mkSetLuaBinding mappings.renderHoveredDoc "require('lspsaga.hover').render_hover_doc")
vim.maps.normal = mkMerge [ (mkSetLuaBinding mappings.smartScrollUp "function() require('lspsaga.action').smart_scroll_with_saga(-1) end")
(mkSetLuaBinding mappings.lspFinder "require('lspsaga.provider').lsp_finder") (mkSetLuaBinding mappings.smartScrollDown "function() require('lspsaga.action').smart_scroll_with_saga(1) end")
(mkSetLuaBinding mappings.renderHoveredDoc "require('lspsaga.hover').render_hover_doc")
(mkSetLuaBinding mappings.smartScrollUp "function() require('lspsaga.action').smart_scroll_with_saga(-1) end") (mkSetLuaBinding mappings.rename "require('lspsaga.rename').rename")
(mkSetLuaBinding mappings.smartScrollDown "function() require('lspsaga.action').smart_scroll_with_saga(1) end") (mkSetLuaBinding mappings.previewDefinition "require('lspsaga.provider').preview_definition")
(mkSetLuaBinding mappings.rename "require('lspsaga.rename').rename") (mkSetLuaBinding mappings.showLineDiagnostics "require('lspsaga.diagnostic').show_line_diagnostics")
(mkSetLuaBinding mappings.previewDefinition "require('lspsaga.provider').preview_definition") (mkSetLuaBinding mappings.showCursorDiagnostics "require('lspsaga.diagnostic').show_cursor_diagnostics")
(mkSetLuaBinding mappings.showLineDiagnostics "require('lspsaga.diagnostic').show_line_diagnostics") (mkSetLuaBinding mappings.nextDiagnostic "require('lspsaga.diagnostic').navigate('next')")
(mkSetLuaBinding mappings.showCursorDiagnostics "require('lspsaga.diagnostic').show_cursor_diagnostics") (mkSetLuaBinding mappings.previousDiagnostic "require('lspsaga.diagnostic').navigate('prev')")
(mkSetLuaBinding mappings.nextDiagnostic "require('lspsaga.diagnostic').navigate('next')") (mkIf (!cfg.nvimCodeActionMenu.enable) (mkSetLuaBinding mappings.codeAction "require('lspsaga.codeaction').code_action"))
(mkSetLuaBinding mappings.previousDiagnostic "require('lspsaga.diagnostic').navigate('prev')") (mkIf (!cfg.lspSignature.enable) (mkSetLuaBinding mappings.signatureHelp "require('lspsaga.signaturehelp').signature_help"))
];
};
(mkIf (!cfg.nvimCodeActionMenu.enable) (mkSetLuaBinding mappings.codeAction "require('lspsaga.codeaction').code_action")) luaConfigRC.lspsaga = entryAnywhere ''
(mkIf (!cfg.lspSignature.enable) (mkSetLuaBinding mappings.signatureHelp "require('lspsaga.signaturehelp').signature_help")) require('lspsaga').init_lsp_saga({
]; ${optionalString config.vim.ui.borders.plugins.lspsaga.enable ''
border_style = '${config.vim.ui.borders.plugins.lspsaga.style}',
vim.luaConfigRC.lspsage = nvim.dag.entryAnywhere '' ''}
-- Enable lspsaga })
local saga = require 'lspsaga' '';
saga.init_lsp_saga({ };
${optionalString (config.vim.ui.borders.plugins.lspsaga.enable) ''
border_style = '${config.vim.ui.borders.plugins.lspsaga.style}',
''}
})
'';
}; };
} }

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./lspsaga.nix ./lspsaga.nix
./config.nix ./config.nix

View file

@ -1,5 +1,6 @@
{lib, ...}: let {lib, ...}: let
inherit (lib) mkEnableOption mkMappingOption; inherit (lib.options) mkEnableOption;
inherit (lib.nvim.binds) mkMappingOption;
in { in {
options.vim.lsp.lspsaga = { options.vim.lsp.lspsaga = {
enable = mkEnableOption "LSP Saga"; enable = mkEnableOption "LSP Saga";

View file

@ -1,5 +1,6 @@
{lib, ...}: let {lib, ...}: let
inherit (lib) mkEnableOption mkMappingOption; inherit (lib.options) mkEnableOption;
inherit (lib.nvim.binds) mkMappingOption;
in { in {
options.vim.lsp = { options.vim.lsp = {
enable = mkEnableOption "LSP, also enabled automatically through null-ls and lspconfig options"; enable = mkEnableOption "LSP, also enabled automatically through null-ls and lspconfig options";

View file

@ -1,37 +1,41 @@
{ {
pkgs,
config, config,
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf mkMerge nvim mapAttrs; inherit (lib.modules) mkIf mkMerge;
inherit (lib.attrsets) mapAttrs;
inherit (lib.nvim.dag) entryAnywhere entryAfter entryBetween;
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf cfg.null-ls.enable (mkMerge [ config = mkIf cfg.null-ls.enable (mkMerge [
{ {
vim.lsp.enable = true; vim = {
vim.startPlugins = ["none-ls"]; lsp.enable = true;
startPlugins = ["none-ls"];
vim.luaConfigRC.null_ls-setup = nvim.dag.entryAnywhere '' luaConfigRC.null_ls-setup = entryAnywhere ''
local null_ls = require("null-ls") local null_ls = require("null-ls")
local null_helpers = require("null-ls.helpers") local null_helpers = require("null-ls.helpers")
local null_methods = require("null-ls.methods") local null_methods = require("null-ls.methods")
local ls_sources = {} local ls_sources = {}
''; '';
vim.luaConfigRC.null_ls = nvim.dag.entryAfter ["null_ls-setup" "lsp-setup"] ''
require('null-ls').setup({ luaConfigRC.null_ls = entryAfter ["null_ls-setup" "lsp-setup"] ''
debug = false, require('null-ls').setup({
diagnostics_format = "[#{m}] #{s} (#{c})", debug = false,
debounce = 250, diagnostics_format = "[#{m}] #{s} (#{c})",
default_timeout = 5000, debounce = 250,
sources = ls_sources, default_timeout = 5000,
on_attach=default_on_attach sources = ls_sources,
}) on_attach = default_on_attach
''; })
'';
};
} }
{ {
vim.luaConfigRC = mapAttrs (_: v: (nvim.dag.entryBetween ["null_ls"] ["null_ls-setup"] v)) cfg.null-ls.sources; vim.luaConfigRC = mapAttrs (_: v: (entryBetween ["null_ls"] ["null_ls-setup"] v)) cfg.null-ls.sources;
} }
]); ]);
} }

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./config.nix ./config.nix
./null-ls.nix ./null-ls.nix

View file

@ -1,19 +1,13 @@
{ {lib, ...}: let
pkgs, inherit (lib.options) mkEnableOption mkOption;
config, inherit (lib.types) attrsOf str;
lib,
...
}: let
inherit (lib) mkEnableOption mkOption types;
cfg = config.vim.lsp;
in { in {
options.vim.lsp.null-ls = { options.vim.lsp.null-ls = {
enable = mkEnableOption "null-ls, also enabled automatically"; enable = mkEnableOption "null-ls, also enabled automatically";
sources = mkOption { sources = mkOption {
description = "null-ls sources"; description = "null-ls sources";
type = with types; attrsOf str; type = attrsOf str;
default = {}; default = {};
}; };
}; };

View file

@ -3,32 +3,35 @@
lib, lib,
... ...
}: let }: let
inherit (lib) addDescriptionsToMappings mkIf mkSetBinding nvim pushDownDefault; inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.binds) mkSetBinding addDescriptionsToMappings pushDownDefault;
cfg = config.vim.lsp; cfg = config.vim.lsp;
self = import ./nvim-code-action-menu.nix {inherit lib;}; self = import ./nvim-code-action-menu.nix {inherit lib;};
mappingDefinitions = self.options.vim.lsp.nvimCodeActionMenu.mappings; mappingDefinitions = self.options.vim.lsp.nvimCodeActionMenu.mappings;
mappings = addDescriptionsToMappings cfg.nvimCodeActionMenu.mappings mappingDefinitions; mappings = addDescriptionsToMappings cfg.nvimCodeActionMenu.mappings mappingDefinitions;
in { in {
config = mkIf (cfg.enable && cfg.nvimCodeActionMenu.enable) { config = mkIf (cfg.enable && cfg.nvimCodeActionMenu.enable) {
vim.startPlugins = ["nvim-code-action-menu"]; vim = {
startPlugins = ["nvim-code-action-menu"];
vim.maps.normal = mkSetBinding mappings.open ":CodeActionMenu<CR>"; maps.normal = mkSetBinding mappings.open ":CodeActionMenu<CR>";
vim.binds.whichKey.register = pushDownDefault { binds.whichKey.register = pushDownDefault {
"<leader>c" = "+CodeAction"; "<leader>c" = "+CodeAction";
};
luaConfigRC.code-action-menu = entryAnywhere ''
-- border configuration
vim.g.code_action_menu_window_border = '${config.vim.ui.borders.plugins.code-action-menu.style}'
-- show individual sections of the code action menu
${lib.optionalString cfg.nvimCodeActionMenu.show.details "vim.g.code_action_menu_show_details = true"}
${lib.optionalString cfg.nvimCodeActionMenu.show.diff "vim.g.code_action_menu_show_diff = true"}
${lib.optionalString cfg.nvimCodeActionMenu.show.actionKind "vim.g.code_action_menu_show_action_kind = true"}
'';
}; };
vim.luaConfigRC.code-action-menu = nvim.dag.entryAnywhere ''
-- border configuration
vim.g.code_action_menu_window_border = '${config.vim.ui.borders.plugins.code-action-menu.style}'
-- show individual sections of the code action menu
${lib.optionalString (cfg.nvimCodeActionMenu.show.details) "vim.g.code_action_menu_show_details = true"}
${lib.optionalString (cfg.nvimCodeActionMenu.show.diff) "vim.g.code_action_menu_show_diff = true"}
${lib.optionalString (cfg.nvimCodeActionMenu.show.actionKind) "vim.g.code_action_menu_show_action_kind = true"}
'';
}; };
} }

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./nvim-code-action-menu.nix ./nvim-code-action-menu.nix
./config.nix ./config.nix

View file

@ -1,5 +1,6 @@
{lib, ...}: let {lib, ...}: let
inherit (lib) mkEnableOption mkMappingOption; inherit (lib.options) mkEnableOption;
inherit (lib.nvim.binds) mkMappingOption;
in { in {
options.vim.lsp = { options.vim.lsp = {
nvimCodeActionMenu = { nvimCodeActionMenu = {

View file

@ -3,8 +3,10 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf nvim addDescriptionsToMappings mkSetBinding mkMerge;
inherit (builtins) toString; inherit (builtins) toString;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding;
cfg = config.vim.lsp.nvim-docs-view; cfg = config.vim.lsp.nvim-docs-view;
self = import ./nvim-docs-view.nix {inherit lib;}; self = import ./nvim-docs-view.nix {inherit lib;};
@ -17,7 +19,7 @@ in {
lsp.enable = true; lsp.enable = true;
startPlugins = ["nvim-docs-view"]; startPlugins = ["nvim-docs-view"];
luaConfigRC.nvim-docs-view = nvim.dag.entryAnywhere '' luaConfigRC.nvim-docs-view = entryAnywhere ''
require("docs-view").setup { require("docs-view").setup {
position = "${cfg.position}", position = "${cfg.position}",
width = ${toString cfg.width}, width = ${toString cfg.width},

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./config.nix ./config.nix
./nvim-docs-view.nix ./nvim-docs-view.nix

View file

@ -1,11 +1,13 @@
{lib, ...}: let {lib, ...}: let
inherit (lib) mkEnableOption mkOption types mkMappingOption; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) enum int;
inherit (lib.nvim.binds) mkMappingOption;
in { in {
options.vim.lsp.nvim-docs-view = { options.vim.lsp.nvim-docs-view = {
enable = mkEnableOption "nvim-docs-view, for displaying lsp hover documentation in a side panel."; enable = mkEnableOption "nvim-docs-view, for displaying lsp hover documentation in a side panel.";
position = mkOption { position = mkOption {
type = types.enum ["left" "right" "top" "bottom"]; type = enum ["left" "right" "top" "bottom"];
default = "right"; default = "right";
description = '' description = ''
Where to open the docs view panel Where to open the docs view panel
@ -13,7 +15,7 @@ in {
}; };
height = mkOption { height = mkOption {
type = types.int; type = int;
default = 10; default = 10;
description = '' description = ''
Height of the docs view panel if the position is set to either top or bottom Height of the docs view panel if the position is set to either top or bottom
@ -21,7 +23,7 @@ in {
}; };
width = mkOption { width = mkOption {
type = types.int; type = int;
default = 60; default = 60;
description = '' description = ''
Width of the docs view panel if the position is set to either left or right Width of the docs view panel if the position is set to either left or right
@ -29,12 +31,14 @@ in {
}; };
updateMode = mkOption { updateMode = mkOption {
type = types.enum ["auto" "manual"]; type = enum ["auto" "manual"];
default = "auto"; default = "auto";
description = '' description = ''
Determines the mechanism used to update the docs view panel content. Determines the mechanism used to update the docs view panel content
- If auto, the content will update upon cursor move.
- If manual, the content will only update once :DocsViewUpdate is called Possible values:
- auto: the content will update upon cursor move.
- manual: the content will only update once :DocsViewUpdate is called
''; '';
}; };

View file

@ -3,36 +3,39 @@
lib, lib,
... ...
}: let }: let
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim pushDownDefault; inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding pushDownDefault;
cfg = config.vim.lsp; cfg = config.vim.lsp;
self = import ./trouble.nix {inherit lib;}; self = import ./trouble.nix {inherit lib;};
mappingDefinitions = self.options.vim.lsp.trouble.mappings; mappingDefinitions = self.options.vim.lsp.trouble.mappings;
mappings = addDescriptionsToMappings cfg.trouble.mappings mappingDefinitions; mappings = addDescriptionsToMappings cfg.trouble.mappings mappingDefinitions;
in { in {
config = mkIf (cfg.enable && cfg.trouble.enable) { config = mkIf (cfg.enable && cfg.trouble.enable) {
vim.startPlugins = ["trouble"]; vim = {
startPlugins = ["trouble"];
vim.maps.normal = mkMerge [ maps.normal = mkMerge [
(mkSetBinding mappings.toggle "<cmd>TroubleToggle<CR>") (mkSetBinding mappings.toggle "<cmd>TroubleToggle<CR>")
(mkSetBinding mappings.workspaceDiagnostics "<cmd>TroubleToggle workspace_diagnostics<CR>") (mkSetBinding mappings.workspaceDiagnostics "<cmd>TroubleToggle workspace_diagnostics<CR>")
(mkSetBinding mappings.documentDiagnostics "<cmd>TroubleToggle document_diagnostics<CR>") (mkSetBinding mappings.documentDiagnostics "<cmd>TroubleToggle document_diagnostics<CR>")
(mkSetBinding mappings.lspReferences "<cmd>TroubleToggle lsp_references<CR>") (mkSetBinding mappings.lspReferences "<cmd>TroubleToggle lsp_references<CR>")
(mkSetBinding mappings.quickfix "<cmd>TroubleToggle quickfix<CR>") (mkSetBinding mappings.quickfix "<cmd>TroubleToggle quickfix<CR>")
(mkSetBinding mappings.locList "<cmd>TroubleToggle loclist<CR>") (mkSetBinding mappings.locList "<cmd>TroubleToggle loclist<CR>")
]; ];
vim.binds.whichKey.register = pushDownDefault { binds.whichKey.register = pushDownDefault {
"<leader>l" = "Trouble"; "<leader>l" = "Trouble";
"<leader>x" = "+Trouble"; "<leader>x" = "+Trouble";
"<leader>lw" = "Workspace"; "<leader>lw" = "Workspace";
};
luaConfigRC.trouble = entryAnywhere ''
-- Enable trouble diagnostics viewer
require("trouble").setup {}
'';
}; };
vim.luaConfigRC.trouble = nvim.dag.entryAnywhere ''
-- Enable trouble diagnostics viewer
require("trouble").setup {}
'';
}; };
} }

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./trouble.nix ./trouble.nix
./config.nix ./config.nix

View file

@ -1,5 +1,6 @@
{lib, ...}: let {lib, ...}: let
inherit (lib) mkEnableOption mkMappingOption; inherit (lib.options) mkEnableOption;
inherit (lib.nvim.binds) mkMappingOption;
in { in {
options.vim.lsp = { options.vim.lsp = {
trouble = { trouble = {

View file

@ -1,5 +1,6 @@
{lib, ...}: let {lib, ...}: let
inherit (lib) mkEnableOption mkMappingOption; inherit (lib.options) mkEnableOption;
inherit (lib.nvim.binds) mkMappingOption;
in { in {
options.vim.minimap.codewindow = { options.vim.minimap.codewindow = {
enable = mkEnableOption "codewindow plugin for minimap view"; enable = mkEnableOption "codewindow plugin for minimap view";

View file

@ -3,7 +3,9 @@
lib, lib,
... ...
}: let }: let
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetLuaBinding nvim pushDownDefault; inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding pushDownDefault;
cfg = config.vim.minimap.codewindow; cfg = config.vim.minimap.codewindow;
@ -13,26 +15,28 @@
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions; mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim.startPlugins = [ vim = {
"codewindow-nvim" startPlugins = [
]; "codewindow-nvim"
];
vim.maps.normal = mkMerge [ maps.normal = mkMerge [
(mkSetLuaBinding mappings.open "require('codewindow').open_minimap") (mkSetLuaBinding mappings.open "require('codewindow').open_minimap")
(mkSetLuaBinding mappings.close "require('codewindow').close_minimap") (mkSetLuaBinding mappings.close "require('codewindow').close_minimap")
(mkSetLuaBinding mappings.toggle "require('codewindow').toggle_minimap") (mkSetLuaBinding mappings.toggle "require('codewindow').toggle_minimap")
(mkSetLuaBinding mappings.toggleFocus "require('codewindow').toggle_focus") (mkSetLuaBinding mappings.toggleFocus "require('codewindow').toggle_focus")
]; ];
vim.binds.whichKey.register = pushDownDefault { binds.whichKey.register = pushDownDefault {
"<leader>m" = "+Minimap"; "<leader>m" = "+Minimap";
};
luaConfigRC.codewindow = entryAnywhere ''
local codewindow = require('codewindow')
codewindow.setup({
exclude_filetypes = { 'NvimTree', 'orgagenda', 'Alpha'},
})
'';
}; };
vim.luaConfigRC.codewindow = nvim.dag.entryAnywhere ''
local codewindow = require('codewindow')
codewindow.setup({
exclude_filetypes = { 'NvimTree', 'orgagenda', 'Alpha'},
})
'';
}; };
} }

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./codewindow.nix ./codewindow.nix
./config.nix ./config.nix

View file

@ -1,4 +1,4 @@
{...}: { {
imports = [ imports = [
./minimap-vim ./minimap-vim
./codewindow ./codewindow

View file

@ -1,10 +1,11 @@
{ {
pkgs,
config, config,
pkgs,
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf pushDownDefault; inherit (lib.modules) mkIf;
inherit (lib.nvim.binds) pushDownDefault;
cfg = config.vim.minimap.minimap-vim; cfg = config.vim.minimap.minimap-vim;
in { in {

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./minimap-vim.nix ./minimap-vim.nix
./config.nix ./config.nix

View file

@ -1,11 +1,7 @@
{ {lib, ...}: let
config, inherit (lib.options) mkEnableOption;
lib,
...
}: let
inherit (lib) mkEnableOption;
in { in {
options.vim.minimap.minimap-vim = { options.vim.minimap.minimap-vim = {
enable = mkEnableOption "minimap-vim plugin for minimap view"; enable = mkEnableOption "minimap view [minimap-vim]";
}; };
} }

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./obsidian ./obsidian
./orgmode ./orgmode

View file

@ -3,27 +3,31 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf nvim pushDownDefault; inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.binds) pushDownDefault;
cfg = config.vim.notes.mind-nvim; cfg = config.vim.notes.mind-nvim;
in { in {
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
vim.startPlugins = [ vim = {
"mind-nvim" startPlugins = [
]; "mind-nvim"
];
vim.maps.normal = { maps.normal = {
"<leader>om" = {action = ":MindOpenMain<CR>";}; "<leader>om" = {action = ":MindOpenMain<CR>";};
"<leader>op" = {action = ":MindOpenProject<CR>";}; "<leader>op" = {action = ":MindOpenProject<CR>";};
"<leader>oc" = {action = ":MindClose<CR>";}; "<leader>oc" = {action = ":MindClose<CR>";};
};
binds.whichKey.register = pushDownDefault {
"<leader>o" = "+Notes";
};
luaConfigRC.mind-nvim = entryAnywhere ''
require'mind'.setup()
'';
}; };
vim.binds.whichKey.register = pushDownDefault {
"<leader>o" = "+Notes";
};
vim.luaConfigRC.mind-nvim = nvim.dag.entryAnywhere ''
require'mind'.setup()
'';
}; };
} }

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./mind-nvim.nix ./mind-nvim.nix
./config.nix ./config.nix

View file

@ -1,11 +1,7 @@
{ {lib, ...}: let
config, inherit (lib.options) mkEnableOption;
lib,
...
}: let
inherit (lib) mkEnableOption;
in { in {
options.vim.notes.mind-nvim = { options.vim.notes.mind-nvim = {
enable = mkEnableOption "organizer tool for Neovim."; enable = mkEnableOption "note organizer tool for Neovim [mind-nvim]";
}; };
} }

View file

@ -3,45 +3,49 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf nvim pushDownDefault; inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.binds) pushDownDefault;
cfg = config.vim.notes.obsidian; cfg = config.vim.notes.obsidian;
auto = config.vim.autocomplete; auto = config.vim.autocomplete;
in { in {
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
vim.startPlugins = [ vim = {
"obsidian-nvim" startPlugins = [
"vim-markdown" "obsidian-nvim"
"tabular" "vim-markdown"
]; "tabular"
];
vim.binds.whichKey.register = pushDownDefault { binds.whichKey.register = pushDownDefault {
"<leader>o" = "+Notes"; "<leader>o" = "+Notes";
}; };
vim.luaConfigRC.obsidian = nvim.dag.entryAnywhere '' luaConfigRC.obsidian = entryAnywhere ''
require("obsidian").setup({ require("obsidian").setup({
dir = "${cfg.dir}", dir = "${cfg.dir}",
completion = { completion = {
nvim_cmp = ${ nvim_cmp = ${
if (auto.type == "nvim-cmp") if (auto.type == "nvim-cmp")
then "true" then "true"
else "false" else "false"
}
},
daily_notes = {
folder = ${
if (cfg.daily-notes.folder == "")
then "nil,"
else "'${cfg.daily-notes.folder}',"
}
date_format = ${
if (cfg.daily-notes.date-format == "")
then "nil,"
else "'${cfg.daily-notes.date-format}',"
}
} }
}) },
''; daily_notes = {
folder = ${
if (cfg.daily-notes.folder == "")
then "nil,"
else "'${cfg.daily-notes.folder}',"
}
date_format = ${
if (cfg.daily-notes.date-format == "")
then "nil,"
else "'${cfg.daily-notes.date-format}',"
}
}
})
'';
};
}; };
} }

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./obsidian.nix ./obsidian.nix
./config.nix ./config.nix

View file

@ -1,27 +1,24 @@
{ {lib, ...}: let
config, inherit (lib.options) mkEnableOption mkOption;
lib, inherit (lib.types) str bool;
...
}: let
inherit (lib) mkEnableOption mkOption types;
in { in {
options.vim.notes = { options.vim.notes = {
obsidian = { obsidian = {
enable = mkEnableOption "complementary neovim plugins for Obsidian editor"; enable = mkEnableOption "complementary neovim plugins for Obsidian editor";
dir = mkOption { dir = mkOption {
type = types.str; type = str;
default = "~/my-vault"; default = "~/my-vault";
description = "Obsidian vault directory"; description = "Obsidian vault directory";
}; };
daily-notes = { daily-notes = {
folder = mkOption { folder = mkOption {
type = types.str; type = str;
default = ""; default = "";
description = "Directory in which daily notes should be created"; description = "Directory in which daily notes should be created";
}; };
date-format = mkOption { date-format = mkOption {
type = types.str; type = str;
default = ""; default = "";
description = "Date format used for creating daily notes"; description = "Date format used for creating daily notes";
}; };
@ -29,8 +26,7 @@ in {
completion = { completion = {
nvim_cmp = mkOption { nvim_cmp = mkOption {
# if using nvim-cmp, otherwise set to false type = bool;
type = types.bool;
description = "If using nvim-cmp, otherwise set to false"; description = "If using nvim-cmp, otherwise set to false";
}; };
}; };

View file

@ -3,42 +3,46 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf mkMerge nvim pushDownDefault; inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.binds) pushDownDefault;
cfg = config.vim.notes.orgmode; cfg = config.vim.notes.orgmode;
in { in {
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
{ {
vim.startPlugins = [ vim = {
"orgmode-nvim" startPlugins = [
]; "orgmode-nvim"
];
vim.binds.whichKey.register = pushDownDefault { binds.whichKey.register = pushDownDefault {
"<leader>o" = "+Notes"; "<leader>o" = "+Notes";
};
luaConfigRC.orgmode = entryAnywhere ''
-- Load custom treesitter grammar for org filetype
require('orgmode').setup_ts_grammar()
-- Treesitter configuration
require('nvim-treesitter.configs').setup {
-- If TS highlights are not enabled at all, or disabled via `disable` prop,
-- highlighting will fallback to default Vim syntax highlighting
highlight = {
enable = true,
-- Required for spellcheck, some LaTex highlights and
-- code block highlights that do not have ts grammar
additional_vim_regex_highlighting = {'org'},
},
}
require('orgmode').setup({
org_agenda_files = ${cfg.orgAgendaFiles},
org_default_notes_file = '${cfg.orgDefaultNotesFile}',
})
'';
}; };
vim.luaConfigRC.orgmode = nvim.dag.entryAnywhere ''
-- Load custom treesitter grammar for org filetype
require('orgmode').setup_ts_grammar()
-- Treesitter configuration
require('nvim-treesitter.configs').setup {
-- If TS highlights are not enabled at all, or disabled via `disable` prop,
-- highlighting will fallback to default Vim syntax highlighting
highlight = {
enable = true,
-- Required for spellcheck, some LaTex highlights and
-- code block highlights that do not have ts grammar
additional_vim_regex_highlighting = {'org'},
},
}
require('orgmode').setup({
org_agenda_files = ${cfg.orgAgendaFiles},
org_default_notes_file = '${cfg.orgDefaultNotesFile}',
})
'';
} }
(mkIf cfg.treesitter.enable { (mkIf cfg.treesitter.enable {

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./orgmode.nix ./orgmode.nix
./config.nix ./config.nix

View file

@ -4,27 +4,28 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib) mkEnableOption types mkOption nvim; inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) str;
inherit (lib.nvim.types) mkGrammarOption;
in { in {
options.vim.notes.orgmode = { options.vim.notes.orgmode = {
enable = mkEnableOption "nvim-orgmode: Neovim plugin for Emac Orgmode. Get the best of both worlds"; enable = mkEnableOption "nvim-orgmode: Neovim plugin for Emac Orgmode. Get the best of both worlds";
orgAgendaFiles = mkOption { orgAgendaFiles = mkOption {
type = types.str; type = str;
default = "{'~/Documents/org/*', '~/my-orgs/**/*'}"; default = "{'~/Documents/org/*', '~/my-orgs/**/*'}";
description = "List of org files to be used as agenda files."; description = "List of org files to be used as agenda files.";
}; };
orgDefaultNotesFile = mkOption { orgDefaultNotesFile = mkOption {
type = types.str; type = str;
default = "~/Documents/org/refile.org"; default = "~/Documents/org/refile.org";
description = "Default org file to be used for notes."; description = "Default org file to be used for notes.";
}; };
treesitter = { treesitter = {
enable = mkEnableOption "Orgmode treesitter" // {default = config.vim.languages.enableTreesitter;}; enable = mkEnableOption "Orgmode treesitter" // {default = config.vim.languages.enableTreesitter;};
orgPackage = mkGrammarOption pkgs "org";
orgPackage = nvim.types.mkGrammarOption pkgs "org";
}; };
}; };
} }

View file

@ -4,46 +4,49 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkMerge mkBinding mkIf; inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.binds) mkBinding;
cfg = config.vim.notes.todo-comments; cfg = config.vim.notes.todo-comments;
self = import ./todo-comments.nix {inherit lib;}; self = import ./todo-comments.nix {inherit lib;};
mappings = self.options.vim.notes.todo-comments.mappings; inherit (self.options.vim.notes.todo-comments) mappings;
in { in {
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
vim.startPlugins = [ vim = {
"todo-comments" startPlugins = [
]; "todo-comments"
];
vim.maps.normal = mkMerge [ maps.normal = mkMerge [
(mkBinding cfg.mappings.quickFix ":TodoQuickFix<CR>" mappings.quickFix.description) (mkBinding cfg.mappings.quickFix ":TodoQuickFix<CR>" mappings.quickFix.description)
(mkIf config.vim.telescope.enable (mkBinding cfg.mappings.telescope ":TodoTelescope<CR>" mappings.telescope.description)) (mkIf config.vim.telescope.enable (mkBinding cfg.mappings.telescope ":TodoTelescope<CR>" mappings.telescope.description))
(mkIf config.vim.lsp.trouble.enable (mkBinding cfg.mappings.trouble ":TodoTrouble<CR>" mappings.trouble.description)) (mkIf config.vim.lsp.trouble.enable (mkBinding cfg.mappings.trouble ":TodoTrouble<CR>" mappings.trouble.description))
]; ];
vim.luaConfigRC.todo-comments = '' luaConfigRC.todo-comments = ''
require('todo-comments').setup { require('todo-comments').setup {
highlight = { highlight = {
before = "", -- "fg" or "bg" or empty before = "", -- "fg" or "bg" or empty
keyword = "bg", -- "fg", "bg", "wide" or empty keyword = "bg", -- "fg", "bg", "wide" or empty
after = "fg", -- "fg" or "bg" or empty after = "fg", -- "fg" or "bg" or empty
pattern = ${cfg.patterns.highlight}, pattern = ${cfg.patterns.highlight},
comments_only = true, -- uses treesitter to match keywords in comments only comments_only = true, -- uses treesitter to match keywords in comments only
max_line_len = 400, -- ignore lines longer than this max_line_len = 400, -- ignore lines longer than this
exclude = {}, -- list of file types to exclude highlighting exclude = {}, -- list of file types to exclude highlighting
},
search = {
command = "${pkgs.ripgrep}/bin/rg",
args = {
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
}, },
pattern = ${cfg.patterns.search}, search = {
}, command = "${pkgs.ripgrep}/bin/rg",
} args = {
''; "--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
},
pattern = ${cfg.patterns.search},
},
}
'';
};
}; };
} }

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./todo-comments.nix ./todo-comments.nix
./config.nix ./config.nix

View file

@ -1,18 +1,20 @@
{lib, ...}: let {lib, ...}: let
inherit (lib) mkEnableOption mkOption types mkMappingOption; inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) str;
inherit (lib.nvim.binds) mkMappingOption;
in { in {
options.vim.notes.todo-comments = { options.vim.notes.todo-comments = {
enable = mkEnableOption "todo-comments: highlight and search for todo comments like TODO, HACK, BUG in your code base"; enable = mkEnableOption "todo-comments: highlight and search for todo comments like TODO, HACK, BUG in your code base";
patterns = { patterns = {
highlight = mkOption { highlight = mkOption {
type = types.str; type = str;
default = ''[[.*<(KEYWORDS)(\([^\)]*\))?:]]''; default = ''[[.*<(KEYWORDS)(\([^\)]*\))?:]]'';
description = "vim regex pattern used for highlighting comments"; description = "vim regex pattern used for highlighting comments";
}; };
search = mkOption { search = mkOption {
type = types.str; type = str;
default = ''[[\b(KEYWORDS)(\([^\)]*\))?:]]''; default = ''[[\b(KEYWORDS)(\([^\)]*\))?:]]'';
description = "ripgrep regex pattern used for searching comments"; description = "ripgrep regex pattern used for searching comments";
}; };

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./project-nvim ./project-nvim
]; ];

View file

@ -3,7 +3,10 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf nvim boolToString concatStringsSep; inherit (lib.modules) mkIf;
inherit (lib.trivial) boolToString;
inherit (lib.strings) concatStringsSep;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.projects.project-nvim; cfg = config.vim.projects.project-nvim;
in { in {
@ -12,7 +15,7 @@ in {
"project-nvim" "project-nvim"
]; ];
vim.luaConfigRC.project-nvim = nvim.dag.entryAnywhere '' vim.luaConfigRC.project-nvim = entryAnywhere ''
require('project_nvim').setup({ require('project_nvim').setup({
manual_mode = ${boolToString cfg.manualMode}, manual_mode = ${boolToString cfg.manualMode},
detection_methods = { ${concatStringsSep ", " (map (x: "\"" + x + "\"") cfg.detectionMethods)} }, detection_methods = { ${concatStringsSep ", " (map (x: "\"" + x + "\"") cfg.detectionMethods)} },

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./config.nix ./config.nix
./project-nvim.nix ./project-nvim.nix

View file

@ -1,60 +1,57 @@
{ {lib, ...}: let
config, inherit (lib.options) mkEnableOption mkOption;
lib, inherit (lib.types) enum bool listOf str;
...
}: let
inherit (lib) mkEnableOption mkOption types;
in { in {
options.vim.projects.project-nvim = { options.vim.projects.project-nvim = {
enable = mkEnableOption "project-nvim for project management"; enable = mkEnableOption "project-nvim for project management";
manualMode = mkOption { manualMode = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "don't automatically change the root directory so the user has the option to manually do so using `:ProjectRoot` command"; description = "don't automatically change the root directory so the user has the option to manually do so using `:ProjectRoot` command";
}; };
# detection methods should accept one or more strings from a list # detection methods should accept one or more strings from a list
detectionMethods = mkOption { detectionMethods = mkOption {
type = types.listOf types.str; type = listOf str;
default = ["lsp" "pattern"]; default = ["lsp" "pattern"];
description = "Detection methods to use"; description = "Detection methods to use";
}; };
# patterns # patterns
patterns = mkOption { patterns = mkOption {
type = types.listOf types.str; type = listOf str;
default = [".git" "_darcs" ".hg" ".bzr" ".svn" "Makefile" "package.json" "flake.nix" "cargo.toml"]; default = [".git" "_darcs" ".hg" ".bzr" ".svn" "Makefile" "package.json" "flake.nix" "cargo.toml"];
description = "Patterns to use for pattern detection method"; description = "Patterns to use for pattern detection method";
}; };
# table of lsp servers to ignore by name # table of lsp servers to ignore by name
lspIgnored = mkOption { lspIgnored = mkOption {
type = types.listOf types.str; type = listOf str;
default = []; default = [];
description = "LSP servers no ignore by name"; description = "LSP servers no ignore by name";
}; };
excludeDirs = mkOption { excludeDirs = mkOption {
type = types.listOf types.str; type = listOf str;
default = []; default = [];
description = "Directories to exclude from project root search"; description = "Directories to exclude from project root search";
}; };
showHidden = mkOption { showHidden = mkOption {
type = types.bool; type = bool;
default = false; default = false;
description = "Show hidden files in telescope picker"; description = "Show hidden files in telescope picker";
}; };
silentChdir = mkOption { silentChdir = mkOption {
type = types.bool; type = bool;
default = true; default = true;
description = "Silently change directory when changing project"; description = "Silently change directory when changing project";
}; };
scopeChdir = mkOption { scopeChdir = mkOption {
type = types.enum ["global" "tab" "win"]; type = enum ["global" "tab" "win"];
default = "global"; default = "global";
description = "What scope to change the directory"; description = "What scope to change the directory";
}; };

Some files were not shown because too many files have changed in this diff Show more