mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-07 12:45:57 +01:00
Merge pull request #237 from FrothyMarrow/unstable-wrapper
wrapper: migrate to `makeNeovimUnstable` wrapper
This commit is contained in:
commit
42016d8e04
182 changed files with 2304 additions and 2010 deletions
128
.github/README.md
vendored
128
.github/README.md
vendored
|
@ -1,5 +1,5 @@
|
|||
<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>
|
||||
<h1 align="center">❄️ neovim-flake</h1>
|
||||
<div align="center">
|
||||
|
@ -30,7 +30,10 @@
|
|||
|
||||
<div align="center">
|
||||
<a>
|
||||
A highly modular, configurable, extensible and easy to use Neovim configuration wrapper written in Nix. Designed for flexibility and ease of use, this flake 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>
|
||||
</div>
|
||||
|
||||
|
@ -62,106 +65,137 @@
|
|||
|
||||
### 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
|
||||
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
|
||||
utilities.You may also use `#nix`, `#tidal` or `#maximal` to get try out different configurations.
|
||||
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 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
|
||||
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]
|
||||
> 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.
|
||||
> Should you choose to try out the `maximal` configuration, using the binary cache as described in the manual is _strongly_ recommended.
|
||||
> 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. Should you choose to try out the `maximal` configuration,
|
||||
> using the binary cache as described in the manual is _strongly_ recommended.
|
||||
|
||||
### Docker
|
||||
|
||||
As of version 0.5, an image for the `nix` output is published to Dockerhub and GitHub packages with each tagged release. If you do not have Nix installed
|
||||
As of version 0.5, an image for the `nix` output is published to Dockerhub
|
||||
and GitHub packages with each tagged release. If you do not have Nix installed
|
||||
on your system, you may run neovim within a container using your favorite tool.
|
||||
The following command will open the current directory in neovim with necessary tools bootstrapped.
|
||||
The following command will open the current directory in neovim with necessary
|
||||
tools bootstrapped.
|
||||
|
||||
```console
|
||||
docker run -v `pwd`:/home/neovim/demo --rm -it notashelf/neovim-flake:latest
|
||||
```
|
||||
|
||||
The available registeres are `ghcr.io` and `dockerhub` for the time being. Adjust to your liking.
|
||||
The available registeres are `ghcr.io` and `dockerhub` for the time being.
|
||||
Adjust to your liking.
|
||||
|
||||
## Documentation
|
||||
|
||||
See the [neovim-flake Manual](https://notashelf.github.io/neovim-flake/) for detailed installation guides, configurations, available options, release notes
|
||||
and more.
|
||||
See the [neovim-flake Manual](https://notashelf.github.io/neovim-flake/) for
|
||||
detailed installation guides, configurations, available options, release notes
|
||||
and more. Tips for installing userspace plugins is also contained in the
|
||||
documentation.
|
||||
|
||||
If you want to dive right into trying **neovim-flake** you can get a fully featured configuration with `nix`
|
||||
language support by running:
|
||||
If you want to dive right into trying **neovim-flake** you can get a fully
|
||||
featured configuration with `nix` language support by running:
|
||||
|
||||
```console
|
||||
nix run github:notashelf/neovim-flake
|
||||
```
|
||||
|
||||
Please create an issue on the [issue tracker](../../../issues) if you find the documentation lacking or confusing.
|
||||
I also appreciate any contributions to the documentation.
|
||||
Please create an issue on the [issue tracker](../../../issues) if you find
|
||||
the documentation lacking or confusing. I also appreciate any contributions
|
||||
to the documentation.
|
||||
|
||||
## Help
|
||||
|
||||
You can create an issue on the [issue tracker](../../../issues) to ask questions or report bugs.
|
||||
I am not yet on spaces like matrix or IRC, so please use the issue tracker for now.
|
||||
You can create an issue on the [issue tracker](../../../issues) to ask questions
|
||||
or report bugs. I am not yet on spaces like matrix or IRC, so please use the issue
|
||||
tracker for now.
|
||||
|
||||
## Contributing
|
||||
|
||||
I am always looking for new ways to help improve this flake. If you would like to contribute, please read
|
||||
the [contributing guide](CONTRIBUTING.md) before submitting a pull request. You can also create an
|
||||
issue on the [issue tracker](../../../issues) before submitting a pull request if you would like to discuss
|
||||
a feature or bug fix.
|
||||
I am always looking for new ways to help improve this flake. If you would like
|
||||
to contribute, please read the [contributing guide](CONTRIBUTING.md) before
|
||||
submitting a pull request. You can also create an issue on the
|
||||
[issue tracker](../../../issues) before submitting a pull request if you would
|
||||
like to discuss a feature or bug fix.
|
||||
|
||||
## Philosophy
|
||||
|
||||
The philosophy behind this flake configuration is to create an easily configurable and reproducible Neovim environment.
|
||||
While it does sacrifice in size (which I know some users will find _disagreeable_), it offers a lot of flexibility and customizability in
|
||||
exchange for the large size of the flake inputs. The "KISS" (Keep it simple, stupid) principle has mostly been abandoned here, however, you _can_
|
||||
ultimately leverage the flexibility of this flake to declare a configuration that follows KISS principles, as it is very easy to bring your
|
||||
own plugins and configurations from non-nix. What this flake is meant to be does eventually fall into your hands. Whether you are a
|
||||
developer, writer, or live coder, you can quickly craft a config that suits every project's need. Think of it like a distribution of Neovim that you have
|
||||
full control over. A distribution that takes advantage of pinning vim plugins and third party dependencies (such as tree-sitter grammars, language servers, and more).
|
||||
The philosophy behind this flake configuration is to create an easily
|
||||
configurable and reproducible Neovim environment. While it does sacrifice in
|
||||
size (which I know some users will find _disagreeable_), it offers a lot of
|
||||
flexibility and customizability in exchange for the large size of the flake
|
||||
inputs. The "KISS" (Keep it simple, stupid) principle has mostly been abandoned
|
||||
here, however, you _can_ ultimately leverage the flexibility of this flake to
|
||||
declare a configuration that follows KISS principles, as it is very easy to
|
||||
bring your own plugins and configurations from non-nix. What this flake is
|
||||
meant to be does eventually fall into your hands. Whether you are a developer,
|
||||
writer, or live coder, you can quickly craft a config that suits every project's
|
||||
needs. Think of it like a distribution of Neovim that you have full control over.
|
||||
|
||||
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.
|
||||
A distribution that takes advantage of pinning vim plugins and third party
|
||||
dependencies (such as tree-sitter grammars, language servers, and more).
|
||||
|
||||
One should never get a broken config when setting options. If setting multiple
|
||||
options results in a broken Neovim, file an issue! Each plugin knows when another
|
||||
plugin which allows for smart configuration of keybindings and automatic setup
|
||||
of things like completion sources and languages.
|
||||
|
||||
## FAQ
|
||||
|
||||
**Q**: Why is this flake so big?
|
||||
<br/>
|
||||
**A**: I have sacrificed in size in order to provide a highly configurable and reproducible Neovim environment. A binary cache is provided to
|
||||
eleminate the need to build the flake from source, but it is still a large flake. If you do not need all the features, you can use the default `nix` output
|
||||
instead of the `maximal` output. This will reduce size by a lot, but you will lose some language specific features.
|
||||
**A**: I have sacrificed in size in order to provide a highly configurable and
|
||||
reproducible Neovim environment. A binary cache is provided to eleminate the
|
||||
need to build the flake from source, but it is still a large flake. If you do
|
||||
not need all the features, you can use the default `nix` output instead of the
|
||||
`maximal` output. This will reduce size by a lot, but you will lose some
|
||||
language specific features.
|
||||
<br/><br/>
|
||||
|
||||
**Q**: Will you try to make this flake smaller?
|
||||
<br/>
|
||||
**A**: Yes. As a matter of fact, I am actively working on making this flake smaller. Unfortunately the process of providing everything
|
||||
possible by itself makes the flake large. Best I can do is to optimize the flake as much as possible by selecting plugins that
|
||||
are small and fast. And the binary cache, so at least you don't have to build it from source.
|
||||
**A**: Yes. As a matter of fact, I am actively working on making this flake
|
||||
smaller. Unfortunately the process of providing everything possible by itself
|
||||
makes the flake large. Best I can do is to optimize the flake as much as
|
||||
possible by selecting plugins that are small and fast. And the binary cache, so
|
||||
at least you don't have to build it from source.
|
||||
<br/><br/>
|
||||
|
||||
**Q**: Will you use a plugin manager/language server installer?
|
||||
<br/>
|
||||
**A**: No. If you feel the need to ask that question, then you have missed the whole point of using nix and ultimately this flake.
|
||||
The whole reason we use nix is to be able to handle EVERYTHING declaratively, well including the LSP and plugin installations.
|
||||
**A**: No. If you feel the need to ask that question, then you have missed the
|
||||
whole point of using nix and ultimately this flake. The whole reason we use nix
|
||||
is to be able to handle EVERYTHING declaratively, well including the LSP and
|
||||
plugin installations.
|
||||
<br/><br/>
|
||||
|
||||
**Q**: Can you add _X_?
|
||||
<br/>
|
||||
**A**: Maybe. Open an issue using the appropriate template and I will consider it. I do not intend to
|
||||
add _every plugin that is in existence_, but I will consider it, should it offer something useful to the flake.
|
||||
**A**: Maybe. Open an issue using the appropriate template and I will consider
|
||||
it. I do not intend to add _every plugin that is in existence_, but I will
|
||||
consider it, should it offer something useful to the flake.
|
||||
|
||||
## Credits
|
||||
|
||||
|
@ -180,14 +214,16 @@ and everyone who has submitted issues or pull requests!
|
|||
|
||||
### 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.
|
||||
- [@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.
|
||||
- [@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/>
|
||||
|
||||
---
|
||||
|
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
384
flake.lock
384
flake.lock
|
@ -3,11 +3,11 @@
|
|||
"alpha-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705520464,
|
||||
"narHash": "sha256-Yz5ZqxjaargJjnbmH1L43EwYp5J5w5RPREG7/smdRQc=",
|
||||
"lastModified": 1708891191,
|
||||
"narHash": "sha256-kTVPKZ/e1us/uHfSwFwR38lFYN8EotJq2jKz6xm/eqg=",
|
||||
"owner": "goolord",
|
||||
"repo": "alpha-nvim",
|
||||
"rev": "4b36c1ca9ea475bdc006896657cf1ccc486aeffa",
|
||||
"rev": "41283fb402713fc8b327e60907f74e46166f4cfd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -19,11 +19,11 @@
|
|||
"bufdelete-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1703393686,
|
||||
"narHash": "sha256-O0JRhx6UJzeZTG+XwGi/6DLaoX8hfqxwSt0W9yQXhBw=",
|
||||
"lastModified": 1708814161,
|
||||
"narHash": "sha256-ljUNfmpImtxFCS19HC9kFlaLlqaPDltKtnx1+/6Y33U=",
|
||||
"owner": "famiu",
|
||||
"repo": "bufdelete.nvim",
|
||||
"rev": "0b9c0f182b09c51170bb9f252f15de7695e4d507",
|
||||
"rev": "f6bcea78afb3060b198125256f897040538bcb81",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -35,11 +35,11 @@
|
|||
"catppuccin": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706227543,
|
||||
"narHash": "sha256-br32TBzK++QK6RqlMjyN4vmNi1cgNgDca8byZqV3oUQ=",
|
||||
"lastModified": 1711706907,
|
||||
"narHash": "sha256-GQjxE8lQj52pheJtHCS+9v2lsJY7wMj2IXVCoNRmQSQ=",
|
||||
"owner": "catppuccin",
|
||||
"repo": "nvim",
|
||||
"rev": "afab7ec2a79c7127627dede79c0018b6e45663d0",
|
||||
"rev": "aebe43db9cb26e1c70fc5b2fd4158169c405e720",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -51,11 +51,11 @@
|
|||
"ccc": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1702716924,
|
||||
"narHash": "sha256-nWe7uYWPZ1LjQRVynYnPomb4EFfyh919Jsh07UPSdvg=",
|
||||
"lastModified": 1711976559,
|
||||
"narHash": "sha256-rSOjeklOdIPQvxNfUBG9Hm001cIlBgrPYcnm7afc9TE=",
|
||||
"owner": "uga-rosa",
|
||||
"repo": "ccc.nvim",
|
||||
"rev": "ec6e23fd2c0bf4ffcf71c1271acdcee6e2c6f49c",
|
||||
"rev": "46b8a38a3bc287f27789800d3d26480d093d65b5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -99,11 +99,11 @@
|
|||
"cinnamon-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1670143364,
|
||||
"narHash": "sha256-JglXQhoPgN9sQ3yuv0+VQxmKMvoQTu5lbGLSRaQkytI=",
|
||||
"lastModified": 1711005384,
|
||||
"narHash": "sha256-LNikkGldBpUsfyH8ThtX7RS1p/z3JzSPonT9qUU84jw=",
|
||||
"owner": "declancm",
|
||||
"repo": "cinnamon.nvim",
|
||||
"rev": "c406ffda3a0302f32c23b24ab756ea20467d6578",
|
||||
"rev": "559fe02fae00ffd78377e9c242b2faa25a428592",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -243,11 +243,11 @@
|
|||
"copilot-lua": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1704638182,
|
||||
"narHash": "sha256-8/EPnigWaY2P4ZlVyu42DOQVOjRPgSCtmdOVbl2ACN8=",
|
||||
"lastModified": 1709095198,
|
||||
"narHash": "sha256-JX3sdsnOnjkY7r9fCtC2oauo0PXF3SQ+SHUo8ifBvAc=",
|
||||
"owner": "zbirenbaum",
|
||||
"repo": "copilot.lua",
|
||||
"rev": "b03617a6dc4bc88b65ab5deac1631da9a9c2dcaf",
|
||||
"rev": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -259,11 +259,11 @@
|
|||
"crates-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706141227,
|
||||
"narHash": "sha256-vkq1N6XvJOSsIbCCcAk1+9ReRMF4it/mofq55JhwQRY=",
|
||||
"lastModified": 1710361360,
|
||||
"narHash": "sha256-wfwSHuP05PEqCbpEG7GStGElMLkrDEbPW7V6p1EANGU=",
|
||||
"owner": "Saecki",
|
||||
"repo": "crates.nvim",
|
||||
"rev": "f2a169840e97a8ed2048abb507d2742c3895c85b",
|
||||
"rev": "b4f4987ccdb1cc3899ee541ef4375c73c48c4570",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -275,11 +275,11 @@
|
|||
"dashboard-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1699578883,
|
||||
"narHash": "sha256-LNjYIRL5xZyLgFkoTu3K5USOfk1mtaXe5RhKBAbzYRw=",
|
||||
"lastModified": 1712122933,
|
||||
"narHash": "sha256-s2PDyOnE3jVk+RCp0aaV2vVJGkO394iDhQTEHRcb9kY=",
|
||||
"owner": "glepnir",
|
||||
"repo": "dashboard-nvim",
|
||||
"rev": "63df28409d940f9cac0a925df09d3dc369db9841",
|
||||
"rev": "7c0c09d55118a2afeb8874e885f87ae80d8ff452",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -324,11 +324,11 @@
|
|||
"dracula": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705994462,
|
||||
"narHash": "sha256-yGV/bA7+Xi+LBi4Iz/SZDVl0KWoo+IO9kgfSIgTk0Ow=",
|
||||
"lastModified": 1708834650,
|
||||
"narHash": "sha256-I3rtbJYv1D+kniOLL9hmTF3ucp/qSNewnO2GmYAERko=",
|
||||
"owner": "Mofiqul",
|
||||
"repo": "dracula.nvim",
|
||||
"rev": "a6cb758d4b182d9f2b7e742910078d94877c1059",
|
||||
"rev": "8d8bddb8814c3e7e62d80dda65a9876f97eb699c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -340,11 +340,11 @@
|
|||
"dressing-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706209758,
|
||||
"narHash": "sha256-P8XlaiNNbOtkOS2un+pfCOOayOzJ/8uLQFrcFlSW7tQ=",
|
||||
"lastModified": 1710299803,
|
||||
"narHash": "sha256-9AwOFTRvhWFo7USgoFYfceiojZM62IXPpBs8CnSqc18=",
|
||||
"owner": "stevearc",
|
||||
"repo": "dressing.nvim",
|
||||
"rev": "0e88293ce3459f4bb310125f3366304af6dc7990",
|
||||
"rev": "18e5beb3845f085b6a33c24112b37988f3f93c06",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -356,11 +356,11 @@
|
|||
"elixir-ls": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705860624,
|
||||
"narHash": "sha256-pd/ZkDpzlheEJfX7X6fFWY4Y5B5Y2EnJMBtuNHPuUJw=",
|
||||
"lastModified": 1711286188,
|
||||
"narHash": "sha256-OIB5f+FBOPsTWKGWyoU+/NQDMsJXBdj1v7UclbTP5ZY=",
|
||||
"owner": "elixir-lsp",
|
||||
"repo": "elixir-ls",
|
||||
"rev": "d10ce2cfe3acf475949e9a21984d18be579d7ec4",
|
||||
"rev": "3e71900e0d0891f9f95e35d9a52b16c6a773a259",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -372,11 +372,11 @@
|
|||
"elixir-tools": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1703976612,
|
||||
"narHash": "sha256-6QdjqugY2kouDVzQa4bxFb9dp9vVantueO+6nnbnOwo=",
|
||||
"lastModified": 1710172806,
|
||||
"narHash": "sha256-pVDeS9oCFzA9t9J/JfYG/RfdMoSmaaERd5nUgL9KHyM=",
|
||||
"owner": "elixir-tools",
|
||||
"repo": "elixir-tools.nvim",
|
||||
"rev": "163522196c962fa87cac0df2a0d1ad332e1e0755",
|
||||
"rev": "4d003f4b41ab9b4f8b569104fa7818f048ed4e25",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -388,11 +388,11 @@
|
|||
"fidget-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1707329128,
|
||||
"narHash": "sha256-mMLAhAbIs33RoU9c8COchbWRr2NM231zJn6TtwJmI+4=",
|
||||
"lastModified": 1710942727,
|
||||
"narHash": "sha256-8pBg8uQto5UzNBRhjFFMMmWLnmpYsG0L1mDa+FN8tpU=",
|
||||
"owner": "j-hui",
|
||||
"repo": "fidget.nvim",
|
||||
"rev": "ad8873c16faa123fe3f9fd6539c41dfb0f97a9e9",
|
||||
"rev": "933db4596e4bab1b09b6d48a10e21819e4cc458f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -422,11 +422,11 @@
|
|||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1704982712,
|
||||
"narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=",
|
||||
"lastModified": 1712014858,
|
||||
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "07f6395285469419cf9d078f59b5b49993198c00",
|
||||
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -440,11 +440,11 @@
|
|||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1705309234,
|
||||
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -471,11 +471,11 @@
|
|||
"flutter-tools": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705943990,
|
||||
"narHash": "sha256-g/cgFJ8kwBk1gNVaio+s1sa5KqpC/LMf06/6+MOPZk4=",
|
||||
"lastModified": 1711622317,
|
||||
"narHash": "sha256-TQRz2MHg6qnzZGUDVFUoaZJiTBwQ3Hjqvc8AAeVS93Y=",
|
||||
"owner": "akinsho",
|
||||
"repo": "flutter-tools.nvim",
|
||||
"rev": "271eec9edb0f1a2bf30ad449ec3b4eeb2c88af05",
|
||||
"rev": "4f18033c3b78aa5450e538d81dfbbb3e67aeadec",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -503,11 +503,11 @@
|
|||
"gitsigns-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706282483,
|
||||
"narHash": "sha256-jVzZPD9RdM0Ie3nWuZgv+XVhwWzLJ2QODrIGRCENWjo=",
|
||||
"lastModified": 1712162672,
|
||||
"narHash": "sha256-uEHuKccCAYpLGVJovz2PY2Q7THA47z8TA5CHWexBv3E=",
|
||||
"owner": "lewis6991",
|
||||
"repo": "gitsigns.nvim",
|
||||
"rev": "fb9fd5312476b51a42a98122616e1c448d823d5c",
|
||||
"rev": "b45ff86f5618d1421a88c12d4feb286b80a1e2d3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -535,11 +535,11 @@
|
|||
"gruvbox": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1704132908,
|
||||
"narHash": "sha256-p/y65ub1qL+5g0ZiWzaTyQeiP7LtVfsdcdJ0eb0A7Og=",
|
||||
"lastModified": 1706538659,
|
||||
"narHash": "sha256-jWnrRy/PT7D0UcPGL+XTbKHWvS0ixvbyqPtTzG9HY84=",
|
||||
"owner": "ellisonleao",
|
||||
"repo": "gruvbox.nvim",
|
||||
"rev": "4176b0b720db0c90ab4030e5c1b4893faf41fd51",
|
||||
"rev": "6e4027ae957cddf7b193adfaec4a8f9e03b4555f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -599,11 +599,11 @@
|
|||
"image-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1707861531,
|
||||
"narHash": "sha256-mh3J3lW2Co2uA7YJzSGum0ZmpJBP0ZzBWUvJLAI9bHw=",
|
||||
"lastModified": 1711809713,
|
||||
"narHash": "sha256-4xsyVDZOFidvLqwfWRB7BPMOejWk3/uhsnUsCNG/hpU=",
|
||||
"owner": "3rd",
|
||||
"repo": "image.nvim",
|
||||
"rev": "4c6cb5ad93ee93d8d7b7c84e1eb291cee99f0a0e",
|
||||
"rev": "a0b756d589c1623ebbfe344666e6d7c49bdc9d71",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -615,11 +615,11 @@
|
|||
"indent-blankline": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705027513,
|
||||
"narHash": "sha256-T0tbTyD9+J7OWcvfrPolrXbjGiXzEXhTtgC9Xj3ANFc=",
|
||||
"lastModified": 1710388427,
|
||||
"narHash": "sha256-Xp8ZQBz0in2MX3l0bnLUsSbH0lDPE+QvdmFpBFry5yY=",
|
||||
"owner": "lukas-reineke",
|
||||
"repo": "indent-blankline.nvim",
|
||||
"rev": "12e92044d313c54c438bd786d11684c88f6f78cd",
|
||||
"rev": "3d08501caef2329aba5121b753e903904088f7e6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -647,11 +647,11 @@
|
|||
"leap-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706284537,
|
||||
"narHash": "sha256-kA6Lkfx7RHPUZjhxx4tc0gsAdhrfFvp6yY5qO+ZXUtM=",
|
||||
"lastModified": 1711935259,
|
||||
"narHash": "sha256-HcuNaKyf+rmhg3t4BQXiRlyeavwyhy16pfPn1Y1l09k=",
|
||||
"owner": "ggandor",
|
||||
"repo": "leap.nvim",
|
||||
"rev": "14eda5bb233354933baa99b6d40bef3a40dbeaae",
|
||||
"rev": "7a9407d17fab3a1c3cfe201965d680a408776152",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -663,11 +663,11 @@
|
|||
"lsp-lines": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1698584731,
|
||||
"narHash": "sha256-3DWM2mTnm6b7J4cYUwCKBGHkXw/dQDO0ZTJXkTl06aE=",
|
||||
"lastModified": 1709989705,
|
||||
"narHash": "sha256-opViLzbwtyUgDoaVKz4z6SN06N8jCQ0YmoqPIht8e64=",
|
||||
"owner": "~whynothugo",
|
||||
"repo": "lsp_lines.nvim",
|
||||
"rev": "cf2306dd332e34a3e91075b40bdd4f6db824b2ee",
|
||||
"rev": "6f3defec73f7c87939e800e9afa5d0571b19b401",
|
||||
"type": "sourcehut"
|
||||
},
|
||||
"original": {
|
||||
|
@ -679,11 +679,11 @@
|
|||
"lsp-signature": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1701211782,
|
||||
"narHash": "sha256-4GcTfu7MRpZUi5dqewaddSvaOezRl9ROKrR7wnnLnKE=",
|
||||
"lastModified": 1710647656,
|
||||
"narHash": "sha256-O7y7pcCvF0xUFamG+wMLe4mC6hUQ679rJV+ZUoWB0oY=",
|
||||
"owner": "ray-x",
|
||||
"repo": "lsp_signature.nvim",
|
||||
"rev": "fed2c8389c148ff1dfdcdca63c2b48d08a50dea0",
|
||||
"rev": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -727,11 +727,11 @@
|
|||
"lualine": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706181415,
|
||||
"narHash": "sha256-LMMcRY4qnGywdK6Bl4YeAEKLhnRuOZ2txn4oYoso2gI=",
|
||||
"lastModified": 1710998293,
|
||||
"narHash": "sha256-+2fi58GolO3e0O7+kl+idNeFuTfJA1b5yCBdY2RnVjA=",
|
||||
"owner": "hoob3rt",
|
||||
"repo": "lualine.nvim",
|
||||
"rev": "7d131a8d3ba5016229e8a1d08bf8782acea98852",
|
||||
"rev": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -759,11 +759,11 @@
|
|||
"minimap-vim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1696276849,
|
||||
"narHash": "sha256-bPW/wDCvItpl0VIQCgz5AEYfx1aAnIMhB1S/tJN5/80=",
|
||||
"lastModified": 1710689313,
|
||||
"narHash": "sha256-GR8VAHla5HWry1TAZQv0Xp7iG256vIGeQcBGMxyt310=",
|
||||
"owner": "wfxr",
|
||||
"repo": "minimap.vim",
|
||||
"rev": "701f4cf4b60a3e1685d2da484282f3a3d8bf9db6",
|
||||
"rev": "395378137e6180762d5b963ca9ad5ac2db5d3283",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -812,11 +812,11 @@
|
|||
"neocord": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1704948184,
|
||||
"narHash": "sha256-HnaMKTNjMuDwHDvxHH5kd4ysa5WU+MlbdD9jH/iJcU8=",
|
||||
"lastModified": 1711651358,
|
||||
"narHash": "sha256-ZZF7ttn/6QIsaub1m0LV0ZirvNVXyFh+WDc39wi4UsM=",
|
||||
"owner": "IogaMaster",
|
||||
"repo": "neocord",
|
||||
"rev": "9b624d5189f699ab454e9515262c13965395b8dd",
|
||||
"rev": "6269823e78a2d2d8c3954068da196879cf2f0fe6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -828,11 +828,11 @@
|
|||
"neodev-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706249139,
|
||||
"narHash": "sha256-BRsZdc1TO88pCoehDv7ervBjaeOpcmSGm/RZAInhI9Q=",
|
||||
"lastModified": 1711715247,
|
||||
"narHash": "sha256-mAJOMVN7/xO7ykVNAeTeX+z2A/7yB8zdqlEKHL6Pb74=",
|
||||
"owner": "folke",
|
||||
"repo": "neodev.nvim",
|
||||
"rev": "64b2a51b02c6f2ae177c745e4d8bc801a339fe09",
|
||||
"rev": "ce9a2e8eaba5649b553529c5498acb43a6c317cd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -867,11 +867,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1708807242,
|
||||
"narHash": "sha256-sRTRkhMD4delO/hPxxi+XwLqPn8BuUq6nnj4JqLwOu0=",
|
||||
"lastModified": 1711703276,
|
||||
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "73de017ef2d18a04ac4bfd0c02650007ccb31c2a",
|
||||
"rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -884,11 +884,11 @@
|
|||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1703961334,
|
||||
"narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=",
|
||||
"lastModified": 1711703276,
|
||||
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9",
|
||||
"rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -966,11 +966,11 @@
|
|||
"noice-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705952416,
|
||||
"narHash": "sha256-lNCdwB0B5arbTEIHdDoQ19/vQ0UT89AQFwZM+RHqOTg=",
|
||||
"lastModified": 1711471279,
|
||||
"narHash": "sha256-y6gHNkWVsIuwBf7MblCTKTZSqjGDxqeFeQZWexzwk94=",
|
||||
"owner": "folke",
|
||||
"repo": "noice.nvim",
|
||||
"rev": "bf67d70bd7265d075191e7812d8eb42b9791f737",
|
||||
"rev": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -982,27 +982,28 @@
|
|||
"none-ls": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706069423,
|
||||
"narHash": "sha256-s+Hp0Yzge7FKKDez4DO8uytsNORIqeNWYOLSO7kSZbo=",
|
||||
"lastModified": 1708525772,
|
||||
"narHash": "sha256-VCDUKiy9C3Bu9suf2bI6XSis1+j01oFC3GFPyQxi74c=",
|
||||
"owner": "nvimtools",
|
||||
"repo": "none-ls.nvim",
|
||||
"rev": "a311c7cc8f17543143a7482cdbe3a384c371d56a",
|
||||
"rev": "bb680d752cec37949faca7a1f509e2fe67ab418a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nvimtools",
|
||||
"repo": "none-ls.nvim",
|
||||
"rev": "bb680d752cec37949faca7a1f509e2fe67ab418a",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nui-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1704411133,
|
||||
"narHash": "sha256-SWG0IQDNXrgWK1ApQSpc2oPKNYgTPend877DQ6FuqUc=",
|
||||
"lastModified": 1710740032,
|
||||
"narHash": "sha256-Zr5CNx6BIM6naCXW8YBc/Oj1qOtWV/3tuMoaaZjoSZA=",
|
||||
"owner": "MunifTanjim",
|
||||
"repo": "nui.nvim",
|
||||
"rev": "35da9ca1de0fc4dda96c2e214d93d363c145f418",
|
||||
"rev": "cbd2668414331c10039278f558630ed19b93e69b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1014,11 +1015,11 @@
|
|||
"nvim-autopairs": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705959312,
|
||||
"narHash": "sha256-4sZoZfg6ORbEwbvjIRnaDrKtVnoHpx7cAOcxn1Er6pg=",
|
||||
"lastModified": 1710930065,
|
||||
"narHash": "sha256-H4mJ43Eyo36noIqYZ0lyqM7WPwgIKqi96OjW5F3pfvU=",
|
||||
"owner": "windwp",
|
||||
"repo": "nvim-autopairs",
|
||||
"rev": "096d0baecc34f6c5d8a6dd25851e9d5ad338209b",
|
||||
"rev": "dbfc1c34bed415906395db8303c71039b3a3ffb4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1030,11 +1031,11 @@
|
|||
"nvim-bufferline-lua": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706180994,
|
||||
"narHash": "sha256-/iGzUDJaodkUyWpwim8UtwaRuarfu/Nk6wxVApk+QxY=",
|
||||
"lastModified": 1709805539,
|
||||
"narHash": "sha256-drvgwupiyRAoShL2enXEYUumkYJnG+QtIkBIVqVZK+U=",
|
||||
"owner": "akinsho",
|
||||
"repo": "nvim-bufferline.lua",
|
||||
"rev": "d6cb9b7cac52887bcac65f8698e67479553c0748",
|
||||
"rev": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1046,11 +1047,11 @@
|
|||
"nvim-cmp": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1702541213,
|
||||
"narHash": "sha256-BtAYRYn6m788zAq/mNnbAzAxp1TGf9QkRE0hSOp9sdc=",
|
||||
"lastModified": 1712041554,
|
||||
"narHash": "sha256-DBxQTmwuEGj2g7LP7d1PJk/SyO0iJq2CIIHsFh0QJ4I=",
|
||||
"owner": "hrsh7th",
|
||||
"repo": "nvim-cmp",
|
||||
"rev": "538e37ba87284942c1d76ed38dd497e54e65b891",
|
||||
"rev": "ce16de5665c766f39c271705b17fff06f7bcb84f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1126,11 +1127,11 @@
|
|||
"nvim-dap": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705151920,
|
||||
"narHash": "sha256-9Rc4dxbgN1LxoXPXHTi+V92MA0fEn5PveqCSMHbgn98=",
|
||||
"lastModified": 1711382674,
|
||||
"narHash": "sha256-HoLnYeA18TpHM1SJ3NOY53ZAyBo2y2EoUbAIr7TqtQI=",
|
||||
"owner": "mfussenegger",
|
||||
"repo": "nvim-dap",
|
||||
"rev": "9adbfdca13afbe646d09a8d7a86d5d031fb9c5a5",
|
||||
"rev": "405df1dcc2e395ab5173a9c3d00e03942c023074",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1142,11 +1143,11 @@
|
|||
"nvim-dap-ui": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705942789,
|
||||
"narHash": "sha256-4tYSdxPj+/hxd8KNzCU6Lvf+ACxpKgYyGOlF+Jwzxa8=",
|
||||
"lastModified": 1710867604,
|
||||
"narHash": "sha256-KAwCt8E3lC0fzXQ9GpPsdb9wdWC6G2P4C/YFQFY9AAM=",
|
||||
"owner": "rcarriga",
|
||||
"repo": "nvim-dap-ui",
|
||||
"rev": "d845ebd798ad1cf30aa4abd4c4eff795cdcfdd4f",
|
||||
"rev": "edfa93f60b189e5952c016eee262d0685d838450",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1190,11 +1191,11 @@
|
|||
"nvim-lspconfig": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705757419,
|
||||
"narHash": "sha256-StYsN9C2rV471JkncUR1PFeXs0S15ZGTF1DigSbwOHI=",
|
||||
"lastModified": 1712139869,
|
||||
"narHash": "sha256-DMhB4L/0FjYbhNx7SwFnyFVa4PLVLlwB4uiNbiKUmEo=",
|
||||
"owner": "neovim",
|
||||
"repo": "nvim-lspconfig",
|
||||
"rev": "8917d2c830e04bf944a699b8c41f097621283828",
|
||||
"rev": "96e5711040df23583591391ce49e556b8cd248d8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1206,11 +1207,11 @@
|
|||
"nvim-navbuddy": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1694669446,
|
||||
"narHash": "sha256-zy1Tq8M5UITNAwtAlFYaUFlHnIZ5LWD9ZLaZcy7ulQ8=",
|
||||
"lastModified": 1711239174,
|
||||
"narHash": "sha256-EZXzFjGsZHkb2Ui5uvOottPHA8X15F6xyikab4dBlYk=",
|
||||
"owner": "SmiteshP",
|
||||
"repo": "nvim-navbuddy",
|
||||
"rev": "f137a3466a6cd1965cdcc5398daff54e66eebbe5",
|
||||
"rev": "f34237e8a41ebc6e2716af2ebf49854d8c5289c8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1251,14 +1252,30 @@
|
|||
"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": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705342184,
|
||||
"narHash": "sha256-WhC80NnWXEAYHLORpUPIXb2s1ERJxyK3l2L9oke68mo=",
|
||||
"lastModified": 1708161547,
|
||||
"narHash": "sha256-xJYPOX4YLcWojMCdP1RO22/7FMrbcBQxqxrcVCE2TrU=",
|
||||
"owner": "rcarriga",
|
||||
"repo": "nvim-notify",
|
||||
"rev": "80b67b265530632505193553d05127ae7fe09ddd",
|
||||
"rev": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1270,11 +1287,11 @@
|
|||
"nvim-session-manager": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705767424,
|
||||
"narHash": "sha256-BTVhCevq40A7yOYp2fLg6N9A+yarIWJM83Z2bfvlQuU=",
|
||||
"lastModified": 1708284146,
|
||||
"narHash": "sha256-+TDWY8mprJfUp9ZFKbz83to7XW8iiovja22jHms+N1A=",
|
||||
"owner": "Shatur",
|
||||
"repo": "neovim-session-manager",
|
||||
"rev": "b8a22f2c88429a11272117a901db66055abf3e7f",
|
||||
"rev": "d8e1ba3bbcf3fdc6a887bcfbd94c48ae4707b457",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1286,11 +1303,11 @@
|
|||
"nvim-surround": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705526094,
|
||||
"narHash": "sha256-CGAQtBxhiP6AUQzwdra5AOpsNu+oeLO2hCJnmL61jgE=",
|
||||
"lastModified": 1709063002,
|
||||
"narHash": "sha256-uInXJq+TrfKM9WfOlUAYxbDad9mwf7DK5lETyTu+ShM=",
|
||||
"owner": "kylechui",
|
||||
"repo": "nvim-surround",
|
||||
"rev": "0c02c52182a9c2a7fa7e122b4037f6408e98434a",
|
||||
"rev": "84a26afce16cffa7e3322cfa80a42cddf60616eb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1302,11 +1319,11 @@
|
|||
"nvim-tree-lua": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705818283,
|
||||
"narHash": "sha256-EKAzWIT2Qs65Il1pwgpkFsCogFViapUiSHcZgVy+QsY=",
|
||||
"lastModified": 1711866287,
|
||||
"narHash": "sha256-AMbUthY+49wREBr7EQSZ/tH8hT4gixPfcPT+ZzssUKw=",
|
||||
"owner": "nvim-tree",
|
||||
"repo": "nvim-tree.lua",
|
||||
"rev": "7bdb220d0fe604a77361e92cdbc7af1b8a412126",
|
||||
"rev": "d8d3a1590a05b2d8b5eb26e2ed1c6052b1b47a77",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1318,11 +1335,11 @@
|
|||
"nvim-treesitter-context": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706217055,
|
||||
"narHash": "sha256-QhmTXikUIye+xxLw52ttRJz9T0bfhn/ks5VSQd8tDo0=",
|
||||
"lastModified": 1711099836,
|
||||
"narHash": "sha256-iDBFUMUjGJXzEioZ4cTydDYHRR30GF6z9W0M7IZUasc=",
|
||||
"owner": "nvim-treesitter",
|
||||
"repo": "nvim-treesitter-context",
|
||||
"rev": "9c06b115abc57c99cf0aa81dc29490f5001f57a1",
|
||||
"rev": "f19766163c18515fb4d3c12d572bf9cba6cdb990",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1334,11 +1351,11 @@
|
|||
"nvim-ts-autotag": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706174398,
|
||||
"narHash": "sha256-C3FOh11eF5Blzh6vsFSA6AB7opXl5Gocdti1QhFZ2vM=",
|
||||
"lastModified": 1707265789,
|
||||
"narHash": "sha256-cPIEIjcYxX3ZkOyou2mYlHMdhBxCoVTpJVXZtiWe9Ks=",
|
||||
"owner": "windwp",
|
||||
"repo": "nvim-ts-autotag",
|
||||
"rev": "a65b202cfd08e0e69e531eab737205ff5bc082a4",
|
||||
"rev": "531f48334c422222aebc888fd36e7d109cb354cd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1350,11 +1367,11 @@
|
|||
"nvim-web-devicons": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706072160,
|
||||
"narHash": "sha256-w038PU9i1onEBo3x4bo1kDz9Fo46Whd8ZJhyIqxz3I8=",
|
||||
"lastModified": 1711417099,
|
||||
"narHash": "sha256-G8URFQdABLf3ptj+9kwSFGXly9D+4lkt3SXfbhVDH6g=",
|
||||
"owner": "nvim-tree",
|
||||
"repo": "nvim-web-devicons",
|
||||
"rev": "b427ac5f9dff494f839e81441fb3f04a58cbcfbc",
|
||||
"rev": "3ee60deaa539360518eaab93a6c701fe9f4d82ef",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1366,11 +1383,11 @@
|
|||
"obsidian-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706230460,
|
||||
"narHash": "sha256-jl03+C9/L081eza6XwK05GiGZI0U82wqQBMwTjtedv8=",
|
||||
"lastModified": 1711994732,
|
||||
"narHash": "sha256-RD5EhYv2AZvCywxQYKkPjZPY/jEjl2rEofMVCHO6SJQ=",
|
||||
"owner": "epwalsh",
|
||||
"repo": "obsidian.nvim",
|
||||
"rev": "194f9fc798ac0f73dbac2e83fc3d5c99b8f70e78",
|
||||
"rev": "d70f3289399c25153b7f503b838afbf981124a37",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1382,11 +1399,11 @@
|
|||
"onedark": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705931596,
|
||||
"narHash": "sha256-jjvZ2z93xd1Yng8g6+cdsXhLkm2lC7DSUHiFYC+Gg5k=",
|
||||
"lastModified": 1706527208,
|
||||
"narHash": "sha256-1+aO8vrUGEe/NIVI1C1xJyuQVPQZ1s510lopkEVP7No=",
|
||||
"owner": "navarasu",
|
||||
"repo": "onedark.nvim",
|
||||
"rev": "14e5de43cf1ff761c280d1ff5b9980897f5b46c7",
|
||||
"rev": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1398,11 +1415,11 @@
|
|||
"orgmode-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706216082,
|
||||
"narHash": "sha256-M9AI3LlJvs6ZqQPeYr+rqRFu4gYVZbLFV3PUuZ77ReE=",
|
||||
"lastModified": 1712161945,
|
||||
"narHash": "sha256-44dTemgSevEdiluUanGLySo7WbvKrXW+n2dUwUO4cqY=",
|
||||
"owner": "nvim-orgmode",
|
||||
"repo": "orgmode",
|
||||
"rev": "ab045e3084d5987e8939d25d69b09baaf762278c",
|
||||
"rev": "ddcfbb1e52b2ff5b90469eb13214676931a66e09",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1431,11 +1448,11 @@
|
|||
"plenary-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705841956,
|
||||
"narHash": "sha256-awRAI1ov9OBt6VuNxk/qjPTSPBYsMJzURKVV+IA7kok=",
|
||||
"lastModified": 1711369325,
|
||||
"narHash": "sha256-wM/FuK24NPEyaWntwT+mi2SuPExC/abXDK9c2WvgUBk=",
|
||||
"owner": "nvim-lua",
|
||||
"repo": "plenary.nvim",
|
||||
"rev": "663246936325062427597964d81d30eaa42ab1e4",
|
||||
"rev": "8aad4396840be7fc42896e3011751b7609ca4119",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1567,6 +1584,7 @@
|
|||
"nvim-navbuddy": "nvim-navbuddy",
|
||||
"nvim-navic": "nvim-navic",
|
||||
"nvim-neoclip": "nvim-neoclip",
|
||||
"nvim-nio": "nvim-nio",
|
||||
"nvim-notify": "nvim-notify",
|
||||
"nvim-session-manager": "nvim-session-manager",
|
||||
"nvim-surround": "nvim-surround",
|
||||
|
@ -1608,11 +1626,11 @@
|
|||
"rose-pine": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1707703907,
|
||||
"narHash": "sha256-jmDGDlCurGAG85SglAwmQr943kVr8KUr11zpPejQliQ=",
|
||||
"lastModified": 1711769966,
|
||||
"narHash": "sha256-GVYCkyFdVgye/8pEXPT8Y+4YyLmivgX/IHht/G1DdEA=",
|
||||
"owner": "rose-pine",
|
||||
"repo": "neovim",
|
||||
"rev": "f01ce3a71748a92997d266cfe2c985decd18c601",
|
||||
"rev": "19055dfe90bfa46a1e5b0a706d13980bdffa2dee",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1681,11 +1699,11 @@
|
|||
"smartcolumn": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1703592909,
|
||||
"narHash": "sha256-c5tENO4LJaSRELxuCOp/aI94ifhKjqd8J2chJbxfFdc=",
|
||||
"lastModified": 1710067624,
|
||||
"narHash": "sha256-DHIeDNUF9n9s14GVeojIwc5QUPwJMYYl3gRvhvO/rdE=",
|
||||
"owner": "m4xshen",
|
||||
"repo": "smartcolumn.nvim",
|
||||
"rev": "a52915d6d9abf9972e249ebcffcc651cf9b062dd",
|
||||
"rev": "cefb17be095ad5526030a21bb2a80553cae09127",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1791,11 +1809,11 @@
|
|||
"telescope": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706154992,
|
||||
"narHash": "sha256-uagWtwd/L07RRUpSu+kVv0qD+neySSmSrIeFBJ0gZiM=",
|
||||
"lastModified": 1712065014,
|
||||
"narHash": "sha256-8Bp1E9JY1MByjRCcON1HJLYRswLx63lmz20rGrJW7Wc=",
|
||||
"owner": "nvim-telescope",
|
||||
"repo": "telescope.nvim",
|
||||
"rev": "1bfbb1fb5c56d2dbe33216fcb2ebe82e499aa06c",
|
||||
"rev": "4626aaa2bcfdacf55fd6d44b430e2df81b2403ff",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1848,11 +1866,11 @@
|
|||
"todo-comments": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705847650,
|
||||
"narHash": "sha256-DiyieXXx7iYGWkpeOvduJf0n7dnpaQ7rXmaWvZQaCyE=",
|
||||
"lastModified": 1711553769,
|
||||
"narHash": "sha256-BJNU01iTRDNrPv48fgiJRS+ouaHkoqw2AYXKDRgDzfw=",
|
||||
"owner": "folke",
|
||||
"repo": "todo-comments.nvim",
|
||||
"rev": "833d8dd8b07eeda37a09e99460f72a02616935cb",
|
||||
"rev": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1864,11 +1882,11 @@
|
|||
"toggleterm-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705944058,
|
||||
"narHash": "sha256-y+83w0D2jD68QJpBCYXLqUUxVu9MTBZ+nJutYD7jAoQ=",
|
||||
"lastModified": 1707733615,
|
||||
"narHash": "sha256-FJyDxQm2vs9R4WkqAbh6ryCvEABfrLSKRrAGo/qI5jM=",
|
||||
"owner": "akinsho",
|
||||
"repo": "toggleterm.nvim",
|
||||
"rev": "b49df5cdce67a8964d1b027dae94bde212092b51",
|
||||
"rev": "193786e0371e3286d3bc9aa0079da1cd41beaa62",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1880,11 +1898,11 @@
|
|||
"tokyonight": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706078362,
|
||||
"narHash": "sha256-qHuX21iC8edV5K0RgHin4PowMtKBXWXQgvHjx2SPTKE=",
|
||||
"lastModified": 1711665767,
|
||||
"narHash": "sha256-ItCmSUMMTe8iQeneIJLuWedVXsNgm+FXNtdrrdJ/1oE=",
|
||||
"owner": "folke",
|
||||
"repo": "tokyonight.nvim",
|
||||
"rev": "e3301873c1e96903daebb98cc9b5926810bf73dd",
|
||||
"rev": "9bf9ec53d5e87b025e2404069b71e7ebdc3a13e5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1896,11 +1914,11 @@
|
|||
"trouble": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1697626811,
|
||||
"narHash": "sha256-8nLghiueYOtWY7OGVxow9A2G/5lgt+Kt5D8q1xeJvVg=",
|
||||
"lastModified": 1711693365,
|
||||
"narHash": "sha256-kIQ72fqAsiMF9jq0MzC6peaHJddYn5PRNXfYFHTQB5Q=",
|
||||
"owner": "folke",
|
||||
"repo": "trouble.nvim",
|
||||
"rev": "f1168feada93c0154ede4d1fe9183bf69bac54ea",
|
||||
"rev": "b9cf677f20bb2faa2dacfa870b084e568dca9572",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1945,11 +1963,11 @@
|
|||
"vim-dirtytalk": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1697142601,
|
||||
"narHash": "sha256-ezbcgCvOXhPSpsOZpCI2QIaFFaRGZAFbuAluMvB7Jjk=",
|
||||
"lastModified": 1711553630,
|
||||
"narHash": "sha256-1cLseaHfWgyAvzHcK93nl9sy66J/zvlnK7P4vnIthmY=",
|
||||
"owner": "psliwka",
|
||||
"repo": "vim-dirtytalk",
|
||||
"rev": "f5b0d51a7d822177814e7edc116ca484f852665f",
|
||||
"rev": "d2929ffff8639b2b4b4bb7c2b6c04575c1322d2f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1961,11 +1979,11 @@
|
|||
"vim-illuminate": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706241276,
|
||||
"narHash": "sha256-8stuFv+PzjmFKib1Y7kwK4C1db5dlDyptuaz9iU+ptM=",
|
||||
"lastModified": 1707016059,
|
||||
"narHash": "sha256-KNIu4cNyZddZSRS8KZ0U0T8uSSLJu8iqNLQN8e+Bv94=",
|
||||
"owner": "RRethy",
|
||||
"repo": "vim-illuminate",
|
||||
"rev": "97c1265ff0b67064b6cfdc15bafc50202a537ae2",
|
||||
"rev": "305bf07b919ac526deb5193280379e2f8b599926",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1977,11 +1995,11 @@
|
|||
"vim-markdown": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1698870120,
|
||||
"narHash": "sha256-d3GDuMlnhweAajSc284wWN/h0teu5uFG6NQTWa+dcxo=",
|
||||
"lastModified": 1709279705,
|
||||
"narHash": "sha256-eKwWdyvMZ7FV3FvOtqWVD7pulXNnhbEEjHq7MYg1woU=",
|
||||
"owner": "preservim",
|
||||
"repo": "vim-markdown",
|
||||
"rev": "46add6c3017d3e4035dc10ffa9cb54221d8dfe1a",
|
||||
"rev": "a657e697376909c41475a686eeef7fc7a4972d94",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -2094,11 +2112,11 @@
|
|||
"nixpkgs": "nixpkgs_4"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1706288111,
|
||||
"narHash": "sha256-CvSS/BMm86Uzjeb8pEkWa3qnuzMiPPmT8hf5lDOP6TE=",
|
||||
"lastModified": 1712017348,
|
||||
"narHash": "sha256-At+mk7gHMk2kbisQhkts8cYkz7XhIRei9+zT3wP8bT8=",
|
||||
"owner": "mitchellh",
|
||||
"repo": "zig-overlay",
|
||||
"rev": "7f5d4cbecf3aa75ac8afaef8a20723b3a57f7d20",
|
||||
"rev": "63bdd97bf1c93a1da1c658ec9ab974fef52a7280",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
11
flake.nix
11
flake.nix
|
@ -46,7 +46,7 @@
|
|||
default = self'.devShells.lsp;
|
||||
nvim-nix = pkgs.mkShell {nativeBuildInputs = [config.packages.nix];};
|
||||
lsp = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [nil statix deadnix];
|
||||
nativeBuildInputs = with pkgs; [nil statix deadnix alejandra];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -117,7 +117,8 @@
|
|||
};
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
|
@ -589,5 +590,11 @@
|
|||
url = "github:tpope/vim-repeat";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
nvim-nio = {
|
||||
# (required nvim-dap-ui)
|
||||
url = "github:nvim-neotest/nvim-nio";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{lib}: let
|
||||
inherit (lib.options) mkOption;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.modules) mkIf mkDefault;
|
||||
inherit (lib.types) nullOr str;
|
||||
inherit (lib.attrsets) isAttrs mapAttrs;
|
||||
|
||||
|
@ -65,6 +65,8 @@
|
|||
|
||||
mkSetLuaBinding = binding: action:
|
||||
mkLuaBinding binding.value action binding.description;
|
||||
|
||||
pushDownDefault = attr: mapAttrs (_name: value: mkDefault value) attr;
|
||||
};
|
||||
in
|
||||
binds
|
||||
|
|
21
lib/dag.nix
21
lib/dag.nix
|
@ -8,13 +8,16 @@
|
|||
# - the addition of the function `entryBefore` indicating a "wanted
|
||||
# by" relationship.
|
||||
{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 {
|
||||
empty = {};
|
||||
|
||||
isEntry = e: e ? data && e ? after && e ? before;
|
||||
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,
|
||||
|
@ -76,8 +79,8 @@ in {
|
|||
*/
|
||||
topoSort = dag: let
|
||||
dagBefore = dag: name:
|
||||
builtins.attrNames
|
||||
(filterAttrs (_n: v: builtins.elem name v.before) dag);
|
||||
attrNames
|
||||
(filterAttrs (_n: v: elem name v.before) dag);
|
||||
normalizedDag =
|
||||
mapAttrs (n: v: {
|
||||
name = n;
|
||||
|
@ -85,8 +88,8 @@ in {
|
|||
after = v.after ++ dagBefore dag n;
|
||||
})
|
||||
dag;
|
||||
before = a: b: builtins.elem a.name b.after;
|
||||
sorted = toposort before (builtins.attrValues normalizedDag);
|
||||
before = a: b: elem a.name b.after;
|
||||
sorted = toposort before (attrValues normalizedDag);
|
||||
in
|
||||
if sorted ? result
|
||||
then {
|
||||
|
@ -100,8 +103,8 @@ in {
|
|||
entryBetween = before: after: data: {inherit data before after;};
|
||||
|
||||
# Create a DAG entry with no particular dependency information.
|
||||
entryAnywhere = nvim.dag.entryBetween [] [];
|
||||
entryAnywhere = entryBetween [] [];
|
||||
|
||||
entryAfter = nvim.dag.entryBetween [];
|
||||
entryBefore = before: nvim.dag.entryBetween before [];
|
||||
entryAfter = entryBetween [];
|
||||
entryBefore = before: entryBetween before [];
|
||||
}
|
||||
|
|
|
@ -1,32 +1,37 @@
|
|||
# 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
|
||||
# configuration formats.
|
||||
diagnosticsToLua = {
|
||||
lang,
|
||||
config,
|
||||
diagnostics,
|
||||
diagnosticsProviders,
|
||||
}:
|
||||
lib.listToAttrs
|
||||
listToAttrs
|
||||
(map (v: let
|
||||
type =
|
||||
if builtins.isString v
|
||||
if isString v
|
||||
then v
|
||||
else builtins.getAttr v.type;
|
||||
else getAttr v.type;
|
||||
package =
|
||||
if builtins.isString v
|
||||
then diagnostics.${type}.package
|
||||
if isString v
|
||||
then diagnosticsProviders.${type}.package
|
||||
else v.package;
|
||||
in {
|
||||
name = "${lang}-diagnostics-${type}";
|
||||
value = diagnostics.${type}.nullConfig package;
|
||||
value = diagnosticsProviders.${type}.nullConfig package;
|
||||
})
|
||||
config);
|
||||
|
||||
mkEnable = desc:
|
||||
lib.mkOption {
|
||||
mkOption {
|
||||
description = "Turn on ${desc} for enabled languages by default";
|
||||
type = lib.types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
}
|
||||
|
|
46
lib/lua.nix
46
lib/lua.nix
|
@ -1,7 +1,9 @@
|
|||
# Helpers for converting values to lua
|
||||
{lib}: let
|
||||
inherit (lib) mapAttrsToList filterAttrs concatStringsSep concatMapStringsSep stringToCharacters boolToString;
|
||||
inherit (builtins) hasAttr head throw typeOf;
|
||||
inherit (builtins) hasAttr head throw typeOf isList isAttrs isBool isInt isString isPath isFloat toJSON;
|
||||
inherit (lib.attrsets) mapAttrsToList filterAttrs;
|
||||
inherit (lib.strings) concatStringsSep concatMapStringsSep stringToCharacters;
|
||||
inherit (lib.trivial) boolToString;
|
||||
in rec {
|
||||
# Convert a null value to lua's nil
|
||||
nullString = value:
|
||||
|
@ -11,29 +13,29 @@ in rec {
|
|||
|
||||
# convert an expression to lua
|
||||
expToLua = exp:
|
||||
if builtins.isList exp
|
||||
if isList exp
|
||||
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
|
||||
else if builtins.isBool exp
|
||||
then lib.boolToString exp # if bool, convert to string
|
||||
else if builtins.isInt exp
|
||||
then builtins.toString exp # if int, convert to string
|
||||
else if isBool exp
|
||||
then boolToString exp # if bool, convert to string
|
||||
else if isInt exp
|
||||
then toString exp # if int, convert to string
|
||||
else if exp == null
|
||||
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
|
||||
listToLuaTable = list:
|
||||
"{ " + (builtins.concatStringsSep ", " (map expToLua list)) + " }";
|
||||
"{ " + (concatStringsSep ", " (map expToLua list)) + " }";
|
||||
|
||||
# convert attrset to a lua table
|
||||
attrsetToLuaTable = attrset:
|
||||
"{ "
|
||||
+ (
|
||||
builtins.concatStringsSep ", "
|
||||
concatStringsSep ", "
|
||||
(
|
||||
lib.mapAttrsToList (
|
||||
mapAttrsToList (
|
||||
name: value:
|
||||
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
|
||||
luaTable = items: ''{${builtins.concatStringsSep "," items}}'';
|
||||
luaTable = items: ''{${concatStringsSep "," items}}'';
|
||||
|
||||
toLuaObject = args:
|
||||
if builtins.isAttrs args
|
||||
if isAttrs args
|
||||
then
|
||||
if hasAttr "__raw" args
|
||||
then args.__raw
|
||||
|
@ -68,19 +70,19 @@ in rec {
|
|||
)
|
||||
args)))
|
||||
+ "}"
|
||||
else if builtins.isList args
|
||||
else if isList args
|
||||
then "{" + concatMapStringsSep "," toLuaObject args + "}"
|
||||
else if builtins.isString args
|
||||
else if isString args
|
||||
then
|
||||
# This should be enough!
|
||||
builtins.toJSON args
|
||||
else if builtins.isPath args
|
||||
then builtins.toJSON (toString args)
|
||||
else if builtins.isBool args
|
||||
toJSON args
|
||||
else if isPath args
|
||||
then toJSON (toString args)
|
||||
else if isBool args
|
||||
then "${boolToString args}"
|
||||
else if builtins.isFloat args
|
||||
else if isFloat args
|
||||
then "${toString args}"
|
||||
else if builtins.isInt args
|
||||
else if isInt args
|
||||
then "${toString args}"
|
||||
else if (args == null)
|
||||
then "nil"
|
||||
|
|
|
@ -15,13 +15,13 @@ with lib; let
|
|||
in {
|
||||
diagnostics = {
|
||||
langDesc,
|
||||
diagnostics,
|
||||
defaultDiagnostics,
|
||||
diagnosticsProviders,
|
||||
defaultDiagnosticsProvider,
|
||||
}:
|
||||
mkOption {
|
||||
description = "List of ${langDesc} diagnostics to enable";
|
||||
type = with types; listOf (either (enum (attrNames diagnostics)) (submodule diagnosticSubmodule));
|
||||
default = defaultDiagnostics;
|
||||
type = with types; listOf (either (enum (attrNames diagnosticsProviders)) (submodule diagnosticSubmodule));
|
||||
default = defaultDiagnosticsProvider;
|
||||
};
|
||||
|
||||
mkGrammarOption = pkgs: grammar:
|
||||
|
|
|
@ -99,6 +99,7 @@ with lib; let
|
|||
"highlight-undo"
|
||||
"nvim-docs-view"
|
||||
"image-nvim"
|
||||
"nvim-nio"
|
||||
];
|
||||
# You can either use the name of the plugin or a package.
|
||||
pluginType = with types;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
let
|
||||
inherit (builtins) isInt isBool toJSON;
|
||||
inherit (builtins) isInt isBool toJSON toString;
|
||||
in rec {
|
||||
# yes? no.
|
||||
yesNo = value:
|
||||
|
@ -16,7 +16,7 @@ in rec {
|
|||
# convert a literal value to a vim compliant value
|
||||
valToVim = val:
|
||||
if (isInt val)
|
||||
then (builtins.toString val)
|
||||
then (toString val)
|
||||
else
|
||||
(
|
||||
if (isBool val)
|
||||
|
|
|
@ -4,12 +4,15 @@
|
|||
...
|
||||
}: let
|
||||
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;
|
||||
in {
|
||||
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 =
|
||||
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
|
||||
set encoding=utf-8
|
||||
set mouse=${cfg.mouseSupport}
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkOption;
|
||||
inherit (lib.types) types;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) package path str bool int listOf enum nullOr;
|
||||
in {
|
||||
options.vim = {
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
type = package;
|
||||
default = pkgs.neovim-unwrapped;
|
||||
description = ''
|
||||
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 = {
|
||||
enable = mkEnableOption "debug mode";
|
||||
level = mkOption {
|
||||
type = types.int;
|
||||
type = int;
|
||||
default = 20;
|
||||
description = "Set the debug level";
|
||||
};
|
||||
|
||||
logFile = mkOption {
|
||||
type = types.path;
|
||||
type = path;
|
||||
default = "/tmp/nvim.log";
|
||||
description = "Set the log file";
|
||||
};
|
||||
|
@ -33,7 +33,7 @@ in {
|
|||
enableLuaLoader = mkEnableOption "experimental Lua module loader to speed up the start up process";
|
||||
|
||||
leaderKey = mkOption {
|
||||
type = with types; nullOr str;
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = "The leader key to be used internally";
|
||||
};
|
||||
|
@ -42,7 +42,7 @@ in {
|
|||
enable = mkEnableOption "neovim's built-in spellchecking";
|
||||
enableProgrammingWordList = mkEnableOption "vim-dirtytalk, a wordlist for programmers, that includes programming words";
|
||||
languages = mkOption {
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
description = "The languages to be used for spellchecking";
|
||||
default = ["en"];
|
||||
example = ["en" "de"];
|
||||
|
@ -50,55 +50,55 @@ in {
|
|||
};
|
||||
|
||||
colourTerm = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Set terminal up for 256 colours";
|
||||
};
|
||||
|
||||
disableArrows = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Set to prevent arrow keys from moving cursor";
|
||||
};
|
||||
|
||||
hideSearchHighlight = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Hide search highlight so it doesn't stay highlighted";
|
||||
};
|
||||
|
||||
scrollOffset = mkOption {
|
||||
type = types.int;
|
||||
type = int;
|
||||
default = 8;
|
||||
description = "Start scrolling this number of lines from the top or bottom of the page.";
|
||||
};
|
||||
|
||||
wordWrap = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Enable word wrapping.";
|
||||
};
|
||||
|
||||
syntaxHighlighting = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Enable syntax highlighting";
|
||||
};
|
||||
|
||||
mapLeaderSpace = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Map the space key to leader key";
|
||||
};
|
||||
|
||||
useSystemClipboard = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Make use of the clipboard for default yank and paste operations. Don't use * and +";
|
||||
};
|
||||
|
||||
mouseSupport = mkOption {
|
||||
type = with types; enum ["a" "n" "v" "i" "c"];
|
||||
type = enum ["a" "n" "v" "i" "c"];
|
||||
default = "a";
|
||||
description = ''
|
||||
Set modes for mouse support.
|
||||
|
@ -112,7 +112,7 @@ in {
|
|||
};
|
||||
|
||||
lineNumberMode = mkOption {
|
||||
type = with types; enum ["relative" "number" "relNumber" "none"];
|
||||
type = enum ["relative" "number" "relNumber" "none"];
|
||||
default = "relNumber";
|
||||
description = ''
|
||||
How line numbers are displayed. Available options are
|
||||
|
@ -121,78 +121,78 @@ in {
|
|||
};
|
||||
|
||||
preventJunkFiles = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Prevent swapfile, backupfile from being created";
|
||||
};
|
||||
|
||||
tabWidth = mkOption {
|
||||
type = types.int;
|
||||
type = int;
|
||||
default = 4;
|
||||
description = "Set the width of tabs";
|
||||
};
|
||||
|
||||
autoIndent = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Enable auto indent";
|
||||
};
|
||||
|
||||
cmdHeight = mkOption {
|
||||
type = types.int;
|
||||
type = int;
|
||||
default = 1;
|
||||
description = "Height of the command pane";
|
||||
};
|
||||
|
||||
updateTime = mkOption {
|
||||
type = types.int;
|
||||
type = int;
|
||||
default = 300;
|
||||
description = "The number of milliseconds till Cursor Hold event is fired";
|
||||
};
|
||||
|
||||
showSignColumn = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Show the sign column";
|
||||
};
|
||||
|
||||
bell = mkOption {
|
||||
type = types.enum ["none" "visual" "on"];
|
||||
type = enum ["none" "visual" "on"];
|
||||
default = "none";
|
||||
description = "Set how bells are handled. Options: on, visual or none";
|
||||
};
|
||||
|
||||
mapTimeout = mkOption {
|
||||
type = types.int;
|
||||
type = int;
|
||||
default = 500;
|
||||
description = "Timeout in ms that neovim will wait for mapped action to complete";
|
||||
};
|
||||
|
||||
splitBelow = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "New splits will open below instead of on top";
|
||||
};
|
||||
|
||||
splitRight = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "New splits will open to the right";
|
||||
};
|
||||
enableEditorconfig = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Follow editorconfig rules in current directory";
|
||||
};
|
||||
|
||||
cursorlineOpt = mkOption {
|
||||
type = types.enum ["line" "screenline" "number" "both"];
|
||||
type = enum ["line" "screenline" "number" "both"];
|
||||
default = "line";
|
||||
description = "Highlight the text line of the cursor with CursorLine hl-CursorLine";
|
||||
};
|
||||
|
||||
searchCase = mkOption {
|
||||
type = types.enum ["ignore" "smart" "sensitive"];
|
||||
type = enum ["ignore" "smart" "sensitive"];
|
||||
default = "sensitive";
|
||||
description = "Set the case sensitivity of search";
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.options) mkEnableOption mkOption literalMD;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
inherit (lib.types) enum attrsOf nullOr str;
|
||||
in {
|
||||
|
@ -52,7 +52,7 @@ in {
|
|||
'';
|
||||
type = str;
|
||||
default = "nvim_cmp_menu_map";
|
||||
example = lib.literalMD ''
|
||||
example = literalMD ''
|
||||
```lua
|
||||
function(entry, vim_item)
|
||||
return vim_item
|
||||
|
|
|
@ -4,10 +4,16 @@
|
|||
...
|
||||
}: let
|
||||
inherit (builtins) attrValues attrNames map mapAttrs toJSON isString concatStringsSep filter;
|
||||
inherit (lib) mkOption types mapAttrsFlatten filterAttrs optionalString getAttrs literalExpression;
|
||||
inherit (lib) nvim;
|
||||
inherit (nvim.lua) toLuaObject;
|
||||
inherit (nvim.vim) valToVim;
|
||||
inherit (lib.options) mkOption literalExpression mdDoc;
|
||||
inherit (lib.attrsets) filterAttrs getAttrs;
|
||||
inherit (lib.strings) optionalString;
|
||||
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;
|
||||
|
||||
|
@ -22,7 +28,7 @@
|
|||
|
||||
mkBool = value: description:
|
||||
mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = value;
|
||||
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.";
|
||||
|
||||
desc = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = "A description of this keybind, to be shown in which-key, if you have it enabled.";
|
||||
};
|
||||
|
@ -94,17 +100,17 @@
|
|||
})
|
||||
maps);
|
||||
|
||||
mapOption = types.submodule {
|
||||
mapOption = submodule {
|
||||
options =
|
||||
mapConfigOptions
|
||||
// {
|
||||
action = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
description = "The action to execute.";
|
||||
};
|
||||
|
||||
lua = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = ''
|
||||
If true, `action` is considered to be lua code.
|
||||
Thus, it will not be wrapped in `""`.
|
||||
|
@ -117,13 +123,13 @@
|
|||
mapOptions = mode:
|
||||
mkOption {
|
||||
description = "Mappings for ${mode} mode";
|
||||
type = types.attrsOf mapOption;
|
||||
type = attrsOf mapOption;
|
||||
default = {};
|
||||
};
|
||||
in {
|
||||
options = {
|
||||
assertions = lib.mkOption {
|
||||
type = with types; listOf unspecified;
|
||||
assertions = mkOption {
|
||||
type = listOf unspecified;
|
||||
internal = true;
|
||||
default = [];
|
||||
example = literalExpression ''
|
||||
|
@ -139,9 +145,9 @@ in {
|
|||
warnings = mkOption {
|
||||
internal = true;
|
||||
default = [];
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
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
|
||||
the evaluation of the system configuration.
|
||||
'';
|
||||
|
@ -150,46 +156,46 @@ in {
|
|||
vim = {
|
||||
viAlias = mkOption {
|
||||
description = "Enable vi alias";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
vimAlias = mkOption {
|
||||
description = "Enable vim alias";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
configRC = mkOption {
|
||||
description = "vimrc contents";
|
||||
type = types.oneOf [(nvim.types.dagOf types.lines) types.str];
|
||||
type = oneOf [(dagOf lines) str];
|
||||
default = {};
|
||||
};
|
||||
|
||||
luaConfigRC = mkOption {
|
||||
description = "vim lua config";
|
||||
type = types.oneOf [(nvim.types.dagOf types.lines) types.str];
|
||||
type = oneOf [(dagOf lines) str];
|
||||
default = {};
|
||||
};
|
||||
|
||||
builtConfigRC = mkOption {
|
||||
internal = true;
|
||||
type = types.lines;
|
||||
type = lines;
|
||||
description = "The built config for neovim after resolving the DAG";
|
||||
};
|
||||
|
||||
startPlugins = nvim.types.pluginsOpt {
|
||||
startPlugins = pluginsOpt {
|
||||
default = [];
|
||||
description = "List of plugins to startup.";
|
||||
};
|
||||
|
||||
optPlugins = nvim.types.pluginsOpt {
|
||||
optPlugins = pluginsOpt {
|
||||
default = [];
|
||||
description = "List of plugins to optionally load";
|
||||
};
|
||||
|
||||
extraPlugins = mkOption {
|
||||
type = types.attrsOf nvim.types.extraPluginType;
|
||||
type = attrsOf extraPluginType;
|
||||
default = {};
|
||||
description = ''
|
||||
List of plugins and related config.
|
||||
|
@ -210,7 +216,7 @@ in {
|
|||
};
|
||||
|
||||
luaPackages = mkOption {
|
||||
type = types.listOf types.str;
|
||||
type = listOf str;
|
||||
default = [];
|
||||
description = ''
|
||||
List of lua packages to install.
|
||||
|
@ -220,11 +226,11 @@ in {
|
|||
globals = mkOption {
|
||||
default = {};
|
||||
description = "Set containing global variable values";
|
||||
type = types.attrs;
|
||||
type = attrs;
|
||||
};
|
||||
|
||||
maps = mkOption {
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
normal = mapOptions "normal";
|
||||
insert = mapOptions "insert";
|
||||
|
@ -289,12 +295,12 @@ in {
|
|||
mapResult,
|
||||
}: let
|
||||
# When the value is a string, default it to dag.entryAnywhere
|
||||
finalDag = lib.mapAttrs (_: value:
|
||||
finalDag = mapAttrs (_: value:
|
||||
if isString value
|
||||
then nvim.dag.entryAnywhere value
|
||||
then entryAnywhere value
|
||||
else value)
|
||||
dag;
|
||||
sortedDag = nvim.dag.topoSort finalDag;
|
||||
sortedDag = topoSort finalDag;
|
||||
result =
|
||||
if sortedDag ? result
|
||||
then mapResult sortedDag.result
|
||||
|
@ -305,7 +311,7 @@ in {
|
|||
vim = {
|
||||
startPlugins = map (x: x.package) (attrValues cfg.extraPlugins);
|
||||
configRC = {
|
||||
globalsScript = nvim.dag.entryAnywhere (concatStringsSep "\n" globalsScript);
|
||||
globalsScript = entryAnywhere (concatStringsSep "\n" globalsScript);
|
||||
|
||||
luaScript = let
|
||||
mkSection = r: ''
|
||||
|
@ -319,7 +325,7 @@ in {
|
|||
inherit mapResult;
|
||||
};
|
||||
in
|
||||
nvim.dag.entryAfter ["globalsScript"] luaConfig;
|
||||
entryAfter ["globalsScript"] luaConfig;
|
||||
|
||||
extraPluginConfigs = let
|
||||
mkSection = r: ''
|
||||
|
@ -332,7 +338,7 @@ in {
|
|||
setup,
|
||||
...
|
||||
}:
|
||||
nvim.dag.entryAfter after setup)
|
||||
entryAfter after setup)
|
||||
cfg.extraPlugins;
|
||||
pluginConfig = resolveDag {
|
||||
name = "extra plugins config";
|
||||
|
@ -340,7 +346,7 @@ in {
|
|||
inherit mapResult;
|
||||
};
|
||||
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.
|
||||
mappings = let
|
||||
|
@ -359,7 +365,7 @@ in {
|
|||
];
|
||||
mapConfig = wrapLuaConfig (concatStringsSep "\n" (map (v: concatStringsSep "\n" v) maps));
|
||||
in
|
||||
nvim.dag.entryAfter ["globalsScript"] mapConfig;
|
||||
entryAfter ["globalsScript"] mapConfig;
|
||||
};
|
||||
|
||||
builtConfigRC = let
|
||||
|
@ -368,7 +374,7 @@ in {
|
|||
baseSystemAssertWarn =
|
||||
if failedAssertions != []
|
||||
then throw "\nFailed assertions:\n${concatStringsSep "\n" (map (x: "- ${x}") failedAssertions)}"
|
||||
else lib.showWarnings config.warnings;
|
||||
else showWarnings config.warnings;
|
||||
|
||||
mkSection = r: ''
|
||||
" SECTION: ${r.name}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
in {
|
||||
options.vim.dashboard.dashboard-nvim = {
|
||||
enable = mkEnableOption "Fancy and Blazing Fast start screen plugin of neovim [dashboard.nvim]";
|
||||
|
|
|
@ -49,7 +49,7 @@ in {
|
|||
];
|
||||
})
|
||||
(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"] (''
|
||||
local dapui = require("dapui")
|
||||
|
|
|
@ -6,8 +6,9 @@ inputs: {
|
|||
extraSpecialArgs ? {},
|
||||
}: let
|
||||
inherit (builtins) map filter isString toString getAttr;
|
||||
inherit (pkgs) wrapNeovim vimPlugins;
|
||||
inherit (pkgs) wrapNeovimUnstable vimPlugins;
|
||||
inherit (pkgs.vimUtils) buildVimPlugin;
|
||||
inherit (pkgs.neovimUtils) makeNeovimConfig;
|
||||
|
||||
extendedLib = import ../lib/stdlib-extended.nix lib;
|
||||
|
||||
|
@ -57,21 +58,22 @@ inputs: {
|
|||
(f: f != null)
|
||||
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) vimAlias;
|
||||
|
||||
inherit extraLuaPackages;
|
||||
|
||||
configure = {
|
||||
customRC = vimOptions.builtConfigRC;
|
||||
|
||||
packages.myVimPackage = {
|
||||
start = buildConfigPlugins vimOptions.startPlugins;
|
||||
opt = buildConfigPlugins vimOptions.optPlugins;
|
||||
};
|
||||
};
|
||||
};
|
||||
inherit plugins;
|
||||
customRC = vimOptions.builtConfigRC;
|
||||
});
|
||||
in {
|
||||
inherit (module) options config;
|
||||
inherit (module._module.args) pkgs;
|
||||
|
|
|
@ -33,7 +33,7 @@ in {
|
|||
|
||||
vim.luaConfigRC.nvimtreelua = entryAnywhere ''
|
||||
${
|
||||
lib.optionalString cfg.disableNetrw ''
|
||||
optionalString cfg.disableNetrw ''
|
||||
-- disable netrew completely
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
|
|
@ -3,29 +3,30 @@
|
|||
lib,
|
||||
...
|
||||
}: 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 {
|
||||
options.vim.filetree.nvimTree = {
|
||||
enable = mkEnableOption "filetree via nvim-tree.lua";
|
||||
|
||||
mappings = {
|
||||
toggle = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = nullOr str;
|
||||
default = "<leader>t";
|
||||
description = "Toggle NvimTree";
|
||||
};
|
||||
refresh = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = nullOr str;
|
||||
default = "<leader>tr";
|
||||
description = "Refresh NvimTree";
|
||||
};
|
||||
findFile = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = nullOr str;
|
||||
default = "<leader>tg";
|
||||
description = "Find file in NvimTree";
|
||||
};
|
||||
focus = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = nullOr str;
|
||||
default = "<leader>tf";
|
||||
description = "Focus NvimTree";
|
||||
};
|
||||
|
@ -34,19 +35,19 @@ in {
|
|||
disableNetrw = mkOption {
|
||||
default = false;
|
||||
description = "Disables netrw and replaces it with tree";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
hijackNetrw = mkOption {
|
||||
default = true;
|
||||
description = "Prevents netrw from automatically opening when opening directories";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
autoreloadOnWrite = mkOption {
|
||||
default = true;
|
||||
description = "Auto reload tree on write";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
updateFocusedFile = mkOption {
|
||||
|
@ -55,16 +56,16 @@ in {
|
|||
until it finds the file.
|
||||
'';
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "update focused file";
|
||||
};
|
||||
|
||||
updateRoot = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Update the root directory of the tree if the file is not under current
|
||||
|
@ -75,7 +76,7 @@ in {
|
|||
};
|
||||
|
||||
ignoreList = mkOption {
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
default = [];
|
||||
description = ''
|
||||
List of buffer names and filetypes that will not update the root dir
|
||||
|
@ -93,26 +94,26 @@ in {
|
|||
sorter = mkOption {
|
||||
default = "name";
|
||||
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 {
|
||||
default = true;
|
||||
description = "Sort folders before files. Has no effect when `sort.sorter` is a function.";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
};
|
||||
|
||||
hijackCursor = mkOption {
|
||||
default = false;
|
||||
description = "Hijack the cursor in the tree to put it at the start of the filename";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
hijackUnnamedBufferWhenOpening = mkOption {
|
||||
default = false;
|
||||
description = "Open nvimtree in place of the unnamed buffer if it's empty.";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
rootDirs = mkOption {
|
||||
|
@ -120,7 +121,7 @@ in {
|
|||
description = ''
|
||||
Preferred root directories. Only relevant when `updateFocusedFile.updateRoot` is `true`
|
||||
'';
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
};
|
||||
|
||||
preferStartupRoot = mkOption {
|
||||
|
@ -129,11 +130,11 @@ in {
|
|||
Prefer startup root directory when updating root directory of the tree.
|
||||
Only relevant when `update_focused_file.update_root` is `true`
|
||||
'';
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
syncRootWithCwd = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Changes the tree root directory on `DirChanged` and refreshes the tree.
|
||||
|
@ -145,13 +146,13 @@ in {
|
|||
|
||||
reloadOnBufEnter = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = "Automatically reloads the tree on `BufEnter` nvim-tree.";
|
||||
};
|
||||
|
||||
respectBufCwd = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = "Will change cwd of nvim-tree to that of new buffer's when opening nvim-tree.";
|
||||
};
|
||||
|
||||
|
@ -163,10 +164,10 @@ in {
|
|||
autoOpen = false;
|
||||
};
|
||||
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = ''
|
||||
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.
|
||||
|
@ -174,7 +175,7 @@ in {
|
|||
};
|
||||
|
||||
autoOpen = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = ''
|
||||
Opens the tree if the tree was previously closed.
|
||||
'';
|
||||
|
@ -187,7 +188,7 @@ in {
|
|||
args = mkOption {
|
||||
default = [];
|
||||
description = "Optional argument list.";
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
};
|
||||
|
||||
cmd = mkOption {
|
||||
|
@ -198,7 +199,7 @@ in {
|
|||
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`";
|
||||
description = "The open command itself";
|
||||
type = types.str;
|
||||
type = str;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -210,13 +211,13 @@ in {
|
|||
|
||||
default = {};
|
||||
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
enable = mkEnableOption "diagnostics view in the signcolumn.";
|
||||
|
||||
debounceDelay = mkOption {
|
||||
description = "Idle milliseconds between diagnostic event and update.";
|
||||
type = types.int;
|
||||
type = int;
|
||||
default = 50;
|
||||
};
|
||||
|
||||
|
@ -226,7 +227,7 @@ in {
|
|||
};
|
||||
|
||||
showOnOpenDirs = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Show diagnostics icons on directories that are open.
|
||||
|
@ -237,26 +238,26 @@ in {
|
|||
icons = mkOption {
|
||||
description = "Icons for diagnostic severity.";
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
hint = mkOption {
|
||||
description = "Icon used for `hint` diagnostic.";
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = "";
|
||||
};
|
||||
info = mkOption {
|
||||
description = "Icon used for `info` diagnostic.";
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = "";
|
||||
};
|
||||
warning = mkOption {
|
||||
description = "Icon used for `warning` diagnostic.";
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = "";
|
||||
};
|
||||
error = mkOption {
|
||||
description = "Icon used for `error` diagnostic.";
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
|
@ -266,17 +267,17 @@ in {
|
|||
severity = mkOption {
|
||||
description = "Severity for which the diagnostics will be displayed. See `:help diagnostic-severity`";
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
min = mkOption {
|
||||
description = "Minimum severity.";
|
||||
type = types.enum ["HINT" "INFO" "WARNING" "ERROR"];
|
||||
type = enum ["HINT" "INFO" "WARNING" "ERROR"];
|
||||
default = "HINT";
|
||||
};
|
||||
|
||||
max = mkOption {
|
||||
description = "Maximum severity.";
|
||||
type = types.enum ["HINT" "INFO" "WARNING" "ERROR"];
|
||||
type = enum ["HINT" "INFO" "WARNING" "ERROR"];
|
||||
default = "ERROR";
|
||||
};
|
||||
};
|
||||
|
@ -290,19 +291,19 @@ in {
|
|||
enable = mkEnableOption "Git integration with icons and colors.";
|
||||
|
||||
showOnDirs = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Show git icons on parent directories.";
|
||||
};
|
||||
|
||||
showOnOpenDirs = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Show git icons on directories that are open.";
|
||||
};
|
||||
|
||||
disableForDirs = mkOption {
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
default = [];
|
||||
description = ''
|
||||
Disable git integration when git top-level matches these paths.
|
||||
|
@ -311,7 +312,7 @@ in {
|
|||
};
|
||||
|
||||
timeout = mkOption {
|
||||
type = types.int;
|
||||
type = int;
|
||||
default = 400;
|
||||
description = ''
|
||||
Kills the git process after some time if it takes too long.
|
||||
|
@ -323,18 +324,18 @@ in {
|
|||
modified = mkOption {
|
||||
description = "Indicate which file have unsaved modification.";
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
enable = mkEnableOption "Modified files with icons and color highlight.";
|
||||
|
||||
showOnDirs = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = "Show modified icons on parent directories.";
|
||||
default = true;
|
||||
};
|
||||
|
||||
showOnOpenDirs = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = "Show modified icons on directories that are open.";
|
||||
default = true;
|
||||
};
|
||||
|
@ -351,22 +352,22 @@ in {
|
|||
performance.
|
||||
'';
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
enable = mkOption {
|
||||
description = "Enable filesystem watchers.";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
debounceDelay = mkOption {
|
||||
description = "Idle milliseconds between filesystem change and action.";
|
||||
type = types.int;
|
||||
type = int;
|
||||
default = 50;
|
||||
};
|
||||
|
||||
ignoreDirs = mkOption {
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
default = [];
|
||||
description = ''
|
||||
List of vim regex for absolute directory paths that will not be watched.
|
||||
|
@ -385,22 +386,22 @@ in {
|
|||
view = mkOption {
|
||||
description = "Window / buffer setup.";
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
centralizeSelection = mkOption {
|
||||
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;
|
||||
};
|
||||
|
||||
cursorline = mkOption {
|
||||
description = "Enable cursorline in nvim-tree window.";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
debounceDelay = mkOption {
|
||||
type = types.int;
|
||||
type = int;
|
||||
default = 15;
|
||||
description = ''
|
||||
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
|
||||
longest line.
|
||||
'';
|
||||
type = with types; oneOf [int attrs];
|
||||
type = oneOf [int attrs];
|
||||
default = 30;
|
||||
example = literalExpression ''
|
||||
{
|
||||
|
@ -429,7 +430,7 @@ in {
|
|||
|
||||
side = mkOption {
|
||||
description = "Side of the tree.";
|
||||
type = types.enum ["left" "right"];
|
||||
type = enum ["left" "right"];
|
||||
default = "left";
|
||||
};
|
||||
|
||||
|
@ -438,13 +439,13 @@ in {
|
|||
Preserves window proportions when opening a file.
|
||||
If `false`, the height and width of windows other than nvim-tree will be equalized.
|
||||
'';
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
number = mkOption {
|
||||
description = "Print the line number in front of each line.";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
|
@ -454,13 +455,13 @@ in {
|
|||
If the option `view.number` is also `true`, the number on the cursor line
|
||||
will be the line number instead of `0`.
|
||||
'';
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
signcolumn = mkOption {
|
||||
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";
|
||||
};
|
||||
|
||||
|
@ -468,23 +469,23 @@ in {
|
|||
description = "Configuration options for floating window.";
|
||||
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
enable = mkOption {
|
||||
description = "If true, tree window will be floating.";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
quitOnFocusLoss = mkOption {
|
||||
description = "Close the floating tree window when it loses focus.";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
openWinConfig = mkOption {
|
||||
description = "Floating window config. See `:h nvim_open_win()` for more details.";
|
||||
type = types.attrs;
|
||||
type = attrs;
|
||||
default = {
|
||||
relative = "editor";
|
||||
border = "rounded";
|
||||
|
@ -505,23 +506,23 @@ in {
|
|||
addTrailing = mkOption {
|
||||
default = false;
|
||||
description = "Appends a trailing slash to folder names.";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
groupEmpty = mkOption {
|
||||
default = false;
|
||||
description = "Compact folders that only contain a single folder into one node in the file tree.";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
fullName = mkOption {
|
||||
default = false;
|
||||
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 {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Enable file highlight for git attributes using `NvimTreeGit` highlight groups.
|
||||
|
@ -531,7 +532,7 @@ in {
|
|||
};
|
||||
|
||||
highlightOpenedFiles = mkOption {
|
||||
type = types.enum ["none" "icon" "name" "all"];
|
||||
type = enum ["none" "icon" "name" "all"];
|
||||
default = "none";
|
||||
description = ''
|
||||
Highlight icons and/or names for bufloaded() files using the
|
||||
|
@ -540,7 +541,7 @@ in {
|
|||
};
|
||||
|
||||
highlightModified = mkOption {
|
||||
type = types.enum ["none" "icon" "name" "all"];
|
||||
type = enum ["none" "icon" "name" "all"];
|
||||
default = "none";
|
||||
description = ''
|
||||
Highlight modified files in the tree using `NvimTreeNormal` highlight group.
|
||||
|
@ -549,7 +550,7 @@ in {
|
|||
};
|
||||
|
||||
rootFolderLabel = mkOption {
|
||||
type = with types; oneOf [str bool];
|
||||
type = oneOf [str bool];
|
||||
default = false;
|
||||
example = ''"":~:s?$?/..?"'';
|
||||
description = ''
|
||||
|
@ -566,7 +567,7 @@ in {
|
|||
};
|
||||
|
||||
indentWidth = mkOption {
|
||||
type = with types; addCheck int (x: x >= 1);
|
||||
type = addCheck int (x: x >= 1);
|
||||
default = 2;
|
||||
description = "Number of spaces for an each tree nesting level. Minimum 1.";
|
||||
};
|
||||
|
@ -574,17 +575,17 @@ in {
|
|||
indentMarkers = mkOption {
|
||||
description = "Configuration options for tree indent markers.";
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
enable = mkEnableOption "Display indent markers when folders are open.";
|
||||
inlineArrows = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Display folder arrows in the same column as indent marker when using `renderer.icons.show.folder_arrow`";
|
||||
};
|
||||
|
||||
icons = mkOption {
|
||||
type = types.attrs;
|
||||
type = attrs;
|
||||
description = "Individual elements of the indent markers";
|
||||
default = {
|
||||
corner = "└";
|
||||
|
@ -599,13 +600,13 @@ in {
|
|||
};
|
||||
|
||||
specialFiles = mkOption {
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
default = ["Cargo.toml" "README.md" "readme.md" "Makefile" "MAKEFILE" "flake.nix"]; # ;)
|
||||
description = "A list of filenames that gets highlighted with `NvimTreeSpecialFile";
|
||||
};
|
||||
|
||||
symlinkDestination = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether to show the destination of the symlink.";
|
||||
};
|
||||
|
@ -613,53 +614,53 @@ in {
|
|||
icons = mkOption {
|
||||
description = "Configuration options for icons.";
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
webdevColors = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = " Use the webdev icon colors, otherwise `NvimTreeFileIcon`";
|
||||
default = true;
|
||||
};
|
||||
|
||||
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.";
|
||||
default = "before";
|
||||
};
|
||||
|
||||
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.";
|
||||
default = "after";
|
||||
};
|
||||
|
||||
padding = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
description = "Inserted between icon and filename";
|
||||
default = " ";
|
||||
};
|
||||
|
||||
symlinkArrow = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
description = "Used as a separator between symlinks' source and target.";
|
||||
default = " ➛ ";
|
||||
};
|
||||
|
||||
show = {
|
||||
file = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = "Show an icon before the file name. `nvim-web-devicons` will be used if available.";
|
||||
default = true;
|
||||
};
|
||||
|
||||
folder = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = "Show an icon before the folder name.";
|
||||
default = true;
|
||||
};
|
||||
|
||||
folderArrow = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Show a small arrow before the folder node. Arrow will be a part of the
|
||||
|
@ -668,7 +669,7 @@ in {
|
|||
};
|
||||
|
||||
git = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Show a git status icon, see `renderer.icons.gitPlacement`
|
||||
|
@ -677,7 +678,7 @@ in {
|
|||
};
|
||||
|
||||
modified = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Show a modified icon, see `renderer.icons.modifiedPlacement`
|
||||
|
@ -692,29 +693,29 @@ in {
|
|||
to appear in the signcolumn.
|
||||
'';
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
default = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
description = "Glyph for files. Will be overridden by `nvim-web-devicons` if available.";
|
||||
default = "";
|
||||
};
|
||||
|
||||
symlink = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
description = "Glyph for symlinks.";
|
||||
default = "";
|
||||
};
|
||||
|
||||
modified = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
description = "Icon to display for modified files.";
|
||||
default = "";
|
||||
};
|
||||
|
||||
# TODO: hardcode each attribute
|
||||
folder = mkOption {
|
||||
type = types.attrs;
|
||||
type = attrs;
|
||||
description = "Glyphs for directories. Recommended to use the defaults unless you know what you are doing.";
|
||||
default = {
|
||||
default = "";
|
||||
|
@ -729,7 +730,7 @@ in {
|
|||
};
|
||||
|
||||
git = mkOption {
|
||||
type = types.attrs;
|
||||
type = attrs;
|
||||
description = "Glyphs for git status.";
|
||||
default = {
|
||||
unstaged = "✗";
|
||||
|
@ -759,22 +760,22 @@ in {
|
|||
noBuffer = false;
|
||||
exclude = [];
|
||||
};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
gitIgnored = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = "Ignore files based on `.gitignore`. Requires git.enable` to be `true`";
|
||||
default = false;
|
||||
};
|
||||
|
||||
dotfiles = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = "Do not show dotfiles: files starting with a `.`";
|
||||
default = false;
|
||||
};
|
||||
|
||||
gitClean = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
|
||||
description = ''
|
||||
|
@ -784,13 +785,13 @@ in {
|
|||
};
|
||||
|
||||
noBuffer = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Do not show files that have no `buflisted()` buffer.";
|
||||
};
|
||||
|
||||
exclude = mkOption {
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
default = [];
|
||||
description = "List of directories or files to exclude from filtering: always show them.";
|
||||
};
|
||||
|
@ -804,10 +805,10 @@ in {
|
|||
cmd = "${pkgs.glib}/bin/gio trash";
|
||||
};
|
||||
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
cmd = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
description = "The command used to trash items";
|
||||
};
|
||||
};
|
||||
|
@ -817,10 +818,10 @@ in {
|
|||
actions = mkOption {
|
||||
description = "Configuration for various actions.";
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
useSystemClipboard = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = ''
|
||||
A boolean value that toggle the use of system clipboard when copy/paste
|
||||
|
@ -833,16 +834,16 @@ in {
|
|||
changeDir = mkOption {
|
||||
description = "vim `change-directory` behaviour";
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Change the working directory when changing directories in the tree.";
|
||||
};
|
||||
|
||||
global = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Use `:cd` instead of `:lcd` when changing directories.
|
||||
|
@ -851,7 +852,7 @@ in {
|
|||
};
|
||||
|
||||
restrictAboveCwd = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Restrict changing to a directory above the global current working directory.
|
||||
|
@ -865,10 +866,10 @@ in {
|
|||
expandAll = mkOption {
|
||||
description = "Configuration for expand_all behaviour.";
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
maxFolderDiscovery = mkOption {
|
||||
type = types.int;
|
||||
type = int;
|
||||
default = 300;
|
||||
description = ''
|
||||
Limit the number of folders being explored when expanding every folders.
|
||||
|
@ -876,7 +877,7 @@ in {
|
|||
'';
|
||||
};
|
||||
exclude = mkOption {
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
description = "A list of directories that should not be expanded automatically.";
|
||||
default = [".git" "target" "build" "result"];
|
||||
};
|
||||
|
@ -888,10 +889,10 @@ in {
|
|||
filePopup = mkOption {
|
||||
description = "Configuration for file_popup behaviour.";
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
openWinConfig = mkOption {
|
||||
type = types.attrs;
|
||||
type = attrs;
|
||||
default = {
|
||||
col = 1;
|
||||
row = 1;
|
||||
|
@ -909,22 +910,22 @@ in {
|
|||
openFile = mkOption {
|
||||
description = "Configuration options for opening a file from nvim-tree.";
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
quitOnOpen = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = "Closes the explorer when opening a file.";
|
||||
default = false;
|
||||
};
|
||||
|
||||
eject = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = "Prevent new opened file from opening in the same window as the tree.";
|
||||
default = false;
|
||||
};
|
||||
|
||||
resizeWindow = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
|
||||
description = "Resizes the tree when opening a file. Previously `view.auto_resize`";
|
||||
|
@ -933,16 +934,16 @@ in {
|
|||
windowPicker = mkOption {
|
||||
description = "window_picker";
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
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.";
|
||||
default = false;
|
||||
};
|
||||
|
||||
picker = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = "default";
|
||||
description = ''
|
||||
Change the default window picker, can be a string `"default"` or a function.
|
||||
|
@ -959,20 +960,20 @@ in {
|
|||
};
|
||||
|
||||
chars = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
description = "A string of chars used as identifiers by the window picker.";
|
||||
default = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
|
||||
};
|
||||
|
||||
exclude = {
|
||||
filetype = mkOption {
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
description = "A list of filetypes to exclude from the window picker.";
|
||||
default = ["notify" "packer" "qf" "diff" "fugitive" "fugitiveblame"];
|
||||
};
|
||||
|
||||
buftype = mkOption {
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
description = "A list of buftypes to exclude from the window picker.";
|
||||
default = ["nofile" "terminal" "help"];
|
||||
};
|
||||
|
@ -986,7 +987,7 @@ in {
|
|||
|
||||
removeFile = {
|
||||
closeWindow = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
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.
|
||||
'';
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
prefix = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
description = "Prefix of the filter displayed in the buffer.";
|
||||
default = "[FILTER]: ";
|
||||
};
|
||||
|
||||
alwaysShowFolders = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = "Whether to filter folders or not.";
|
||||
default = true;
|
||||
};
|
||||
|
@ -1024,15 +1025,15 @@ in {
|
|||
tab = mkOption {
|
||||
description = "Configuration for tab behaviour.";
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
sync = mkOption {
|
||||
description = "Configuration for syncing nvim-tree across tabs.";
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
open = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Opens the tree automatically when switching tabpage or opening a new
|
||||
|
@ -1041,7 +1042,7 @@ in {
|
|||
};
|
||||
|
||||
close = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Closes the tree across all tabpages when the tree is closed.
|
||||
|
@ -1049,7 +1050,7 @@ in {
|
|||
};
|
||||
|
||||
ignore = mkOption {
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
default = [];
|
||||
description = ''
|
||||
List of filetypes or buffer names on new tab that will prevent
|
||||
|
@ -1066,16 +1067,16 @@ in {
|
|||
notify = mkOption {
|
||||
description = "Configuration for notifications.";
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
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`";
|
||||
default = "INFO";
|
||||
};
|
||||
|
||||
absolutePath = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = "Whether to use absolute paths or item names in fs action notifications.";
|
||||
default = true;
|
||||
};
|
||||
|
@ -1086,17 +1087,17 @@ in {
|
|||
ui = mkOption {
|
||||
description = "General UI configuration.";
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
type = submodule {
|
||||
options = {
|
||||
confirm = {
|
||||
remove = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = "Prompt before removing.";
|
||||
default = true;
|
||||
};
|
||||
|
||||
trash = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = "Prompt before trash.";
|
||||
default = true;
|
||||
};
|
||||
|
@ -1109,7 +1110,7 @@ in {
|
|||
openOnSetup = mkOption {
|
||||
default = true;
|
||||
description = "Open when vim is started on a directory";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
inherit (lib.lists) isList;
|
||||
inherit (lib.types) enum either package listOf str bool;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
inherit (lib.nvim.types) diagnostics mkGrammarOption;
|
||||
|
||||
cfg = config.vim.languages.bash;
|
||||
|
||||
|
@ -45,8 +46,8 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultDiagnostics = ["shellcheck"];
|
||||
diagnostics = {
|
||||
defaultDiagnosticsProvider = ["shellcheck"];
|
||||
diagnosticsProviders = {
|
||||
shellcheck = {
|
||||
package = pkgs.shellcheck;
|
||||
nullConfig = pkg: ''
|
||||
|
@ -65,7 +66,7 @@ in {
|
|||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Bash treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = lib.nvim.types.mkGrammarOption pkgs "bash";
|
||||
package = mkGrammarOption pkgs "bash";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
|
@ -106,10 +107,10 @@ in {
|
|||
|
||||
extraDiagnostics = {
|
||||
enable = mkEnableOption "extra Bash diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
|
||||
types = lib.nvim.types.diagnostics {
|
||||
types = diagnostics {
|
||||
langDesc = "Bash";
|
||||
inherit diagnostics;
|
||||
inherit defaultDiagnostics;
|
||||
inherit diagnosticsProviders;
|
||||
inherit defaultDiagnosticsProvider;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
inherit (lib.lists) isList;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
inherit (lib.nvim.languages) diagnosticsToLua;
|
||||
|
||||
cfg = config.vim.languages.bash;
|
||||
diagnostics = {
|
||||
diagnosticsProviders = {
|
||||
shellcheck = {
|
||||
package = pkgs.shellcheck;
|
||||
nullConfig = pkg: ''
|
||||
|
@ -72,10 +73,10 @@ in {
|
|||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources = lib.nvim.languages.diagnosticsToLua {
|
||||
vim.lsp.null-ls.sources = diagnosticsToLua {
|
||||
lang = "bash";
|
||||
config = cfg.extraDiagnostics.types;
|
||||
inherit diagnostics;
|
||||
inherit diagnosticsProviders;
|
||||
};
|
||||
})
|
||||
]);
|
||||
|
|
|
@ -1,19 +1,27 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
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;
|
||||
|
||||
defaultServer = "ccls";
|
||||
packageToCmd = package: defaultCmd:
|
||||
if isList cfg.lsp.package
|
||||
then nvim.lua.expToLua cfg.lsp.package
|
||||
else ''{ "${cfg.lsp.package}/bin/${defaultCmd}" }'';
|
||||
servers = {
|
||||
ccls = {
|
||||
package = pkgs.ccls;
|
||||
|
@ -79,14 +87,14 @@ in {
|
|||
C syntax for headers. Can fix treesitter errors, see:
|
||||
https://www.reddit.com/r/neovim/comments/orfpcd/question_does_the_c_parser_from_nvimtreesitter/
|
||||
'';
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "C/C++ treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
cPackage = nvim.types.mkGrammarOption pkgs "c";
|
||||
cppPackage = nvim.types.mkGrammarOption pkgs "cpp";
|
||||
cPackage = mkGrammarOption pkgs "c";
|
||||
cppPackage = mkGrammarOption pkgs "cpp";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
|
@ -94,20 +102,20 @@ in {
|
|||
|
||||
server = mkOption {
|
||||
description = "The clang LSP server to use";
|
||||
type = with types; enum (attrNames servers);
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
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 "]'';
|
||||
type = with types; either package (listOf str);
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
|
||||
opts = mkOption {
|
||||
description = "Options to pass to clang LSP server";
|
||||
type = with types; nullOr str;
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
@ -115,17 +123,17 @@ in {
|
|||
dap = {
|
||||
enable = mkOption {
|
||||
description = "Enable clang Debug Adapter";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = config.vim.languages.enableDAP;
|
||||
};
|
||||
debugger = mkOption {
|
||||
description = "clang debugger to use";
|
||||
type = with types; enum (attrNames debuggers);
|
||||
type = enum (attrNames debuggers);
|
||||
default = defaultDebugger;
|
||||
};
|
||||
package = mkOption {
|
||||
description = "clang debugger package.";
|
||||
type = types.package;
|
||||
type = package;
|
||||
default = debuggers.${cfg.dap.debugger}.package;
|
||||
};
|
||||
};
|
||||
|
@ -133,7 +141,7 @@ in {
|
|||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(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 {
|
||||
|
|
|
@ -5,7 +5,12 @@
|
|||
...
|
||||
}: let
|
||||
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;
|
||||
|
||||
|
@ -25,7 +30,7 @@
|
|||
on_attach = default_on_attach;
|
||||
cmd = ${
|
||||
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"}''
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +44,7 @@ in {
|
|||
treesitter = {
|
||||
enable = mkEnableOption "CSS treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
|
||||
package = nvim.types.mkGrammarOption pkgs "css";
|
||||
package = mkGrammarOption pkgs "css";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
|
@ -47,14 +52,14 @@ in {
|
|||
|
||||
server = mkOption {
|
||||
description = "CSS LSP server to use";
|
||||
type = with types; enum (attrNames servers);
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
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 "]'';
|
||||
type = with types; either package (listOf str);
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
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;
|
||||
|
||||
|
@ -19,13 +25,14 @@
|
|||
on_attach = default_on_attach;
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then nvim.lua.expToLua cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/gopls", "serve"}''
|
||||
},
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
defaultDebugger = "delve";
|
||||
debuggers = {
|
||||
delve = {
|
||||
|
@ -73,7 +80,7 @@ in {
|
|||
treesitter = {
|
||||
enable = mkEnableOption "Go treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
|
||||
package = nvim.types.mkGrammarOption pkgs "go";
|
||||
package = mkGrammarOption pkgs "go";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
|
@ -81,14 +88,14 @@ in {
|
|||
|
||||
server = mkOption {
|
||||
description = "Go LSP server to use";
|
||||
type = with types; enum (attrNames servers);
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
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 "]'';
|
||||
type = with types; either package (listOf str);
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
};
|
||||
|
@ -96,17 +103,17 @@ in {
|
|||
dap = {
|
||||
enable = mkOption {
|
||||
description = "Enable Go Debug Adapter";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = config.vim.languages.enableDAP;
|
||||
};
|
||||
debugger = mkOption {
|
||||
description = "Go debugger to use";
|
||||
type = with types; enum (attrNames debuggers);
|
||||
type = enum (attrNames debuggers);
|
||||
default = defaultDebugger;
|
||||
};
|
||||
package = mkOption {
|
||||
description = "Go debugger package.";
|
||||
type = types.package;
|
||||
type = package;
|
||||
default = debuggers.${cfg.dap.debugger}.package;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,27 +1,26 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: 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;
|
||||
in {
|
||||
options.vim.languages.html = {
|
||||
enable = mkEnableOption "HTML language support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkOption {
|
||||
description = "Enable HTML treesitter";
|
||||
type = types.bool;
|
||||
default = config.vim.languages.enableTreesitter;
|
||||
};
|
||||
package = nvim.types.mkGrammarOption pkgs "html";
|
||||
|
||||
enable = mkEnableOption "HTML treesitter support" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkGrammarOption pkgs "html";
|
||||
autotagHtml = mkOption {
|
||||
description = "Enable autoclose/autorename of html tags (nvim-ts-autotag)";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
@ -29,14 +28,18 @@ in {
|
|||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
vim = {
|
||||
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 ''
|
||||
require('nvim-ts-autotag').setup()
|
||||
'');
|
||||
luaConfigRC.html-autotag = mkIf cfg.treesitter.autotagHtml (entryAnywhere ''
|
||||
require('nvim-ts-autotag').setup()
|
||||
'');
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: 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;
|
||||
in {
|
||||
|
@ -13,16 +19,15 @@ in {
|
|||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Java treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = nvim.types.mkGrammarOption pkgs "java";
|
||||
package = mkGrammarOption pkgs "java";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "Java LSP support (java-language-server)" // {default = config.vim.languages.enableLSP;};
|
||||
|
||||
package = mkOption {
|
||||
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"]'';
|
||||
type = with types; either package (listOf str);
|
||||
type = either package (listOf str);
|
||||
default = pkgs.jdt-language-server;
|
||||
};
|
||||
};
|
||||
|
@ -37,7 +42,7 @@ in {
|
|||
on_attach = default_on_attach,
|
||||
cmd = ${
|
||||
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"}''
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: 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;
|
||||
in {
|
||||
|
@ -12,14 +20,15 @@ in {
|
|||
enable = mkEnableOption "Lua language support";
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Lua Treesitter support" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = nvim.types.mkGrammarOption pkgs "lua";
|
||||
package = mkGrammarOption pkgs "lua";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "Lua LSP support via LuaLS" // {default = config.vim.languages.enableLSP;};
|
||||
|
||||
package = mkOption {
|
||||
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;
|
||||
};
|
||||
|
||||
|
@ -43,7 +52,7 @@ in {
|
|||
${optionalString cfg.lsp.neodev.enable "before_init = require('neodev.lsp').before_init;"}
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then nvim.lua.expToLua cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${getExe cfg.lsp.package}"}''
|
||||
};
|
||||
}
|
||||
|
@ -52,7 +61,7 @@ in {
|
|||
|
||||
(mkIf cfg.lsp.neodev.enable {
|
||||
vim.startPlugins = ["neodev-nvim"];
|
||||
vim.luaConfigRC.neodev = nvim.dag.entryBefore ["lua-lsp"] ''
|
||||
vim.luaConfigRC.neodev = entryBefore ["lua-lsp"] ''
|
||||
require("neodev").setup({})
|
||||
'';
|
||||
})
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
lib,
|
||||
...
|
||||
}: 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;
|
||||
servers = {
|
||||
|
@ -16,7 +18,7 @@
|
|||
on_attach = default_on_attach;
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then nvim.lua.expToLua cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/marksman", "server"}''
|
||||
},
|
||||
}
|
||||
|
@ -27,13 +29,11 @@ in {
|
|||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
|
||||
vim.treesitter.grammars = [cfg.treesitter.mdPackage cfg.treesitter.mdInlinePackage];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
|
||||
vim.lsp.lspconfig.sources.markdown-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||
})
|
||||
]);
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
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;
|
||||
defaultServer = "marksman";
|
||||
|
@ -18,7 +22,7 @@
|
|||
on_attach = default_on_attach;
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then nvim.lua.expToLua cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/marksman", "server"}''
|
||||
},
|
||||
}
|
||||
|
@ -32,11 +36,11 @@ in {
|
|||
treesitter = {
|
||||
enable = mkOption {
|
||||
description = "Enable Markdown treesitter";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = config.vim.languages.enableTreesitter;
|
||||
};
|
||||
mdPackage = nvim.types.mkGrammarOption pkgs "markdown";
|
||||
mdInlinePackage = nvim.types.mkGrammarOption pkgs "markdown-inline";
|
||||
mdPackage = mkGrammarOption pkgs "markdown";
|
||||
mdInlinePackage = mkGrammarOption pkgs "markdown-inline";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
|
@ -44,14 +48,14 @@ in {
|
|||
|
||||
server = mkOption {
|
||||
description = "Markdown LSP server to use";
|
||||
type = with types; enum (attrNames servers);
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
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 "]'';
|
||||
type = with types; either package (listOf str);
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
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;
|
||||
|
||||
defaultServer = "nimlsp";
|
||||
|
@ -18,7 +24,7 @@
|
|||
on_attach = default_on_attach;
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then nvim.lua.expToLua cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''
|
||||
{"${cfg.lsp.package}/bin/nimlsp"}
|
||||
''
|
||||
|
@ -47,41 +53,37 @@ in {
|
|||
enable = mkEnableOption "Nim language support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkOption {
|
||||
description = "Enable Nim treesitter";
|
||||
type = types.bool;
|
||||
default = config.vim.languages.enableTreesitter;
|
||||
};
|
||||
package = nvim.types.mkGrammarOption pkgs "nim";
|
||||
enable = mkEnableOption "Nim treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkGrammarOption pkgs "nim";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "Nim LSP support" // {default = config.vim.languages.enableLSP;};
|
||||
|
||||
server = mkOption {
|
||||
description = "Nim LSP server to use";
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "Nim LSP server package, or the command to run as a list of strings";
|
||||
example = ''[lib.getExe pkgs.nimlsp]'';
|
||||
type = with types; either package (listOf str);
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
};
|
||||
|
||||
format = {
|
||||
enable = mkEnableOption "Nim formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
description = "Nim formatter to use";
|
||||
type = with types; enum (attrNames formats);
|
||||
type = enum (attrNames formats);
|
||||
default = defaultFormat;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "Nim formatter package";
|
||||
type = types.package;
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,11 +1,19 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
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;
|
||||
|
||||
|
@ -15,7 +23,7 @@
|
|||
defaultServer = "nil";
|
||||
packageToCmd = package: defaultCmd:
|
||||
if isList package
|
||||
then lib.nvim.lua.expToLua package
|
||||
then expToLua package
|
||||
else ''{"${package}/bin/${defaultCmd}"}'';
|
||||
servers = {
|
||||
rnix = {
|
||||
|
@ -82,14 +90,15 @@
|
|||
)
|
||||
'';
|
||||
};
|
||||
|
||||
nixpkgs-fmt = {
|
||||
package = pkgs.nixpkgs-fmt;
|
||||
# Never need to use null-ls for nixpkgs-fmt
|
||||
};
|
||||
};
|
||||
|
||||
defaultDiagnostics = ["statix" "deadnix"];
|
||||
diagnostics = {
|
||||
defaultDiagnosticsProvider = ["statix" "deadnix"];
|
||||
diagnosticsProviders = {
|
||||
statix = {
|
||||
package = pkgs.statix;
|
||||
nullConfig = pkg: ''
|
||||
|
@ -101,6 +110,7 @@
|
|||
)
|
||||
'';
|
||||
};
|
||||
|
||||
deadnix = {
|
||||
package = pkgs.deadnix;
|
||||
nullConfig = pkg: ''
|
||||
|
@ -118,26 +128,22 @@ in {
|
|||
enable = mkEnableOption "Nix language support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkOption {
|
||||
description = "Enable Nix treesitter";
|
||||
type = types.bool;
|
||||
default = config.vim.languages.enableTreesitter;
|
||||
};
|
||||
package = nvim.types.mkGrammarOption pkgs "nix";
|
||||
enable = mkEnableOption "Nix treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkGrammarOption pkgs "nix";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "Nix LSP support" // {default = config.vim.languages.enableLSP;};
|
||||
|
||||
server = mkOption {
|
||||
description = "Nix LSP server to use";
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
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"]'';
|
||||
type = with types; either package (listOf str);
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
};
|
||||
|
@ -147,33 +153,30 @@ in {
|
|||
|
||||
type = mkOption {
|
||||
description = "Nix formatter to use";
|
||||
type = with types; enum (attrNames formats);
|
||||
type = enum (attrNames formats);
|
||||
default = defaultFormat;
|
||||
};
|
||||
package = mkOption {
|
||||
description = "Nix formatter package";
|
||||
type = types.package;
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
enable = mkOption {
|
||||
description = "Enable extra Nix diagnostics";
|
||||
type = types.bool;
|
||||
default = config.vim.languages.enableExtraDiagnostics;
|
||||
};
|
||||
types = lib.nvim.types.diagnostics {
|
||||
enable = mkEnableOption "extra Nix diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
|
||||
|
||||
types = diagnostics {
|
||||
langDesc = "Nix";
|
||||
inherit diagnostics;
|
||||
inherit defaultDiagnostics;
|
||||
inherit diagnosticsProviders;
|
||||
inherit defaultDiagnosticsProvider;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
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
|
||||
'';
|
||||
}
|
||||
|
@ -195,10 +198,10 @@ in {
|
|||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources = lib.nvim.languages.diagnosticsToLua {
|
||||
vim.lsp.null-ls.sources = diagnosticsToLua {
|
||||
lang = "nix";
|
||||
config = cfg.extraDiagnostics.types;
|
||||
inherit diagnostics;
|
||||
inherit diagnosticsProviders;
|
||||
};
|
||||
})
|
||||
]);
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
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;
|
||||
|
||||
|
@ -19,7 +25,7 @@
|
|||
on_attach = default_on_attach,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then nvim.lua.expToLua cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''
|
||||
{
|
||||
"${getExe cfg.lsp.package}",
|
||||
|
@ -39,7 +45,7 @@
|
|||
on_attach = default_on_attach,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then nvim.lua.expToLua cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''
|
||||
{
|
||||
"${getExe cfg.lsp.package}",
|
||||
|
@ -65,7 +71,7 @@ in {
|
|||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "PHP treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = nvim.types.mkGrammarOption pkgs "php";
|
||||
package = mkGrammarOption pkgs "php";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
|
@ -73,14 +79,14 @@ in {
|
|||
|
||||
server = mkOption {
|
||||
description = "PHP LSP server to use";
|
||||
type = with types; enum (attrNames servers);
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
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 "]'';
|
||||
type = with types; either package (listOf str);
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
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;
|
||||
|
||||
|
@ -19,7 +24,7 @@
|
|||
on_attach = default_on_attach;
|
||||
cmd = ${
|
||||
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"}''
|
||||
}
|
||||
}
|
||||
|
@ -40,6 +45,7 @@
|
|||
)
|
||||
'';
|
||||
};
|
||||
|
||||
isort = {
|
||||
package = pkgs.isort;
|
||||
nullConfig = ''
|
||||
|
@ -51,6 +57,7 @@
|
|||
)
|
||||
'';
|
||||
};
|
||||
|
||||
black-and-isort = {
|
||||
package = pkgs.writeShellApplication {
|
||||
name = "black";
|
||||
|
@ -140,7 +147,7 @@ in {
|
|||
enable = mkEnableOption "Python treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkOption {
|
||||
description = "Python treesitter grammar to use";
|
||||
type = types.package;
|
||||
type = package;
|
||||
default = pkgs.vimPlugins.nvim-treesitter.builtGrammars.python;
|
||||
};
|
||||
};
|
||||
|
@ -150,14 +157,14 @@ in {
|
|||
|
||||
server = mkOption {
|
||||
description = "Python LSP server to use";
|
||||
type = with types; enum (attrNames servers);
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
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"]'';
|
||||
type = with types; either package (listOf str);
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
};
|
||||
|
@ -167,13 +174,13 @@ in {
|
|||
|
||||
type = mkOption {
|
||||
description = "Python formatter to use";
|
||||
type = with types; enum (attrNames formats);
|
||||
type = enum (attrNames formats);
|
||||
default = defaultFormat;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "Python formatter package";
|
||||
type = types.package;
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
|
@ -182,25 +189,28 @@ in {
|
|||
dap = {
|
||||
enable = mkOption {
|
||||
description = "Enable Python Debug Adapter";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = config.vim.languages.enableDAP;
|
||||
};
|
||||
|
||||
debugger = mkOption {
|
||||
description = "Python debugger to use";
|
||||
type = with types; enum (attrNames debuggers);
|
||||
type = enum (attrNames debuggers);
|
||||
default = defaultDebugger;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = debuggers.${cfg.dap.debugger}.package;
|
||||
example = literalExpression "with pkgs; python39.withPackages (ps: with ps; [debugpy])";
|
||||
description = ''
|
||||
Python debugger package.
|
||||
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 [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: 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;
|
||||
in {
|
||||
|
@ -13,31 +21,30 @@ in {
|
|||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Rust treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = nvim.types.mkGrammarOption pkgs "rust";
|
||||
package = mkGrammarOption pkgs "rust";
|
||||
};
|
||||
|
||||
crates = {
|
||||
enable = mkEnableOption "crates-nvim, tools for managing dependencies";
|
||||
codeActions = mkOption {
|
||||
description = "Enable code actions through null-ls";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "Rust LSP support (rust-analyzer with extra tools)" // {default = config.vim.languages.enableLSP;};
|
||||
|
||||
package = mkOption {
|
||||
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"]'';
|
||||
type = with types; either package (listOf str);
|
||||
type = either package (listOf str);
|
||||
default = pkgs.rust-analyzer;
|
||||
};
|
||||
|
||||
opts = mkOption {
|
||||
description = "Options to pass to rust analyzer";
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
|
@ -45,12 +52,13 @@ in {
|
|||
dap = {
|
||||
enable = mkOption {
|
||||
description = "Rust Debug Adapter support";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = config.vim.languages.enableDAP;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "lldb pacakge";
|
||||
type = types.package;
|
||||
type = package;
|
||||
default = pkgs.lldb;
|
||||
};
|
||||
};
|
||||
|
@ -58,89 +66,95 @@ in {
|
|||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.crates.enable {
|
||||
vim.lsp.null-ls.enable = mkIf cfg.crates.codeActions true;
|
||||
|
||||
vim.startPlugins = ["crates-nvim"];
|
||||
|
||||
vim.autocomplete.sources = {"crates" = "[Crates]";};
|
||||
vim.luaConfigRC.rust-crates = nvim.dag.entryAnywhere ''
|
||||
require('crates').setup {
|
||||
null_ls = {
|
||||
enabled = ${boolToString cfg.crates.codeActions},
|
||||
name = "crates.nvim",
|
||||
vim = {
|
||||
startPlugins = ["crates-nvim"];
|
||||
lsp.null-ls.enable = mkIf cfg.crates.codeActions true;
|
||||
autocomplete.sources = {"crates" = "[Crates]";};
|
||||
luaConfigRC.rust-crates = entryAnywhere ''
|
||||
require('crates').setup {
|
||||
null_ls = {
|
||||
enabled = ${boolToString cfg.crates.codeActions},
|
||||
name = "crates.nvim",
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
'';
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(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;
|
||||
vim.lsp.lspconfig.sources.rust-lsp = ''
|
||||
local rt = require('rust-tools')
|
||||
rust_on_attach = function(client, bufnr)
|
||||
default_on_attach(client, bufnr)
|
||||
local opts = { noremap=true, silent=true, buffer = bufnr }
|
||||
vim.keymap.set("n", "<leader>ris", rt.inlay_hints.set, opts)
|
||||
vim.keymap.set("n", "<leader>riu", rt.inlay_hints.unset, opts)
|
||||
vim.keymap.set("n", "<leader>rr", rt.runnables.runnables, opts)
|
||||
vim.keymap.set("n", "<leader>rp", rt.parent_module.parent_module, opts)
|
||||
vim.keymap.set("n", "<leader>rm", rt.expand_macro.expand_macro, opts)
|
||||
vim.keymap.set("n", "<leader>rc", rt.open_cargo_toml.open_cargo_toml, opts)
|
||||
vim.keymap.set("n", "<leader>rg", function() rt.crate_graph.view_crate_graph("x11", nil) end, opts)
|
||||
${optionalString cfg.dap.enable ''
|
||||
vim.keymap.set("n", "<leader>rd", ":RustDebuggables<cr>", opts)
|
||||
vim.keymap.set(
|
||||
"n", "${config.vim.debugger.nvim-dap.mappings.continue}",
|
||||
function()
|
||||
local dap = require("dap")
|
||||
if dap.status() == "" then
|
||||
vim.cmd "RustDebuggables"
|
||||
else
|
||||
dap.continue()
|
||||
end
|
||||
end,
|
||||
opts
|
||||
)
|
||||
''}
|
||||
end
|
||||
local rustopts = {
|
||||
tools = {
|
||||
autoSetHints = true,
|
||||
hover_with_actions = false,
|
||||
inlay_hints = {
|
||||
only_current_line = false,
|
||||
}
|
||||
},
|
||||
server = {
|
||||
capabilities = capabilities,
|
||||
on_attach = rust_on_attach,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then nvim.lua.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",
|
||||
lsp.lspconfig = {
|
||||
enable = true;
|
||||
sources.rust-lsp = ''
|
||||
local rt = require('rust-tools')
|
||||
rust_on_attach = function(client, bufnr)
|
||||
default_on_attach(client, bufnr)
|
||||
local opts = { noremap=true, silent=true, buffer = bufnr }
|
||||
vim.keymap.set("n", "<leader>ris", rt.inlay_hints.set, opts)
|
||||
vim.keymap.set("n", "<leader>riu", rt.inlay_hints.unset, opts)
|
||||
vim.keymap.set("n", "<leader>rr", rt.runnables.runnables, opts)
|
||||
vim.keymap.set("n", "<leader>rp", rt.parent_module.parent_module, opts)
|
||||
vim.keymap.set("n", "<leader>rm", rt.expand_macro.expand_macro, opts)
|
||||
vim.keymap.set("n", "<leader>rc", rt.open_cargo_toml.open_cargo_toml, opts)
|
||||
vim.keymap.set("n", "<leader>rg", function() rt.crate_graph.view_crate_graph("x11", nil) end, opts)
|
||||
${optionalString cfg.dap.enable ''
|
||||
vim.keymap.set("n", "<leader>rd", ":RustDebuggables<cr>", opts)
|
||||
vim.keymap.set(
|
||||
"n", "${config.vim.debugger.nvim-dap.mappings.continue}",
|
||||
function()
|
||||
local dap = require("dap")
|
||||
if dap.status() == "" then
|
||||
vim.cmd "RustDebuggables"
|
||||
else
|
||||
dap.continue()
|
||||
end
|
||||
end,
|
||||
opts
|
||||
)
|
||||
''}
|
||||
end
|
||||
local rustopts = {
|
||||
tools = {
|
||||
autoSetHints = true,
|
||||
hover_with_actions = false,
|
||||
inlay_hints = {
|
||||
only_current_line = false,
|
||||
}
|
||||
},
|
||||
server = {
|
||||
capabilities = capabilities,
|
||||
on_attach = rust_on_attach,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/rust-analyzer"}''
|
||||
},
|
||||
},
|
||||
''}
|
||||
}
|
||||
rt.setup(rustopts)
|
||||
'';
|
||||
settings = {
|
||||
${cfg.lsp.opts}
|
||||
}
|
||||
},
|
||||
|
||||
${optionalString cfg.dap.enable ''
|
||||
dap = {
|
||||
adapter = {
|
||||
type = "executable",
|
||||
command = "${cfg.dap.package}/bin/lldb-vscode",
|
||||
name = "rt_lldb",
|
||||
},
|
||||
},
|
||||
''}
|
||||
}
|
||||
rt.setup(rustopts)
|
||||
'';
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
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;
|
||||
sqlfluffDefault = pkgs.sqlfluff;
|
||||
|
@ -23,7 +29,7 @@
|
|||
end,
|
||||
cmd = ${
|
||||
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()) }''
|
||||
}
|
||||
}
|
||||
|
@ -47,8 +53,8 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultDiagnostics = ["sqlfluff"];
|
||||
diagnostics = {
|
||||
defaultDiagnosticsProvider = ["sqlfluff"];
|
||||
diagnosticsProviders = {
|
||||
sqlfluff = {
|
||||
package = sqlfluffDefault;
|
||||
nullConfig = pkg: ''
|
||||
|
@ -68,7 +74,7 @@ in {
|
|||
|
||||
dialect = mkOption {
|
||||
description = "SQL dialect for sqlfluff (if used)";
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = "ansi";
|
||||
};
|
||||
|
||||
|
@ -77,7 +83,7 @@ in {
|
|||
|
||||
package = mkOption {
|
||||
description = "SQL treesitter grammar to use";
|
||||
type = types.package;
|
||||
type = package;
|
||||
default = pkgs.vimPlugins.nvim-treesitter.builtGrammars.sql;
|
||||
};
|
||||
};
|
||||
|
@ -87,14 +93,14 @@ in {
|
|||
|
||||
server = mkOption {
|
||||
description = "SQL LSP server to use";
|
||||
type = with types; enum (attrNames servers);
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
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"]'';
|
||||
type = with types; either package (listOf str);
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
};
|
||||
|
@ -104,13 +110,13 @@ in {
|
|||
|
||||
type = mkOption {
|
||||
description = "SQL formatter to use";
|
||||
type = with types; enum (attrNames formats);
|
||||
type = enum (attrNames formats);
|
||||
default = defaultFormat;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "SQL formatter package";
|
||||
type = types.package;
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
|
@ -118,10 +124,10 @@ in {
|
|||
extraDiagnostics = {
|
||||
enable = mkEnableOption "extra SQL diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
|
||||
|
||||
types = lib.nvim.types.diagnostics {
|
||||
types = diagnostics {
|
||||
langDesc = "SQL";
|
||||
inherit diagnostics;
|
||||
inherit defaultDiagnostics;
|
||||
inherit diagnosticsProviders;
|
||||
inherit defaultDiagnosticsProvider;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -133,10 +139,14 @@ in {
|
|||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.startPlugins = ["sqls-nvim"];
|
||||
vim = {
|
||||
startPlugins = ["sqls-nvim"];
|
||||
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
vim.lsp.lspconfig.sources.sql-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||
lsp.lspconfig = {
|
||||
enable = true;
|
||||
sources.sql-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
|
@ -146,10 +156,10 @@ in {
|
|||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources = lib.nvim.languages.diagnosticsToLua {
|
||||
vim.lsp.null-ls.sources = diagnosticsToLua {
|
||||
lang = "sql";
|
||||
config = cfg.extraDiagnostics.types;
|
||||
inherit diagnostics;
|
||||
inherit diagnosticsProviders;
|
||||
};
|
||||
})
|
||||
]);
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
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;
|
||||
|
||||
|
@ -19,7 +26,7 @@
|
|||
on_attach = attach_keymaps,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then nvim.lua.expToLua cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/svelteserver", "--stdio"}''
|
||||
}
|
||||
}
|
||||
|
@ -44,15 +51,15 @@
|
|||
};
|
||||
|
||||
# TODO: specify packages
|
||||
defaultDiagnostics = ["eslint_d"];
|
||||
diagnostics = {
|
||||
defaultDiagnosticsProvider = ["eslint_d"];
|
||||
diagnosticsProviders = {
|
||||
eslint_d = {
|
||||
package = pkgs.nodePackages.eslint_d;
|
||||
nullConfig = pkg: ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
null_ls.builtins.diagnostics.eslint_d.with({
|
||||
command = "${lib.getExe pkg}",
|
||||
command = "${getExe pkg}",
|
||||
})
|
||||
)
|
||||
'';
|
||||
|
@ -65,7 +72,7 @@ in {
|
|||
treesitter = {
|
||||
enable = mkEnableOption "Svelte treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
|
||||
sveltePackage = nvim.types.mkGrammarOption pkgs "svelte";
|
||||
sveltePackage = mkGrammarOption pkgs "svelte";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
|
@ -73,14 +80,14 @@ in {
|
|||
|
||||
server = mkOption {
|
||||
description = "Svelte LSP server to use";
|
||||
type = with types; enum (attrNames servers);
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
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"]'';
|
||||
type = with types; either package (listOf str);
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
};
|
||||
|
@ -90,13 +97,13 @@ in {
|
|||
|
||||
type = mkOption {
|
||||
description = "Svelte formatter to use";
|
||||
type = with types; enum (attrNames formats);
|
||||
type = enum (attrNames formats);
|
||||
default = defaultFormat;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "Svelte formatter package";
|
||||
type = types.package;
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
|
@ -104,10 +111,10 @@ in {
|
|||
extraDiagnostics = {
|
||||
enable = mkEnableOption "extra Svelte diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
|
||||
|
||||
types = lib.nvim.types.diagnostics {
|
||||
types = diagnostics {
|
||||
langDesc = "Svelte";
|
||||
inherit diagnostics;
|
||||
inherit defaultDiagnostics;
|
||||
inherit diagnosticsProviders;
|
||||
inherit defaultDiagnosticsProvider;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -130,10 +137,10 @@ in {
|
|||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources = lib.nvim.languages.diagnosticsToLua {
|
||||
vim.lsp.null-ls.sources = diagnosticsToLua {
|
||||
lang = "svelte";
|
||||
config = cfg.extraDiagnostics.types;
|
||||
inherit diagnostics;
|
||||
inherit diagnosticsProviders;
|
||||
};
|
||||
})
|
||||
]);
|
||||
|
|
|
@ -5,7 +5,11 @@
|
|||
...
|
||||
}: let
|
||||
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;
|
||||
|
||||
|
@ -19,7 +23,7 @@
|
|||
on_attach = default_on_attach;
|
||||
cmd = ${
|
||||
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"}''
|
||||
}
|
||||
}
|
||||
|
@ -35,14 +39,14 @@ in {
|
|||
|
||||
server = mkOption {
|
||||
description = "Tailwindcss LSP server to use";
|
||||
type = with types; enum (attrNames servers);
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
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 "]'';
|
||||
type = with types; either package (listOf str);
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: 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;
|
||||
in {
|
||||
|
@ -13,7 +16,7 @@ in {
|
|||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Terraform treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = nvim.types.mkGrammarOption pkgs "terraform";
|
||||
package = mkGrammarOption pkgs "terraform";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
|
@ -21,7 +24,7 @@ in {
|
|||
|
||||
package = mkOption {
|
||||
description = "terraform-ls package";
|
||||
type = with types; package;
|
||||
type = package;
|
||||
default = pkgs.terraform-ls;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib.modules) mkIf;
|
||||
|
||||
cfg = config.vim.tidal;
|
||||
in {
|
||||
|
|
|
@ -3,20 +3,21 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkOption types;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) int bool;
|
||||
in {
|
||||
options.vim.tidal = {
|
||||
enable = mkEnableOption "tidalcycles tools and plugins";
|
||||
|
||||
flash = mkOption {
|
||||
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;
|
||||
};
|
||||
|
||||
openSC = mkOption {
|
||||
description = "Automatically run the supercollider CLI, sclang, alongside the Tidal GHCI terminal.";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
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;
|
||||
|
||||
|
@ -19,7 +26,7 @@
|
|||
on_attach = attach_keymaps,
|
||||
cmd = ${
|
||||
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"}''
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +41,7 @@
|
|||
on_attach = attach_keymaps,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then nvim.lua.expToLua cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/deno", "lsp"}''
|
||||
}
|
||||
}
|
||||
|
@ -70,15 +77,15 @@
|
|||
};
|
||||
|
||||
# TODO: specify packages
|
||||
defaultDiagnostics = ["eslint_d"];
|
||||
diagnostics = {
|
||||
defaultDiagnosticsProvider = ["eslint_d"];
|
||||
diagnosticsProviders = {
|
||||
eslint_d = {
|
||||
package = pkgs.nodePackages.eslint_d;
|
||||
nullConfig = pkg: ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
null_ls.builtins.diagnostics.eslint_d.with({
|
||||
command = "${lib.getExe pkg}",
|
||||
command = "${getExe pkg}",
|
||||
})
|
||||
)
|
||||
'';
|
||||
|
@ -90,8 +97,8 @@ in {
|
|||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Typescript/Javascript treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
tsPackage = nvim.types.mkGrammarOption pkgs "tsx";
|
||||
jsPackage = nvim.types.mkGrammarOption pkgs "javascript";
|
||||
tsPackage = mkGrammarOption pkgs "tsx";
|
||||
jsPackage = mkGrammarOption pkgs "javascript";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
|
@ -99,14 +106,14 @@ in {
|
|||
|
||||
server = mkOption {
|
||||
description = "Typescript/Javascript LSP server to use";
|
||||
type = with types; enum (attrNames servers);
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
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"]'';
|
||||
type = with types; either package (listOf str);
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
};
|
||||
|
@ -116,13 +123,13 @@ in {
|
|||
|
||||
type = mkOption {
|
||||
description = "Typescript/Javascript formatter to use";
|
||||
type = with types; enum (attrNames formats);
|
||||
type = enum (attrNames formats);
|
||||
default = defaultFormat;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "Typescript/Javascript formatter package";
|
||||
type = types.package;
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
|
@ -130,10 +137,10 @@ in {
|
|||
extraDiagnostics = {
|
||||
enable = mkEnableOption "extra Typescript/Javascript diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
|
||||
|
||||
types = lib.nvim.types.diagnostics {
|
||||
types = diagnostics {
|
||||
langDesc = "Typescript/Javascript";
|
||||
inherit diagnostics;
|
||||
inherit defaultDiagnostics;
|
||||
inherit diagnosticsProviders;
|
||||
inherit defaultDiagnosticsProvider;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -156,10 +163,10 @@ in {
|
|||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources = lib.nvim.languages.diagnosticsToLua {
|
||||
vim.lsp.null-ls.sources = diagnosticsToLua {
|
||||
lang = "ts";
|
||||
config = cfg.extraDiagnostics.types;
|
||||
inherit diagnostics;
|
||||
inherit diagnosticsProviders;
|
||||
};
|
||||
})
|
||||
]);
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: 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;
|
||||
in {
|
||||
|
@ -13,7 +18,7 @@ in {
|
|||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Zig treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = nvim.types.mkGrammarOption pkgs "zig";
|
||||
package = mkGrammarOption pkgs "zig";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
|
@ -22,13 +27,13 @@ in {
|
|||
package = mkOption {
|
||||
description = "ZLS package, or the command to run as a list of strings";
|
||||
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;
|
||||
};
|
||||
|
||||
zigPackage = mkOption {
|
||||
description = "Zig package used by ZLS";
|
||||
type = types.package;
|
||||
type = package;
|
||||
default = pkgs.zig;
|
||||
};
|
||||
};
|
||||
|
@ -47,7 +52,7 @@ in {
|
|||
on_attach=default_on_attach,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then nvim.lua.expToLua cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/zls"}''
|
||||
},
|
||||
settings = {
|
||||
|
|
|
@ -4,7 +4,11 @@
|
|||
pkgs,
|
||||
...
|
||||
}: 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;
|
||||
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}'})";
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = optional usingNvimCmp "cmp-nvim-lsp";
|
||||
vim = {
|
||||
startPlugins = optional usingNvimCmp "cmp-nvim-lsp";
|
||||
|
||||
vim.autocomplete.sources = {"nvim_lsp" = "[LSP]";};
|
||||
vim.luaConfigRC.lsp-setup = ''
|
||||
vim.g.formatsave = ${boolToString cfg.formatOnSave};
|
||||
autocomplete.sources = {"nvim_lsp" = "[LSP]";};
|
||||
|
||||
local attach_keymaps = function(client, bufnr)
|
||||
${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
|
||||
luaConfigRC.lsp-setup = ''
|
||||
vim.g.formatsave = ${boolToString cfg.formatOnSave};
|
||||
|
||||
-- Enable formatting
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
local attach_keymaps = function(client, bufnr)
|
||||
${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)
|
||||
if vim.g.formatsave then
|
||||
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
|
||||
-- Enable formatting
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
|
||||
local function is_null_ls_formatting_enabled(bufnr)
|
||||
local file_type = vim.api.nvim_buf_get_option(bufnr, "filetype")
|
||||
local generators = require("null-ls.generators").get_available(
|
||||
file_type,
|
||||
require("null-ls.methods").internal.FORMATTING
|
||||
)
|
||||
return #generators > 0
|
||||
end
|
||||
format_callback = function(client, bufnr)
|
||||
if vim.g.formatsave then
|
||||
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
|
||||
|
||||
if is_null_ls_formatting_enabled(bufnr) then
|
||||
vim.lsp.buf.format({
|
||||
bufnr = bufnr,
|
||||
filter = function(client)
|
||||
return client.name == "null-ls"
|
||||
end
|
||||
})
|
||||
else
|
||||
vim.lsp.buf.format({
|
||||
bufnr = bufnr,
|
||||
})
|
||||
end
|
||||
''
|
||||
else "
|
||||
local function is_null_ls_formatting_enabled(bufnr)
|
||||
local file_type = vim.api.nvim_buf_get_option(bufnr, "filetype")
|
||||
local generators = require("null-ls.generators").get_available(
|
||||
file_type,
|
||||
require("null-ls.methods").internal.FORMATTING
|
||||
)
|
||||
return #generators > 0
|
||||
end
|
||||
|
||||
if is_null_ls_formatting_enabled(bufnr) then
|
||||
vim.lsp.buf.format({
|
||||
bufnr = bufnr,
|
||||
filter = function(client)
|
||||
return client.name == "null-ls"
|
||||
end
|
||||
})
|
||||
else
|
||||
vim.lsp.buf.format({
|
||||
bufnr = bufnr,
|
||||
})
|
||||
end
|
||||
''
|
||||
else "
|
||||
vim.lsp.buf.format({
|
||||
bufnr = bufnr,
|
||||
})
|
||||
"
|
||||
}
|
||||
end,
|
||||
})
|
||||
}
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
${optionalString (config.vim.ui.breadcrumbs.enable) ''local navic = require("nvim-navic")''}
|
||||
default_on_attach = function(client, bufnr)
|
||||
attach_keymaps(client, bufnr)
|
||||
format_callback(client, bufnr)
|
||||
${optionalString (config.vim.ui.breadcrumbs.enable) ''
|
||||
-- let navic attach to buffers
|
||||
if client.server_capabilities.documentSymbolProvider then
|
||||
navic.attach(client, bufnr)
|
||||
${optionalString (config.vim.ui.breadcrumbs.enable) ''local navic = require("nvim-navic")''}
|
||||
default_on_attach = function(client, bufnr)
|
||||
attach_keymaps(client, bufnr)
|
||||
format_callback(client, bufnr)
|
||||
${optionalString (config.vim.ui.breadcrumbs.enable) ''
|
||||
-- let navic attach to buffers
|
||||
if client.server_capabilities.documentSymbolProvider then
|
||||
navic.attach(client, bufnr)
|
||||
end
|
||||
''}
|
||||
end
|
||||
''}
|
||||
end
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
${optionalString usingNvimCmp "capabilities = require('cmp_nvim_lsp').default_capabilities()"}
|
||||
'';
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
${optionalString usingNvimCmp "capabilities = require('cmp_nvim_lsp').default_capabilities()"}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
# nvim lsp support
|
||||
./config.nix
|
||||
|
|
|
@ -3,20 +3,21 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf nvim;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.lsp;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.lightbulb.enable) {
|
||||
vim.startPlugins = ["nvim-lightbulb"];
|
||||
vim = {
|
||||
startPlugins = ["nvim-lightbulb"];
|
||||
|
||||
vim.configRC.lightbulb = nvim.dag.entryAnywhere ''
|
||||
autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb()
|
||||
'';
|
||||
luaConfigRC.lightbulb = entryAnywhere ''
|
||||
vim.api.nvim_command('autocmd CursorHold,CursorHoldI * lua require\'nvim-lightbulb\'.update_lightbulb()')
|
||||
|
||||
vim.luaConfigRC.lightbulb = nvim.dag.entryAnywhere ''
|
||||
-- Enable trouble diagnostics viewer
|
||||
require'nvim-lightbulb'.setup()
|
||||
'';
|
||||
-- Enable trouble diagnostics viewer
|
||||
require'nvim-lightbulb'.setup()
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./lightbulb.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption;
|
||||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
lightbulb = {
|
||||
|
|
|
@ -3,25 +3,29 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf nvim optionalString;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.strings) optionalString;
|
||||
|
||||
cfg = config.vim.lsp;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.lspSignature.enable) {
|
||||
vim.startPlugins = [
|
||||
"lsp-signature"
|
||||
];
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"lsp-signature"
|
||||
];
|
||||
|
||||
vim.luaConfigRC.lsp-signature = nvim.dag.entryAnywhere ''
|
||||
-- Enable lsp signature viewer
|
||||
require("lsp_signature").setup({
|
||||
${optionalString (config.vim.ui.borders.plugins.lsp-signature.enable) ''
|
||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||
handler_opts = {
|
||||
border = "${config.vim.ui.borders.plugins.lsp-signature.style}"
|
||||
}
|
||||
''}
|
||||
})
|
||||
'';
|
||||
luaConfigRC.lsp-signature = entryAnywhere ''
|
||||
-- Enable lsp signature viewer
|
||||
require("lsp_signature").setup({
|
||||
${optionalString config.vim.ui.borders.plugins.lsp-signature.enable ''
|
||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||
handler_opts = {
|
||||
border = "${config.vim.ui.borders.plugins.lsp-signature.style}"
|
||||
}
|
||||
''}
|
||||
})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./lsp-signature.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption;
|
||||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
lspSignature = {
|
||||
enable = mkEnableOption "lsp signature viewer";
|
||||
enable = mkEnableOption "lsp signature viewer [lsp-signature]";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,32 +1,35 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: 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;
|
||||
in {
|
||||
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"] ''
|
||||
local lspconfig = require('lspconfig')
|
||||
luaConfigRC.lspconfig = entryAfter ["lsp-setup"] ''
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
${
|
||||
# TODO: make border style configurable
|
||||
optionalString (config.vim.ui.borders.enable) ''
|
||||
require('lspconfig.ui.windows').default_options.border = '${config.vim.ui.borders.globalStyle}'
|
||||
''
|
||||
}
|
||||
'';
|
||||
${
|
||||
optionalString config.vim.ui.borders.enable ''
|
||||
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;
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./lspconfig.nix
|
||||
|
|
|
@ -1,17 +1,13 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkOption types;
|
||||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) attrsOf str;
|
||||
in {
|
||||
options.vim.lsp.lspconfig = {
|
||||
enable = mkEnableOption "nvim-lspconfig, also enabled automatically";
|
||||
|
||||
sources = mkOption {
|
||||
description = "nvim-lspconfig sources";
|
||||
type = with types; attrsOf str;
|
||||
type = attrsOf str;
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf nvim;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.lsp;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.lspkind.enable) {
|
||||
vim.startPlugins = ["lspkind"];
|
||||
vim.luaConfigRC.lspkind = nvim.dag.entryAnywhere ''
|
||||
vim.luaConfigRC.lspkind = entryAnywhere ''
|
||||
local lspkind = require'lspkind'
|
||||
local lspkind_opts = {
|
||||
mode = '${cfg.lspkind.mode}'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./lspkind.nix
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkOption types;
|
||||
|
||||
cfg = config.vim.lsp;
|
||||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) enum;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
lspkind = {
|
||||
|
@ -14,7 +8,7 @@ in {
|
|||
|
||||
mode = mkOption {
|
||||
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";
|
||||
};
|
||||
};
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf nvim;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
|
||||
cfg = config.vim.lsp;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.lsplines.enable) {
|
||||
vim.startPlugins = ["lsp-lines"];
|
||||
vim.luaConfigRC.lsplines = nvim.dag.entryAfter ["lspconfig"] ''
|
||||
vim.luaConfigRC.lsplines = entryAfter ["lspconfig"] ''
|
||||
require("lsp_lines").setup()
|
||||
|
||||
vim.diagnostic.config({
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./lsplines.nix
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
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]
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,7 +3,10 @@
|
|||
lib,
|
||||
...
|
||||
}: 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;
|
||||
self = import ./lspsaga.nix {inherit lib;};
|
||||
|
@ -12,38 +15,39 @@
|
|||
mappings = addDescriptionsToMappings cfg.lspsaga.mappings mappingDefinitions;
|
||||
in {
|
||||
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.lspFinder "require('lspsaga.provider').lsp_finder")
|
||||
(mkSetLuaBinding mappings.renderHoveredDoc "require('lspsaga.hover').render_hover_doc")
|
||||
(mkSetLuaBinding mappings.smartScrollUp "function() require('lspsaga.action').smart_scroll_with_saga(-1) end")
|
||||
(mkSetLuaBinding mappings.smartScrollDown "function() require('lspsaga.action').smart_scroll_with_saga(1) end")
|
||||
|
||||
(mkSetLuaBinding mappings.smartScrollUp "function() require('lspsaga.action').smart_scroll_with_saga(-1) end")
|
||||
(mkSetLuaBinding mappings.smartScrollDown "function() require('lspsaga.action').smart_scroll_with_saga(1) end")
|
||||
(mkSetLuaBinding mappings.rename "require('lspsaga.rename').rename")
|
||||
(mkSetLuaBinding mappings.previewDefinition "require('lspsaga.provider').preview_definition")
|
||||
|
||||
(mkSetLuaBinding mappings.rename "require('lspsaga.rename').rename")
|
||||
(mkSetLuaBinding mappings.previewDefinition "require('lspsaga.provider').preview_definition")
|
||||
(mkSetLuaBinding mappings.showLineDiagnostics "require('lspsaga.diagnostic').show_line_diagnostics")
|
||||
(mkSetLuaBinding mappings.showCursorDiagnostics "require('lspsaga.diagnostic').show_cursor_diagnostics")
|
||||
|
||||
(mkSetLuaBinding mappings.showLineDiagnostics "require('lspsaga.diagnostic').show_line_diagnostics")
|
||||
(mkSetLuaBinding mappings.showCursorDiagnostics "require('lspsaga.diagnostic').show_cursor_diagnostics")
|
||||
(mkSetLuaBinding mappings.nextDiagnostic "require('lspsaga.diagnostic').navigate('next')")
|
||||
(mkSetLuaBinding mappings.previousDiagnostic "require('lspsaga.diagnostic').navigate('prev')")
|
||||
|
||||
(mkSetLuaBinding mappings.nextDiagnostic "require('lspsaga.diagnostic').navigate('next')")
|
||||
(mkSetLuaBinding mappings.previousDiagnostic "require('lspsaga.diagnostic').navigate('prev')")
|
||||
(mkIf (!cfg.nvimCodeActionMenu.enable) (mkSetLuaBinding mappings.codeAction "require('lspsaga.codeaction').code_action"))
|
||||
(mkIf (!cfg.lspSignature.enable) (mkSetLuaBinding mappings.signatureHelp "require('lspsaga.signaturehelp').signature_help"))
|
||||
];
|
||||
};
|
||||
|
||||
(mkIf (!cfg.nvimCodeActionMenu.enable) (mkSetLuaBinding mappings.codeAction "require('lspsaga.codeaction').code_action"))
|
||||
(mkIf (!cfg.lspSignature.enable) (mkSetLuaBinding mappings.signatureHelp "require('lspsaga.signaturehelp').signature_help"))
|
||||
];
|
||||
|
||||
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}',
|
||||
''}
|
||||
})
|
||||
'';
|
||||
luaConfigRC.lspsaga = entryAnywhere ''
|
||||
require('lspsaga').init_lsp_saga({
|
||||
${optionalString config.vim.ui.borders.plugins.lspsaga.enable ''
|
||||
border_style = '${config.vim.ui.borders.plugins.lspsaga.style}',
|
||||
''}
|
||||
})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./lspsaga.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption mkMappingOption;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.lsp.lspsaga = {
|
||||
enable = mkEnableOption "LSP Saga";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption mkMappingOption;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
enable = mkEnableOption "LSP, also enabled automatically through null-ls and lspconfig options";
|
||||
|
|
|
@ -1,37 +1,41 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: 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;
|
||||
in {
|
||||
config = mkIf cfg.null-ls.enable (mkMerge [
|
||||
{
|
||||
vim.lsp.enable = true;
|
||||
vim.startPlugins = ["none-ls"];
|
||||
vim = {
|
||||
lsp.enable = true;
|
||||
startPlugins = ["none-ls"];
|
||||
|
||||
vim.luaConfigRC.null_ls-setup = nvim.dag.entryAnywhere ''
|
||||
local null_ls = require("null-ls")
|
||||
local null_helpers = require("null-ls.helpers")
|
||||
local null_methods = require("null-ls.methods")
|
||||
local ls_sources = {}
|
||||
'';
|
||||
vim.luaConfigRC.null_ls = nvim.dag.entryAfter ["null_ls-setup" "lsp-setup"] ''
|
||||
require('null-ls').setup({
|
||||
debug = false,
|
||||
diagnostics_format = "[#{m}] #{s} (#{c})",
|
||||
debounce = 250,
|
||||
default_timeout = 5000,
|
||||
sources = ls_sources,
|
||||
on_attach=default_on_attach
|
||||
})
|
||||
'';
|
||||
luaConfigRC.null_ls-setup = entryAnywhere ''
|
||||
local null_ls = require("null-ls")
|
||||
local null_helpers = require("null-ls.helpers")
|
||||
local null_methods = require("null-ls.methods")
|
||||
local ls_sources = {}
|
||||
'';
|
||||
|
||||
luaConfigRC.null_ls = entryAfter ["null_ls-setup" "lsp-setup"] ''
|
||||
require('null-ls').setup({
|
||||
debug = false,
|
||||
diagnostics_format = "[#{m}] #{s} (#{c})",
|
||||
debounce = 250,
|
||||
default_timeout = 5000,
|
||||
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;
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./null-ls.nix
|
||||
|
|
|
@ -1,19 +1,13 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkOption types;
|
||||
|
||||
cfg = config.vim.lsp;
|
||||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) attrsOf str;
|
||||
in {
|
||||
options.vim.lsp.null-ls = {
|
||||
enable = mkEnableOption "null-ls, also enabled automatically";
|
||||
|
||||
sources = mkOption {
|
||||
description = "null-ls sources";
|
||||
type = with types; attrsOf str;
|
||||
type = attrsOf str;
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -3,32 +3,35 @@
|
|||
lib,
|
||||
...
|
||||
}: 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;
|
||||
|
||||
self = import ./nvim-code-action-menu.nix {inherit lib;};
|
||||
|
||||
mappingDefinitions = self.options.vim.lsp.nvimCodeActionMenu.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.nvimCodeActionMenu.mappings mappingDefinitions;
|
||||
in {
|
||||
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 {
|
||||
"<leader>c" = "+CodeAction";
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<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"}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./nvim-code-action-menu.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption mkMappingOption;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
nvimCodeActionMenu = {
|
||||
|
|
|
@ -3,8 +3,10 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf nvim addDescriptionsToMappings mkSetBinding mkMerge;
|
||||
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;
|
||||
self = import ./nvim-docs-view.nix {inherit lib;};
|
||||
|
@ -17,7 +19,7 @@ in {
|
|||
lsp.enable = true;
|
||||
startPlugins = ["nvim-docs-view"];
|
||||
|
||||
luaConfigRC.nvim-docs-view = nvim.dag.entryAnywhere ''
|
||||
luaConfigRC.nvim-docs-view = entryAnywhere ''
|
||||
require("docs-view").setup {
|
||||
position = "${cfg.position}",
|
||||
width = ${toString cfg.width},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./nvim-docs-view.nix
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption mkOption types mkMappingOption;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) enum int;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.lsp.nvim-docs-view = {
|
||||
enable = mkEnableOption "nvim-docs-view, for displaying lsp hover documentation in a side panel.";
|
||||
|
||||
position = mkOption {
|
||||
type = types.enum ["left" "right" "top" "bottom"];
|
||||
type = enum ["left" "right" "top" "bottom"];
|
||||
default = "right";
|
||||
description = ''
|
||||
Where to open the docs view panel
|
||||
|
@ -13,7 +15,7 @@ in {
|
|||
};
|
||||
|
||||
height = mkOption {
|
||||
type = types.int;
|
||||
type = int;
|
||||
default = 10;
|
||||
description = ''
|
||||
Height of the docs view panel if the position is set to either top or bottom
|
||||
|
@ -21,7 +23,7 @@ in {
|
|||
};
|
||||
|
||||
width = mkOption {
|
||||
type = types.int;
|
||||
type = int;
|
||||
default = 60;
|
||||
description = ''
|
||||
Width of the docs view panel if the position is set to either left or right
|
||||
|
@ -29,12 +31,14 @@ in {
|
|||
};
|
||||
|
||||
updateMode = mkOption {
|
||||
type = types.enum ["auto" "manual"];
|
||||
type = enum ["auto" "manual"];
|
||||
default = "auto";
|
||||
description = ''
|
||||
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
|
||||
Determines the mechanism used to update the docs view panel content
|
||||
|
||||
Possible values:
|
||||
- auto: the content will update upon cursor move.
|
||||
- manual: the content will only update once :DocsViewUpdate is called
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
@ -3,36 +3,39 @@
|
|||
lib,
|
||||
...
|
||||
}: 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;
|
||||
|
||||
self = import ./trouble.nix {inherit lib;};
|
||||
|
||||
mappingDefinitions = self.options.vim.lsp.trouble.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.trouble.mappings mappingDefinitions;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.trouble.enable) {
|
||||
vim.startPlugins = ["trouble"];
|
||||
vim = {
|
||||
startPlugins = ["trouble"];
|
||||
|
||||
vim.maps.normal = mkMerge [
|
||||
(mkSetBinding mappings.toggle "<cmd>TroubleToggle<CR>")
|
||||
(mkSetBinding mappings.workspaceDiagnostics "<cmd>TroubleToggle workspace_diagnostics<CR>")
|
||||
(mkSetBinding mappings.documentDiagnostics "<cmd>TroubleToggle document_diagnostics<CR>")
|
||||
(mkSetBinding mappings.lspReferences "<cmd>TroubleToggle lsp_references<CR>")
|
||||
(mkSetBinding mappings.quickfix "<cmd>TroubleToggle quickfix<CR>")
|
||||
(mkSetBinding mappings.locList "<cmd>TroubleToggle loclist<CR>")
|
||||
];
|
||||
maps.normal = mkMerge [
|
||||
(mkSetBinding mappings.toggle "<cmd>TroubleToggle<CR>")
|
||||
(mkSetBinding mappings.workspaceDiagnostics "<cmd>TroubleToggle workspace_diagnostics<CR>")
|
||||
(mkSetBinding mappings.documentDiagnostics "<cmd>TroubleToggle document_diagnostics<CR>")
|
||||
(mkSetBinding mappings.lspReferences "<cmd>TroubleToggle lsp_references<CR>")
|
||||
(mkSetBinding mappings.quickfix "<cmd>TroubleToggle quickfix<CR>")
|
||||
(mkSetBinding mappings.locList "<cmd>TroubleToggle loclist<CR>")
|
||||
];
|
||||
|
||||
vim.binds.whichKey.register = pushDownDefault {
|
||||
"<leader>l" = "Trouble";
|
||||
"<leader>x" = "+Trouble";
|
||||
"<leader>lw" = "Workspace";
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>l" = "Trouble";
|
||||
"<leader>x" = "+Trouble";
|
||||
"<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 {}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./trouble.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption mkMappingOption;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
trouble = {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption mkMappingOption;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.minimap.codewindow = {
|
||||
enable = mkEnableOption "codewindow plugin for minimap view";
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
lib,
|
||||
...
|
||||
}: 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;
|
||||
|
||||
|
@ -13,26 +15,28 @@
|
|||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = [
|
||||
"codewindow-nvim"
|
||||
];
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"codewindow-nvim"
|
||||
];
|
||||
|
||||
vim.maps.normal = mkMerge [
|
||||
(mkSetLuaBinding mappings.open "require('codewindow').open_minimap")
|
||||
(mkSetLuaBinding mappings.close "require('codewindow').close_minimap")
|
||||
(mkSetLuaBinding mappings.toggle "require('codewindow').toggle_minimap")
|
||||
(mkSetLuaBinding mappings.toggleFocus "require('codewindow').toggle_focus")
|
||||
];
|
||||
maps.normal = mkMerge [
|
||||
(mkSetLuaBinding mappings.open "require('codewindow').open_minimap")
|
||||
(mkSetLuaBinding mappings.close "require('codewindow').close_minimap")
|
||||
(mkSetLuaBinding mappings.toggle "require('codewindow').toggle_minimap")
|
||||
(mkSetLuaBinding mappings.toggleFocus "require('codewindow').toggle_focus")
|
||||
];
|
||||
|
||||
vim.binds.whichKey.register = pushDownDefault {
|
||||
"<leader>m" = "+Minimap";
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<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'},
|
||||
})
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./codewindow.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{...}: {
|
||||
{
|
||||
imports = [
|
||||
./minimap-vim
|
||||
./codewindow
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf pushDownDefault;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.binds) pushDownDefault;
|
||||
|
||||
cfg = config.vim.minimap.minimap-vim;
|
||||
in {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./minimap-vim.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption;
|
||||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
in {
|
||||
options.vim.minimap.minimap-vim = {
|
||||
enable = mkEnableOption "minimap-vim plugin for minimap view";
|
||||
enable = mkEnableOption "minimap view [minimap-vim]";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./obsidian
|
||||
./orgmode
|
||||
|
|
|
@ -3,27 +3,31 @@
|
|||
lib,
|
||||
...
|
||||
}: 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;
|
||||
in {
|
||||
config = mkIf (cfg.enable) {
|
||||
vim.startPlugins = [
|
||||
"mind-nvim"
|
||||
];
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"mind-nvim"
|
||||
];
|
||||
|
||||
vim.maps.normal = {
|
||||
"<leader>om" = {action = ":MindOpenMain<CR>";};
|
||||
"<leader>op" = {action = ":MindOpenProject<CR>";};
|
||||
"<leader>oc" = {action = ":MindClose<CR>";};
|
||||
maps.normal = {
|
||||
"<leader>om" = {action = ":MindOpenMain<CR>";};
|
||||
"<leader>op" = {action = ":MindOpenProject<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()
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./mind-nvim.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption;
|
||||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
in {
|
||||
options.vim.notes.mind-nvim = {
|
||||
enable = mkEnableOption "organizer tool for Neovim.";
|
||||
enable = mkEnableOption "note organizer tool for Neovim [mind-nvim]";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,45 +3,49 @@
|
|||
lib,
|
||||
...
|
||||
}: 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;
|
||||
auto = config.vim.autocomplete;
|
||||
in {
|
||||
config = mkIf (cfg.enable) {
|
||||
vim.startPlugins = [
|
||||
"obsidian-nvim"
|
||||
"vim-markdown"
|
||||
"tabular"
|
||||
];
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"obsidian-nvim"
|
||||
"vim-markdown"
|
||||
"tabular"
|
||||
];
|
||||
|
||||
vim.binds.whichKey.register = pushDownDefault {
|
||||
"<leader>o" = "+Notes";
|
||||
};
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>o" = "+Notes";
|
||||
};
|
||||
|
||||
vim.luaConfigRC.obsidian = nvim.dag.entryAnywhere ''
|
||||
require("obsidian").setup({
|
||||
dir = "${cfg.dir}",
|
||||
completion = {
|
||||
nvim_cmp = ${
|
||||
if (auto.type == "nvim-cmp")
|
||||
then "true"
|
||||
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}',"
|
||||
}
|
||||
luaConfigRC.obsidian = entryAnywhere ''
|
||||
require("obsidian").setup({
|
||||
dir = "${cfg.dir}",
|
||||
completion = {
|
||||
nvim_cmp = ${
|
||||
if (auto.type == "nvim-cmp")
|
||||
then "true"
|
||||
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}',"
|
||||
}
|
||||
}
|
||||
})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./obsidian.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,27 +1,24 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkOption types;
|
||||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) str bool;
|
||||
in {
|
||||
options.vim.notes = {
|
||||
obsidian = {
|
||||
enable = mkEnableOption "complementary neovim plugins for Obsidian editor";
|
||||
dir = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = "~/my-vault";
|
||||
description = "Obsidian vault directory";
|
||||
};
|
||||
|
||||
daily-notes = {
|
||||
folder = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = "";
|
||||
description = "Directory in which daily notes should be created";
|
||||
};
|
||||
date-format = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = "";
|
||||
description = "Date format used for creating daily notes";
|
||||
};
|
||||
|
@ -29,8 +26,7 @@ in {
|
|||
|
||||
completion = {
|
||||
nvim_cmp = mkOption {
|
||||
# if using nvim-cmp, otherwise set to false
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
description = "If using nvim-cmp, otherwise set to false";
|
||||
};
|
||||
};
|
||||
|
|
|
@ -3,42 +3,46 @@
|
|||
lib,
|
||||
...
|
||||
}: 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;
|
||||
in {
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
vim.startPlugins = [
|
||||
"orgmode-nvim"
|
||||
];
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"orgmode-nvim"
|
||||
];
|
||||
|
||||
vim.binds.whichKey.register = pushDownDefault {
|
||||
"<leader>o" = "+Notes";
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<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 {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./orgmode.nix
|
||||
./config.nix
|
||||
|
|
|
@ -4,27 +4,28 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption types mkOption nvim;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) str;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
in {
|
||||
options.vim.notes.orgmode = {
|
||||
enable = mkEnableOption "nvim-orgmode: Neovim plugin for Emac Orgmode. Get the best of both worlds";
|
||||
|
||||
orgAgendaFiles = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = "{'~/Documents/org/*', '~/my-orgs/**/*'}";
|
||||
description = "List of org files to be used as agenda files.";
|
||||
};
|
||||
|
||||
orgDefaultNotesFile = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = "~/Documents/org/refile.org";
|
||||
description = "Default org file to be used for notes.";
|
||||
};
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Orgmode treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
|
||||
orgPackage = nvim.types.mkGrammarOption pkgs "org";
|
||||
orgPackage = mkGrammarOption pkgs "org";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -4,46 +4,49 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkMerge mkBinding mkIf;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.binds) mkBinding;
|
||||
|
||||
cfg = config.vim.notes.todo-comments;
|
||||
self = import ./todo-comments.nix {inherit lib;};
|
||||
mappings = self.options.vim.notes.todo-comments.mappings;
|
||||
inherit (self.options.vim.notes.todo-comments) mappings;
|
||||
in {
|
||||
config = mkIf (cfg.enable) {
|
||||
vim.startPlugins = [
|
||||
"todo-comments"
|
||||
];
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"todo-comments"
|
||||
];
|
||||
|
||||
vim.maps.normal = mkMerge [
|
||||
(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.lsp.trouble.enable (mkBinding cfg.mappings.trouble ":TodoTrouble<CR>" mappings.trouble.description))
|
||||
];
|
||||
maps.normal = mkMerge [
|
||||
(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.lsp.trouble.enable (mkBinding cfg.mappings.trouble ":TodoTrouble<CR>" mappings.trouble.description))
|
||||
];
|
||||
|
||||
vim.luaConfigRC.todo-comments = ''
|
||||
require('todo-comments').setup {
|
||||
highlight = {
|
||||
before = "", -- "fg" or "bg" or empty
|
||||
keyword = "bg", -- "fg", "bg", "wide" or empty
|
||||
after = "fg", -- "fg" or "bg" or empty
|
||||
pattern = ${cfg.patterns.highlight},
|
||||
comments_only = true, -- uses treesitter to match keywords in comments only
|
||||
max_line_len = 400, -- ignore lines longer than this
|
||||
exclude = {}, -- list of file types to exclude highlighting
|
||||
},
|
||||
search = {
|
||||
command = "${pkgs.ripgrep}/bin/rg",
|
||||
args = {
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
luaConfigRC.todo-comments = ''
|
||||
require('todo-comments').setup {
|
||||
highlight = {
|
||||
before = "", -- "fg" or "bg" or empty
|
||||
keyword = "bg", -- "fg", "bg", "wide" or empty
|
||||
after = "fg", -- "fg" or "bg" or empty
|
||||
pattern = ${cfg.patterns.highlight},
|
||||
comments_only = true, -- uses treesitter to match keywords in comments only
|
||||
max_line_len = 400, -- ignore lines longer than this
|
||||
exclude = {}, -- list of file types to exclude highlighting
|
||||
},
|
||||
pattern = ${cfg.patterns.search},
|
||||
},
|
||||
}
|
||||
'';
|
||||
search = {
|
||||
command = "${pkgs.ripgrep}/bin/rg",
|
||||
args = {
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
},
|
||||
pattern = ${cfg.patterns.search},
|
||||
},
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./todo-comments.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,18 +1,20 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption mkOption types mkMappingOption;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) str;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.notes.todo-comments = {
|
||||
enable = mkEnableOption "todo-comments: highlight and search for todo comments like TODO, HACK, BUG in your code base";
|
||||
|
||||
patterns = {
|
||||
highlight = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = ''[[.*<(KEYWORDS)(\([^\)]*\))?:]]'';
|
||||
description = "vim regex pattern used for highlighting comments";
|
||||
};
|
||||
|
||||
search = mkOption {
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = ''[[\b(KEYWORDS)(\([^\)]*\))?:]]'';
|
||||
description = "ripgrep regex pattern used for searching comments";
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./project-nvim
|
||||
];
|
||||
|
|
|
@ -3,7 +3,10 @@
|
|||
lib,
|
||||
...
|
||||
}: 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;
|
||||
in {
|
||||
|
@ -12,7 +15,7 @@ in {
|
|||
"project-nvim"
|
||||
];
|
||||
|
||||
vim.luaConfigRC.project-nvim = nvim.dag.entryAnywhere ''
|
||||
vim.luaConfigRC.project-nvim = entryAnywhere ''
|
||||
require('project_nvim').setup({
|
||||
manual_mode = ${boolToString cfg.manualMode},
|
||||
detection_methods = { ${concatStringsSep ", " (map (x: "\"" + x + "\"") cfg.detectionMethods)} },
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./project-nvim.nix
|
||||
|
|
|
@ -1,60 +1,57 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkOption types;
|
||||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) enum bool listOf str;
|
||||
in {
|
||||
options.vim.projects.project-nvim = {
|
||||
enable = mkEnableOption "project-nvim for project management";
|
||||
|
||||
manualMode = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
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
|
||||
detectionMethods = mkOption {
|
||||
type = types.listOf types.str;
|
||||
type = listOf str;
|
||||
default = ["lsp" "pattern"];
|
||||
description = "Detection methods to use";
|
||||
};
|
||||
|
||||
# patterns
|
||||
patterns = mkOption {
|
||||
type = types.listOf types.str;
|
||||
type = listOf str;
|
||||
default = [".git" "_darcs" ".hg" ".bzr" ".svn" "Makefile" "package.json" "flake.nix" "cargo.toml"];
|
||||
description = "Patterns to use for pattern detection method";
|
||||
};
|
||||
|
||||
# table of lsp servers to ignore by name
|
||||
lspIgnored = mkOption {
|
||||
type = types.listOf types.str;
|
||||
type = listOf str;
|
||||
default = [];
|
||||
description = "LSP servers no ignore by name";
|
||||
};
|
||||
|
||||
excludeDirs = mkOption {
|
||||
type = types.listOf types.str;
|
||||
type = listOf str;
|
||||
default = [];
|
||||
description = "Directories to exclude from project root search";
|
||||
};
|
||||
|
||||
showHidden = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Show hidden files in telescope picker";
|
||||
};
|
||||
|
||||
silentChdir = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Silently change directory when changing project";
|
||||
};
|
||||
|
||||
scopeChdir = mkOption {
|
||||
type = types.enum ["global" "tab" "win"];
|
||||
type = enum ["global" "tab" "win"];
|
||||
default = "global";
|
||||
description = "What scope to change the directory";
|
||||
};
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue