diff --git a/.editorconfig b/.editorconfig index 1f39b72e..5f4be94c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,17 +14,15 @@ indent_style = space indent_size = 2 trim_trailing_whitespace = false -[*.{js,json,nix,yml,yaml,toml}] +[*.{nix,yml,yaml}] indent_style = space indent_size = 2 tab_width = 2 -[*.{diff,patch,lock}] +[*.{diff,patch}] end_of_line = unset insert_final_newline = unset trim_trailing_whitespace = unset -[npins/sources.json] -indent_style = unset +[*.lock] indent_size = unset -trim_trailing_whitespace = unset diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2fb071ca..de6ff5ef 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1 @@ -# Codeowners should be used to distinguish the maintainers of the project -# and not contributors of specific modules to nvf. While adding a new module -# please consider adding yourself to 'meta.maintainers' in the module instead -# of CODEOWNERS here. -* @NotAShelf @horriblename @Soliprem +* @NotAShelf diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 2379973f..436a68ec 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -2,72 +2,29 @@ ## Table of Contents -- [Preface](#preface) -- [Contributing Process](#contributing-process) +- [Welcome](#welcome) +- [Contributing](#contributing) - [Code of Conduct](#code-of-conduct) -## Preface +## Welcome -[LICENSE]: ../LICENSE +I'm glad you are thinking about contributing to neovim-flake! If you're unsure about anything, just ask - or submit the issue or pull request anyway. The worst that can happen is you'll be politely asked to change something. Friendly contributions are always welcome. -I am glad you are thinking about contributing to nvf! The project is shaped by -contributors and user feedback, and all contributions are appreciated. +Before you contribute, I encourage you to read this project's CONTRIBUTING policy (you are here), its [LICENSE](LICENSE.md), and its [README](README.md). -If you are unsure about anything, whether a change is necessary or if it would -be accepted _had_ you created a PR, please just ask! Or submit the issue or pull -request anyway, the worst that can happen is that you will be politely asked to -change something. Friendly contributions are _always_ welcome. +If you have any questions regarding those files, feel free to open an issue or [shoot me an email](mailto:me@notashelf.dev). Discussions tab is also available for more informal discussions. -Before you contribute, I encourage you to read the rest of this document for our -contributing policy and guidelines, followed by the [LICENSE] to understand how -your contributions are licensed. +## Contributing -If you have any questions regarding those files, or would like to ask a question -that is not covered by any of them, please feel free to open an issue! -Discussions tab is also available for less formal discussions. You may also -choose to contact me on Discord or Matrix if you would like to talk to me -personally. - -## Contributing Process - -[pull request template]: ./PULL_REQUEST_TEMPLATE.md - -The contribution process is mostly documented in the [pull request template]. -When you create a pull request, you will find a checklist of items to complete -before it can be submitted. We ask that you please complete it before submitting -a pull request to help maintainers provide more specific feedback. If you are -unsure about any of the items, please ask. +The contribution process is mostly documented in the [pull request template](.github/pull_request_template.md). You will find a checklist of items to complete before submitting a pull request. Please make sure you complete it before submitting a pull request. If you are unsure about any of the items, please ask. ### Guidelines -We provide instructions for a healthy contribution to nvf. This includes -**styling**, **commit formats**, **how-to guides for common contributions**. You -are strongly encouraged to read the contributing guidelines in full over at -[the documentation](https://notashelf.github.io/nvf#hacking). - -A general gist of our requirements is that you must - -1. Write clean Nix code -2. Self-test your changes -3. Document your changes - -Though, please take a look at the manual for the complete contributing guide. -Please also feel free to let us know if you feel that something is missing. We -hope to provide clear, comprehensive instructions that make the contribution -process a breeze. +We provide instructions on a healthy contribution to neovim-flake - including styling, commit formats, how-to guides for adding new modules and options. +You are very well recommended to read the contributing guideliner over at [the documentation](https://notashelf.github.io/neovim-flake#hacking) ### Code of Conduct -This project does not have a formal code of conduct yet, and to be perfectly -honest I am not entirely positive if I want one or if it will _ever_ have one. -This project is not expected to be a hotbed of activity, and I trust my -contributors to keep it civil and respectful. +This project does not quite have a code of conduct yet. And to be honest, I'm not sure if I want one or if it will ever have one. I'm not expecting this project to be a hotbed of activity, but I do want to make sure that everyone who does contribute feels welcome and safe. As such, I will do my best to make sure that those who distrupt the project are dealt with swiftly and appropriately. -I do, however, want to make sure that everyone who does contribute feels welcome -and safe around project spaces. As such, I will do my best to make sure anyone -who disrupts the project or engages in negative behaviour will are dealt with -appropriately, and swiftly. You are invited to share any concerns that you have -with the projects moderation, be it over public or private spaces. - -If you feel that you are not being treated with respect, please contact me -directly. +If you feel that you are not being treated with respect, please contact me directly. diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 97a82378..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: NotAShelf diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index be97db2a..c9270b26 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -1,120 +1,60 @@ name: "🐛 Bug Report" -description: "Submit a bug report to help us improve nvf" -title: "" +description: "Submit a bug report to help us improve" +#title: "[Bug] " labels: [bug] body: - type: checkboxes + id: no-duplicate-issues attributes: - label: I have confirmed that this is a bug related to nvf - description: >- - If you are unsure whether this is a bug, a packaging issue, or user error that is *not* - stemming from nvf, please consider creating a [discussion](https://github.com/notashelf/nvf/discussions) - post instead. Invalid bug reports will be closed without an explanation. + label: "⚠️ Please verify that this bug has NOT been reported before." + description: "Search in the issues sections by clicking [HERE](https://github.com/notashelf/neovim-flake/issues?q=)" options: - - required: true - label: >- - This is a bug, and not an user error or a support request. I understand that my issue - will be closed if it is not a bug in nvf. - - required: true - label: >- - I have checked the [issues tab](https://github.com/notashelf/nvf/issues?q=is%3Aissue) - and confirmed that my issue has not yet been reported. I understand that my issue will - be closed if it is a duplicate. - + - label: "I checked all existing issues and didn't find a similar issue" + required: true - type: textarea - attributes: - label: Description - placeholder: "Describe the issue here..." - description: >- - Describe the issue in detail, with steps you have taken included. If applicable, please include - a minimal reproducible example, relevant Nix logs, comparisons with alternative commands and - screenshots. Do note that **logs** are preferred over screenshots. + id: description validations: - required: true - - - type: dropdown + required: false attributes: - label: Installation Method - description: "How was nvf installed?" - options: - - NixOS Module (`nixosModules.default`) - - Home Manager Module (`homeManagerModules.default`) - - Standalone (flake outputs, `nix profile install`, etc.) - - Other - validations: - required: true - - - type: textarea - attributes: - label: Installation Method (Other) - description: "If you have selected 'Other' in the previous section, please describe your installation method" - placeholder: >- - I installed nvf from... - - - type: textarea - attributes: - label: nvf Version - description: "Which version of nvf are you using? If added as a flake input, write 'master'" - placeholder: >- - For example, v0.8 if consuming nvf from a tagged release. - validations: - required: true - + label: "Description" + description: "You could also upload screenshots, if necessary" - type: textarea id: steps-to-reproduce - attributes: - label: Reproduction steps - description: "How do you trigger this bug? Please walk us through the problem, step by step" - placeholder: >- - 1. Do this - 2. Do that - 3. Observe validations: required: true - + attributes: + label: "👟 Reproduction steps" + description: "How do you trigger this bug? Please walk us through the problem, step by step" + placeholder: "..." - type: textarea id: expected-behavior + validations: + required: true attributes: - label: Expected behavior + label: "👀 Expected behavior" description: "What did you think would or should happen?" placeholder: "..." - validations: - required: true - - type: textarea id: actual-behavior + validations: + required: true attributes: - label: Actual Behavior + label: "😓 Actual Behavior" description: "What actually happen?" placeholder: "..." - validations: - required: true - - - type: textarea + - type: input + id: nix-metadata attributes: - label: System Information - description: "Output of `nix-info --markdown`" - render: bash - placeholder: |- - '[user@system:~]$ nix-shell -p nix-info --run "nix-info --markdown" - - system: - - host os: - - multi-user?: - - sandbox: - - version: - - nixpkgs: + label: "💻 Metadata" + description: 'Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the result.' + placeholder: '[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"' validations: required: true - - type: textarea id: logs attributes: + label: "📝 Relevant log output" + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. render: bash - label: "Relevant log output" - description: >- - Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. - - > [!TIP] - > You can get your nvf configuration with `nvf-print-config` and attach it by using a service like termbin.com validations: required: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index 819891df..d7ed2654 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -1,72 +1,58 @@ name: 🚀 Feature Request description: "Propose a new feature" -title: "" +#title: "[Feature] " labels: [feature-request] body: - type: checkboxes + id: no-duplicate-issues attributes: - label: I have verified that this feature request has not been made before - description: >- - Before opening a new issue for feature requests, please consider searching through currently - open issues [here](https://github.com/notashelf/nvf/issues). If you would like to discuss a - new addition beforehand, you may first want to create a new discussion threat and discuss it - with the maintainers [on the discussions tab](https://github.com/notashelf/nvf/discussions) + label: "⚠️ Please verify that this feature request has NOT been suggested before." + description: "Search in the issues sections by clicking [HERE](https://github.com/notashelf/neovim-flake/issues?q=)" options: - - required: true - label: >- - I have checked the [issues tab](https://github.com/notashelf/nvf/issues?q=is%3Aissue), - and did not find a similar feature request. I understand that my issue will be closed - if it is a duplicate. - + - label: "I checked and didn't find a similar feature request" + required: true - type: dropdown id: feature-area attributes: - label: Feature Type - description: Please describe the kind of addition this is + label: "🏷️ Feature Type" + description: "What kind of a feature request is this?" multiple: true options: - - New Plugin - - Update Request (Plugin/Nixpkgs) - - Documentation Updates + - New Command + - New Addon + - API Additions - Other validations: required: true - - - type: textarea id: feature-description - attributes: - label: Feature description - description: >- - Please provide a clear and concise description of the desired addition. If this is a plugin - addition, please also include a link to the desired plugin and the reason why you think this - is a good addition. Keep in mind that we may refuse plugin requests as nvf already provides - appropriate methods of installing plugins in user configurations. - placeholder: >- - "nvf currently does [...], which really frustrates me" or "You should add [...] because I think - [...]" validations: required: true - + attributes: + label: "🔖 Feature description" + description: "A clear and concise description of what your feature request is." + placeholder: "'You should add [...]' or '[...] has always frustrated me' " + - type: textarea + id: solution + validations: + required: true + attributes: + label: "✔️ Solution" + description: "A clear and concise description of what you want to happen." + placeholder: "In my use-case, I would like [...]" - type: textarea id: alternatives - attributes: - label: Alternatives - description: >- - If you have tried anything before creating this issue, please give us a clear and concise - description of any alternative solutions or methods you have considered. - placeholder: "I have considered [...]" validations: required: false - + attributes: + label: "❓ Alternatives" + description: "A clear and concise description of any alternative solutions or features you've considered." + placeholder: "I have considered [...]" - type: textarea id: additional-context - attributes: - label: Additional Context - description: >- - If there is anything else you would like to mention, such as additional context or screenshots - demonstrating the requested feature, please add them here. This field is optional, but you may - be requested to provide further context. Please ensure that your feature request clearly describes - the requested feature in good detail. validations: required: false + attributes: + label: "📝 Additional Context" + description: "Add any other context or screenshots about the feature request here." + placeholder: "..." diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 66fe9c0f..00000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,64 +0,0 @@ - - -## Sanity Checking - - - -[editorconfig]: https://editorconfig.org -[changelog]: https://github.com/NotAShelf/nvf/tree/main/docs/release-notes -[hacking nvf]: https://notashelf.github.io/nvf/index.xhtml#sec-guidelines - -- [ ] I have updated the [changelog] as per my changes -- [ ] I have tested, and self-reviewed my code -- [ ] My changes fit guidelines found in [hacking nvf] -- Style and consistency - - [ ] I ran **Alejandra** to format my code (`nix fmt`) - - [ ] My code conforms to the [editorconfig] configuration of the project - - [ ] My changes are consistent with the rest of the codebase -- If new changes are particularly complex: - - [ ] My code includes comments in particularly complex areas - - [ ] I have added a section in the manual - - [ ] _(For breaking changes)_ I have included a migration guide -- Package(s) built: - - [ ] `.#nix` _(default package)_ - - [ ] `.#maximal` - - [ ] `.#docs-html` _(manual, must build)_ - - [ ] `.#docs-linkcheck` _(optional, please build if adding links)_ -- Tested on platform(s) - - [ ] `x86_64-linux` - - [ ] `aarch64-linux` - - [ ] `x86_64-darwin` - - [ ] `aarch64-darwin` - - - ---- - -Add a :+1: [reaction] to [pull requests you find important]. - -[reaction]: https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/ -[pull requests you find important]: https://github.com/NixOS/nixpkgs/pulls?q=is%3Aopen+sort%3Areactions-%2B1-desc diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md new file mode 100644 index 00000000..ca65c8b2 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -0,0 +1,39 @@ +# Description + +A clear and concise description of the aim of your Pull Request. + +**If your pull request aims to fix an open issue or a present bug, please link the relevant issue below. If not, please remove this section** +Fixes #(issue) + +## Type of change + +Please delete any options that are not relevant. + +- Bug fix (non-breaking change which fixes an issue) +- New feature (non-breaking change which adds functionality) +- Breaking change (fix or feature that would cause existing functionality to not work as expected) +- Translation/Language update +- Docs +- Other + +## Checklist + +Please try to check at least a majority of the checklist before opening your pull request. Exceptions to this will be reviewed on a case by case basis. + +- [ ] My code follows the style and contributing guidelines of this project. +- [ ] I ran Alejandra to format my code (`nix fmt`). +- [ ] I have performed a self-review of my own code and tested it. +- [ ] I have commented my code, particularly in hard-to-understand areas. +- [ ] My changes generate no new warnings. +- [ ] This change requires a documentation update. +- [ ] I have updated the documentation accordingly. + +## Screenshots & Logs + +You are kindly requested to attach screenshots of your changes in actions and preferably your build/run logs for all available packages. If you are not sure how to do this, you can refer to the [documentation](https://notashelf.github.io/neovim-flake/). + +**Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically.** + +```console +# Paste your logs here +``` diff --git a/.github/README.md b/.github/README.md new file mode 100644 index 00000000..7418d27d --- /dev/null +++ b/.github/README.md @@ -0,0 +1,189 @@ +
+ nvf Logo +
+

❄️ nvf

+
+

+ + Latest release + + + Last commit + + + License + + + Stars + + + Issues + + + Repo Size + +

+ +

+ +

+ +
+ + A highly modular, configurable, extensible and easy to use Neovim configuration + framework in Nix. Designed for flexibility and ease of use, this flake + allows you to easily configure your Neovim instance with a few lines of + Nix code. + +
+
+ +> [!WARNING] +> Main branch is only updated for small, non-breaking changes. For the latest version of neovim-flake, please see +> [the list of branches](https://github.com/NotAShelf/neovim-flake/branches) or +> [open pull requests](https://github.com/NotAShelf/neovim-flake/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc). +> neovim-flake, at the time, is still being actively developed - and will continue to be so for the foreseeable +> future. + +--- + +

+ +**[
 Get Started 
][Get Started]** +**[
 Documentation 
][Documentation]** +**[
 Help 
][Help]** +**[
 Contribute 
][Contribute]** +**[
 FAQ 
][Faq]** +**[
 Credits 
][Credits]** + +

+ +[Get Started]: #get-started +[Documentation]: #documentation +[Help]: #help +[Contribute]: #contributing +[FAQ]: #faq +[Credits]: #credits + +--- + +## Get Started + +### Using `nix` CLI + +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/nvf +``` + +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: + +```console +nix run github:notashelf/nvf#tidal +``` + +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. + +## Documentation + +See the [**nvf** Manual](https://notashelf.github.io/nvf/) for +detailed installation guides, configurations, available options, release notes +and more. Tips for installing userspace plugins is also contained in the +documentation. + +If you want to dive right into trying **nvf** you can get a fully +featured configuration with `nix` language support by running: + +```console +nix run github:notashelf/nvf#nix +``` + +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. + +## 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. + +## FAQ + +**Q**: Can you add _X_? +
+**A**: Maybe! It is not one of our goals to support each and every Neovim +plugin, however, I am always open to new modules and plugin setup additions +to **nvf**. Use the [appropritate issue +template](https://github.com/NotAShelf/nvf/issues/new/choose) and I will +consider a module addition. + +**Q**: A plugin I need is not available in **nvf**. What to do? +
+**A**: **nvf** exposes several APIs for you to be able to add your own +plugin configurations! Please see the documentation on how you may do +this. + +## Credits + +### Contributors + +Special thanks to + +- [@fufexan](https://github.com/fufexan) - For the transition to flake-parts +- [@FlafyDev](https://github.com/FlafyDev) - For getting the home-manager to work +- [@n3oney](https://github.com/n3oney) - For making custom keybinds finally possible +- [@horriblename](https://github.com/horriblename) - For actively implementing planned features and quality of life updates +- [@Yavko](https://github.com/Yavko) - For the amazing **nvf** logo +- [@FrothyMarrow](https://github.com/FrothyMarrow) - For seeing mistakes that I could not + +and everyone who has submitted issues or pull requests! + +### Inspiration + +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. +
+ +## License + +Following the [original neovim-flake](https://github.com/jordanisaacs/neovim-flake) +**nvf** has been made available under the **MIT License**. However, all assets +are published under the [CC BY License]. + +--- + +
+ Back to the Top +
diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8ca4ed01..162fed05 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,11 @@ version: 2 updates: - package-ecosystem: github-actions - open-pull-requests-limit: 15 directory: "/" schedule: interval: daily + open-pull-requests-limit: 15 + reviewers: + - NotAShelf + assignees: + - NotAShelf diff --git a/.github/labels.yml b/.github/labels.yml deleted file mode 100644 index 34c3bf2c..00000000 --- a/.github/labels.yml +++ /dev/null @@ -1,55 +0,0 @@ -# This file is used by .github/workflows/labels.yml -"topic: plugins": - - any: - - changed-files: - - any-glob-to-any-file: - - modules/plugins/**/* - -"topic: modules": - - any: - - changed-files: - - any-glob-to-any-file: - - modules/**/* - -"topic: dependencies": - - any: - - changed-files: - - any-glob-to-any-file: - - npins - - flake.lock - -"topic: CI": - - any: - - changed-files: - - any-glob-to-any-file: - - .github/workflows/*.yml - - .github/typos.toml - - .github/dependabot.yml - -"topic: meta": - - any: - - changed-files: - - any-glob-to-any-file: - - .github/CODEOWNERS - - LICENSE - - .github/README.md - - .github/funding.yml - - .github/assets - - .github/*_TEMPLATE - - .gitignore - - .editorconfig - - release.json - -"topic: documentation": - - any: - - changed-files: - - any-glob-to-any-file: - - docs/**/* - - .github/CONTRIBUTING.md - - .github/README.md -"topic: packaging": - - any: - - changed-files: - - any-glob-to-any-file: - - flake.nix - - flake/packages.nix diff --git a/.github/typos.toml b/.github/typos.toml deleted file mode 100644 index 25d5c0e1..00000000 --- a/.github/typos.toml +++ /dev/null @@ -1,14 +0,0 @@ - -files.extend-exclude = ["npins/sources.json"] -default.extend-ignore-words-re = [ - "(?i)(noice)", - "befores", - "annote", - "viw", - "typ", - "edn", - "esy", - "BA", # somehow "BANanaD3V" is valid, but BA is not... - "Emac" -] - diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml deleted file mode 100644 index cb2927e4..00000000 --- a/.github/workflows/backport.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Backport PR on Label - -on: - pull_request_target: - types: - - labeled - -# Permissions needed for the korthout/backport-action to create branches and PRs -permissions: - contents: write - pull-requests: write - -jobs: - backport: - name: Create Backport PR - runs-on: ubuntu-latest - if: | - github.event.pull_request.merged == true && startsWith(github.event.label.name, 'backport-') - steps: - - uses: actions/checkout@v6 - with: - ref: ${{ github.event.pull_request.head.sha }} - token: ${{ steps.app-token.outputs.token }} - - - name: Backport Action - uses: korthout/backport-action@v3 - with: - # Regex pattern for labels that should trigger a backport AND extracts the target branch - # from the name (e.g. v0.x or v0.x.y; we use zerover). This action will ONLY proceed if - # the label that triggered the workflow fully matches this pattern. - # Example matching labels: "backport-v0.1", "backport-v0.10.1" - # Example non-matching labels: "backport-foo", "backport-v1.0" - label_pattern: '^backport-(v0\.\d+(\.\d+)?)$' diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index 88768ee9..5ecf45a0 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -19,20 +19,26 @@ jobs: package: - default - nix + - tidal - maximal steps: - - uses: actions/checkout@v6 + - uses: easimon/maximize-build-space@v10 + name: Maximize build space + with: + overprovision-lvm: true + remove-android: true + remove-dotnet: true + remove-haskell: true + remove-codeql: true + + - uses: actions/checkout@v4 name: Checkout - name: Install Nix - uses: cachix/install-nix-action@v31.8.4 - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - substituters = https://cache.nixos.org/ https://feel-co.cachix.org - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w= + uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main - - uses: cachix/cachix-action@v16 + - uses: cachix/cachix-action@v14 with: authToken: ${{ secrets.CACHIX_TOKEN }} extraPullNames: nix-community diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml new file mode 100644 index 00000000..9a651962 --- /dev/null +++ b/.github/workflows/check-docs.yml @@ -0,0 +1,51 @@ +name: "Validate flake & check documentation" +on: + pull_request: + workflow_dispatch: + push: + branches: + - main + paths: + - docs/** +jobs: + flake-docs-check: + name: Validate Flake Documentation + runs-on: ubuntu-latest + strategy: + matrix: + package: + - docs + - docs-html + - docs-manpages + - docs-json + steps: + - uses: easimon/maximize-build-space@v10 + with: + overprovision-lvm: true + remove-android: true + remove-dotnet: true + remove-haskell: true + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + + - uses: actions/checkout@v4 + name: Checkout + + - name: Set default git branch (to reduce log spam) + run: git config --global init.defaultBranch main + + - name: Build documentation packages + run: nix build .#${{ matrix.package }} --print-build-logs + + - name: Get current date + id: get-date + # output format: 2023-12-22-120000 + run: echo "date=$(date +'%Y-%m-%d-%H%M%S')" >> ${GITHUB_OUTPUT} + + - name: Upload doc artifacts + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.package }}" + path: result/share/doc/neovim-flake/ diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 78671a88..8101b8b1 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,6 +1,4 @@ -name: "Treewide Checks" -permissions: read-all - +name: "Validate flake & check formatting" on: pull_request: workflow_dispatch: @@ -8,177 +6,33 @@ on: branches: - main paths-ignore: + - .github/** - assets/** - + - .gitignore jobs: nix-flake-check: - name: "Validate flake" + name: Validate Flake runs-on: ubuntu-latest - if: "!contains(github.event.pull_request.title, '[skip ci]')" steps: - name: Checkout - uses: actions/checkout@v6 - - uses: cachix/install-nix-action@v31.8.4 - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - substituters = https://cache.nixos.org/ https://feel-co.cachix.org - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w= + uses: actions/checkout@v4 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main - name: Check Flake run: nix flake check format-with-alejandra: - name: "Check formatting" + name: Formatting via Alejandra runs-on: ubuntu-latest - if: "!contains(github.event.pull_request.title, '[skip ci]')" steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@v31.8.4 - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - substituters = https://cache.nixos.org/ https://feel-co.cachix.org - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w= + uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main - - name: Check formatting via Alejandra - run: nix run nixpkgs#alejandra -- --check . --exclude npins - - - name: Check formatting via Deno - run: nix run nixpkgs#deno -- fmt --check --ext md **/*.md - - - if: ${{ failure() }} - shell: bash - run: | - echo "::error:: Current codebase contains formatting errors that were caught by the CI!" - echo "Please ensure that all Nix code is formatted with Alejandra, and Markdown with `deno fmt" - echo "[skip ci] label may be added to the PR title if this is a one-time issue and is safe to ignore" - exit 1 - - check-typos: - name: "Check source tree for typos" - runs-on: ubuntu-latest - if: "!contains(github.event.pull_request.title, '[skip ci]')" - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Check for typos - uses: crate-ci/typos@master - with: - config: .github/typos.toml - - - if: ${{ failure() }} - shell: bash - run: | - echo "::error:: Current codebase contains typos that were caught by the CI!" - echo "If those typos were intentional, please add them to the ignored regexes in .github/typos.toml" - echo "[skip ci] label may be added to the PR title if this is a one-time issue and is safe to ignore" - exit 1 - - flake-docs-check: - name: "Validate documentation builds" - runs-on: ubuntu-latest - if: "!contains(github.event.pull_request.title, '[skip ci]')" - strategy: - matrix: - package: - - docs - - docs-html - - docs-manpages - - docs-json - steps: - - name: Checkout - uses: actions/checkout@v6 - - uses: cachix/install-nix-action@v31.8.4 - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - substituters = https://cache.nixos.org/ https://feel-co.cachix.org - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w= - - - name: Set default git branch (to reduce log spam) - run: git config --global init.defaultBranch main - - - name: Build documentation packages - run: nix build .#${{ matrix.package }} --print-build-logs - - - name: Get current date - id: get-date - # output format: 2023-12-22-120000 - run: echo "date=$(date +'%Y-%m-%d-%H%M%S')" >> ${GITHUB_OUTPUT} - - - name: Upload doc artifacts - uses: actions/upload-artifact@v5 - with: - name: "${{ matrix.package }}" - path: result/share/doc/nvf - - flake-docs-linkcheck: - name: "Validate hyperlinks in documentation sources" - runs-on: ubuntu-latest - if: false # disabled until we fix ndg docs - steps: - - name: Checkout - uses: actions/checkout@v6 - - uses: cachix/install-nix-action@v31.8.4 - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - substituters = https://cache.nixos.org/ https://feel-co.cachix.org - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w= - - - name: Build linkcheck package - run: nix build .#docs-linkcheck -Lv - - check-editorconfig: - name: "Validate Editorconfig conformance" - runs-on: ubuntu-latest - if: "!contains(github.event.pull_request.title, '[skip ci]')" - steps: - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 2 # slows down checkout, but we need to compare against the previous commit on push events - - - name: Get list of changed files from PR - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - shell: bash - run: | - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - gh api repos/${{ github.repository }}/pulls/${{ github.event.number }}/files --paginate \ - | jq -r '.[] | select(.status != "removed") | .filename' \ - > "$HOME/changed_files" - else - git diff --name-only HEAD^ > "$HOME/changed_files" - fi - - - name: Print list of changed files - run: | - cat "$HOME/changed_files" - - - name: Install Nix - uses: cachix/install-nix-action@v31.8.4 - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - substituters = https://cache.nixos.org/ https://feel-co.cachix.org - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w= - - - name: Checking Editorconfig conformance - shell: bash - run: | - < "$HOME/changed_files" nix-shell -p editorconfig-checker \ - --run 'xargs -r editorconfig-checker -disable-indent-size --exclude flake.lock' - - - if: ${{ failure() }} - shell: bash - run: | - echo "::error:: Current formatting does not fit convention provided by .editorconfig located in the project root." - echo "Please make sure your editor properly integrates editorconfig, Neovim does so by default." - echo "See https://editorconfig.org/#download on how to integrate Editorconfig to your editor." - exit 1 + - run: nix run nixpkgs#alejandra -- -c . diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml deleted file mode 100644 index ec153088..00000000 --- a/.github/workflows/cleanup.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Delete Stale Branches -permissions: - contents: write - -on: - workflow_dispatch: - schedule: - - cron: "0 4 1 * *" # 4AM on 1st of every month - - cron: "0 4 15 * *" # 4AM on the 15th of every month - -jobs: - branches: - name: Cleanup old branches - runs-on: ubuntu-latest - steps: - - name: "Checkout" - uses: actions/checkout@v6 - - - name: "Delete old branches" - uses: beatlabs/delete-old-branches-action@v0.0.11 - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - date: "1 months ago" - dry_run: false - delete_tags: false - exclude_open_pr_branches: true diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..1edfb05c --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,50 @@ +name: "Publish Docker Image" +on: + workflow_dispatch: + push: + tags: ["v*"] + +jobs: + build-docker-image: + name: "Build Docker Image" + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + - name: Magic Nix Cache + uses: DeterminateSystems/magic-nix-cache-action@main + + - name: Build Docker Image + run: nix build .#docker-nix --print-build-logs + + - name: Load & Tag Built Docker Image + run: | + docker load -i result && + docker tag neovim-flake:latest notashelf/neovim-flake:latest + + - name: Log into DockerHub + uses: docker/login-action@master + with: + username: notashelf + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} + + - name: Push to DockerHub + run: docker push notashelf/neovim-flake:latest + + - name: Log into ghcr + uses: docker/login-action@master + with: + registry: "ghcr.io" + username: "${{ github.actor }}" + password: "${{ secrets.GITHUB_TOKEN }}" + + - name: Publish Docker Image (Github Packages) + run: docker push notashelf/neovim-flake:latest diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml deleted file mode 100644 index 74fd4b34..00000000 --- a/.github/workflows/docs-preview.yml +++ /dev/null @@ -1,186 +0,0 @@ -name: Build and Preview Manual - -on: - workflow_dispatch: - pull_request_target: - types: [opened, synchronize, reopened, closed] - paths: - - ".github/workflows/docs-preview.yml" - - "modules/**" - - "docs/**" - -# Defining permissions here passes it to all jobs. -# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token -permissions: - contents: write - pull-requests: write - issues: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build-preview: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: cachix/install-nix-action@v31.8.4 - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - substituters = https://cache.nixos.org/ https://feel-co.cachix.org - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w= - - - name: Set default git branch (to reduce log spam) - run: git config --global init.defaultBranch main - - - name: Build documentation packages - run: nix build .#docs-html --print-build-logs || exit 1 - - - name: Deploy to GitHub Pages preview - run: | - PR_NUMBER=${{ github.event.pull_request.number }} - BRANCH_NAME="gh-pages" - PREVIEW_DIR="docs-preview-${PR_NUMBER}" - - # Clone the gh-pages branch and move to the preview subdirectory - git clone --single-branch --branch $BRANCH_NAME https://github.com/${{ github.repository }} gh-pages - cd gh-pages - - mkdir -p $PREVIEW_DIR - - # Copy the build files to the preview subdirectory - cp -rvf ../result/share/doc/* ./$PREVIEW_DIR - - # Configure git to use the GitHub Actions token for authentication - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" - - # Set the GitHub token for authentication - git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} - - # Add and commit the changes - git add --all - git commit -m "Deploy PR #${PR_NUMBER} preview" || echo "No changes to commit" - git push --force origin $BRANCH_NAME - - comment-url: - needs: build-preview - runs-on: ubuntu-latest - steps: - - name: Prepare Environment - id: prelude - run: | - PR_NUMBER=${{ github.event.pull_request.number }} - URL="https://${{ github.repository_owner }}.github.io/nvf/docs-preview-${PR_NUMBER}/" - - # Propagate non-interpolatable environment vars - echo "URL=$URL" >> "$GITHUB_OUTPUT" - echo "REV=$GITHUB_SHA" >> "$GITHUB_OUTPUT" - echo "ACTOR=$GITHUB_ACTOR" >> "$GITHUB_OUTPUT" - echo "REF=$GITHUB_HEAD_REF" >> "$GITHUB_OUTPUT" - echo "RUNS=$GITHUB_RUN_NUMBER" >> "$GITHUB_OUTPUT" - - echo "Live Preview URL: $URL" - echo "Rev: $GITHUB_SHA" - echo "Actor: $GITHUB_ACTOR" - echo "Ref: "$GITHUB_HEAD_REF" - echo "Reruns: "$GITHUB_RUN_NUMBER" - - echo "### :rocket: Live Preview Deployed " >> "$GITHUB_STEP_SUMMARY" - echo "Preview can be found at ${URL}" >> "$GITHUB_STEP_SUMMARY" - - - name: Find Comment - uses: peter-evans/find-comment@v4 - id: fc - with: - comment-author: "github-actions[bot]" - issue-number: ${{ github.event.pull_request.number }} - body-includes: "Live preview deployed" - - - name: Post live preview comment - uses: peter-evans/create-or-update-comment@v5 - env: - COMMENT_ID: ${{ steps.fc.outputs.comment-id }} - URL: ${{ steps.prelude.outputs.URL }} - GITHUB_SHA: ${{ steps.prelude.outputs.REV }} - ACTOR: ${{ steps.prelude.outputs.ACTOR }} - REF: ${{ steps.prelude.outputs.REF }} - RUNS: ${{ steps.prelude.outputs.RUNS }} - with: - comment-id: ${{ env.COMMENT_ID }} - issue-number: ${{ github.event.pull_request.number }} # issue number also applies to pull requests - edit-mode: replace # replace previous body - body: | - ### :rocket: Live preview deployed from ${{ env.GITHUB_SHA }} - - View it [here](${{ env.URL }}): - -
- Debug Information -

Triggered by: ${{ env.ACTOR }}

-

HEAD at: ${{ env.REF }}

-

Reruns: ${{ env.RUNS }}

-
- - cleanup: - if: ${{ github.event.pull_request.merged == true || github.event.pull_request.state == 'closed' }} - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Delete preview for closed/merged PR - run: | - PR_NUMBER=${{ github.event.pull_request.number }} - BRANCH_NAME="gh-pages" - PREVIEW_DIR="docs-preview-${PR_NUMBER}" - - # Clone the gh-pages branch - git clone --single-branch --branch $BRANCH_NAME https://github.com/${{ github.repository }} gh-pages - cd gh-pages - - # Check if the preview directory exists, and delete it if it does - if [ -d "$PREVIEW_DIR" ]; then - echo "Deleting preview directory $PREVIEW_DIR" - rm -rf $PREVIEW_DIR - else - echo "Preview directory $PREVIEW_DIR does not exist. Skipping deletion." - fi - - # Configure git to use the GitHub Actions token for authentication - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" - - # Set the GitHub token for authentication - git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} - - # Add and commit the changes (only if there's something to delete) - git add . - git diff --quiet || git commit -m "Remove preview for PR #${PR_NUMBER}" - git push origin $BRANCH_NAME - - cleanup-comment: - needs: cleanup - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Double check preview directory deletion - run: | - # Check if the preview directory exists, and delete it if it does - if [ -d "docs-preview-${{ github.event.pull_request.number }}" ]; then - echo "Something went wrong, preview directory is not deleted." - exit 1 - else - echo "Preview directory has been deleted successfully, proceeding." - fi - - - name: Post cleanup verification - uses: peter-evans/create-or-update-comment@v5 - with: - issue-number: ${{ github.event.pull_request.number }} - body: | - ✅ Preview has been deleted successfully! diff --git a/.github/workflows/editorconfig.yml b/.github/workflows/editorconfig.yml new file mode 100644 index 00000000..68176c7f --- /dev/null +++ b/.github/workflows/editorconfig.yml @@ -0,0 +1,47 @@ +name: "Check validity of .editorconfig" + +permissions: read-all + +on: + pull_request: + +jobs: + check-editorconfig: + runs-on: ubuntu-latest + if: "!contains(github.event.pull_request.title, '[skip ci]')" + steps: + - name: Get list of changed files from PR + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh api \ + repos/notashelf/neovim-flake/pulls/${{github.event.number}}/files --paginate \ + | jq '.[] | select(.status != "removed") | .filename' \ + > "$HOME/changed_files" + + - name: Print list of changed files + run: | + cat "$HOME/changed_files" + + - name: Checkout + uses: actions/checkout@v4 + with: + ref: refs/pull/${{ github.event.pull_request.number }}/merge + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + + - name: Checking EditorConfig + shell: bash + run: | + cat "$HOME/changed_files" | nix-shell -p editorconfig-checker.out --run 'xargs -r editorconfig-checker -disable-indentation -exclude flake.lock --verbose' + echo -n "Check status: $?" + + - name: Fail Gracefully + if: ${{ failure() }} + shell: bash + run: | + echo "::error:: Current formatting does not fit convention provided by .editorconfig located in the project root." + echo "Please make sure your editor properly integrates editorconfig. See https://editorconfig.org/#download for more." + exit 1 diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml deleted file mode 100644 index b24c00aa..00000000 --- a/.github/workflows/labeler.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Label PR" - -on: - pull_request_target: - types: [edited, opened, synchronize, reopened] - -permissions: - contents: read - pull-requests: write - -jobs: - labels: - name: "Label PR" - runs-on: ubuntu-latest - if: "!contains(github.event.pull_request.title, '[skip ci]')" - steps: - - uses: actions/labeler@v6 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - configuration-path: .github/labels.yml - sync-labels: true diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 9a8b690f..855ee9c4 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -1,5 +1,4 @@ name: "Build and deploy documentation" - on: workflow_dispatch: push: @@ -8,7 +7,6 @@ on: paths: # build the manuals only when docs directory is updated - docs/** - - modules/** # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: @@ -22,40 +20,23 @@ concurrency: cancel-in-progress: true jobs: - check_date: - runs-on: ubuntu-latest - name: Check latest commit - outputs: - should_run: ${{ steps.should_run.outputs.should_run }} - steps: - - uses: actions/checkout@v6 - - name: print latest_commit - run: echo ${{ github.sha }} - - - id: should_run - continue-on-error: true - name: check latest commit is less than a day - if: ${{ github.event_name == 'schedule' }} - run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" - publish: - needs: check_date - if: ${{ needs.check_date.outputs.should_run != 'false' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - - uses: cachix/install-nix-action@v31.8.4 - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - substituters = https://cache.nixos.org/ https://feel-co.cachix.org - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w= + - name: Checkout + uses: actions/checkout@v4 - - run: | - nix build .#docs -Lv - cp -r result/share/doc public + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main - - uses: peaceiris/actions-gh-pages@v4 + - name: Build + run: | + nix build '.#docs' + cp -r result/share/doc/neovim-flake public + + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./public diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml deleted file mode 100644 index f1c5cc4b..00000000 --- a/.github/workflows/update.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Weekly Dependency Updates -on: - workflow_dispatch: - schedule: - # 8 PM UTC every Friday - - cron: '0 20 * * 5' -jobs: - update-dependencies: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: "Install Nix" - uses: cachix/install-nix-action@v31.9.0 - - - name: Set up Git - run: | - git config user.name "GitHub Actions Bot" - git config user.email "actions@github.com" - - - name: Create branch for updates - run: | - DATE=$(date +%Y-%m-%d) - BRANCH_NAME="update/dependencies-$DATE" - git checkout -b $BRANCH_NAME - echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV - - - name: Update npins - run: nix run nixpkgs#npins update - - # Only update Nixpkgs. mnw might break on update, better to track it manually to avoid - # unexpected breakage. - - name: Update nixpkgs - run: nix flake update nixpkgs - - - name: Check for changes - id: check_changes - run: | - if git diff --quiet; then - echo "No changes detected" - echo "changes_detected=false" >> "$GITHUB_OUTPUT" - exit 0 - else - echo "Changes detected" - echo "changes_detected=true" >> "$GITHUB_OUTPUT" - fi - - # FIXME: Worth adding additional checks for, e.g., fragile plugins - # or modules - # nix build .#checks.. - # We'll probably want to handle this with machine tests - - name: Verify changes - if: steps.check_changes.outputs.changes_detected == 'true' - run: | - # Run verification tests to ensure updates don't break anything - nix flake check - - - - name: Set date variable - run: echo "DATE=$(date +%Y-%m-%d)" >> "$GITHUB_ENV" - - - name: Commit and push changes - if: steps.check_changes.outputs.changes_detected == 'true' - run: | - git add . - git commit -m "pins: bump all plugins (${{ env.DATE }})" - git push -u origin $BRANCH_NAME - - - name: Create Pull Request - if: steps.check_changes.outputs.changes_detected == 'true' - uses: peter-evans/create-pull-request@v8 - with: - branch: ${{ env.BRANCH_NAME }} - base: main - labels: dependencies,automated pr - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: "npins: bump all plugins (${{ env.DATE }})" - title: "Weekly Dependency Updates: ${{ env.DATE }}" - body: | - > [!NOTE] - > This PR was automatically generated by the Weekly Dependency Updates workflow. Please wait - > for all CI steps to complete, and test any major changes personally. - - Updates Performed: - - - Updated dependencies using `npins update` - - Updated nixpkgs using `nix flake update nixpkgs` - - If the verification steps have passed, updates should be safe to merge. For failing CI steps - submit a Pull Request targetting ${{ env.BRANCH_NAME }} diff --git a/README.md b/README.md deleted file mode 100644 index 7786636a..00000000 --- a/README.md +++ /dev/null @@ -1,334 +0,0 @@ - -
- nvf Logo -
-

nvf

-
- - - -

- -

- - - ---- - -

- -[Features]: #features -[Get Started]: #get-started -[Documentation]: #documentation -[Help]: #getting-help -[Contribute]: #contributing -[FAQ]: #frequently-asked-questions -[Credits]: #credits - -**[
 Features
][Features]** -**[
 Get Started 
][Get Started]** -**[
 Documentation 
][Documentation]** -**[
 Help 
][Help]** -**[
 Contribute 
][Contribute]** -**[
 FAQ 
][FAQ]** **[
 Credits 
][Credits]** - -

- ---- - -## Features - -[standalone]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-installation -[NixOS module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-nixos -[Home-Manager module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-hm -[release notes]: https://notashelf.github.io/nvf/release-notes.html -[discussions tab]: https://github.com/notashelf/nvf/discussions -[FAQ section]: #frequently-asked-questions -[DAG]: https://en.wikipedia.org/wiki/Directed_acyclic_graph - -- **Simple**: One language to rule them all! Use Nix to configure everything, - with optional Lua support for robust configurability! -- **Reproducible**: Your configuration will behave the same _anywhere_. No - surprises, promise! -- **Portable**: nvf depends _solely_ on your Nix store, and nothing else. No - more global binaries! Works on all platforms, without hassle. - - Options to install [standalone], [NixOS module] or [Home-Manager module]. -- **Customizable**: There are _almost no defaults_ to annoy you. nvf is fully - customizable through the Nix module system. - - Not comfortable with a full-nix config or want to bring your Lua config? You - can do just that, no unnecessary restrictions. - - Lazyloading? We got it! Lazyload both internal and external plugins at will - 💤 . - - nvf allows _ordering configuration bits_ using [DAG] (_Directed acyclic - graph_)s. It has never been easier to construct an editor configuration - deterministically! - - nvf exposes everything you need to avoid a vendor lock-in. Which means you - can add new modules, plugins and so on without relying on us adding a module - for them! Though, of course, feel free to request them. - - Use plugins from anywhere: inputs, npins, nixpkgs... You name it. - - Add your own modules with ease. It's all built-in! -- **Well-documented**: Documentation is priority. You will _never_ face - undocumented, obscure behaviour. - - Any and all changes, breaking or otherwise, will be communicated in the - [release notes]. - - Refer to the [FAQ section] for answers to common questions. - - Your question not there? Head to the [discussions tab]! -- **Idiomatic**: nvf does things ✨ _the right way_ ✨ - the codebase is, and - will, remain maintainable for myself and any contributors. -- **Community-Led**: we would like nvf to be fully capable of accomplishing what - you really want it to do. If you have a use case that is not made possible by - nvf, please open an issue (or a pull request!) - - Your feedback is more than welcome! Feedback is what _drives_ nvf forward. - If you have anything to say, or ask, please let us know. - - Pull requests are _always_ welcome. If you think the project can benefit - from something you did locally, but are not quite sure how to upstream, - please feel free to contact us! We'll help you get it done. - -## Get Started - -[nvf manual]: https://notashelf.github.io/nvf/ -[issue tracker]: https://github.com/NotAShelf/nvf/issues - -If you are not sold on the concepts of **nvf**, and would like to try out the -default configuration before even _thinking about_ installing it, you may run -the following in order to take **nvf** out for a spin. - -```bash -# Run the default package -$ nix run github:notashelf/nvf -``` - -This will get you a feel for the base configuration and UI design. Though, none -of the configuration options are final as **nvf** is designed to be modular and -configurable. - -> [!TIP] -> The flake exposes `nix` as the default package, which will be evaluated when -> you run `nix build` or `nix run` on this repo. It is minimal, and providing -> limited language support and various utilities. We also expose the `maximal` -> package, which you may choose to build if you'd like to see more of nvf's -> built-in modules. Please keep in mind that those are demo packages, nvf does -> not ship a default configuration if installed as a NixOS/Home-Manager module -> or via standalone method. - -It is as simple as changing the target output in your `nix run` command to get a -different configuration. For example, to get a configuration with large language -coverage, run: - -```bash -# Run the maximal package -$ nix run github:notashelf/nvf#maximal -``` - -Similar instructions will apply for `nix profile install`. However, you are -recommended to instead use the module system as described in the [nvf manual]. - -> [!NOTE] -> The `maximal` configuration is quite large, and might take a while to build. -> To get a feel for the configuration, use the default `nix` configuration. -> Should you choose to try out the `maximal` configuration, using the binary -> cache as described in the manual is _strongly_ recommended. - -If you are convinced, proceed to the next section to view the installation -instructions. - -## Documentation - -**nvf** prides itself in its rich, intuitive documentation. The chapter below -covers several methods through which you can install **nvf**. If you believe -something is missing, or could be done better, please feel free to contact us! - -### Installation - -The _recommended_ way of installing nvf is using either the NixOS or the -Home-Manager module, though it is completely possible and no less supported to -install **nvf** as a standalone package, or a flake output. - -See the rendered [nvf manual] for detailed and up-to-date installation guides, -configurations, available options, release notes and more. Tips for installing -userspace plugins are also contained in the documentation. - -> [!TIP] -> While using NixOS or Home-Manager modules, -> `programs.nvf.enableManpages = true;` will allow you to view option -> documentation from the comfort of your terminal via `man 5 nvf`. The more you -> know. - -Please create an issue on the [issue tracker] if you find the documentation -lacking or confusing. Any improvements to the documentation through pull -requests are also welcome, and appreciated. - -## Getting Help - -If you are confused, stuck or would like to ask a simple question; you may -create an issue on the [issue tracker] to ask questions or report bugs. - -We are not yet on spaces like matrix or IRC, so please use the issue tracker for -now. The [discussions tab] can also be a place to request help from community -members, or engage in productive discussion with the maintainers. - -## Contributing - -[contributing guide]: .github/CONTRIBUTING.md - -I am always looking for new ways to help improve this flake. If you would like -to contribute, please read the [contributing guide] before submitting a pull -request. You can also create an issue on the [issue tracker] before submitting a -pull request if you would like to discuss a feature or bug fix. - -## Frequently Asked Questions - -[issue template]: https://github.com/NotAShelf/nvf/issues/new/choose -[list of branches]: https://github.com/NotAShelf/nvf/branches -[list of open pull requests]: https://github.com/NotAShelf/nvf/pulls - -**Q**: What platforms are supported? - -**A**: nvf actively supports **Linux and Darwin** platforms using standalone -Nix, NixOS or Home-Manager. It has been reported that **Android** is also -supported through the Home-Manager module, or using standalone package. Please -take a look at the [nvf manual] for available installation instructions. - -**Q**: Can you add _X_? - -**A**: Maybe! It is not one of our goals to support each and every Neovim -plugin, however, I am always open to new modules and plugin setup additions to -**nvf**. Use the appropriate [issue template] and I will consider a module -addition. As mentioned before, pull requests to add new features are also -welcome. - -**Q**: A plugin I need is not available in **nvf**. What to do? - -**A**: **nvf** exposes several APIs for you to be able to add your own plugin -configurations! Please see the documentation on how you may do this. - -**Q**: Main branch is awfully silent, is the project dead? - -**A**: No! Sometimes we branch out (e.g. `v0.6`) to avoid breaking userspace and -work in a separate branch until we make sure the new additions are implemented -in the most comfortable way possible for the end user. If you have not noticed -any activity on the main branch, consider taking a look at the -[list of branches] or the [list of open pull requests]. You may also consider -_testing_ those release branches to get access to new features ahead of time and -better prepare for breaking changes. - -**Q**: Will you support non-flake installations? - -**A**: Quite possibly. **nvf** started as "neovim-flake", which does mean it is -and will remain flakes-first but we might consider non-flakes compatibility. -Though keep in mind that **nvf** under non-flake environments would lose -customizability of plugin inputs, which is one of our primary features. - -**Q**: I prefer working with Lua, can I use nvf as a plugin manager while I use -an imperative path (e.g., `~/.config/nvim`) for my Neovim configuration instead -of a configuration generated from Nix? - -**A**: Yes! Add `"~/.config/nvim"` to `vim.additionalRuntimePaths = [ ... ]` and -any plugins you want to load to `vim.startPlugins`. This will load your -configuration from `~/.config/nvim`. You may still use `vim.*` options in Nix to -further configure Neovim. - -## Credits - -### Co-Maintainers - -Alongside [myself](https://github.com/notashelf), nvf is developed by those -talented folk. **nvf** would not be what it is today without their invaluable -contributions. - -- [**@horriblename**](https://github.com/horriblename) - ([Liberapay](https://liberapay.com/horriblename/)) - For actively implementing - planned features and quality of life updates. -- [**@Soliprem**](https://github.com/soliprem) - For rigorously implementing - missing features and excellent work on new language modules. - -Please do remember to extend your thanks (financially or otherwise) if this -project has been helpful to you. - -### Contributors - -[mnw]: https://github.com/gerg-l/mnw - -nvf would not be what it is today without the awesome people below. Special, -heart-felt thanks to - -- [**@fufexan**](https://github.com/fufexan) - For the transition to flake-parts - and invaluable Nix assistance. -- [**@FlafyDev**](https://github.com/FlafyDev) - For getting Home-Manager module - to work and Nix assistance. -- [**@n3oney**](https://github.com/n3oney) - For making custom keybinds finally - possible, great ideas and module additions. -- [**@Yavko**](https://github.com/Yavko) - For the amazing **nvf** logo -- [**@FrothyMarrow**](https://github.com/FrothyMarrow) - For seeing mistakes - that I could not and contributing good ideas & code. -- [**@Gerg-l**](https://github.com/gerg-l) 🐸 - For the modern Neovim wrapper, - [mnw], and occasional improvements to the codebase. -- [**@Diniamo**](https://github.com/Diniamo) - For actively submitting pull - requests, issues and assistance with co-maintenance of nvf. - -and everyone who has submitted issues or pull requests! - -### Inspiration - -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. -- [@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. -- [@sioodmy's](https://github.com/sioodmy) - [dotfiles](https://github.com/sioodmy/dotfiles) that inspired the design - choices for UI and plugin defaults. - -I am grateful for their previous work and inspiration, and I wholeheartedly -recommend checking their work out. - -## License - -Following the license of -[the original neovim-flake](https://github.com/jordanisaacs/neovim-flake), nvf -has been made available under the [**MIT License**](LICENSE). However, all -assets and documentation are published under the -[**CC BY License**](https://github.com/NotAShelf/nvf/blob/main/.github/assets/LICENSE) -under explicit permission by the author or authors. - -
Yes, this includes the logo work too. Stop taking artwork that is not yours!
- ---- - - diff --git a/configuration.nix b/configuration.nix index cc314288..95320467 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,280 +1,255 @@ -# This is the sample configuration for nvf, aiming to give you a feel of the default options -# while certain plugins are enabled. While it may partially act as one, this is *not* quite -# an overview of nvf's module options. To find a complete and curated list of nvf module -# options, examples, instruction tutorials and more; please visit the online manual. -# https://notashelf.github.io/nvf/options.html -isMaximal: { - config.vim = { - viAlias = true; - vimAlias = true; - debugMode = { - enable = false; - level = 16; - logFile = "/tmp/nvim.log"; +inputs: let + modulesWithInputs = import ./modules inputs; + + neovimConfiguration = { + modules ? [], + pkgs, + lib ? pkgs.lib, + check ? true, + extraSpecialArgs ? {}, + extraModules ? [], + ... + }: + modulesWithInputs { + inherit pkgs lib check extraSpecialArgs extraModules; + configuration.imports = modules; }; - spellcheck = { - enable = true; - programmingWordlist.enable = isMaximal; - }; + tidalConfig = { + config.vim.languages.tidal.enable = true; + }; - lsp = { - # This must be enabled for the language modules to hook into - # the LSP API. - enable = true; - - formatOnSave = true; - lspkind.enable = false; - lightbulb.enable = true; - lspsaga.enable = false; - trouble.enable = true; - lspSignature.enable = !isMaximal; # conflicts with blink in maximal - otter-nvim.enable = isMaximal; - nvim-docs-view.enable = isMaximal; - harper-ls.enable = isMaximal; - }; - - debugger = { - nvim-dap = { - enable = true; - ui.enable = true; + mainConfig = isMaximal: { + config.vim = { + viAlias = true; + vimAlias = true; + debugMode = { + enable = false; + level = 16; + logFile = "/tmp/nvim.log"; }; - }; - # This section does not include a comprehensive list of available language modules. - # To list all available language module options, please visit the nvf manual. - languages = { - enableFormat = true; - enableTreesitter = true; - enableExtraDiagnostics = true; - - # Languages that will be supported in default and maximal configurations. - nix.enable = true; - markdown.enable = true; - - # Languages that are enabled in the maximal configuration. - bash.enable = isMaximal; - clang.enable = isMaximal; - css.enable = isMaximal; - html.enable = isMaximal; - json.enable = isMaximal; - sql.enable = isMaximal; - java.enable = isMaximal; - kotlin.enable = isMaximal; - ts.enable = isMaximal; - go.enable = isMaximal; - lua.enable = isMaximal; - zig.enable = isMaximal; - python.enable = isMaximal; - typst.enable = isMaximal; - rust = { + spellcheck = { enable = isMaximal; - extensions.crates-nvim.enable = isMaximal; }; - # Language modules that are not as common. - assembly.enable = false; - astro.enable = false; - nu.enable = false; - csharp.enable = false; - julia.enable = false; - vala.enable = false; - scala.enable = false; - r.enable = false; - gleam.enable = false; - dart.enable = false; - ocaml.enable = false; - elixir.enable = false; - haskell.enable = false; - hcl.enable = false; - ruby.enable = false; - fsharp.enable = false; - just.enable = false; - qml.enable = false; - - tailwind.enable = false; - svelte.enable = false; - - # Nim LSP is broken on Darwin and therefore - # should be disabled by default. Users may still enable - # `vim.languages.vim` to enable it, this does not restrict - # that. - # See: - nim.enable = false; - }; - - visuals = { - nvim-scrollbar.enable = isMaximal; - nvim-web-devicons.enable = true; - nvim-cursorline.enable = true; - cinnamon-nvim.enable = true; - fidget-nvim.enable = true; - - highlight-undo.enable = true; - indent-blankline.enable = true; - - # Fun - cellular-automaton.enable = false; - }; - - statusline = { - lualine = { - enable = true; - theme = "catppuccin"; + lsp = { + formatOnSave = true; + lspkind.enable = false; + lightbulb.enable = true; + lspsaga.enable = false; + nvimCodeActionMenu.enable = isMaximal; + trouble.enable = true; + lspSignature.enable = true; + lsplines.enable = isMaximal; + nvim-docs-view.enable = isMaximal; }; - }; - theme = { - enable = true; - name = "catppuccin"; - style = "mocha"; - transparent = false; - }; - - autopairs.nvim-autopairs.enable = true; - - # nvf provides various autocomplete options. The tried and tested nvim-cmp - # is enabled in default package, because it does not trigger a build. We - # enable blink-cmp in maximal because it needs to build its rust fuzzy - # matcher library. - autocomplete = { - nvim-cmp.enable = !isMaximal; - blink-cmp.enable = isMaximal; - }; - - snippets.luasnip.enable = true; - - filetree = { - neo-tree = { - enable = true; - }; - }; - - tabline = { - nvimBufferline.enable = true; - }; - - treesitter.context.enable = true; - - binds = { - whichKey.enable = true; - cheatsheet.enable = true; - }; - - telescope.enable = true; - - git = { - enable = true; - gitsigns.enable = true; - gitsigns.codeActions.enable = false; # throws an annoying debug message - neogit.enable = isMaximal; - }; - - minimap = { - minimap-vim.enable = false; - codewindow.enable = isMaximal; # lighter, faster, and uses lua for configuration - }; - - dashboard = { - dashboard-nvim.enable = false; - alpha.enable = isMaximal; - }; - - notify = { - nvim-notify.enable = true; - }; - - projects = { - project-nvim.enable = isMaximal; - }; - - utility = { - ccc.enable = false; - vim-wakatime.enable = false; - diffview-nvim.enable = true; - yanky-nvim.enable = false; - qmk-nvim.enable = false; # requires hardware specific options - icon-picker.enable = isMaximal; - surround.enable = isMaximal; - leetcode-nvim.enable = isMaximal; - multicursors.enable = isMaximal; - smart-splits.enable = isMaximal; - undotree.enable = isMaximal; - nvim-biscuits.enable = isMaximal; - - motion = { - hop.enable = true; - leap.enable = true; - precognition.enable = isMaximal; - }; - images = { - image-nvim.enable = false; - img-clip.enable = isMaximal; - }; - }; - - notes = { - obsidian.enable = false; # FIXME: neovim fails to build if obsidian is enabled - neorg.enable = false; - orgmode.enable = false; - mind-nvim.enable = isMaximal; - todo-comments.enable = true; - }; - - terminal = { - toggleterm = { - enable = true; - lazygit.enable = true; - }; - }; - - ui = { - borders.enable = true; - noice.enable = true; - colorizer.enable = true; - modes-nvim.enable = false; # the theme looks terrible with catppuccin - illuminate.enable = true; - breadcrumbs = { - enable = isMaximal; - navbuddy.enable = isMaximal; - }; - smartcolumn = { - enable = true; - setupOpts.custom_colorcolumn = { - # this is a freeform module, it's `buftype = int;` for configuring column position - nix = "110"; - ruby = "120"; - java = "130"; - go = ["90" "130"]; + debugger = { + nvim-dap = { + enable = true; + ui.enable = true; }; }; - fastaction.enable = true; - }; - assistant = { - chatgpt.enable = false; - copilot = { - enable = false; - cmp.enable = isMaximal; + languages = { + enableLSP = true; + enableFormat = true; + enableTreesitter = true; + enableExtraDiagnostics = true; + + nix.enable = true; + html.enable = isMaximal; + css.enable = isMaximal; + sql.enable = isMaximal; + java.enable = isMaximal; + ts.enable = isMaximal; + svelte.enable = isMaximal; + go.enable = isMaximal; + zig.enable = isMaximal; + python.enable = isMaximal; + dart.enable = isMaximal; + elixir.enable = isMaximal; + bash.enable = isMaximal; + terraform.enable = isMaximal; + nim.enable = false; + tailwind.enable = isMaximal; + clang = { + enable = isMaximal; + lsp.server = "clangd"; + }; + + rust = { + enable = isMaximal; + crates.enable = true; + }; }; - codecompanion-nvim.enable = false; - avante-nvim.enable = isMaximal; - }; - session = { - nvim-session-manager.enable = false; - }; + visuals = { + enable = true; + nvimWebDevicons.enable = true; + scrollBar.enable = true; + smoothScroll.enable = true; + cellularAutomaton.enable = false; + fidget-nvim.enable = true; + highlight-undo.enable = true; - gestures = { - gesture-nvim.enable = false; - }; + indentBlankline = { + enable = true; + fillChar = null; + eolChar = null; + scope = { + enabled = true; + }; + }; - comments = { - comment-nvim.enable = true; - }; + cursorline = { + enable = true; + lineTimeout = 0; + }; + }; - presence = { - neocord.enable = false; + statusline = { + lualine = { + enable = true; + theme = "catppuccin"; + }; + }; + + theme = { + enable = true; + name = "catppuccin"; + style = "mocha"; + transparent = false; + }; + + autopairs.enable = true; + + autocomplete = { + enable = true; + type = "nvim-cmp"; + }; + + filetree = { + nvimTree = { + enable = true; + }; + }; + + tabline = { + nvimBufferline.enable = true; + }; + + treesitter.context.enable = true; + + binds = { + whichKey.enable = true; + cheatsheet.enable = true; + }; + + telescope.enable = true; + + git = { + enable = true; + gitsigns.enable = true; + gitsigns.codeActions.enable = false; # throws an annoying debug message + }; + + minimap = { + minimap-vim.enable = false; + codewindow.enable = isMaximal; # lighter, faster, and uses lua for configuration + }; + + dashboard = { + dashboard-nvim.enable = false; + alpha.enable = isMaximal; + }; + + notify = { + nvim-notify.enable = true; + }; + + projects = { + project-nvim.enable = isMaximal; + }; + + utility = { + ccc.enable = isMaximal; + vim-wakatime.enable = isMaximal; + icon-picker.enable = isMaximal; + surround.enable = isMaximal; + diffview-nvim.enable = true; + motion = { + hop.enable = true; + leap.enable = true; + }; + + images = { + image-nvim.enable = false; + }; + }; + + notes = { + obsidian.enable = false; # FIXME: neovim fails to build if obsidian is enabled + orgmode.enable = false; + mind-nvim.enable = isMaximal; + todo-comments.enable = true; + }; + + terminal = { + toggleterm = { + enable = true; + lazygit.enable = true; + }; + }; + + ui = { + borders.enable = true; + noice.enable = true; + colorizer.enable = true; + modes-nvim.enable = false; # the theme looks terrible with catppuccin + illuminate.enable = true; + breadcrumbs = { + enable = isMaximal; + navbuddy.enable = isMaximal; + }; + smartcolumn = { + enable = true; + setupOpts.custom_colorcolumn = { + # this is a freeform module, it's `buftype = int;` for configuring column position + nix = 110; + ruby = 120; + java = 130; + go = [90 130]; + }; + }; + }; + + assistant = { + chatgpt.enable = false; + copilot = { + enable = false; + cmp.enable = isMaximal; + }; + }; + + session = { + nvim-session-manager.enable = false; + }; + + gestures = { + gesture-nvim.enable = false; + }; + + comments = { + comment-nvim.enable = true; + }; + + presence = { + neocord.enable = false; + }; }; }; +in { + inherit neovimConfiguration mainConfig tidalConfig; } diff --git a/default.nix b/default.nix deleted file mode 100644 index e597b612..00000000 --- a/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -(import ( - let - lock = builtins.fromJSON (builtins.readFile ./flake.lock); - inherit (lock.nodes.flake-compat.locked) url rev narHash; - in - builtins.fetchTarball { - url = "${url}/archive/${rev}.tar.gz"; - sha256 = narHash; - } - ) { - src = ./.; - copySourceTreeToStore = false; - useBuiltinsFetchTree = true; - }) -.defaultNix diff --git a/docs/default.nix b/docs/default.nix index 662dd403..5d521d66 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -1,131 +1,132 @@ { inputs, pkgs, - lib, + lib ? import ../lib/stdlib-extended.nix pkgs.lib inputs, + manpageUrls ? pkgs.path + "/doc/manpage-urls.json", + ... }: let - inherit ((lib.importJSON ../release.json)) release; + inherit (lib.modules) mkForce evalModules; + inherit (lib.strings) hasPrefix removePrefix; + inherit (lib.attrsets) isAttrs mapAttrs optionalAttrs recursiveUpdate isDerivation; + inherit (builtins) fromJSON readFile; - nvimModuleDocs = pkgs.nixosOptionsDoc { - variablelistId = "nvf-options"; - warningsAreErrors = true; + # release data + release-config = fromJSON (readFile ../release.json); + revision = release-config.release; - inherit - ( - (lib.evalModules { - specialArgs = {inherit inputs;}; - modules = - import ../modules/modules.nix { - inherit lib pkgs; - } - ++ [ - ( - let - # From nixpkgs: - # - # Recursively replace each derivation in the given attribute set - # with the same derivation but with the `outPath` attribute set to - # the string `"\${pkgs.attribute.path}"`. This allows the - # documentation to refer to derivations through their values without - # establishing an actual dependency on the derivation output. - # - # This is not perfect, but it seems to cover a vast majority of use - # cases. - # - # Caveat: even if the package is reached by a different means, the - # path above will be shown and not e.g. - # `${config.services.foo.package}`. - scrubDerivations = namePrefix: pkgSet: - builtins.mapAttrs ( - name: value: let - wholeName = "${namePrefix}.${name}"; - in - if builtins.isAttrs value - then - scrubDerivations wholeName value - // lib.optionalAttrs (lib.isDerivation value) { - inherit (value) drvPath; - outPath = "\${${wholeName}}"; - } - else value - ) - pkgSet; - in { - _module = { - check = false; - args.pkgs = lib.mkForce (scrubDerivations "pkgs" pkgs); - }; - } - ) - ]; - }) - ) - options - ; + # From home-manager: + # + # Recursively replace each derivation in the given attribute set + # with the same derivation but with the `outPath` attribute set to + # the string `"\${pkgs.attribute.path}"`. This allows the + # documentation to refer to derivations through their values without + # establishing an actual dependency on the derivation output. + # + # This is not perfect, but it seems to cover a vast majority of use + # cases. + # + # Caveat: even if the package is reached by a different means, the + # path above will be shown and not e.g. + # `${config.services.foo.package}`. + scrubDerivations = prefixPath: attrs: let + scrubDerivation = name: value: let + pkgAttrName = prefixPath + "." + name; + in + if isAttrs value + then + scrubDerivations pkgAttrName value + // optionalAttrs (isDerivation value) { + outPath = "\${${pkgAttrName}}"; + } + else value; + in + mapAttrs scrubDerivation attrs; - transformOptions = opt: - opt - // { - declarations = - map ( - decl: - if lib.hasPrefix (toString ../.) (toString decl) + # Make sure the used package is scrubbed to avoid actually + # instantiating derivations. + scrubbedPkgsModule = { + imports = [ + { + _module.args = { + pkgs = mkForce (scrubDerivations "pkgs" pkgs); + pkgs_i686 = mkForce {}; + }; + } + ]; + }; + + # Specify the path to the module entrypoint + nvimPath = toString ./..; + buildOptionsDocs = args @ { + modules, + includeModuleSystemOptions ? true, + warningsAreErrors ? true, + ... + }: let + inherit ((evalModules {inherit modules;})) options; + + # Declaration of the Github site URL. + # Takes a user, repo, and subpath, and returns a declaration site + # as a string. + githubDeclaration = user: repo: subpath: let + urlRef = "github.com"; + branch = "main"; + in { + url = "https://${urlRef}/${user}/${repo}/blob/${branch}/${subpath}"; + name = "<${repo}/${subpath}>"; + }; + in + pkgs.buildPackages.nixosOptionsDoc ({ + inherit warningsAreErrors; + + options = + if includeModuleSystemOptions + then options + else builtins.removeAttrs options ["_module"]; + + transformOptions = opt: + recursiveUpdate opt { + # Clean up declaration sites to not refer to the nvf + # source tree. + declarations = map (decl: + if hasPrefix nvimPath (toString decl) then - lib.pipe decl [ - toString - (lib.removePrefix (toString ../.)) - (lib.removePrefix "/") - (x: { - url = "https://github.com/NotAShelf/nvf/blob/main/${x}"; - name = ""; - }) - ] + githubDeclaration "notashelf" "nvf" + (removePrefix "/" (removePrefix nvimPath (toString decl))) else if decl == "lib/modules.nix" - then { - url = "https://github.com/NixOS/nixpkgs/blob/master/${decl}"; - name = ""; - } - else decl - ) - opt.declarations; - }; - }; + then + # TODO: handle this in a better way (may require upstream + # changes to nixpkgs) + githubDeclaration "NixOS" "nixpkgs" decl + else decl) + opt.declarations; + }; + } + // builtins.removeAttrs args ["modules" "includeModuleSystemOptions"]); - # Generate the HTML manual pages - html = pkgs.callPackage ./manual.nix { - inherit inputs release; - inherit (nvimModuleDocs) optionsJSON; + nvimModuleDocs = buildOptionsDocs { + variablelistId = "nvf-options"; + + modules = + import ../modules/modules.nix { + inherit lib pkgs; + check = false; + } + ++ [scrubbedPkgsModule]; }; -in { - # TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream - # `nixosOptionsDoc` is more customizable. - options.json = - pkgs.runCommand "options.json" { - meta.description = "List of nvf options in JSON format"; - } '' - mkdir -p $out/{share/doc,nix-support} - cp -a ${nvimModuleDocs.optionsJSON}/share/doc/nixos $out/share/doc/nvf - substitute \ - ${nvimModuleDocs.optionsJSON}/nix-support/hydra-build-products \ - $out/nix-support/hydra-build-products \ - --replace \ - '${nvimModuleDocs.optionsJSON}/share/doc/nixos' \ - "$out/share/doc/nvf" - ''; # Generate the `man home-configuration.nix` package - manPages = + nvf-configuration-manual = pkgs.runCommand "nvf-reference-manpage" { - nativeBuildInputs = [ - pkgs.buildPackages.installShellFiles - pkgs.nixos-render-docs - ]; + nativeBuildInputs = [pkgs.buildPackages.installShellFiles pkgs.nixos-render-docs]; allowedReferences = ["out"]; } '' # Generate manpages. - mkdir -p $out/share/man/{man5,man1} + mkdir -p $out/share/man/man5 + mkdir -p $out/share/man/man1 nixos-render-docs -j $NIX_BUILD_CORES options manpage \ - --revision ${release} \ + --revision ${revision} \ --header ${./man/header.5} \ --footer ${./man/footer.5} \ ${nvimModuleDocs.optionsJSON}/share/doc/nixos/options.json \ @@ -134,8 +135,38 @@ in { cp ${./man/nvf.1} $out/share/man/man1/nvf.1 ''; - manual = { - inherit html; - htmlOpenTool = pkgs.callPackage ./html-open-tool.nix {inherit html;}; + # Generate the HTML manual pages + nvf-manual = pkgs.callPackage ./manual.nix { + inherit revision manpageUrls; + outputPath = "share/doc/nvf"; + options = { + nvf = nvimModuleDocs.optionsJSON; + }; }; + + html = nvf-manual; + htmlOpenTool = pkgs.callPackage ./html-open-tool.nix {} {inherit html;}; +in { + inherit (inputs) nmd; + + options = { + # TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream + # `nixosOptionsDoc` is more customizable. + json = + pkgs.runCommand "options.json" { + meta.description = "List of nvf options in JSON format"; + } '' + mkdir -p $out/{share/doc,nix-support} + cp -a ${nvimModuleDocs.optionsJSON}/share/doc/nixos $out/share/doc/nvf + substitute \ + ${nvimModuleDocs.optionsJSON}/nix-support/hydra-build-products \ + $out/nix-support/hydra-build-products \ + --replace \ + '${nvimModuleDocs.optionsJSON}/share/doc/nixos' \ + "$out/share/doc/nvf" + ''; + }; + + manPages = nvf-configuration-manual; + manual = {inherit html htmlOpenTool;}; } diff --git a/docs/html-open-tool.nix b/docs/html-open-tool.nix index d430d24b..756feba1 100644 --- a/docs/html-open-tool.nix +++ b/docs/html-open-tool.nix @@ -2,9 +2,13 @@ writeShellScriptBin, makeDesktopItem, symlinkJoin, +}: { html, + pathName ? "nvf", + projectName ? pathName, + name ? "${pathName}-help", }: let - helpScript = writeShellScriptBin "nvf-help" '' + helpScript = writeShellScriptBin name '' set -euo pipefail if [[ ! -v BROWSER || -z $BROWSER ]]; then @@ -20,23 +24,20 @@ echo "$0: unable to start a web browser; please set \$BROWSER" exit 1 else - exec "$BROWSER" "${html}/share/doc/nvf/index.xhtml" + exec "$BROWSER" "${html}/share/doc/${pathName}/index.xhtml" fi ''; desktopItem = makeDesktopItem { - name = "nvf-manual"; - desktopName = "nvf Manual"; - genericName = "View nvf documentation in a web browser"; + name = "${pathName}-manual"; + desktopName = "${projectName} Manual"; + genericName = "View ${projectName} documentation in a web browser"; icon = "nix-snowflake"; - exec = "${helpScript}/bin/nvf-help"; + exec = "${helpScript}/bin/${name}"; categories = ["System"]; }; in symlinkJoin { - name = "nvf-help"; - paths = [ - helpScript - desktopItem - ]; + inherit name; + paths = [helpScript desktopItem]; } diff --git a/docs/man/header.5 b/docs/man/header.5 index 556a113a..a28fc3dd 100644 --- a/docs/man/header.5 +++ b/docs/man/header.5 @@ -1,16 +1,13 @@ -.TH "nvf" "5" "January 1, 1980" "nvf" +.TH "nvf" "5" "01/01/1980" "nvf" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" enable line breaks after slashes .cflags 4 / - .SH "NAME" -nvf \- Configuration specification for the nvf. - -.SH "DESCRIPTION" -The nvf configuration specification provides a declarative structure for configuring Neovim using Nix with few -lines of Nix. This document outlines the available options and their usage to create modular, reusable, and -reproducible configurations using nvf's module system options. For tips, tricks and possible quirks with available -plugins please visit https://notashelf.github.io/nvf/ +nvf configuration specification +.SH "OPTIONS" +.PP +You can use the following options to configure nvf: +.PP diff --git a/docs/man/nvf.1 b/docs/man/nvf.1 index d7519651..0f1e36dc 100644 --- a/docs/man/nvf.1 +++ b/docs/man/nvf.1 @@ -1,5 +1,5 @@ .Dd January 1, 1980 -.Dt NVF 1 +.Dt nvf 1 .Os nvf .\" disable hyphenation .nh @@ -7,46 +7,27 @@ .ad l .\" enable line breaks after slashes .cflags 4 / - .Sh NAME .Nm nvf -.Nd A modular, extensible, and distro-agnostic Neovim configuration framework for Nix/NixOS. - -.Sh DESCRIPTION -.Nm nvf -is a highly modular, configurable, extensible, and easy-to-use Neovim configuration in Nix. -Designed for flexibility and ease of use, nvf allows you to easily configure your fully featured -Neovim instance with a few lines of Nix. - -.Sh COMMANDS -The following commands are bundled with nvf to allow easier debugging of your configuration. - -.Bl -tag -width Ds -.It Nm nvf-print-config -Outputs the full configuration of the current `nvf` setup. This command is useful for debugging -or inspecting the applied configuration. -.Pp -.It Nm nvf-print-config-path -Prints the file path to the configuration file currently in use. This command is helpful for locating -the source configuration file for troubleshooting or easily sharing it via online paste utilities. -.El - +.Nd A highly modular, extensible and distro-agnostic Neovim configuration framework for Nix/NixOS. +. .Sh BUGS .Pp -Please report any bugs on the project issue tracker: -.Lk https://github.com/notashelf/nvf/issues +Please report any bugs that you might encounter on the +\m[blue]\fBproject issue tracker\fR\m[]\&. .Sh SEE ALSO .Pp -.Fn nvf 5 +\fBnvf\fR(5) .Sh AUTHOR .Pp -.Fn nvf contributors +\fBnvf contributors\fR .RS 4 -Primary contributors and maintainers of the project. +Author. .RE .Sh COPYRIGHT -.Pp -Copyright (c) 2023–2025 nvf contributors. +.br +Copyright \(co 2023\(en2024 nvf contributors +.br diff --git a/docs/manual.nix b/docs/manual.nix index 132c20ef..14e8ae27 100644 --- a/docs/manual.nix +++ b/docs/manual.nix @@ -1,47 +1,68 @@ { - inputs, - path, + lib, stdenvNoCC, - runCommandLocal, - optionsJSON, - release, -} @ args: let - manual-release = args.release or "unstable"; -in - runCommandLocal "nvf-docs-html" { - nativeBuildInputs = [ - (inputs.ndg.packages.${stdenvNoCC.system}.ndg.overrideAttrs - { - # FIXME: the tests take too long to build - doCheck = false; - }) - ]; - } '' - mkdir -p $out/share/doc + # build inputs + nixos-render-docs, + documentation-highlighter, + # nrd configuration + manpageUrls, + revision, + options, + outputPath ? "share/doc/nvf", +}: +stdenvNoCC.mkDerivation { + name = "nvf-manual"; + src = builtins.path { + path = lib.sourceFilesBySuffices ./manual [".md"]; + name = "nvf-manual"; + }; - # Copy the markdown sources to be processed by ndg. This is not - # strictly necessary, but allows us to modify the Markdown sources - # as we see fit. - cp -rvf ${./manual} ./manual + nativeBuildInputs = [nixos-render-docs]; - # Replace variables following the @VARIABLE@ style in the manual - # pages. This can be built into ndg at a later date. - substituteInPlace ./manual/index.md \ - --subst-var-by NVF_VERSION ${manual-release} + buildPhase = '' + mkdir -p out/{highlightjs,media} - # Generate the final manual from a set of parameters. This uses - # feel-co/ndg to render the web manual. - ndg html \ - --jobs $NIX_BUILD_CORES --title "NVF" \ - --module-options ${optionsJSON}/share/doc/nixos/options.json \ - --manpage-urls ${path}/doc/manpage-urls.json \ - --options-depth 3 \ - --generate-search \ - --highlight-code \ - --input-dir ./manual \ - --output-dir "$out/share/doc" + cp -vt out/highlightjs \ + ${documentation-highlighter}/highlight.pack.js \ + ${documentation-highlighter}/LICENSE \ + ${documentation-highlighter}/mono-blue.css \ + ${documentation-highlighter}/loader.js + + substituteInPlace ./options.md \ + --subst-var-by \ + OPTIONS_JSON \ + ${options.nvf}/share/doc/nixos/options.json + + substituteInPlace ./manual.md \ + --subst-var-by \ + NVF_VERSION \ + ${revision} + + # copy stylesheet + cp ${./static/style.css} out/style.css + + # copy release notes + cp -vr ${./release-notes} release-notes + + # generate manual from + nixos-render-docs manual html \ + --manpage-urls ${manpageUrls} \ + --revision ${lib.trivial.revisionWithDefault revision} \ + --stylesheet style.css \ + --script highlightjs/highlight.pack.js \ + --script highlightjs/loader.js \ + --toc-depth 2 \ + --section-toc-depth 1 \ + manual.md \ + out/index.xhtml + ''; + + installPhase = '' + dest="$out/${outputPath}" + mkdir -p "$(dirname "$dest")" + mv out "$dest" - # Hydra support. Probably not necessary. mkdir -p $out/nix-support/ echo "doc manual $dest index.html" >> $out/nix-support/hydra-build-products - '' + ''; +} diff --git a/docs/manual/configuring.md b/docs/manual/configuring.md index 99e1755f..8f5e240a 100644 --- a/docs/manual/configuring.md +++ b/docs/manual/configuring.md @@ -1,22 +1,8 @@ # Configuring nvf {#ch-configuring} -[helpful tips section]: ./tips.html#ch-helpful-tips -[options reference]: ./options.html - -nvf allows for _very_ extensive configuration in Neovim through the Nix module -interface. The below chapters describe several of the options exposed in nvf for -your convenience. You might also be interested in the [helpful tips section] for -more advanced or unusual configuration options supported by nvf. - -Note that this section does not cover module _options_. For an overview of all -module options provided by nvf, please visit the [options reference] - ```{=include=} chapters configuring/custom-package.md configuring/custom-plugins.md -configuring/overriding-plugins.md configuring/languages.md configuring/dags.md -configuring/dag-entries.md -configuring/autocmds.md ``` diff --git a/docs/manual/configuring/autocmds.md b/docs/manual/configuring/autocmds.md deleted file mode 100644 index e547ace2..00000000 --- a/docs/manual/configuring/autocmds.md +++ /dev/null @@ -1,119 +0,0 @@ -# Autocommands and Autogroups {#ch-autocmds-augroups} - -This module allows you to declaratively configure Neovim autocommands and -autogroups within your Nix configuration. - -## Autogroups (`vim.augroups`) {#sec-vim-augroups} - -Autogroups (`augroup`) organize related autocommands. This allows them to be -managed collectively, such as clearing them all at once to prevent duplicates. -Each entry in the list is a submodule with the following options: - -| Option | Type | Default | Description | Example | -| :------- | :----- | :------ | :--------------------------------------------------------------------------------------------------- | :---------------- | -| `enable` | `bool` | `true` | Enables or disables this autogroup definition. | `true` | -| `name` | `str` | _None_ | **Required.** The unique name for the autogroup. | `"MyFormatGroup"` | -| `clear` | `bool` | `true` | Clears any existing autocommands within this group before adding new ones defined in `vim.autocmds`. | `true` | - -**Example:** - -```nix -{ - vim.augroups = [ - { - name = "MyCustomAuGroup"; - clear = true; # Clear previous autocommands in this group on reload - } - { - name = "Formatting"; - # clear defaults to true - } - ]; -} -``` - -## Autocommands (`vim.autocmds`) {#sec-vim-autocmds} - -Autocommands (`autocmd`) trigger actions based on events happening within Neovim -(e.g., saving a file, entering a buffer). Each entry in the list is a submodule -with the following options: - -| Option | Type | Default | Description | Example | -| :--------- | :-------------------- | :------ | :---------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------- | -| `enable` | `bool` | `true` | Enables or disables this autocommand definition. | `true` | -| `event` | `nullOr (listOf str)` | `null` | **Required.** List of Neovim events that trigger this autocommand (e.g., `BufWritePre`, `FileType`). | `[ "BufWritePre" ]` | -| `pattern` | `nullOr (listOf str)` | `null` | List of file patterns (globs) to match against (e.g., `*.py`, `*`). If `null`, matches all files for the given event. | `[ "*.lua", "*.nix" ]` | -| `callback` | `nullOr luaInline` | `null` | A Lua function to execute when the event triggers. Use `lib.generators.mkLuaInline`. **Cannot be used with `command`.** | `lib.generators.mkLuaInline "function() print('File saved!') end"` | -| `command` | `nullOr str` | `null` | A Vimscript command to execute when the event triggers. **Cannot be used with `callback`.** | `"echo 'File saved!'"` | -| `group` | `nullOr str` | `null` | The name of an `augroup` (defined in `vim.augroups`) to associate this autocommand with. | `"MyCustomAuGroup"` | -| `desc` | `nullOr str` | `null` | A description for the autocommand (useful for introspection). | `"Format buffer on save"` | -| `once` | `bool` | `false` | If `true`, the autocommand runs only once and then automatically removes itself. | `false` | -| `nested` | `bool` | `false` | If `true`, allows this autocommand to trigger other autocommands. | `false` | - -:::{.warning} - -You cannot define both `callback` (for Lua functions) and `command` (for -Vimscript) for the same autocommand. Choose one. - -::: - -**Examples:** - -```nix -{ lib, ... }: -{ - vim.augroups = [ { name = "UserSetup"; } ]; - - vim.autocmds = [ - # Example 1: Using a Lua callback - { - event = [ "BufWritePost" ]; - pattern = [ "*.lua" ]; - group = "UserSetup"; - desc = "Notify after saving Lua file"; - callback = lib.generators.mkLuaInline '' - function() - vim.notify("Lua file saved!", vim.log.levels.INFO) - end - ''; - } - - # Example 2: Using a Vim command - { - event = [ "FileType" ]; - pattern = [ "markdown" ]; - group = "UserSetup"; - desc = "Set spellcheck for Markdown"; - command = "setlocal spell"; - } - - # Example 3: Autocommand without a specific group - { - event = [ "BufEnter" ]; - pattern = [ "*.log" ]; - desc = "Disable line numbers in log files"; - command = "setlocal nonumber"; - # No 'group' specified - } - - # Example 4: Using Lua for callback - { - event = [ "BufWinEnter" ]; - pattern = [ "*" ]; - desc = "Simple greeting on entering a buffer window"; - callback = lib.generators.mkLuaInline '' - function(args) - print("Entered buffer: " .. args.buf) - end - ''; - - # Run only once per session trigger - once = true; - } - ]; -} -``` - -These definitions are automatically translated into the necessary Lua code to -configure `vim.api.nvim_create_augroup` and `vim.api.nvim_create_autocmd` when -Neovim starts. diff --git a/docs/manual/configuring/custom-package.md b/docs/manual/configuring/custom-package.md new file mode 100644 index 00000000..51d996b6 --- /dev/null +++ b/docs/manual/configuring/custom-package.md @@ -0,0 +1,22 @@ +# Custom Neovim Package {#ch-custom-package} + +As of v0.5, you may now specify the Neovim package that will be wrapped with +your configuration. This is done with the `vim.package` option. + +```nix +{inputs, pkgs, ...}: { + # using the neovim-nightly overlay + vim.package = inputs.neovim-overlay.packages.${pkgs.system}.neovim; +} +``` + +The neovim-nightly-overlay always exposes an unwrapped package. If using a +different source, you are highly recommended to get an "unwrapped" version of +the neovim package, similar to `neovim-unwrapped` in nixpkgs. + +```nix +{ pkgs, ...}: { + # using the neovim-nightly overlay + vim.package = pkgs.neovim-unwrapped; +} +``` diff --git a/docs/manual/configuring/custom-plugins.md b/docs/manual/configuring/custom-plugins.md index 1552e7b1..3bcd324d 100644 --- a/docs/manual/configuring/custom-plugins.md +++ b/docs/manual/configuring/custom-plugins.md @@ -1,37 +1,25 @@ # Custom Plugins {#ch-custom-plugins} -**nvf** exposes a very wide variety of plugins by default, which are consumed by -module options. This is done for your convenience, and to bundle all necessary -dependencies into **nvf**'s runtime with full control of versioning, testing and -dependencies. In the case a plugin you need is _not_ available, you may consider -making a pull request to add the package you're looking for, or you may add it -to your configuration locally. The below section describes how new plugins may -be added to the user's configuration. +**nvf**, by default, exposes a wide variety of plugins as module options +for your convience and bundles necessary dependencies into **nvf**'s runtime. +In case a plugin is not available in **nvf**, you may consider making a pull +request to **nvf** to include it as a module or you may add it to your +configuration locally. ## Adding Plugins {#ch-adding-plugins} -Per **nvf**'s design choices, there are several ways of adding custom plugins to -your configuration as you need them. As we aim for extensive configuration, it -is possible to add custom plugins (from nixpkgs, pinning tools, flake inputs, -etc.) to your Neovim configuration before they are even implemented in **nvf** -as a module. +There are multiple ways of adding custom plugins to your **nvf** configuration. -:::{.info} +You can use custom plugins, before they are implemented in the flake. To add a +plugin to the runtime, you need to add it to the `vim.startPlugins` list in +your configuration. -To add a plugin to your runtime, you will need to add it to -{option}`vim.startPlugins` list in your configuration. This is akin to cloning a -plugin to `~/.config/nvim`, but they are only ever placed in the Nix store and -never exposed to the outside world for purity and full isolation. - -::: - -As you would configure a cloned plugin, you must configure the new plugins that -you've added to `startPlugins.` **nvf** provides multiple ways of configuring -any custom plugins that you might have added to your configuration. +Adding a plugin to `startPlugins` will not allow you to configure the plugin +that you have adeed, but **nvf** provides multiple way of configuring any +custom plugins that you might have added to your configuration. ```{=include=} sections custom-plugins/configuring.md -custom-plugins/lazy-method.md -custom-plugins/non-lazy-method.md -custom-plugins/legacy-method.md +custom-plugins/new-method.md +custom-plugins/old-method.md ``` diff --git a/docs/manual/configuring/custom-plugins/configuring.md b/docs/manual/configuring/custom-plugins/configuring.md index a4b3ce19..da6274d5 100644 --- a/docs/manual/configuring/custom-plugins/configuring.md +++ b/docs/manual/configuring/custom-plugins/configuring.md @@ -1,92 +1,26 @@ # Configuring {#sec-configuring-plugins} Just making the plugin to your Neovim configuration available might not always -be enough., for example, if the plugin requires a setup table. In that case, you -can write custom Lua configuration using one of - -- `config.vim.lazy.plugins.*.setupOpts` -- `config.vim.extraPlugins.*.setup` -- `config.vim.luaConfigRC`. - -## Lazy Plugins {#ch-vim-lazy-plugins} - -`config.vim.lazy.plugins.*.setupOpts` is useful for lazy-loading plugins, and -uses an extended version of `lz.n's` `PluginSpec` to expose a familiar -interface. `setupModule` and `setupOpt` can be used if the plugin uses a -`require('module').setup(...)` pattern. Otherwise, the `before` and `after` -hooks should do what you need. +be enough. In that case, you can write custom vimscript or lua config, using +either `config.vim.configRC` or `config.vim.luaConfigRC` respectively. Both of +these options are attribute sets, and you need to give the configuration you're +adding some name, like this: ```nix { - config.vim.lazy.plugins = { - aerial.nvim = { - # ^^^^^^^^^ this name should match the package.pname or package.name - package = aerial-nvim; - - setupModule = "aerial"; - setupOpts = {option_name = false;}; - - after = "print('aerial loaded')"; - }; - }; + # this will create an "aquarium" section in your init.vim with the contents of your custom config + # which will be *appended* to the rest of your configuration, inside your init.vim + config.vim.configRC.aquarium = "colorscheme aquiarum"; } ``` -## Standard API {#ch-vim-extra-plugins} - -`vim.extraPlugins` uses an attribute set, which maps DAG section names to a -custom type, which has the fields `package`, `after`, `setup`. They allow you to -set the package of the plugin, the sections its setup code should be after (note -that the `extraPlugins` option has its own DAG scope), and the its setup code -respectively. For example: - -```nix -{pkgs, ...}: { - config.vim.extraPlugins = { - aerial = { - package = pkgs.vimPlugins.aerial-nvim; - setup = "require('aerial').setup {}"; - }; - - harpoon = { - package = pkgs.vimPlugins.harpoon; - setup = "require('harpoon').setup {}"; - after = ["aerial"]; # place harpoon configuration after aerial - }; - }; -} -``` - -### Setup using luaConfigRC {#setup-using-luaconfigrc} - -`vim.luaConfigRC` also uses an attribute set, but this one is resolved as a DAG -directly. The attribute names denote the section names, and the values lua code. -For example: - -```nix -{ - # This will create a section called "aquarium" in the 'init.lua' with the - # contents of your custom configuration. By default 'entryAnywhere' is implied - # in DAGs, so this will be inserted to an arbitrary position. In the case you - # wish to control the position of this section with more precision, please - # look into the DAGs section of the manual. - config.vim.luaConfigRC.aquarium = "vim.cmd('colorscheme aquiarum')"; -} -``` - - -[DAG system]: #ch-using-dags -[DAG section]: #ch-dag-entries - -::: {.note} -One of the **greatest strengths** of **nvf** is the ability to order -configuration snippets precisely using the [DAG system]. DAGs -are a very powerful mechanism that allows specifying positions -of individual sections of configuration as needed. We provide helper functions -in the extended library, usually under `inputs.nvf.lib.nvim.dag` that you may -use. - -Please refer to the [DAG section] in the nvf manual +:::{.note} +If your configuration needs to be put in a specific place in the config, you +can use functions from `inputs.nvf.lib.nvim.dag` to order it. Refer to +https://github.com/nix-community/home-manager/blob/master/modules/lib/dag.nix to find out more about the DAG system. ::: - + +If you successfully made your plugin work, please feel free to create a PR to +add it to **nvf** or open an issue with your findings so that we can make it +available for everyone easily. diff --git a/docs/manual/configuring/custom-plugins/lazy-method.md b/docs/manual/configuring/custom-plugins/lazy-method.md deleted file mode 100644 index c16966b8..00000000 --- a/docs/manual/configuring/custom-plugins/lazy-method.md +++ /dev/null @@ -1,62 +0,0 @@ -# Lazy Method {#sec-lazy-method} - -As of version **0.7**, an API is exposed to allow configuring lazy-loaded -plugins via `lz.n` and `lzn-auto-require`. Below is a comprehensive example of -how it may be loaded to lazy-load an arbitrary plugin. - -```nix -{ - config.vim.lazy.plugins = { - "aerial.nvim" = { - package = pkgs.vimPlugins.aerial-nvim; - setupModule = "aerial"; - setupOpts = { - option_name = true; - }; - after = '' - -- custom lua code to run after plugin is loaded - print('aerial loaded') - ''; - - # Explicitly mark plugin as lazy. You don't need this if you define one of - # the trigger "events" below - lazy = true; - - # load on command - cmd = ["AerialOpen"]; - - # load on event - event = ["BufEnter"]; - - # load on keymap - keys = [ - { - key = "a"; - action = ":AerialToggle"; - } - ]; - }; - }; -} -``` - -## LazyFile event {#sec-lazyfile-event} - -**nvf** re-implements `LazyFile` as a familiar user event to load a plugin when -a file is opened: - -```nix -{ - config.vim.lazy.plugins = { - "aerial.nvim" = { - package = pkgs.vimPlugins.aerial-nvim; - event = [{event = "User"; pattern = "LazyFile";}]; - # ... - }; - }; -} -``` - -You can consider the `LazyFile` event as an alias to the combination of -`"BufReadPost"`, `"BufNewFile"` and `"BufWritePre"`, i.e., a list containing all -three of those events: `["BufReadPost" "BufNewFile" "BufWritePre"]` diff --git a/docs/manual/configuring/custom-plugins/legacy-method.md b/docs/manual/configuring/custom-plugins/legacy-method.md deleted file mode 100644 index f4976e5f..00000000 --- a/docs/manual/configuring/custom-plugins/legacy-method.md +++ /dev/null @@ -1,45 +0,0 @@ -# Legacy Method {#sec-legacy-method} - -Prior to version **0.5**, the method of adding new plugins was adding the plugin -package to {option}`vim.startPlugins` and adding its configuration as a DAG -under one of `vim.configRC` or {option}`vim.luaConfigRC`. While `configRC` has -been deprecated, users who have not yet updated to 0.5 or those who prefer a -more hands-on approach may choose to use the old method where the load order of -the plugins is explicitly determined by DAGs without internal abstractions. - -## Adding New Plugins {#sec-adding-new-plugins} - -To add a plugin not available in **nvf** as a module to your configuration using -the legacy method, you must add it to {option}`vim.startPlugins` in order to -make it available to Neovim at runtime. - -```nix -{pkgs, ...}: { - # Add a Neovim plugin from Nixpkgs to the runtime. - # This does not need to come explicitly from packages. 'vim.startPlugins' - # takes a list of *string* (to load internal plugins) or *package* to load - # a Neovim package from any source. - vim.startPlugins = [pkgs.vimPlugins.aerial-nvim]; -} -``` - -Once the package is available in Neovim's runtime, you may use the `luaConfigRC` -option to provide configuration as a DAG using the **nvf** extended library in -order to configure the added plugin, - -```nix -{inputs, ...}: let - # This assumes you have an input called 'nvf' in your flake inputs - # and 'inputs' in your specialArgs. In the case you have passed 'nvf' - # to specialArgs, the 'inputs' prefix may be omitted. - inherit (inputs.nvf.lib.nvim.dag) entryAnywhere; -in { - # luaConfigRC takes Lua configuration verbatim and inserts it at an arbitrary - # position by default or if 'entryAnywhere' is used. - vim.luaConfigRC.aerial-nvim= entryAnywhere '' - require('aerial').setup { - -- your configuration here - } - ''; -} -``` diff --git a/docs/manual/configuring/custom-plugins/new-method.md b/docs/manual/configuring/custom-plugins/new-method.md new file mode 100644 index 00000000..200ba5e7 --- /dev/null +++ b/docs/manual/configuring/custom-plugins/new-method.md @@ -0,0 +1,26 @@ +# New Method {#sec-new-method} + +As of version **0.5**, we have a more extensive API for configuring plugins, +under `vim.extraPlugins`. Instead of using DAGs exposed by the library, you may +use the extra plugin module as follows: + +```nix +{ + config.vim.extraPlugins = with pkgs.vimPlugins; { + aerial = { + package = aerial-nvim; + setup = '' + require('aerial').setup { + -- some lua configuration here + } + ''; + }; + + harpoon = { + package = harpoon; + setup = "require('harpoon').setup {}"; + after = ["aerial"]; + }; + }; +} +``` diff --git a/docs/manual/configuring/custom-plugins/non-lazy-method.md b/docs/manual/configuring/custom-plugins/non-lazy-method.md deleted file mode 100644 index 5174d0a8..00000000 --- a/docs/manual/configuring/custom-plugins/non-lazy-method.md +++ /dev/null @@ -1,29 +0,0 @@ -# Non-lazy Method {#sec-non-lazy-method} - -As of version **0.5**, we have a more extensive API for configuring plugins that -should be preferred over the legacy method. This API is available as -{option}`vim.extraPlugins`. Instead of using DAGs exposed by the library -_directly_, you may use the extra plugin module as follows: - -```nix -{pkgs, ...}: { - config.vim.extraPlugins = { - aerial = { - package = pkgs.vimPlugins.aerial-nvim; - setup = '' - require('aerial').setup { - -- some lua configuration here - } - ''; - }; - - harpoon = { - package = pkgs.vimPlugins.harpoon; - setup = "require('harpoon').setup {}"; - after = ["aerial"]; - }; - }; -} -``` - -This provides a level of abstraction over the DAG system for faster iteration. diff --git a/docs/manual/configuring/custom-plugins/old-method.md b/docs/manual/configuring/custom-plugins/old-method.md new file mode 100644 index 00000000..3b9d090e --- /dev/null +++ b/docs/manual/configuring/custom-plugins/old-method.md @@ -0,0 +1,35 @@ +# Old Method {#sec-old-method} + +Prior to version 0.5, the method of adding new plugins was adding the plugin +package to `vim.startPlugins` and add its configuration as a DAG under one of +`vim.configRC` or `vim.luaConfigRC`. Users who have not yet updated to 0.5, or +prefer a more hands-on approach may use the old method where the load order of +the plugins is determined by DAGs. + +## Adding plugins {#sec-adding-plugins} + +To add a plugin to **nvf**'s runtime, you may add it + +```nix +{pkgs, ...}: { + # add a package from nixpkgs to startPlugins + vim.startPlugins = [ + pkgs.vimPlugins.aerial-nvim ]; +} +``` + +And to configure the added plugin, you can use the `luaConfigRC` option to +provide configuration as a DAG using the **nvf** extended library. + +```nix +{inputs, ...}: let + # assuming you have an input called nvf pointing at the nvf repository + inherit (inputs.nvf.lib.nvim.dag) entryAnywhere; +in { + vim.luaConfigRC.aerial-nvim= entryAnywhere '' + require('aerial').setup { + -- your configuration here + } + ''; +} +``` diff --git a/docs/manual/configuring/dag-entries.md b/docs/manual/configuring/dag-entries.md deleted file mode 100644 index 88c580be..00000000 --- a/docs/manual/configuring/dag-entries.md +++ /dev/null @@ -1,25 +0,0 @@ -# DAG entries in nvf {#ch-dag-entries} - -From the previous chapter, it should be clear that DAGs are useful, because you -can add code that relies on other code. However, if you don't know what the -entries are called, it's hard to do that, so here is a list of the internal -entries in nvf: - -## `vim.luaConfigRC` (top-level DAG) {#ch-vim-luaconfigrc} - -1. (`luaConfigPre`) - not a part of the actual DAG, instead, it's simply - inserted before the rest of the DAG -2. `globalsScript` - used to set globals defined in `vim.globals` -3. `basic` - used to set basic configuration options -4. `optionsScript` - used to set options defined in `vim.o` -5. `theme` (this is simply placed before `pluginConfigs` and `lazyConfigs`, - meaning that surrounding entries don't depend on it) - used to set up the - theme, which has to be done before other plugins -6. `lazyConfigs` - `lz.n` and `lzn-auto-require` configs. If `vim.lazy.enable` - is false, this will contain each plugin's config instead. -7. `pluginConfigs` - the result of the nested `vim.pluginRC` (internal option, - see the [Custom Plugins](/index.xhtml#ch-custom-plugins) page for adding your - own plugins) DAG, used to set up internal plugins -8. `extraPluginConfigs` - the result of `vim.extraPlugins`, which is not a - direct DAG, but is converted to, and resolved as one internally -9. `mappings` - the result of `vim.maps` diff --git a/docs/manual/configuring/dags.md b/docs/manual/configuring/dags.md index 08e82bab..77817cb6 100644 --- a/docs/manual/configuring/dags.md +++ b/docs/manual/configuring/dags.md @@ -1,30 +1,29 @@ # Using DAGs {#ch-using-dags} We conform to the NixOS options types for the most part, however, a noteworthy -addition for certain options is the -[**DAG (Directed acyclic graph)**](https://en.wikipedia.org/wiki/Directed_acyclic_graph) +addition for certain options is the [**DAG +(Directed acyclic graph)**](https://en.wikipedia.org/wiki/Directed_acyclic_graph) type which is borrowed from home-manager's extended library. This type is most used for topologically sorting strings. The DAG type allows the attribute set -entries to express dependency relations among themselves. This can, for example, -be used to control the order of configuration sections in your `luaConfigRC`. +entries to express dependency relations among themselves. This can, for +example, be used to control the order of configuration sections in your +`configRC` or `luaConfigRC`. -The below section, mostly taken from the -[home-manager manual](https://raw.githubusercontent.com/nix-community/home-manager/master/docs/manual/writing-modules/types.md) +The below section, mostly taken from the [home-manager +manual](https://raw.githubusercontent.com/nix-community/home-manager/master/docs/manual/writing-modules/types.md) explains in more detail the overall usage logic of the DAG type. ## entryAnywhere {#sec-types-dag-entryAnywhere} -> `nvf.lib.nvim.dag.entryAnywhere (value: T) : DagEntry` +> `lib.dag.entryAnywhere (value: T) : DagEntry` -Indicates that `value` can be placed anywhere within the DAG. This is also the -default for plain attribute set entries, that is +Indicates that `value` can be placed anywhere within the DAG. +This is also the default for plain attribute set entries, that +is ```nix -# For 'nvf' to be available in module's arguments, -# it needs to be inherited from imports in the modules array as: -# modules = [{ _module.args = { inherit nvf; }; } ...]; foo.bar = { - a = nvf.lib.nvim.dag.entryAnywhere 0; + a = lib.dag.entryAnywhere 0; } ``` @@ -40,15 +39,15 @@ are equivalent. ## entryAfter {#ch-types-dag-entryAfter} -> `nvf.lib.nvim.dag.entryAfter (afters: list string) (value: T) : DagEntry` +> `lib.dag.entryAfter (afters: list string) (value: T) : DagEntry` -Indicates that `value` must be placed _after_ each of the attribute names in the -given list. For example +Indicates that `value` must be placed _after_ each of the +attribute names in the given list. For example ```nix foo.bar = { a = 0; - b = nvf.lib.nvim.dag.entryAfter [ "a" ] 1; + b = lib.dag.entryAfter [ "a" ] 1; } ``` @@ -56,14 +55,14 @@ would place `b` after `a` in the graph. ## entryBefore {#ch-types-dag-entryBefore} -> `nvf.lib.nvim.dag.entryBefore (befores: list string) (value: T) : DagEntry` +> `lib.dag.entryBefore (befores: list string) (value: T) : DagEntry` -Indicates that `value` must be placed _before_ each of the attribute names in -the given list. For example +Indicates that `value` must be placed _before_ each of the +attribute names in the given list. For example ```nix foo.bar = { - b = nvf.lib.nvim.dag.entryBefore [ "a" ] 1; + b = lib.dag.entryBefore [ "a" ] 1; a = 0; } ``` @@ -72,36 +71,37 @@ would place `b` before `a` in the graph. ## entryBetween {#sec-types-dag-entryBetween} -> `nvf.lib.nvim.dag.entryBetween (befores: list string) (afters: list string) (value: T) : DagEntry` +> `lib.dag.entryBetween (befores: list string) (afters: list string) (value: T) : DagEntry` -Indicates that `value` must be placed _before_ the attribute names in the first -list and _after_ the attribute names in the second list. For example +Indicates that `value` must be placed _before_ the attribute +names in the first list and _after_ the attribute names in the +second list. For example ```nix foo.bar = { a = 0; - c = nvf.lib.nvim.dag.entryBetween [ "b" ] [ "a" ] 2; + c = lib.dag.entryBetween [ "b" ] [ "a" ] 2; b = 1; } ``` would place `c` before `b` and after `a` in the graph. -There are also a set of functions that generate a DAG from a list. These are -convenient when you just want to have a linear list of DAG entries, without -having to manually enter the relationship between each entry. Each of these -functions take a `tag` as argument and the DAG entries will be named -`${tag}-${index}`. +There are also a set of functions that generate a DAG from a list. +These are convenient when you just want to have a linear list of DAG +entries, without having to manually enter the relationship between +each entry. Each of these functions take a `tag` as argument and the +DAG entries will be named `${tag}-${index}`. ## entriesAnywhere {#sec-types-dag-entriesAnywhere} -> `nvf.lib.nvim.dag.entriesAnywhere (tag: string) (values: [T]) : Dag` +> `lib.dag.entriesAnywhere (tag: string) (values: [T]) : Dag` -Creates a DAG with the given values with each entry labeled using the given tag. -For example +Creates a DAG with the given values with each entry labeled +using the given tag. For example ```nix -foo.bar = nvf.lib.nvim.dag.entriesAnywhere "a" [ 0 1 ]; +foo.bar = lib.dag.entriesAnywhere "a" [ 0 1 ]; ``` is equivalent to @@ -109,21 +109,21 @@ is equivalent to ```nix foo.bar = { a-0 = 0; - a-1 = nvf.lib.nvim.dag.entryAfter [ "a-0" ] 1; + a-1 = lib.dag.entryAfter [ "a-0" ] 1; } ``` ## entriesAfter {#sec-types-dag-entriesAfter} -> `nvf.lib.nvim.dag.entriesAfter (tag: string) (afters: list string) (values: [T]) : Dag` +> `lib.dag.entriesAfter (tag: string) (afters: list string) (values: [T]) : Dag` -Creates a DAG with the given values with each entry labeled using the given tag. -The list of values are placed are placed _after_ each of the attribute names in -`afters`. For example +Creates a DAG with the given values with each entry labeled +using the given tag. The list of values are placed are placed +_after_ each of the attribute names in `afters`. For example ```nix foo.bar = - { b = 0; } // nvf.lib.nvim.dag.entriesAfter "a" [ "b" ] [ 1 2 ]; + { b = 0; } // lib.dag.entriesAfter "a" [ "b" ] [ 1 2 ]; ``` is equivalent to @@ -131,22 +131,22 @@ is equivalent to ```nix foo.bar = { b = 0; - a-0 = nvf.lib.nvim.dag.entryAfter [ "b" ] 1; - a-1 = nvf.lib.nvim.dag.entryAfter [ "a-0" ] 2; + a-0 = lib.dag.entryAfter [ "b" ] 1; + a-1 = lib.dag.entryAfter [ "a-0" ] 2; } ``` ## entriesBefore {#sec-types-dag-entriesBefore} -> `nvf.lib.nvim.dag.entriesBefore (tag: string) (befores: list string) (values: [T]) : Dag` +> `lib.dag.entriesBefore (tag: string) (befores: list string) (values: [T]) : Dag` -Creates a DAG with the given values with each entry labeled using the given tag. -The list of values are placed _before_ each of the attribute names in `befores`. -For example +Creates a DAG with the given values with each entry labeled +using the given tag. The list of values are placed _before_ each +of the attribute names in `befores`. For example ```nix -foo.bar = - { b = 0; } // nvf.lib.nvim.dag.entriesBefore "a" [ "b" ] [ 1 2 ]; + foo.bar = + { b = 0; } // lib.dag.entriesBefore "a" [ "b" ] [ 1 2 ]; ``` is equivalent to @@ -155,21 +155,22 @@ is equivalent to foo.bar = { b = 0; a-0 = 1; - a-1 = nvf.lib.nvim.dag.entryBetween [ "b" ] [ "a-0" ] 2; + a-1 = lib.dag.entryBetween [ "b" ] [ "a-0" ] 2; } ``` ## entriesBetween {#sec-types-dag-entriesBetween} -> `nvf.lib.nvim.dag.entriesBetween (tag: string) (befores: list string) (afters: list string) (values: [T]) : Dag` +> `lib.dag.entriesBetween (tag: string) (befores: list string) (afters: list string) (values: [T]) : Dag` -Creates a DAG with the given values with each entry labeled using the given tag. -The list of values are placed _before_ each of the attribute names in `befores` -and _after_ each of the attribute names in `afters`. For example +Creates a DAG with the given values with each entry labeled +using the given tag. The list of values are placed _before_ each +of the attribute names in `befores` and _after_ each of the +attribute names in `afters`. For example ```nix foo.bar = - { b = 0; c = 3; } // nvf.lib.nvim.dag.entriesBetween "a" [ "b" ] [ "c" ] [ 1 2 ]; + { b = 0; c = 3; } // lib.dag.entriesBetween "a" [ "b" ] [ "c" ] [ 1 2 ]; ``` is equivalent to @@ -178,7 +179,7 @@ is equivalent to foo.bar = { b = 0; c = 3; - a-0 = nvf.lib.nvim.dag.entryAfter [ "c" ] 1; - a-1 = nvf.lib.nvim.dag.entryBetween [ "b" ] [ "a-0" ] 2; + a-0 = lib.dag.entryAfter [ "c" ] 1; + a-1 = lib.dag.entryBetween [ "b" ] [ "a-0" ] 2; } ``` diff --git a/docs/manual/configuring/languages.md b/docs/manual/configuring/languages.md index f956a0e3..0e54342d 100644 --- a/docs/manual/configuring/languages.md +++ b/docs/manual/configuring/languages.md @@ -1,95 +1,27 @@ # Language Support {#ch-languages} Language specific support means there is a combination of language specific -plugins, `treesitter` support, `nvim-lspconfig` language servers, `conform-nvim` -formatters, and `nvim-lint` linter integration. This gets you capabilities -ranging from autocompletion to formatting to diagnostics. The following -languages have sections under the `vim.languages` attribute. +plugins, `treesitter` support, `nvim-lspconfig` language servers, and `null-ls` +integration. This gets you capabilities ranging from autocompletion to formatting +to diagnostics. The following languages have sections under the `vim.languages` +attribute. -- Rust: - [vim.languages.rust.enable](./options.html#option-vim-languages-rust-enable) -- Nix: - [vim.languages.nix.enable](./options.html#option-vim-languages-nix-enable) -- SQL: - [vim.languages.sql.enable](./options.html#option-vim-languages-sql-enable) -- C/C++: - [vim.languages.clang.enable](./options.html#option-vim-languages-clang-enable) -- Typescript/Javascript: - [vim.languages.ts.enable](./options.html#option-vim-languages-ts-enable) -- Python: - [vim.languages.python.enable](./options.html#option-vim-languages-python-enable): -- Zig: - [vim.languages.zig.enable](./options.html#option-vim-languages-zig-enable) -- Markdown: - [vim.languages.markdown.enable](./options.html#option-vim-languages-markdown-enable) -- HTML: - [vim.languages.html.enable](./options.html#option-vim-languages-html-enable) -- Dart: - [vim.languages.dart.enable](./options.html#option-vim-languages-dart-enable) -- Go: [vim.languages.go.enable](./options.html#option-vim-languages-go-enable) -- Lua: - [vim.languages.lua.enable](./options.html#option-vim-languages-lua-enable) -- PHP: - [vim.languages.php.enable](./options.html#option-vim-languages-php-enable) -- F#: - [vim.languages.fsharp.enable](./options.html#option-vim-languages-fsharp-enable) -- Assembly: - [vim.languages.assembly.enable](./options.html#option-vim-languages-assembly-enable) -- Astro: - [vim.languages.astro.enable](./options.html#option-vim-languages-astro-enable) -- Bash: - [vim.languages.bash.enable](./options.html#option-vim-languages-bash-enable) -- Clang: - [vim.languages.clang.enable](./options.html#option-vim-languages-clang-enable) -- Clojure: - [vim.languages.clojure.enable](./options.html#option-vim-languages-clojure-enable) -- C#: - [vim.languages.csharp.enable](./options.html#option-vim-languages-csharp-enable) -- CSS: - [vim.languages.css.enable](./options.html#option-vim-languages-css-enable) -- CUE: - [vim.languages.cue.enable](./options.html#option-vim-languages-cue-enable) -- Elixir: - [vim.languages.elixir.enable](./options.html#option-vim-languages-elixir-enable) -- Gleam: - [vim.languages.gleam.enable](./options.html#option-vim-languages-gleam-enable) -- HCL: - [vim.languages.hcl.enable](./options.html#option-vim-languages-hcl-enable) -- Helm: - [vim.languages.helm.enable](./options.html#option-vim-languages-helm-enable) -- Julia: - [vim.languages.julia.enable](./options.html#option-vim-languages-julia-enable) -- Kotlin: - [vim.languages.kotlin.enable](./options.html#option-vim-languages-kotlin-enable) -- Nim: - [vim.languages.nim.enable](./options.html#option-vim-languages-nim-enable) -- Nu: [vim.languages.nu.enable](./options.html#option-vim-languages-nu-enable) -- OCaml: - [vim.languages.ocaml.enable](./options.html#option-vim-languages-ocaml-enable) -- Odin: - [vim.languages.odin.enable](./options.html#option-vim-languages-odin-enable) -- R: [vim.languages.r.enable](./options.html#option-vim-languages-r-enable) -- Ruby: - [vim.languages.ruby.enable](./options.html#option-vim-languages-ruby-enable) -- Scala: - [vim.languages.scala.enable](./options.html#option-vim-languages-scala-enable) -- Svelte: - [vim.languages.svelte.enable](./options.html#option-vim-languages-svelte-enable) -- Tailwind: - [vim.languages.tailwind.enable](./options.html#option-vim-languages-tailwind-enable) -- Terraform: - [vim.languages.terraform.enable](./options.html#option-vim-languages-terraform-enable) -- Typst: - [vim.languages.typst.enable](./options.html#option-vim-languages-typst-enable) -- Vala: - [vim.languages.vala.enable](./options.html#option-vim-languages-vala-enable) -- WGSL: - [vim.languages.wgsl.enable](./options.html#option-vim-languages-wgsl-enable) -- YAML: - [vim.languages.yaml.enable](./options.html#option-vim-languages-yaml-enable) +- Rust: [vim.languages.rust.enable](#opt-vim.languages.rust.enable) +- Nix: [vim.languages.nix.enable](#opt-vim.languages.nix.enable) +- SQL: [vim.languages.sql.enable](#opt-vim.languages.sql.enable) +- C/C++: [vim.languages.clang.enable](#opt-vim.languages.clang.enable) +- Typescript/Javascript: [vim.languages.ts.enable](#opt-vim.languages.ts.enable) +- Python: [vim.languages.python.enable](#opt-vim.languages.python.enable): +- Zig: [vim.languages.zig.enable](#opt-vim.languages.zig.enable) +- Markdown: [vim.languages.markdown.enable](#opt-vim.languages.markdown.enable) +- HTML: [vim.languages.html.enable](#opt-vim.languages.html.enable) +- Dart: [vim.languages.dart.enable](#opt-vim.languages.dart.enable) +- Go: [vim.languages.go.enable](#opt-vim.languages.go.enable) +- Lua: [vim.languages.lua.enable](#opt-vim.languages.lua.enable) +- PHP: [vim.languages.php.enable](#opt-vim.languages.php.enable) -Adding support for more languages, and improving support for existing ones are -great places where you can contribute with a PR. +Adding support for more languages, and improving support for existing ones are great places +where you can contribute with a PR. ```{=include=} sections languages/lsp.md diff --git a/docs/manual/configuring/languages/lsp.md b/docs/manual/configuring/languages/lsp.md index 2ddc08b5..b7a9d073 100644 --- a/docs/manual/configuring/languages/lsp.md +++ b/docs/manual/configuring/languages/lsp.md @@ -1,22 +1,17 @@ # LSP Custom Packages/Command {#sec-languages-custom-lsp-packages} -One of the strengths of **nvf** is convenient aliases to quickly configure LSP -servers through the Nix module system. By default the LSP packages for relevant -language modules will be pulled into the closure. If this is not desirable, you -may provide **a custom LSP package** (e.g., a Bash script that calls a command) -or **a list of strings** to be interpreted as the command to launch the language -server. By using a list of strings, you can use this to skip automatic -installation of a language server, and instead use the one found in your `$PATH` -during runtime, for example: +In any of the `opt.languages..lsp.package` options you can provide +your own LSP package, or provide the command to launch the language server, as +a list of strings. You can use this to skip automatic installation of a language +server, and instead use the one found in your `$PATH` during runtime, for +example: ```nix vim.languages.java = { lsp = { enable = true; - - # This expects 'jdt-language-server' to be in your PATH or in - # 'vim.extraPackages.' There are no additional checks performed to see - # if the command provided is valid. + # this expects jdt-language-server to be in your PATH + # or in `vim.extraPackages` package = ["jdt-language-server" "-data" "~/.cache/jdtls/workspace"]; }; } diff --git a/docs/manual/configuring/overriding-plugins.md b/docs/manual/configuring/overriding-plugins.md deleted file mode 100644 index 55979ce7..00000000 --- a/docs/manual/configuring/overriding-plugins.md +++ /dev/null @@ -1,35 +0,0 @@ -# Overriding plugins {#ch-overriding-plugins} - -The [additional plugins section](./hacking.html#sec-additional-plugins) details -the addition of new plugins to nvf under regular circumstances, i.e. while -making a pull request to the project. You may _override_ those plugins in your -config to change source versions, e.g., to use newer versions of plugins that -are not yet updated in **nvf**. - -```nix -vim.pluginOverrides = { - lazydev-nvim = pkgs.fetchFromGitHub { - owner = "folke"; - repo = "lazydev.nvim"; - rev = ""; - hash = ""; - }; - # It's also possible to use a flake input - lazydev-nvim = inputs.lazydev-nvim; - # Or a local path - lazydev-nvim = ./lazydev; - # Or a npins pin... etc -}; -``` - -This will override the source for the `lazydev.nvim` plugin that is used in nvf -with your own plugin. - -::: {.warning} - -While updating plugin inputs, make sure that any configuration that has been -deprecated in newer versions is changed in the plugin's `setupOpts`. If you -depend on a new version, requesting a version bump in the issues section is a -more reliable option. - -::: diff --git a/docs/manual/default-configs.md b/docs/manual/default-configs.md new file mode 100644 index 00000000..60f3d699 --- /dev/null +++ b/docs/manual/default-configs.md @@ -0,0 +1,9 @@ +# Default Configs {#ch-default-configs} + +While you can configure **nvf** yourself using the builder, you can also use the pre-built configs that are available. +Here are a few default configurations you can use. + +```{=include=} chapters +default-configs/maximal.md +default-configs/nix.md +``` diff --git a/docs/manual/default-configs/maximal.md b/docs/manual/default-configs/maximal.md new file mode 100644 index 00000000..49f95693 --- /dev/null +++ b/docs/manual/default-configs/maximal.md @@ -0,0 +1,13 @@ +# Maximal {#sec-default-maximal} + +```bash +$ nix shell github:notashelf/nvf#maximal test.nix +``` + +It is the same fully configured Neovim as with the [Nix](#sec-default-nix) +configuration, but with every supported language enabled. + +::: {.note} +Running the maximal config will download _a lot_ of packages as it is +downloading language servers, formatters, and more. +::: diff --git a/docs/manual/default-configs/nix.md b/docs/manual/default-configs/nix.md new file mode 100644 index 00000000..5210ef39 --- /dev/null +++ b/docs/manual/default-configs/nix.md @@ -0,0 +1,9 @@ +# Nix {#sec-default-nix} + +```bash +$ nix run github:notashelf/nvf#nix test.nix +``` + +Enables all the of Neovim plugins, with language support for specifically Nix. +This lets you see what a fully configured neovim setup looks like without +downloading a whole bunch of language servers and associated tools. diff --git a/docs/manual/hacking.md b/docs/manual/hacking.md index 7af0fed9..394022ba 100644 --- a/docs/manual/hacking.md +++ b/docs/manual/hacking.md @@ -1,606 +1,21 @@ # Hacking nvf {#ch-hacking} -[open issues]: https://github.com/notashelf/nvf/issues -[new issue]: https://github.com/notashelf/nvf/issues/new +**nvf** is designed for developers as much as it is for the end user. I would like any potential contributor +to be able to propagate their desired changes into the repository without the extra effort. As such, below are guides +(and guidelines) to streamline the contribution process and ensure that your valuable input seamlessly integrates +into **nvf**'s development without leaving question marks in your head. -nvf is designed for the developer as much as it is designed for the end-user. We -would like for any contributor to be able to propagate their changes, or add new -features to the project with minimum possible friction. As such, below are the -guides and guidelines written to streamline the contribution process and to -ensure that your valuable input integrates into nvf's development as seamlessly -as possible without leaving any question marks in your head. +This section is mainly directed towards those who wish to contribute code into **nvf**. If you wish to instead +report a bug or discuss a potential feature implementation, first look among the +already [open issues](https://github.com/notashelf/nvf/issues) and if no matching issue exists you may open +a [new issue](https://github.com/notashelf/nvf/issues/new) and describe your problem/request. While creating an +issue, please try to include as much information as you can, ideally also include relevant context in which an issue +occurs or a feature should be implemented. -This section is directed mainly towards those who wish to contribute code into -the project. If you instead wish to report a bug, or discuss a potential new -feature implementation (which you do not wish to implement yourself) first look -among the already [open issues] and if no matching issue exists you may open a -[new issue] and describe your problem/request. - -While creating an issue, please try to include as much information as you can, -ideally also include relevant context in which an issue occurs or a feature -should be implemented. If you wish to make a contribution, but feel stuck - -please do not be afraid to submit a pull request, we will help you get it in. - -## Getting Started {#sec-contrib-getting-started} - -You, naturally, would like to start by forking the repository to get started. If -you are new to Git and GitHub, do have a look at GitHub's -[Fork a repo guide](https://help.github.com/articles/fork-a-repo/) for -instructions on how you can do this. Once you have a fork of **nvf**, you should -create a separate branch based on the most recent `main` branch. Give your -branch a reasonably descriptive name (e.g. `feature/debugger` or -`fix/pesky-bug`) and you are ready to work on your changes - -Implement your changes and commit them to the newly created branch and when you -are happy with the result, and positive that it fulfills our -[Contributing Guidelines](#sec-guidelines), push the branch to GitHub and -[create a pull request](https://help.github.com/articles/creating-a-pull-request). -The default pull request template available on the **nvf** repository will guide -you through the rest of the process, and we'll gently nudge you in the correct -direction if there are any mistakes. - -## Guidelines {#sec-guidelines} - -If your contribution tightly follows the guidelines, then there is a good chance -it will be merged without too much trouble. Some of the guidelines will be -strictly enforced, others will remain as gentle nudges towards the correct -direction. As we have no automated system enforcing those guidelines, please try -to double check your changes before making your pull request in order to avoid -"faulty" code slipping by. - -If you are uncertain how these rules affect the change you would like to make -then feel free to start a discussion in the -[discussions tab](https://github.com/NotAShelf/nvf/discussions) ideally (but not -necessarily) before you start developing. - -### Adding Documentation {#sec-guidelines-documentation} - -[Nixpkgs Flavoured Markdown]: https://github.com/NixOS/nixpkgs/blob/master/doc/README.md#syntax - -Almost all changes warrant updates to the documentation: at the very least, you -must update the changelog. Both the manual and module options use -[Nixpkgs Flavoured Markdown]. - -The HTML version of this manual containing both the module option descriptions -and the documentation of **nvf** (such as this page) can be generated and opened -by typing the following in a shell within a clone of the **nvf** Git repository: - -```console -$ nix build .#docs-html -$ xdg-open $PWD/result/share/doc/nvf/index.html +```{=include=} sections +hacking/getting-started.md +hacking/guidelines.md +hacking/testing.md +hacking/keybinds.md +hacking/additional-plugins.md ``` - -### Formatting Code {#sec-guidelines-formatting} - -Make sure your code is formatted as described in -[code-style section](#sec-guidelines-code-style). To maintain consistency -throughout the project you are encouraged to browse through existing code and -adopt its style also in new code. - -### Formatting Commits {#sec-guidelines-commit-message-style} - -Similar to [code style guidelines](#sec-guidelines-code-style) we encourage a -consistent commit message format as described in -[commit style guidelines](#sec-guidelines-commit-style). - -### Commit Style {#sec-guidelines-commit-style} - -The commits in your pull request should be reasonably self-contained. Which -means each and every commit in a pull request should make sense both on its own -and in general context. That is, a second commit should not resolve an issue -that is introduced in an earlier commit. In particular, you will be asked to -amend any commit that introduces syntax errors or similar problems even if they -are fixed in a later commit. - -The commit messages should follow the -[seven rules](https://chris.beams.io/posts/git-commit/#seven-rule), except for -"Capitalize the subject line". We also ask you to include the affected code -component or module in the first line. A commit message ideally, but not -necessarily, follow the given template from home-manager's own documentation - -``` - {component}: {description} - - {long description} -``` - -where `{component}` refers to the code component (or module) your change -affects, `{description}` is a very brief description of your change, and -`{long description}` is an optional clarifying description. As a rare exception, -if there is no clear component, or your change affects many components, then the -`{component}` part is optional. See -[example commit message](#sec-guidelines-ex-commit-message) for a commit message -that fulfills these requirements. - -#### Example Commit {#sec-guidelines-ex-commit-message} - -The commit -[69f8e47e9e74c8d3d060ca22e18246b7f7d988ef](https://github.com/nix-community/home-manager/commit/69f8e47e9e74c8d3d060ca22e18246b7f7d988ef) -in home-manager contains the following commit message. - -``` -starship: allow running in Emacs if vterm is used - -The vterm buffer is backed by libvterm and can handle Starship prompts -without issues. -``` - -Similarly, if you are contributing to **nvf**, you would include the scope of -the commit followed by the description: - -``` -languages/ruby: init module - -Adds a language module for Ruby, adds appropriate formatters and Treesitter grammars -``` - -Long description can be omitted if the change is too simple to warrant it. A -minor fix in spelling or a formatting change does not warrant long description, -however, a module addition or removal does as you would like to provide the -relevant context, i.e. the reasoning behind it, for your commit. - -Finally, when adding a new module, say `modules/foo.nix`, we use the fixed -commit format `foo: add module`. You can, of course, still include a long -description if you wish. - -In case of nested modules, i.e `modules/languages/java.nix` you are recommended -to contain the parent as well - for example `languages/java: some major change`. - -### Code Style {#sec-guidelines-code-style} - -#### Treewide {#sec-code-style-treewide} - -Keep lines at a reasonable width, ideally 80 characters or less. This also -applies to string literals and module descriptions and documentation. - -#### Nix {#sec-code-style-nix} - -[alejandra]: https://github.com/kamadorueda/alejandra - -**nvf** is formatted by the [alejandra] tool and the formatting is checked in -the pull request and push workflows. Run the `nix fmt` command inside the -project repository before submitting your pull request. - -While Alejandra is mostly opinionated on how code looks after formatting, -certain changes are done at the user's discretion based on how the original code -was structured. - -Please use one line code for attribute sets that contain only one subset. For -example: - -```nix -# parent modules should always be unfolded -# which means module = { value = ... } instead of module.value = { ... } -module = { - value = mkEnableOption "some description" // { default = true; }; # merges can be done inline where possible - - # same as parent modules, unfold submodules - subModule = { - # this is an option that contains more than one nested value - # Note: try to be careful about the ordering of `mkOption` arguments. - # General rule of thumb is to order from least to most likely to change. - # This is, for most cases, type < default < description. - # Example, if present, would be between default and description - someOtherValue = mkOption { - type = lib.types.bool; - default = true; - description = "Some other description"; - }; - }; -} -``` - -If you move a line down after the merge operator, Alejandra will automatically -unfold the whole merged attrset for you, which we **do not** want. - -```nix -module = { - key = mkEnableOption "some description" // { - default = true; # we want this to be inline - }; # ... -} -``` - -For lists, it is mostly up to your own discretion how you want to format them, -but please try to unfold lists if they contain multiple items and especially if -they are to include comments. - -```nix -# this is ok -acceptableList = [ - item1 # comment - item2 - item3 # some other comment - item4 -]; - -# this is not ok -listToBeAvoided = [item1 item2 /* comment */ item3 item4]; - -# this is ok -acceptableList = [item1 item2]; - -# this is also ok if the list is expected to contain more elements -acceptableList= [ - item1 - item2 - # more items if needed... -]; -``` - -## Testing Changes {#sec-testing-changes} - -Once you have made your changes, you will need to test them thoroughly. If it is -a module, add your module option to `configuration.nix` (located in the root of -this project) inside `neovimConfiguration`. Enable it, and then run the maximal -configuration with `nix run .#maximal -Lv` to check for build errors. If neovim -opens in the current directory without any error messages (you can check the -output of `:messages` inside neovim to see if there are any errors), then your -changes are good to go. Open your pull request, and it will be reviewed as soon -as possible. - -If it is not a new module, but a change to an existing one, then make sure the -module you have changed is enabled in the maximal configuration by editing -`configuration.nix`, and then run it with `nix run .#maximal -Lv`. Same -procedure as adding a new module will apply here. - -## Keybinds {#sec-keybinds} - -As of 0.4, there exists an API for writing your own keybinds and a couple of -useful utility functions are available in the -[extended standard library](https://github.com/NotAShelf/nvf/tree/main/lib). The -following section contains a general overview to how you may utilize said -functions. - -## Custom Key Mappings Support for a Plugin {#sec-custom-key-mappings} - -To set a mapping, you should define it in `vim.keymaps`. - -An example, simple keybinding, can look like this: - -```nix -{ - vim.keymaps = [ - { - key = "wq"; - mode = ["n"]; - action = ":wq"; - silent = true; - desc = "Save file and quit"; - } - ]; -} -``` - -There are many settings available in the options. Please refer to the -[documentation](./options.html#option-vim-keymaps) to see a list of them. - -**nvf** provides a helper function, so that you don't have to write the mapping -attribute sets every time: - -- `mkKeymap`, which mimics neovim's `vim.keymap.set` function - -You can read the source code of some modules to see them in action, but the -usage should look something like this: - -```nix -# plugindefinition.nix -{lib, ...}: let - inherit (lib.options) mkEnableOption; - inherit (lib.nvim.binds) mkMappingOption; -in { - options.vim.plugin = { - enable = mkEnableOption "Enable plugin"; - - # Mappings should always be inside an attrset called mappings - mappings = { - workspaceDiagnostics = mkMappingOption "Workspace diagnostics [trouble]" "lwd"; - documentDiagnostics = mkMappingOption "Document diagnostics [trouble]" "ld"; - lspReferences = mkMappingOption "LSP References [trouble]" "lr"; - quickfix = mkMappingOption "QuickFix [trouble]" "xq"; - locList = mkMappingOption "LOCList [trouble]" "xl"; - symbols = mkMappingOption "Symbols [trouble]" "xs"; - }; -} -``` - -```nix -# config.nix -{ - config, - lib, - options, - ... -}: let - inherit (lib.modules) mkIf; - inherit (lib.nvim.binds) mkKeymap; - - cfg = config.vim.plugin; - - keys = cfg.mappings; - inherit (options.vim.lsp.trouble) mappings; -in { - config = mkIf cfg.enable { - vim.keymaps = [ - (mkKeymap "n" keys.workspaceDiagnostics "Trouble toggle diagnostics" {desc = mappings.workspaceDiagnostics.description;}) - (mkKeymap "n" keys.documentDiagnostics "Trouble toggle diagnostics filter.buf=0" {desc = mappings.documentDiagnostics.description;}) - (mkKeymap "n" keys.lspReferences "Trouble toggle lsp_references" {desc = mappings.lspReferences.description;}) - (mkKeymap "n" keys.quickfix "Trouble toggle quickfix" {desc = mappings.quickfix.description;}) - (mkKeymap "n" keys.locList "Trouble toggle loclist" {desc = mappings.locList.description;}) - (mkKeymap "n" keys.symbols "Trouble toggle symbols" {desc = mappings.symbols.description;}) - ]; - }; -} -``` - -> [!NOTE] -> If you have come across a plugin that has an API that doesn't seem to easily -> allow custom keybindings, don't be scared to implement a draft PR. We'll help -> you get it done. - -## Adding Plugins {#sec-additional-plugins} - -There are two methods for adding new Neovim plugins to **nvf**. npins is the -faster option that should be preferred if the plugin consists of pure Lua or -Vimscript code. In which case there is no building required, and we can easily -handle the copying of plugin files. Alternative method, which is required when -plugins try to build their own libraries (e.g., in Rust or C) that need to be -built with Nix to function correctly. - -### With npins {#sec-npins-for-plugins} - -npins is the standard method of adding new plugins to **nvf**. You simply need -the repository URL for the plugin, and can add it as a source to be built -automatically with one command. To add a new Neovim plugin, use `npins`. For -example: - -```bash -nix-shell -p npins # or nix shell nixpkgs#npins if using flakes -``` - -Then run: - -```bash -npins add --name github -b -``` - -::: {.note} - -Be sure to replace any non-alphanumeric characters with `-` for `--name`. For -example - -```bash -npins add --name lazydev-nvim github folke lazydev.nvim -b main -``` - -::: - -Once the `npins` command is done, you can start referencing the plugin as a -**string**. - -```nix -{ - config.vim.startPlugins = ["lazydev-nvim"]; -} -``` - -### Packaging Complex Plugins {#sec-pkgs-for-plugins} - -[blink.cmp]: https://github.com/Saghen/blink.cmp - -Some plugins require additional packages to be built and substituted to function -correctly. For example [blink.cmp] requires its own fuzzy matcher library, built -with Rust, to be installed or else defaults to a much slower Lua implementation. -In the Blink documentation, you are advised to build with `cargo` but that is -not ideal since we are leveraging the power of Nix. In this case the ideal -solution is to write a derivation for the plugin. - -We use `buildRustPackage` to build the library from the repository root, and -copy everything in the `postInstall` phase. - -```nix -postInstall = '' - cp -r {lua,plugin} "$out" - - mkdir -p "$out/doc" - cp 'doc/'*'.txt' "$out/doc/" - - mkdir -p "$out/target" - mv "$out/lib" "$out/target/release" -''; -``` - -In a similar fashion, you may utilize `stdenv.mkDerivation` and other Nixpkgs -builders to build your library from source, and copy the relevant files and Lua -plugin files in the `postInstall` phase. Do note, however, that you still need -to fetch the plugin sources somehow. npins is, once again, the recommended -option to fetch the plugin sources. Refer to the previous section on how to use -npins to add a new plugin. - -Plugins built from source must go into the `flake/pkgs/by-name` overlay. It will -automatically create flake outputs for individual packages. Lastly, you must add -your package to the plugin builder (`pluginBuilders`) function manually in -`modules/wrapper/build/config.nix`. Once done, you may refer to your plugin as a -**string**. - -```nix -{ - config.vim.startPlugins = ["blink-cmp"]; -} -``` - -### Modular setup options {#sec-modular-setup-options} - -Most plugins is initialized with a call to `require('plugin').setup({...})`. - -We use a special function that lets you easily add support for such setup -options in a modular way: `mkPluginSetupOption`. - -Once you have added the source of the plugin as shown above, you can define the -setup options like this: - -```nix -# in modules/.../your-plugin/your-plugin.nix - -{lib, ...}: -let - inherit (lib.types) bool int; - inherit (lib.nvim.types) mkPluginSetupOption; -in { - options.vim.your-plugin = { - setupOpts = mkPluginSetupOption "plugin name" { - enable_feature_a = mkOption { - type = bool; - default = false; - # ... - }; - - number_option = mkOption { - type = int; - default = 3; - # ... - }; - }; - }; -} -``` - -```nix -# in modules/.../your-plugin/config.nix -{lib, config, ...}: -let - cfg = config.vim.your-plugin; -in { - vim.luaConfigRC = lib.nvim.dag.entryAnywhere '' - require('plugin-name').setup(${lib.nvim.lua.toLuaObject cfg.setupOpts}) - ''; -} -``` - -This above config will result in this Lua script: - -```lua -require('plugin-name').setup({ - enable_feature_a = false, - number_option = 3, -}) -``` - -Now users can set any of the pre-defined option field, and can also add their -own fields! - -```nix -# in user's config -{ - vim.your-plugin.setupOpts = { - enable_feature_a = true; - number_option = 4; - another_field = "hello"; - size = { # nested fields work as well - top = 10; - }; - }; -} -``` - -### Details of toLuaObject {#sec-details-of-toluaobject} - -As you've seen above, `toLuaObject` is used to convert our nix attrSet -`cfg.setupOpts`, into a lua table. Here are some rules of the conversion: - -1. Nix `null` converts to lua `nil` -2. Number and strings convert to their lua counterparts -3. Nix attribute sets (`{}`) and lists (`[]`) convert into Lua dictionaries and - tables respectively. Here is an example of Nix -> Lua conversion. - - `{foo = "bar"}` -> `{["foo"] = "bar"}` - - `["foo" "bar"]` -> `{"foo", "bar"}` -4. You can write raw Lua code using `lib.generators.mkLuaInline`. This function - is part of nixpkgs, and is accessible without relying on **nvf**'s extended - library. - - `mkLuaInline "function add(a, b) return a + b end"` will yield the - following result: - - ```nix - { - _type = "lua-inline"; - expr = "function add(a, b) return a + b end"; - } - ``` - - The above expression will be interpreted as a Lua expression in the final - config. Without the `mkLuaInline` function, you will only receive a string - literal. You can use it to feed plugin configuration tables Lua functions - that return specific values as expected by the plugins. - - ```nix - { - vim.your-plugin.setupOpts = { - on_init = lib.generators.mkLuaInline '' - function() - print('we can write lua!') - end - ''; - }; - } - ``` - -### Lazy plugins {#sec-lazy-plugins} - -If the plugin can be lazy-loaded, `vim.lazy.plugins` should be used to add it. -Lazy plugins are managed by `lz.n`. - -```nix -# in modules/.../your-plugin/config.nix -{config, ...}: let - cfg = config.vim.your-plugin; -in { - vim.lazy.plugins.your-plugin = { - # Instead of vim.startPlugins, use this: - package = "your-plugin"; - - # ıf your plugin uses the `require('your-plugin').setup{...}` pattern - setupModule = "your-plugin"; - inherit (cfg) setupOpts; - - # Events that trigger this plugin to be loaded - event = ["DirChanged"]; - cmd = ["YourPluginCommand"]; - - # Plugin Keymaps - keys = [ - # We'll cover this in detail in the 'keybinds' section - { - key = "d"; - mode = "n"; - action = ":YourPluginCommand"; - } - ]; - }; -} -``` - -This results in the following lua code: - -```lua -require('lz.n').load({ - { - "name-of-your-plugin", - after = function() - require('your-plugin').setup({ - --[[ your setupOpts ]]-- - }) - end, - - event = {"DirChanged"}, - cmd = {"YourPluginCommand"}, - keys = { - {"d", ":YourPluginCommand", mode = {"n"}}, - }, - } -}) -``` - -[`vim.lazy.plugins` spec]: ./options.html#option-vim-lazy-plugins - -A full list of options can be found in the [`vim.lazy.plugins` spec] on the -rendered manual. diff --git a/docs/manual/hacking/additional-plugins.md b/docs/manual/hacking/additional-plugins.md new file mode 100644 index 00000000..7c802154 --- /dev/null +++ b/docs/manual/hacking/additional-plugins.md @@ -0,0 +1,126 @@ +# Adding Plugins {#sec-additional-plugins} + +To add a new Neovim plugin, first add the source url in the inputs section of `flake.nix` +with the prefix `plugin-` + +```nix + +{ + inputs = { + # ... + plugin-neodev-nvim = { + url = "github:folke/neodev.nvim"; + flake = false; + }; + # ... + }; +} +``` + +The addition of the `plugin-` prefix will allow **nvf** to autodiscover the +input from the flake inputs automatically, allowing you to refer to it in areas +that require a very specific plugin type as defined in `lib/types/plugins.nix` + +You can now reference this plugin using its string name, the plugin will be +built with the name and source URL from the flake input, allowing you to +refer to it as a **string**. + +```nix +config.vim.startPlugins = ["neodev-nvim"]; +``` + +## Modular setup options {#sec-modular-setup-options} + +Most plugins is initialized with a call to `require('plugin').setup({...})`. + +We use a special function that lets you easily add support for such setup options in a modular way: +`mkPluginSetupOption`. + +Once you have added the source of the plugin as shown above, you can define the setup options like +this: + +```nix +# in modules/.../your-plugin/your-plugin.nix + +{lib, ...}: +let + inherit (lib.types) bool int; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.your-plugin = { + setupOpts = mkPluginSetupOption "plugin name" { + enable_feature_a = mkOption { + type = bool; + default = false; + # ... + }; + + number_option = mkOption { + type = int; + default = 3; + # ... + }; + }; + }; +} +``` + +```nix +# in modules/.../your-plugin/config.nix +{lib, config, ...}: +let + cfg = config.vim.your-plugin; +in { + vim.luaConfigRC = lib.nvim.dag.entryAnywhere '' + require('plugin-name').setup(${lib.nvim.lua.toLuaObject cfg.setupOpts}) + ''; +} +``` + +This above config will result in this lua script: + +```lua +require('plugin-name').setup({ + enable_feature_a = false, + number_option = 3, +}) +``` + +Now users can set any of the pre-defined option field, and can also add their own fields! + +```nix +# in user's config +{ + vim.your-plugin.setupOpts = { + enable_feature_a = true; + number_option = 4; + another_field = "hello"; + size = { # nested fields work as well + top = 10; + }; + }; +} +``` + +## Details of toLuaObject {#sec-details-of-toluaobject} + +As you've seen above, `toLuaObject` is used to convert our nix attrSet +`cfg.setupOpts`, into a lua table. Here are some rules of the conversion: + +1. nix `null` converts to lua `nil` +2. number and strings convert to their lua counterparts +3. nix attrSet/list convert into lua tables +4. you can write raw lua code using `lib.generators.mkLuaInline`. This + function is part of nixpkgs. + +Example: + +```nix +vim.your-plugin.setupOpts = { + on_init = lib.generators.mkLuaInline '' + function() + print('we can write lua!') + end + ''; +} +``` diff --git a/docs/manual/hacking/getting-started.md b/docs/manual/hacking/getting-started.md new file mode 100644 index 00000000..72927dcf --- /dev/null +++ b/docs/manual/hacking/getting-started.md @@ -0,0 +1,16 @@ +# Getting Started {#sec-contrib-getting-started} + +You, naturally, would like to start by forking the repository to get started. If +you are new to Git and GitHub, do have a look at GitHub's [Fork a repo guide](https://help.github.com/articles/fork-a-repo/) +for instructions on how you can do this. Once you have a fork of **nvf**, you +should create a separate branch based on the msot recent `main` branch. Give +your branch a reasonably descriptive name (e.g. `feature/debugger` or +`fix/pesky-bug`) and you are ready to work on your changes + +Implement your changes and commit them to the newly created branch and when you +are happy with the result, and positive that it fullfills our [Contributing +Guidelines](#sec-guidelines), push the branch to GitHub and [create a pull +request](https://help.github.com/articles/creating-a-pull-request). The default +pull request template available on the **nvf** repository will guide you through +the rest of the process, and we'll gently nudge you in the correct direction if +there are any mistakes. diff --git a/docs/manual/hacking/guidelines.md b/docs/manual/hacking/guidelines.md new file mode 100644 index 00000000..e0afe258 --- /dev/null +++ b/docs/manual/hacking/guidelines.md @@ -0,0 +1,185 @@ +# Guidelines {#sec-guidelines} + +If your contribution tightly follows the guidelines, then there is a good chance +it will be merged without too much trouble. Some of the guidelines will be +strictly enforced, others will remain as gentle nudges towards the correct +direction. As we have no automated system enforcing those guidelines, please +try to double check your changes before making your pull request in order to +avoid "faulty" code slipping by. + +If you are uncertain how these rules affect the change you would like to make +then feel free to start a discussion in the [discussions tab](https://github.com/NotAShelf/nvf/discussions) +ideally (but not necessarily) before you start developing. + +## Adding Documentation {#sec-guidelines-documentation} + +Most, if not all, changes warrant changes to the documentation. Module options +should be documented with [Nixpkgs-flavoured Markdown](https://nixos.org/manual/nixpkgs/unstable/#sec-contributing-markup), +albeit with exceptions. + +::: {.note} +As of **v0.5**, **nvf** is itself documented using full markdown in both module +options and the manual. With **v0.6**, this manual has also been converted to +markdown in full. +::: + +The HTML version of this manual containing both the module option descriptions +and the documentation of **nvf** (such as this page) can be generated and +opened by typing the following in a shell within a clone of the **nvf** Git +repository: + +```console +$ nix build .#docs-html +$ xdg-open $PWD/result/share/doc/nvf/index.html +``` + +## Formatting Code {#sec-guidelines-formatting} + +Make sure your code is formatted as described in [code-style +section](#sec-guidelines-code-style). To maintain consistency throughout the +project you are encouraged to browse through existing code and adopt its style +also in new code. + +## Formatting Commits {#sec-guidelines-commit-message-style} + +Similar to [code style guidelines](#sec-guidelines-code-style) we encourage a +consistent commit message format as described in [commit style +guidelines](#sec-guidelines-commit-style). + +## Commit Style {#sec-guidelines-commit-style} + +The commits in your pull request should be reasonably self-contained. Which +means each and every commit in a pull request should make sense both on its +own and in general context. That is, a second commit should not resolve an +issue that is introduced in an earlier commit. In particular, you will be +asked to amend any commit that introduces syntax errors or similar problems +even if they are fixed in a later commit. + +The commit messages should follow the [seven +rules](https://chris.beams.io/posts/git-commit/#seven-rule), except for +"Capitalize the subject line". We also ask you to include the affected code +component or module in the first line. A commit message ideally, but not +necessarily, follow the given template from home-manager's own documentation + +``` + {component}: {description} + + {long description} +``` + +where `{component}` refers to the code component (or module) your change +affects, `{description}` is a very brief description of your change, and +`{long description}` is an optional clarifying description. As a rare +exception, if there is no clear component, or your change affects many +components, then the `{component}` part is optional. See [example commit +message](#sec-guidelines-ex-commit-message) for a commit message that +fulfills these requirements. + +## Example Commit {#sec-guidelines-ex-commit-message} + +The commit [69f8e47e9e74c8d3d060ca22e18246b7f7d988ef](https://github.com/nix-community/home-manager/commit/69f8e47e9e74c8d3d060ca22e18246b7f7d988ef) +in home-manager contains the following commit message. + +``` +starship: allow running in Emacs if vterm is used + +The vterm buffer is backed by libvterm and can handle Starship prompts +without issues. +``` + +Similarly, if you are contributing to **nvf**, you would include the scope of +the commit followed by the description: + +``` +languages/ruby: init module + +Adds a language module for Ruby, adds appropriate formatters and Treesitter grammers +``` + +Long description can be ommitted if the change is too simple to warrant it. A +minor fix in spelling or a formatting change does not warrant long description, +however, a module addition or removal does as you would like to provide the +relevant context, i.e. the reasoning behind it, for your commit. + +Finally, when adding a new module, say `modules/foo.nix`, we use the fixed +commit format `foo: add module`. You can, of course, still include a long +description if you wish. + +In case of nested modules, i.e `modules/languages/java.nix` you are recommended +to contain the parent as well - for example `languages/java: some major change`. + +## Code Style {#sec-guidelines-code-style} + +### Treewide {#sec-code-style-treewide} + +Keep lines at a reasonable width, ideally 80 characters or less. This also applies +to string literals and module descriptions and documentation. + +### Nix {#sec-code-style-nix} + +**nvf** is formatted by the [alejandra](https://github.com/kamadorueda/alejandra) +tool and the formatting is checked in the pull request and push workflows. Run the +`nix fmt` command inside the project repository before submitting your pull request. + +While Alejandra is mostly opinionated on how code looks after formatting, +certain changes are done at the user's discretion based on how the original +code was structured. + +Please use one line code for attribute sets that contain only one subset. +For example: + +```nix +# parent modules should always be unfolded +# which means module = { value = ... } instead of module.value = { ... } +module = { + value = mkEnableOption "some description" // { default = true; }; # merges can be done inline where possible + + # same as parent modules, unfold submodules + subModule = { + # this is an option that contains more than one nested value + someOtherValue = mkOption { + type = lib.types.bool; + description = "Some other description"; + default = true; + }; + }; +} +``` + +If you move a line down after the merge operator, Alejandra will automatically +unfold the whole merged attrset for you, which we **do not** want. + +```nix +module = { + key = mkEnableOption "some description" // { + default = true; # we want this to be inline + }; # ... +} +``` + +For lists, it is mostly up to your own discretion how you want to format them, +but please try to unfold lists if they contain multiple items and especially +if they are to include comments. + +```nix +# this is ok +acceptableList = [ + item1 # comment + item2 + item3 # some other comment + item4 +]; + +# this is not ok +listToBeAvoided = [item1 item2 /* comment */ item3 item4]; + +# this is ok +acceptableList = [item1 item2]; + +# this is also ok if the list is expected to contain more elements +acceptableList= [ + item1 + item2 + # more items if needed... +]; +``` diff --git a/docs/manual/hacking/keybinds.md b/docs/manual/hacking/keybinds.md new file mode 100644 index 00000000..f4a51499 --- /dev/null +++ b/docs/manual/hacking/keybinds.md @@ -0,0 +1,178 @@ +# Keybinds {#sec-keybinds} + +As of 0.4, there exists an API for writing your own keybinds and a couple of +useful utility functions are available in the [extended standard +library](https://github.com/NotAShelf/nvf/tree/main/lib). The following +section contains a general overview to how you may utilize said functions. + +## Custom Key Mappings Support for a Plugin {#sec-custom-key-mappings} + +To set a mapping, you should define it in `vim.maps.<>`. +The available modes are: + +- normal +- insert +- select +- visual +- terminal +- normalVisualOp +- visualOnly +- operator +- insertCommand +- lang +- command + +An example, simple keybinding, can look like this: + +```nix +{ + vim.maps.normal = { + "wq" = { + action = ":wq"; + silent = true; + desc = "Save file and quit"; + }; + }; +} +``` + +There are many settings available in the options. Please refer to the +[documentation](https://notashelf.github.io/nvf/options.html#opt-vim.maps.command._name_.action) +to see a list of them. + +**nvf** provides a list of helper commands, so that you don't have to write the +mapping attribute sets every time: + +- `mkBinding = key: action: desc:` - makes a basic binding, with `silent` set + to true. +- `mkExprBinding = key: action: desc:` - makes an expression binding, with + `lua`, `silent`, and `expr` set to true. +- `mkLuaBinding = key: action: desc:` - makes an expression binding, with + `lua`, and `silent` set to true. + +Do note that the Lua in these bindings is actual Lua, and not pasted into a +`:lua` command. Therefore, you should either pass in a function like +`require('someplugin').some_function`, without actually calling it, or you +should define your own functions, for example + +```lua +function() + require('someplugin').some_function() +end +``` + +Additionally, to not have to repeat the descriptions, there's another utility +function with its own set of functions: Utility function that takes two +attribute sets: + +- `{ someKey = "some_value" }` +- `{ someKey = { description = "Some Description"; }; }` + +and merges them into `{ someKey = { value = "some_value"; description = "Some Description"; }; }` + +```nix +addDescriptionsToMappings = actualMappings: mappingDefinitions: +``` + +This function can be used in combination with the same `mkBinding` functions as +above, except they only take two arguments - `binding` and `action`, and have +different names: + +- `mkSetBinding = binding: action:` - makes a basic binding, with `silent` + set to true. +- `mkSetExprBinding = binding: action:` - makes an expression binding, with + `lua`, `silent`, and `expr` set to true. +- `mkSetLuaBinding = binding: action:` - makes an expression binding, with + `lua`, and `silent` set to true. + +You can read the source code of some modules to see them in action, but their +usage should look something like this: + +```nix +# plugindefinition.nix +{lib, ...}: with lib; { + options.vim.plugin = { + enable = mkEnableOption "Enable plugin"; + + # Mappings should always be inside an attrset called mappings + mappings = { + # mkMappingOption is a helper function from lib, + # that takes a description (which will also appear in which-key), + # and a default mapping (which can be null) + toggleCurrentLine = mkMappingOption "Toggle current line comment" "gcc"; + toggleCurrentBlock = mkMappingOption "Toggle current block comment" "gbc"; + + toggleOpLeaderLine = mkMappingOption "Toggle line comment" "gc"; + toggleOpLeaderBlock = mkMappingOption "Toggle block comment" "gb"; + + toggleSelectedLine = mkMappingOption "Toggle selected comment" "gc"; + toggleSelectedBlock = mkMappingOption "Toggle selected block" "gb"; + }; + + }; +} +``` + +```nix +# config.nix +{ + config, + pkgs, + lib, + ... +}: + with lib; + with builtins; let + cfg = config.vim.plugin; + self = import ./plugindefinition.nix {inherit lib;}; + mappingDefinitions = self.options.vim.plugin; + + # addDescriptionsToMappings is a helper function from lib, + # that merges mapping values and their descriptions + # into one nice attribute set + mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions; +in { + config = mkIf (cfg.enable) { + # ... + vim.maps.normal = mkMerge [ + # mkSetBinding is another helper function from lib, + # that actually adds the mapping with a description. + (mkSetBinding mappings.findFiles " Telescope find_files") + (mkSetBinding mappings.liveGrep " Telescope live_grep") + (mkSetBinding mappings.buffers " Telescope buffers") + (mkSetBinding mappings.helpTags " Telescope help_tags") + (mkSetBinding mappings.open " Telescope") + + (mkSetBinding mappings.gitCommits " Telescope git_commits") + (mkSetBinding mappings.gitBufferCommits " Telescope git_bcommits") + (mkSetBinding mappings.gitBranches " Telescope git_branches") + (mkSetBinding mappings.gitStatus " Telescope git_status") + (mkSetBinding mappings.gitStash " Telescope git_stash") + + (mkIf config.vim.lsp.enable (mkMerge [ + (mkSetBinding mappings.lspDocumentSymbols " Telescope lsp_document_symbols") + (mkSetBinding mappings.lspWorkspaceSymbols " Telescope lsp_workspace_symbols") + + (mkSetBinding mappings.lspReferences " Telescope lsp_references") + (mkSetBinding mappings.lspImplementations " Telescope lsp_implementations") + (mkSetBinding mappings.lspDefinitions " Telescope lsp_definitions") + (mkSetBinding mappings.lspTypeDefinitions " Telescope lsp_type_definitions") + (mkSetBinding mappings.diagnostics " Telescope diagnostics") + ])) + + ( + mkIf config.vim.treesitter.enable + (mkSetBinding mappings.treesitter " Telescope treesitter") + ) + ]; + # ... + }; +} + +``` + +::: {.note} +If you have come across a plugin that has an API that doesn't seem to easily +allow custom keybindings, don't be scared to implement a draft PR. We'll help +you get it done. +::: diff --git a/docs/manual/hacking/testing.md b/docs/manual/hacking/testing.md new file mode 100644 index 00000000..10830b61 --- /dev/null +++ b/docs/manual/hacking/testing.md @@ -0,0 +1,15 @@ +# Testing Changes {#sec-testing-changes} + +Once you have made your changes, you will need to test them throughly. If it is +a module, add your module option to `configuration.nix` (located in the root of +this project) inside `neovimConfiguration`. Enable it, and then run the maximal +configuration with `nix run .#maximal -Lv` to check for build errors. If neovim +opens in the current directory without any error messages (you can check the +output of `:messages` inside neovim to see if there are any errors), then your +changes are good to go. Open your pull request, and it will be reviewed as soon +as posssible. + +If it is not a new module, but a change to an existing one, then make sure the +module you have changed is enabled in the maximal configuration by editing +`configuration.nix`, and then run it with `nix run .#maximal -Lv`. Same procedure +as adding a new module will apply here. diff --git a/docs/manual/index.md b/docs/manual/index.md deleted file mode 100644 index b07a8aca..00000000 --- a/docs/manual/index.md +++ /dev/null @@ -1,101 +0,0 @@ -# Introduction {#nvf-manual} - -Version @NVF_VERSION@ - -## Preface {#ch-preface} - -### What is nvf {#sec-what-is-it} - -**nvf** is a highly modular, configurable, extensible and easy to use Neovim -configuration framework built and designed to be used with Nix. Boasting -flexibility, robustness and ease of use, this projecct allows you to configure a -fully featured Neovim instance with a few lines of Nix with lots of options for -advanced users as well. - -## Try it out {#ch-try-it-out} - -Thanks to the portability of Nix, you can try out nvf without actually -installing it to your machine. Below are the commands you may run to try out -different configurations provided by this flake. As of v0.5, two specialized -configurations are provided: - -- **Nix** (`packages.nix`) - Nix language server + simple utility plugins -- **Maximal** (`packages.maximal`) - Variable language servers + utility and - decorative plugins - -You may try out any of the provided configurations using the `nix run` command -on a system where Nix is installed. - -```sh -$ cachix use nvf # Optional: it'll save you CPU resources and time -$ nix run github:notashelf/nvf#nix # Will run the default minimal configuration -``` - -Do keep in mind that this is **susceptible to garbage collection** meaning that -the built outputs will be removed from your Nix store once you garbage collect. - -## Using Prebuilt Configs {#sec-using-prebuilt-configs} - -```bash -$ nix run github:notashelf/nvf#nix -$ nix run github:notashelf/nvf#maximal -``` - -### Available Configurations {#sec-available-configs} - -> [!NOTE] -> The below configurations are provided for demonstration purposes, and are -> **not** designed to be installed as is. You may refer to the installation -> steps below and the helpful tips section for details on creating your own -> configurations. - -#### Nix {#sec-configs-nix} - -`Nix` configuration by default provides LSP/diagnostic support for Nix alongside -a set of visual and functional plugins. By running `nix run .#`, which is the -default package, you will build Neovim with this config. - -```bash -$ nix run github:notashelf/nvf#nix test.nix -# => This will open a file called `test.nix` with Nix LSP and syntax highlighting -``` - -This command will start Neovim with some opinionated plugin configurations, and -is designed specifically for Nix. the `nix` configuration lets you see how a -fully configured Neovim setup _might_ look like without downloading too many -packages or shell utilities. - -#### Maximal {#sec-configs-maximal} - -`Maximal` is the ultimate configuration that will enable support for more -commonly used language as well as additional complementary plugins. Keep in -mind, however, that this will pull a lot of dependencies. - -```bash -$ nix run github:notashelf/nvf#maximal -- test.nix -# => This will open a file called `test.nix` with a variety of plugins available -``` - -It uses the same configuration template with the [Nix](#sec-configs-nix) -configuration, but supports many more languages, and enables more utility, -companion or fun plugins. - -> [!WARNING] -> Running the maximal config will download _a lot_ of packages as it is -> downloading language servers, formatters, and more. If CPU time and bandwidth -> are concerns, please use the default package instead. - -## Installing nvf {#ch-installation} - -[module installation section]: #ch-module-installation - -There are multiple ways of installing nvf on your system. You may either choose -the standalone installation method, which does not depend on a module system and -may be done on any system that has the Nix package manager or the appropriate -modules for NixOS and home-manager as described in the -[module installation section]. - -```{=include=} -installation/custom-configuration.md -installation/modules.md -``` diff --git a/docs/manual/installation.md b/docs/manual/installation.md new file mode 100644 index 00000000..afe60d16 --- /dev/null +++ b/docs/manual/installation.md @@ -0,0 +1,11 @@ +# Installing nvf {#ch-installation} + +There are multiple ways of installing nvf on your system. You may either choose +the standalone installation method, which does not depend on a module system and may +be done on any system that has the Nix package manager or the appropriate modules +for NixOS and home-manager as described in the [module installation section](#ch-module-installation) + +```{=include=} chapters +installation/custom-configuration.md +installation/modules.md +``` diff --git a/docs/manual/installation/custom-configuration.md b/docs/manual/installation/custom-configuration.md index 52f81573..408b0399 100644 --- a/docs/manual/installation/custom-configuration.md +++ b/docs/manual/installation/custom-configuration.md @@ -1,9 +1,8 @@ # Standalone Installation {#ch-standalone-installation} -It is possible to install nvf without depending on NixOS or Home-Manager as the -parent module system, using the `neovimConfiguration` function exposed in the -extended library. This function will take `modules` and `extraSpecialArgs` as -arguments, and return the following schema as a result. +It is possible to install **nvf** without depending on NixOS or home-manager as the parent +module system, using the `neovimConfiguration` function exposed by **nvf** extended library. +It takes in the configuration as a module, and returns an attribute set as a result. ```nix { @@ -14,53 +13,6 @@ arguments, and return the following schema as a result. } ``` -An example flake that exposes your custom Neovim configuration might look like - -```nix -{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - nvf.url = "github:notashelf/nvf"; - }; - - outputs = {nixpkgs, ...} @ inputs: { - packages.x86_64-linux = { - # Set the default package to the wrapped instance of Neovim. - # This will allow running your Neovim configuration with - # `nix run` and in addition, sharing your configuration with - # other users in case your repository is public. - default = - (inputs.nvf.lib.neovimConfiguration { - pkgs = nixpkgs.legacyPackages.x86_64-linux; - modules = [ - { - config.vim = { - # Enable custom theming options - theme.enable = true; - - # Enable Treesitter - treesitter.enable = true; - - # Other options will go here. Refer to the config - # reference in Appendix B of the nvf manual. - # ... - }; - } - ]; - }) - .neovim; - }; - }; -} -``` - - - -The above setup will allow to set up nvf as a standalone flake, which you can -build independently from your system configuration while also possibly sharing -it with others. The next two chapters will detail specific usage of such a setup -for a package output in the context of NixOS or Home-Manager installation. - ```{=include=} chapters standalone/nixos.md standalone/home-manager.md diff --git a/docs/manual/installation/modules.md b/docs/manual/installation/modules.md index f78046de..d8462e9d 100644 --- a/docs/manual/installation/modules.md +++ b/docs/manual/installation/modules.md @@ -1,9 +1,5 @@ # Module Installation {#ch-module-installation} -The below chapters will describe installing nvf as NixOS and Home-Manager -modules. Note that those methods are mutually exclusive, and will likely cause -path collisions if used simultaneously. - ```{=include=} chapters modules/nixos.md modules/home-manager.md diff --git a/docs/manual/installation/modules/flakes.md b/docs/manual/installation/modules/flakes.md deleted file mode 100644 index 273d2b00..00000000 --- a/docs/manual/installation/modules/flakes.md +++ /dev/null @@ -1,33 +0,0 @@ -### Prerequisites {#sec-flakes-prerequisites} - -To install nvf with flakes, you must make sure the following requirements are -met. - -1. Nix 2.4 or later must be installed. You may use `nix-shell` to get a later - version of Nix from nixpkgs. -2. Flake-related experimental features must be enabled. Namely, you need - `nix-command` and `flakes`. Some Nix vendors enable those by default, please - consult their documentation if you are not using mainstream Nix. - - When using NixOS, add the following to your `configuration.nix` and rebuild - your system. - - ```nix - nix.settings.experimental-features = "nix-command flakes"; - ``` - - - If you are not using NixOS, add the following to `nix.conf` (located at - `~/.config/nix/` or `/etc/nix/nix.conf`). - - ```bash - experimental-features = nix-command flakes - ``` - - - You may need to restart the Nix daemon with, for example, - `sudo systemctl restart nix-daemon.service`. - - - Alternatively, you can enable flakes on a per-command basis with the - following additional flags to `nix` and `home-manager`: - - ```sh - $ nix --extra-experimental-features "nix-command flakes" - ``` diff --git a/docs/manual/installation/modules/home-manager.md b/docs/manual/installation/modules/home-manager.md index 37d35e2b..6764f797 100644 --- a/docs/manual/installation/modules/home-manager.md +++ b/docs/manual/installation/modules/home-manager.md @@ -5,37 +5,20 @@ inside the home-manager configuration without having to call for the wrapper yourself. It is the recommended way to use **nvf** alongside the NixOS module depending on your needs. -## With Flakes {#sec-hm-flakes} - -```{=include=} -flakes.md -``` - -### Usage {#sec-hm-flakes-usage} - -To use **nvf** with flakes, we first need to add the input to our `flake.nix`. +To use it, we first add the input flake. ```nix -# flake.nix { inputs = { - # Optional, if you intend to follow nvf's obsidian-nvim input - # you must also add it as a flake input. obsidian-nvim.url = "github:epwalsh/obsidian.nvim"; - - # Required, nvf works best and only directly supports flakes nvf = { - url = "github:NotAShelf/nvf"; - # You can override the input nixpkgs to follow your system's - # instance of nixpkgs. This is safe to do as nvf does not depend - # on a binary cache. + url = "github:notashelf/nvf"; + # you can override input nixpkgs inputs.nixpkgs.follows = "nixpkgs"; - # Optionally, you can also override individual plugins + # you can also override individual plugins # for example: inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs }; - - # ... }; } ``` @@ -44,13 +27,13 @@ Followed by importing the home-manager module somewhere in your configuration. ```nix { - # Assuming "nvf" is in your inputs and inputs is in the argument set. - # See example installation below + # assuming nvf is in your inputs and inputs is in the argset + # see example below imports = [ inputs.nvf.homeManagerModules.default ]; } ``` -### Example Installation {#sec-example-installation-hm} +## Example Installation {#sec-example-installation-hm} ```nix { @@ -60,13 +43,13 @@ Followed by importing the home-manager module somewhere in your configuration. nvf.url = "github:notashelf/nvf"; }; - outputs = { nixpkgs, home-manager, nvf, ... }: { + outputs = { nixpkgs, home-manager, nvf, ... }: let + system = "x86_64-linux"; in { # ↓ this is your home output in the flake schema, expected by home-manager - "your-username@your-hostname" = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages.x86_64-linux; + "your-username@your-hostname" = home-manager.lib.homeManagerConfiguration modules = [ nvf.homeManagerModules.default # <- this imports the home-manager module that provides the options - ./home.nix # <- your home entrypoint, `programs.nvf.*` may be defined here + ./home.nix # <- your home entrypoint ]; }; }; @@ -77,8 +60,7 @@ Once the module is properly imported by your host, you will be able to use the `programs.nvf` module option anywhere in your configuration in order to configure **nvf**. -```nix -{ +```nix{ programs.nvf = { enable = true; # your settings need to go into the settings attribute set @@ -95,51 +77,7 @@ configure **nvf**. ``` ::: {.note} - **nvf** exposes a lot of options, most of which are not referenced in the -installation sections of the manual. You may find all available options in the -[appendix](https://notashelf.github.io/nvf/options) - -::: - -## Without Flakes {#sec-hm-flakeless} - -As of v0.8, it is possible to install **nvf** on a system if you are not using -flakes. This is possible thanks to the flake-compat project. - -To get started, you must fetch the repository using `builtins.fetchTarball` or a -similar mechanism. - -```nix -# home.nix -let - nvf = import (builtins.fetchTarball { - url = "https://github.com/notashelf/nvf/archive/.tar.gz"; - # Optionally, you can add 'sha256' for verification and caching - # sha256 = ""; - }); -in { - imports = [ - # Import the NixOS module from your fetched input - nvf.homeManagerModules.nvf - ]; - - # Once the module is imported, you may use `programs.nvf` as exposed by the - # NixOS module. - programs.nvf.enable = true; -} -``` - -[npins]: https://github.com/andir/npins -[niv]: https://github.com/nmattia/niv - -::: {.tip} - -Nix2 does not have a builtin lockfile mechanism like flakes. As such you must -manually update the URL and hash for your input. This is annoying to deal with, -and most users choose to defer this task to projects such as [npins] or [niv]. -If you are new to NixOS, I encourage you to look into Flakes and see if they fit -your use case. Alternatively, look into the aforementioned projects for more -convenient dependency management mechanisms. - +installation sections of the manual. You may find all avaliable options +in the [appendix](https://notashelf.github.io/nvf/options) ::: diff --git a/docs/manual/installation/modules/nixos.md b/docs/manual/installation/modules/nixos.md index 946905c1..9cbc1447 100644 --- a/docs/manual/installation/modules/nixos.md +++ b/docs/manual/installation/modules/nixos.md @@ -5,37 +5,20 @@ the NixOS configuration without having to call for the wrapper yourself. It is the recommended way to use **nvf** alongside the home-manager module depending on your needs. -## With Flakes {#sec-nixos-flakes} - -```{=include=} -flakes.md -``` - -### Usage {#sec-nixos-flakes-usage} - -To use **nvf** with flakes, we first need to add the input to our `flake.nix`. +To use it, we first add the input flake. ```nix -# flake.nix { inputs = { - # Optional, if you intend to follow nvf's obsidian-nvim input - # you must also add it as a flake input. obsidian-nvim.url = "github:epwalsh/obsidian.nvim"; - - # Required, nvf works best and only directly supports flakes nvf = { - url = "github:NotAShelf/nvf"; - # You can override the input nixpkgs to follow your system's - # instance of nixpkgs. This is safe to do as nvf does not depend - # on a binary cache. + url = "github:notashelf/nvf"; + # you can override input nixpkgs inputs.nixpkgs.follows = "nixpkgs"; - # Optionally, you can also override individual plugins + # you can also override individual plugins # for example: inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs }; - - # ... }; } ``` @@ -50,7 +33,7 @@ Followed by importing the NixOS module somewhere in your configuration. } ``` -### Example Installation {#sec-example-installation-nixos} +## Example Installation {#sec-example-installation-nixos} ```nix { @@ -59,12 +42,13 @@ Followed by importing the NixOS module somewhere in your configuration. nvf.url = "github:notashelf/nvf"; }; - outputs = { nixpkgs, nvf, ... }: { + outputs = { nixpkgs, nvf, ... }: let + system = "x86_64-linux"; in { # ↓ this is your host output in the flake schema - nixosConfigurations."your-hostname" = nixpkgs.lib.nixosSystem { + nixosConfigurations."yourUsername»" = nixpkgs.lib.nixosSystem { modules = [ nvf.nixosModules.default # <- this imports the NixOS module that provides the options - ./configuration.nix # <- your host entrypoint, `programs.nvf.*` may be defined here + ./configuration.nix # <- your host entrypoint ]; }; }; @@ -75,12 +59,10 @@ Once the module is properly imported by your host, you will be able to use the `programs.nvf` module option anywhere in your configuration in order to configure **nvf**. -```nix -{ +```nix{ programs.nvf = { enable = true; - - # Your settings need to go into the settings attribute set + # your settings need to go into the settings attribute set # most settings are documented in the appendix settings = { vim.viAlias = false; @@ -94,51 +76,7 @@ configure **nvf**. ``` ::: {.note} - **nvf** exposes a lot of options, most of which are not referenced in the -installation sections of the manual. You may find all available options in the -[appendix](https://notashelf.github.io/nvf/options) - -::: - -## Without Flakes {#sec-nixos-flakeless} - -As of v0.8, it is possible to install **nvf** on a system if you are not using -flakes. This is possible thanks to the flake-compat project. - -To get started, you must fetch the repository using `builtins.fetchTarball` or a -similar mechanism. - -```nix -# configuration.nix -let - nvf = import (builtins.fetchTarball { - url = "https://github.com/notashelf/nvf/archive/.tar.gz"; - # Optionally, you can add 'sha256' for verification and caching - # sha256 = ""; - }); -in { - imports = [ - # Import the NixOS module from your fetched input - nvf.nixosModules.nvf - ]; - - # Once the module is imported, you may use `programs.nvf` as exposed by the - # NixOS module. - programs.nvf.enable = true; -} -``` - -[npins]: https://github.com/andir/npins -[niv]: https://github.com/nmattia/niv - -::: {.tip} - -Nix2 does not have a builtin lockfile mechanism like flakes. As such you must -manually update the URL and hash for your input. This is annoying to deal with, -and most users choose to defer this task to projects such as [npins] or [niv]. -If you are new to NixOS, I encourage you to look into Flakes and see if they fit -your use case. Alternatively, look into the aforementioned projects for more -convenient dependency management mechanisms. - +installation sections of the manual. You may find all avaliable options +in the [appendix](https://notashelf.github.io/nvf/options) ::: diff --git a/docs/manual/installation/standalone/home-manager.md b/docs/manual/installation/standalone/home-manager.md index 0c1dc025..db1ae632 100644 --- a/docs/manual/installation/standalone/home-manager.md +++ b/docs/manual/installation/standalone/home-manager.md @@ -1,12 +1,12 @@ # Standalone Installation on Home-Manager {#ch-standalone-hm} -Your built Neovim configuration can be exposed as a flake output to make it +Your built Neoevim configuration can be exposed as a flake output to make it easier to share across machines, repositories and so on. Or it can be added to your system packages to make it available across your system. The following is an example installation of `nvf` as a standalone package with the default theme enabled. You may use other options inside `config.vim` in -`configModule`, but this example will not cover that extensively. +`configModule`, but this example will not cover that. ```nix { @@ -30,22 +30,23 @@ the default theme enabled. You may use other options inside `config.vim` in }; customNeovim = nvf.lib.neovimConfiguration { - inherit pkgs; modules = [configModule]; + inherit pkgs; }; in { - # This will make the package available as a flake output under 'packages' + # this will make the package available as a flake input packages.${system}.my-neovim = customNeovim.neovim; - # Example Home-Manager configuration using the configured Neovim package + # this is an example home-manager configuration + # using the built neovim package homeConfigurations = { "your-username@your-hostname" = home-manager.lib.homeManagerConfiguration { # ... modules = [ - # This will make Neovim available to users using the Home-Manager - # configuration. To make the package available to all users, prefer - # environment.systemPackages in your NixOS configuration. - {home.packages = [customNeovim.neovim];} + ./home.nix + + # this will make wrapped neovim available in your system packages + {environment.systemPackages = [customNeovim.neovim];} ]; # ... }; diff --git a/docs/manual/installation/standalone/nixos.md b/docs/manual/installation/standalone/nixos.md index 65dc9205..2e6343a1 100644 --- a/docs/manual/installation/standalone/nixos.md +++ b/docs/manual/installation/standalone/nixos.md @@ -1,12 +1,12 @@ # Standalone Installation on NixOS {#ch-standalone-nixos} -Your built Neovim configuration can be exposed as a flake output to make it +Your built Neoevim configuration can be exposed as a flake output to make it easier to share across machines, repositories and so on. Or it can be added to your system packages to make it available across your system. The following is an example installation of `nvf` as a standalone package with the default theme enabled. You may use other options inside `config.vim` in -`configModule`, but this example will not cover that extensively. +`configModule`, but this example will not cover that. ```nix { @@ -16,44 +16,36 @@ the default theme enabled. You may use other options inside `config.vim` in nvf.url = "github:notashelf/nvf"; }; - outputs = { - nixpkgs, - nvf, - self, - ... - }: { - # This will make the package available as a flake output under 'packages' - packages.x86_64-linux.my-neovim = - (nvf.lib.neovimConfiguration { - pkgs = nixpkgs.legacyPackages.x86_64-linux; - modules = [ - # Or move this to a separate file and add it's path here instead - # IE: ./nvf_module.nix - ( - {pkgs, ...}: { - # Add any custom options (and do feel free to upstream them!) - # options = { ... }; - config.vim = { - theme.enable = true; - # and more options as you see fit... - }; - } - ) - ]; - }) - .neovim; + outputs = {nixpkgs, nvf, ...}: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + configModule = { + # Add any custom options (and do feel free to upstream them!) + # options = { ... }; - # Example nixosConfiguration using the configured Neovim package + config.vim = { + theme.enable = true; + # and more options as you see fit... + }; + }; + + customNeovim = nvf.lib.neovimConfiguration { + modules = [configModule]; + inherit pkgs; + }; + in { + # this will make the package available as a flake input + packages.${system}.my-neovim = customNeovim.neovim; + + # this is an example nixosConfiguration using the built neovim package nixosConfigurations = { yourHostName = nixpkgs.lib.nixosSystem { # ... modules = [ - # This will make wrapped neovim available in your system packages - # Can also move this to another config file if you pass your own - # inputs/self around with specialArgs - ({pkgs, ...}: { - environment.systemPackages = [self.packages.${pkgs.stdenv.system}.neovim]; - }) + ./configuration.nix # or whatever your configuration is + + # this will make wrapped neovim available in your system packages + {environment.systemPackages = [customNeovim.neovim];} ]; # ... }; diff --git a/docs/manual/manual.md b/docs/manual/manual.md new file mode 100644 index 00000000..3d80b0c8 --- /dev/null +++ b/docs/manual/manual.md @@ -0,0 +1,26 @@ +# nvf manual {#nvf-manual} + +## Version @NVF_VERSION@ + +```{=include=} preface +preface.md +try-it-out.md +``` + +```{=include=} parts +default-configs.md +installation.md +configuring.md +``` + +```{=include=} chapters +hacking.md +``` + +```{=include=} appendix html:into-file=//options.html +options.md +``` + +```{=include=} appendix html:into-file=//release-notes.html +release-notes/release-notes.md +``` diff --git a/docs/manual/options.md b/docs/manual/options.md new file mode 100644 index 00000000..748e3180 --- /dev/null +++ b/docs/manual/options.md @@ -0,0 +1,11 @@ +# Neovim Flake Configuration Options {#ch-options} + +Below are the options provided by nvf provided in no particular order. +They may include useful comments and warnings, or examples on how a module option +is meant to be used. + +```{=include=} options +id-prefix: opt- +list-id: nvf-options +source: @OPTIONS_JSON@ +``` diff --git a/docs/manual/preface.md b/docs/manual/preface.md new file mode 100644 index 00000000..26e30704 --- /dev/null +++ b/docs/manual/preface.md @@ -0,0 +1,7 @@ +# Preface {#ch-preface} + +If you noticed a bug caused by **nvf** then please consider reporting it over +[the issue tracker](https://github.com/notashelf/nvf/issues). + +Bugfixes, feature additions and upstreamed changes from your local configurations +are always welcome in the [the pull requests tab](https://github.com/notashelf/nvf/pulls). diff --git a/docs/manual/quirks.md b/docs/manual/quirks.md deleted file mode 100644 index 17f7abaf..00000000 --- a/docs/manual/quirks.md +++ /dev/null @@ -1,45 +0,0 @@ -# Known Issues and Quirks {#ch-known-issues-quirks} - -At times, certain plugins and modules may refuse to play nicely with your setup, -be it a result of generating Lua from Nix, or the state of packaging. This page, -in turn, will list any known modules or plugins that are known to misbehave, and -possible workarounds that you may apply. - -## NodeJS {#ch-quirks-nodejs} - -### eslint-plugin-prettier {#sec-eslint-plugin-prettier} - -When working with NodeJS, everything works as expected, but some projects have -settings that can fool nvf. - -If [this plugin](https://github.com/prettier/eslint-plugin-prettier) or similar -is included, you might get a situation where your eslint configuration diagnoses -your formatting according to its own config (usually `.eslintrc.js`). - -The issue there is your formatting is made via prettierd. - -This results in auto-formatting relying on your prettier config, while your -eslint config diagnoses formatting -[which it's not supposed to](https://prettier.io/docs/en/comparison.html)) - -In the end, you get discrepancies between what your editor does and what it -wants. - -Solutions are: - -1. Don't add a formatting config to eslint, and separate prettier and eslint. -2. PR this repo to add an ESLint formatter and configure nvf to use it. - -## Bugs & Suggestions {#ch-bugs-suggestions} - -[issue tracker]: https://github.com/notashelf/nvf/issues -[discussions tab]: https://github.com/notashelf/nvf/discussions -[pull requests tab]: https://github.com/notashelf/nvf/pulls - -Some quirks are not exactly quirks, but bugs in the module systeme. If you -notice any issues with nvf, or this documentation, then please consider -reporting them over at the [issue tracker]. Issues tab, in addition to the -[discussions tab] is a good place as any to request new features. - -You may also consider submitting bugfixes, feature additions and upstreamed -changes that you think are critical over at the [pull requests tab]. diff --git a/docs/manual/release-notes.md b/docs/manual/release-notes.md deleted file mode 100644 index 296b20b1..00000000 --- a/docs/manual/release-notes.md +++ /dev/null @@ -1,15 +0,0 @@ -# Release Notes {#ch-release-notes} - -This section lists the release notes for tagged version of **nvf** and the -current main current main branch - -```{=include=} chapters -release-notes/rl-0.1.md -release-notes/rl-0.2.md -release-notes/rl-0.3.md -release-notes/rl-0.4.md -release-notes/rl-0.5.md -release-notes/rl-0.6.md -release-notes/rl-0.7.md -release-notes/rl-0.8.md -``` diff --git a/docs/manual/release-notes/rl-0.1.md b/docs/manual/release-notes/rl-0.1.md deleted file mode 100644 index bdb922b5..00000000 --- a/docs/manual/release-notes/rl-0.1.md +++ /dev/null @@ -1,49 +0,0 @@ -# Release 0.1 {#sec-release-0-1} - -This is the current master branch and information here is not final. These are -changes from the v0.1 tag. - -Special thanks to [home-manager](https://github.com/nix-community/home-manager/) -for this release. Docs/manual generation, the new module evaluation system, and -DAG implementation are from them. - -## Changelog {#sec-release-0-1-changelog} - -[jordanisaacs](https://github.com/jordanisaacs): - -- Removed hare language support (lsp/tree-sitter/etc). `vim.lsp.hare` is no - longer defined. If you use hare and would like it added back, please file an - issue. - -- {option}`vim.startPlugins` & {option} `vim-optPlugins` are now an enum of - `string` for options sourced from the flake inputs. Users can still provide - vim plugin packages. - - - If you are contributing and adding a new plugin, add the plugin name to - `availablePlugins` in [types-plugin.nix]. - -- `neovimBuilder` has been removed for configuration. Using an overlay is no - longer required. See the manual for the new way to configuration. - -[relevant discourse post]: https://discourse.nixos.org/t/psa-if-you-are-on-unstable-try-out-nvim-treesitter-withallgrammars/23321?u=snowytrees - -- Treesitter grammars are now configurable with - {option}`vim.treesitter.grammars`. Utilizes the nixpkgs `nvim-treesitter` - plugin rather than a custom input in order to take advantage of build support - of pinned versions. See the [relevant discourse post] for more information. - Packages can be found under the `vimPlugins.nvim-treesitter.builtGrammars` - namespace. - -- `vim.configRC` and {option}`vim.luaConfigRC` are now of type DAG lines. This - allows for ordering of the config. Usage is the same is in home-manager's - `home.activation` option. - -```nix -vim.luaConfigRC = lib.nvim.dag.entryAnywhere "config here" -``` - -[MoritzBoehme](https://github.com/MoritzBoehme): - -- `catppuccin` theme is now available as a neovim theme - {option}`vim.theme.style` and Lualine theme - {option}`vim.statusline.lualine.theme`. diff --git a/docs/manual/release-notes/rl-0.2.md b/docs/manual/release-notes/rl-0.2.md deleted file mode 100644 index d3ac1384..00000000 --- a/docs/manual/release-notes/rl-0.2.md +++ /dev/null @@ -1,48 +0,0 @@ -# Release 0.2 {#sec-release-0-2} - -Release notes for release 0.2 - -## Changelog {#sec-release-0-2-changelog} - -[notashelf](https://github.com/notashelf): - -- Added two minimap plugins under `vim.minimap`. `codewindow.nvim` is enabled by - default, while `minimap.vim` is available with its code-minimap dependency. -- A complementary plugin, `obsidian.nvim` and the Neovim alternative for Emacs' - orgmode with `orgmode.nvim` have been added. Both will be disabled by default. -- Smooth scrolling for ANY movement command is now available with - `cinnamon.nvim` -- You will now notice a dashboard on startup. This is provided by the - `alpha.nvim` plugin. You can use any of the three available dashboard plugins, - or disable them entirely. -- There is now a scrollbar on active buffers, which can highlight errors by - hooking to your LSPs. This is on by default, but can be toggled off under - `vim.visuals` if seen necessary. -- Discord Rich Presence has been added through `presence.nvim` for those who - want to flex that they are using the _superior_ text editor. -- An icon picker is now available with telescope integration. You can use - `:IconPickerInsert` or `:IconPickerYank` to add icons to your code. -- A general-purpose cheatsheet has been added through `cheatsheet.nvim`. Forget - no longer! -- `ccc.nvim` has been added to the default plugins to allow picking colors with - ease. -- Most UI components of Neovim have been replaced through the help of - `noice.nvim`. There are also notifications and custom UI elements available - for Neovim messages and prompts. -- A (floating by default) terminal has been added through `toggleterm.nvim`. -- Harness the power of ethical (`tabnine.nvim`) and not-so-ethical - (`copilot.lua`) AI by those new assistant plugins. Both are off by default, - TabNine needs to be wrapped before it's working. -- Experimental mouse gestures have been added through `gesture.nvim`. See plugin - page and the relevant module for more details on how to use. -- Re-open last visited buffers via `nvim-session-manager`. Disabled by default - as deleting buffers seems to be problematic at the moment. -- Most of NvimTree's configuration options have been changed with some options - being toggled to off by default. -- Lualine had its configuration simplified and style toned down. Less color, - more info. -- Modules where multiple plugin configurations were in the same directory have - been simplified. Each plugin inside a single module gets its directory to be - imported. -- Separate config options with the same parent attribute have been merged into - one for simplicity. diff --git a/docs/manual/release-notes/rl-0.3.md b/docs/manual/release-notes/rl-0.3.md deleted file mode 100644 index 0658f1f0..00000000 --- a/docs/manual/release-notes/rl-0.3.md +++ /dev/null @@ -1,102 +0,0 @@ -# Release 0.3 {#sec-release-0-3} - -Release 0.3 had to come out before I wanted it to due to Neovim 0.9 dropping -into nixpkgs-unstable. The Treesitter changes have prompted a Treesitter rework, -which was followed by reworking the languages system. Most of the changes to -those are downstreamed from the original repository. The feature requests that -was originally planned for 0.3 have been moved to 0.4, which should come out -soon. - -## Changelog {#sec-release-0-3-changelog} - -- We have transitioned to flake-parts, from flake-utils to extend the - flexibility of this flake. This means the flake structure is different than - usual, but the functionality remains the same. - -- We now provide a home-manager module. Do note that it is still far from - perfect, but it works. - -- `nodejs_16` is now bundled with `Copilot.lua` if the user has enabled Copilot - assistant. - -- which-key section titles have been fixed. This is to be changed once again in - a possible keybind rewrite, but now it should display the correct titles - instead of `+prefix` - -- Most of `presence.nvim`'s options have been made fully configurable through - your configuration file. - -- Most of the modules have been refactored to separate `config` and `options` - attributes. - -- Darwin has been deprecated as the Zig package is marked as broken. We will - attempt to use the Zig overlay to return Darwin support. - -- `Fidget.nvim` has been added as a neat visual addition for LSP installations. - -- `diffview.nvim` has been added to provide a convenient diff utility. - - [discourse]: https://discourse.nixos.org/t/psa-if-you-are-on-unstable-try-out-nvim-treesitter-withallgrammars/23321?u=snowytrees - -- Treesitter grammars are now configurable with - {option}`vim.treesitter.grammars`. Utilizes the nixpkgs `nvim-treesitter` - plugin rather than a custom input in order to take advantage of build support - of pinned versions. See [discourse] for more information. Packages can be - found under the `pkgs.vimPlugins.nvim-treesitter.builtGrammars` attribute. - Treesitter grammars for supported languages should be enabled within the - module. By default no grammars are installed, thus the following grammars - which do not have a language section are not included anymore: **comment**, - **toml**, **make**, **html**, **css**, **graphql**, **json**. - -- A new section has been added for language support: `vim.languages.`. - - - The options `enableLSP` {option}`vim.languages.enableTreesitter`, etc. will - enable the respective section for all languages that have been enabled. - - All LSP languages have been moved here - - `plantuml` and `markdown` have been moved here - - A new section has been added for `html`. The old - `vim.treesitter.autotagHtml` can be found at - {option}`vim.languages.html.treesitter.autotagHtml`. - -- `vim.git.gitsigns.codeActions` has been added, allowing you to turn on - Gitsigns' code actions. - -- Removed the plugins document in the docs. Was too unwieldy to keep updated. - -- `vim.visual.lspkind` has been moved to {option}`vim.lsp.lspkind.enable` - -- Improved handling of completion formatting. When setting - `vim.autocomplete.sources`, can also include optional menu mapping. And can - provide your own function with `vim.autocomplete.formatting.format`. - -- For `vim.visuals.indentBlankline.fillChar` and - `vim.visuals.indentBlankline.eolChar` options, turning them off should be done - by using `null` rather than `""` now. - -- Transparency has been made optional and has been disabled by default. - {option}`vim.theme.transparent` option can be used to enable or disable - transparency for your configuration. - -- Fixed deprecated configuration method for Tokyonight, and added new style - "moon" - -- Dart language support as well as extended flutter support has been added. - Thanks to @FlafyDev for his contributions towards Dart language support. - -- Elixir language support has been added through `elixir-tools.nvim`. - -- `hop.nvim` and `leap.nvim` have been added for fast navigation. - -- `modes.nvim` has been added to the UI plugins as a minor error highlighter. - -- `smartcollumn.nvim` has been added to dynamically display a colorcolumn when - the limit has been exceeded, providing per-buftype column position and more. - -- `project.nvim` has been added for better project management inside Neovim. - -- More configuration options have been added to `nvim-session-manager`. - -- Editorconfig support has been added to the core functionality, with an enable - option. - -- `venn-nvim` has been dropped due to broken keybinds. diff --git a/docs/manual/release-notes/rl-0.5.md b/docs/manual/release-notes/rl-0.5.md deleted file mode 100644 index 51e144a2..00000000 --- a/docs/manual/release-notes/rl-0.5.md +++ /dev/null @@ -1,115 +0,0 @@ -# Release 0.5 {#sec-release-0-5} - -## Changelog {#sec-release-0-5-changelog} - -[vagahbond](https://github.com/vagahbond): - -- Added phan language server for PHP - -- Added phpactor language server for PHP - -[horriblename](https://github.com/horriblename): - -- Added transparency support for tokyonight theme - -- Fixed a bug where cmp's close and scrollDocs mappings wasn't working - -- Streamlined and simplified extra plugin API with the addition of - {option}`vim.extraPlugins` - -- Allow using command names in place of LSP packages to avoid automatic - installation - -- Add lua LSP and Treesitter support, and neodev.nvim plugin support - -- Add {option}`vim.lsp.mappings.toggleFormatOnSave` keybind - -[amanse](https://github.com/amanse): - -- Added daily notes options for obsidian plugin - -- Added `jdt-language-server` for Java - -[yavko](https://github.com/yavko): - -- Added Deno Language Server for Javascript/Typescript - -- Added support for multiple languages under `vim.spellChecking.languages`, and - added vim-dirtytalk through `vim.spellChecking.enableProgrammingWordList` - -[frothymarrow](https://github.com/FrothyMarrow): - -- Renamed `vim.visuals.cursorWordline` to `vim.visuals.cursorline.enable` - -- Added `vim.visuals.cursorline.lineNumbersOnly` to display cursorline only in - the presence of line numbers - -- Added Oxocarbon to the list of available themes. - -[notashelf](https://github.com/notashelf): - -- Added GitHub Copilot to nvim-cmp completion sources. - -- Added {option}`vim.ui.borders.enable` for global and individual plugin border - configuration. - -- LSP integrated breadcrumbs with {option}`vim.ui.breadcrumbs.enable` through - nvim-navic - -- LSP navigation helper with nvim-navbuddy, depends on nvim-navic (automatically - enabled if navic is enabled) - -- Added nvim-navic integration for Catppuccin theme - -- Fixed mismatching Zig language description - -- Added support for `statix` and `deadnix` through - {option}`vim.languages.nix.extraDiagnostics.types` - -- Added `lsp_lines` plugin for showing diagnostic messages - -- Added a configuration option for choosing the leader key - -- The package used for neovim is now customizable by the user, using - {option}`vim.package`. For best results, always use an unwrapped package - -- Added highlight-undo plugin for highlighting undo/redo targets - -- Added bash LSP and formatter support - -- Disabled Lualine LSP status indicator for Toggleterm buffer - -- Added `nvim-docs-view`, a plugin to display LSP hover documentation in a side - panel - -- Switched to `nixosOptionsDoc` in option documentation. To quote home-manager - commit: "Output is mostly unchanged aside from some minor typographical and - formatting changes, along with better source links." - -- Updated indent-blankine.nvim to v3 - this comes with a few option changes, - which will be migrated with `renamedOptionModule` - -[poz](https://poz.pet): - -- Fixed scrollOffset not being used - -- Updated clangd to 16 - -- Disabled `useSystemClipboard` by default - -[ksonj](https://github.com/ksonj): - -- Add support to change mappings to utility/surround - -- Add black-and-isort python formatter - -- Removed redundant "Enable ..." in `mkEnableOption` descriptions - -- Add options to modify LSP key bindings and add proper which-key descriptions - -- Changed type of `statusline.lualine.activeSection` and - `statusline.lualine.inactiveSection` from `attrsOf str` to - `attrsOf (listOf str)` - -- Added `statusline.lualine.extraActiveSection` and - `statusline.lualine.extraInactiveSection` diff --git a/docs/manual/release-notes/rl-0.6.md b/docs/manual/release-notes/rl-0.6.md deleted file mode 100644 index f40ecb43..00000000 --- a/docs/manual/release-notes/rl-0.6.md +++ /dev/null @@ -1,183 +0,0 @@ -# Release 0.6 {#sec-release-0-6} - -Release notes for release 0.6 - -## Breaking Changes and Migration Guide {#sec-breaking-changes-and-migration-guide} - -In v0.6 we are introducing `setupOpts`: many plugin related options are moved -into their respective `setupOpts` submodule, e.g. `nvimTree.disableNetrw` is -renamed to `nvimTree.setupOpts.disable_netrw`. - -_Why?_ in short, you can now pass in anything to setupOpts and it will be passed -to your `require'plugin'.setup{...}`. No need to wait for us to support every -single plugin option. - -The warnings when you rebuild your config should be enough to guide you through -what you need to do, if there's an option that was renamed but wasn't listed in -the warning, please file a bug report! - -To make your migration process less annoying, here's a keybind that will help -you with renaming stuff from camelCase to snake_case (you'll be doing that a -lot): - -```lua --- paste this in a temp.lua file and load it in vim with :source /path/to/temp.lua -function camelToSnake() - -- Get the current word under the cursor - local word = vim.fn.expand("") - -- Replace each capital letter with an underscore followed by its lowercase equivalent - local snakeCase = string.gsub(word, "%u", function(match) - return "_" .. string.lower(match) - end) - -- Remove the leading underscore if present - if string.sub(snakeCase, 1, 1) == "_" then - snakeCase = string.sub(snakeCase, 2) - end - vim.fn.setreg(vim.v.register, snakeCase) - -- Select the word under the cursor and paste - vim.cmd("normal! viwP") -end - -vim.api.nvim_set_keymap('n', 'a', ':lua camelToSnake()', { noremap = true, silent = true }) -``` - -## Changelog {#sec-release-0-6-changelog} - -[ksonj](https://github.com/ksonj): - -- Added Terraform language support. - -- Added `ChatGPT.nvim`, which can be enabled with - {option}`vim.assistant.chatgpt.enable`. Do keep in mind that this option - requires `OPENAI_API_KEY` environment variable to be set. - -[donnerinoern](https://github.com/donnerinoern): - -- Added Gruvbox theme. - -- Added marksman LSP for Markdown. - -- Fixed markdown preview with Glow not working and added an option for changing - the preview keybind. - -- colorizer.nvim: switched to a maintained fork. - -- Added `markdown-preview.nvim`, moved `glow.nvim` to a brand new - `vim.utility.preview` category. - -[elijahimmer](https://github.com/elijahimmer) - -- Added rose-pine theme. - -[poz](https://poz.pet): - -- Added `vim.autocomplete.alwaysComplete`. Allows users to have the autocomplete - window popup only when manually activated. - -[horriblename](https://github.com/horriblename): - -- Fixed empty winbar when breadcrumbs are disabled. - -- Added custom `setupOpts` for various plugins. - -- Removed support for deprecated plugin "nvim-compe". - -- Moved most plugins to `setupOpts` method. - -[frothymarrow](https://github.com/frothymarrow): - -- Added option `vim.luaPackages` to wrap neovim with extra Lua packages. - -- Rewrote the entire `fidget.nvim` module to include extensive configuration - options. Option `vim.fidget-nvim.align.bottom` has been removed in favor of - `vim.fidget-nvim.notification.window.align`, which now supports `top` and - `bottom` values. `vim.fidget-nvim.align.right` has no longer any equivalent - and also has been removed. - -- `which-key.nvim` categories can now be customized through - [vim.binds.whichKey.register](./options.html#option-vim-binds-whichKey-register) - -- Added `magick` to `vim.luaPackages` for `image.nvim`. - -- Added `alejandra` to the default devShell. - -- Migrated neovim-flake to `makeNeovimUnstable` wrapper. - -[notashelf](https://github.com/notashelf): - -- Finished moving to `nixosOptionsDoc` in the documentation and changelog. All - documentation options and files are fully free of Asciidoc, and will now use - Nixpkgs flavored markdown. - -- Bumped plugin inputs to their latest versions. - -- Deprecated `presence.nvim` in favor of `neocord`. This means - `vim.rich-presence.presence-nvim` is removed and will throw a warning if used. - You are recommended to rewrite your neocord configuration from scratch based - on the. [official documentation](https://github.com/IogaMaster/neocord) - -- Removed Tabnine plugin due to the usage of imperative tarball downloads. If - you'd like to see it back, please create an issue. - -- Added support for css and tailwindcss through - vscode-language-servers-extracted & tailwind-language-server. Those can be - enabled through `vim.languages.css` and `vim.languages.tailwind`. - -- Lualine module now allows customizing `always_divide_middle`, `ignore_focus` - and `disabled_filetypes` through the new options: - [vim.statusline.lualine.alwaysDivideMiddle](./options.html#option-vim-statusline-lualine-alwaysDivideMiddle), - [vim.statusline.lualine.ignoreFocus](./options.html#option-vim-statusline-lualine-ignoreFocus) - and - [vim.statusline.lualine.disabledFiletypes](./options.html#option-vim-statusline-lualine-disabledFiletypes). - -- Updated all plugin inputs to their latest versions (**21.04.2024**) - this - brought minor color changes to the Catppuccin theme. - -- Moved home-manager module entrypoint to `flake/modules` and added an - experimental Nixos module. This requires further testing before it can be - considered ready for use. - -- Made lib calls explicit. E.g. `lib.strings.optionalString` instead of - `lib.optionalString`. This is a pattern expected to be followed by all - contributors in the future. - -- Added `image.nvim` for image previews. - -- The final neovim package is now exposed. This means you can build the neovim - package that will be added to your package list without rebuilding your system - to test if your configuration yields a broken package. - -- Changed the tree structure to distinguish between core options and plugin - options. - -- Added plugin auto-discovery from plugin inputs. This is mostly from - [JordanIsaac's neovim-flake](https://github.com/jordanisaacs/neovim-flake). - Allows contributors to add plugin inputs with the `plugin-` prefix to have - them automatically discovered for the `plugin` type in `lib/types`. - -- Moved internal `wrapLuaConfig` to the extended library, structured its - arguments to take `luaBefore`, `luaConfig` and `luaAfter` as strings, which - are then concatted inside a lua block. - -- Added {option}`vim.luaConfigPre` and {option} `vim-luaConfigPost` for - inserting verbatim Lua configuration before and after the resolved Lua DAG - respectively. Both of those options take strings as the type, so you may read - the contents of a Lua file from a given path. - -- Added `vim.spellchecking.ignoredFiletypes` and - `vim.spellChecking.programmingWordlist.enable` for ignoring certain filetypes - in spellchecking and enabling `vim-dirtytalk` respectively. The previously - used `vim.spellcheck.vim-dirtytalk` aliases to the latter option. - -- Exposed `withRuby`, `withNodeJs`, `withPython3`, and `python3Packages` from - the `makeNeovimConfig` function under their respective options. - -- Added {option}`vim.extraPackages` for appending additional packages to the - wrapper PATH, making said packages available while inside the Neovim session. - -- Made Treesitter options configurable, and moved treesitter-context to - `setupOpts` while it is enabled. - -- Added {option}`vim.notify.nvim-notify.setupOpts.render` which takes either a - string of enum, or a Lua function. The default is "compact", but you may - change it according to nvim-notify documentation. diff --git a/docs/manual/release-notes/rl-0.7.md b/docs/manual/release-notes/rl-0.7.md deleted file mode 100644 index 36d61105..00000000 --- a/docs/manual/release-notes/rl-0.7.md +++ /dev/null @@ -1,390 +0,0 @@ -# Release 0.7 {#sec-release-0-7} - -Release notes for release 0.7 - -## Breaking Changes and Migration Guide {#sec-breaking-changes-and-migration-guide-0-7} - -### `vim.configRC` removed {#sec-vim-configrc-removed} - -In v0.7 we are removing `vim.configRC` in favor of making `vim.luaConfigRC` the -top-level DAG, and thereby making the entire configuration Lua based. This -change introduces a few breaking changes: - -[DAG entries in nvf manual]: /index.xhtml#ch-dag-entries - -- `vim.configRC` has been removed, which means that you have to convert all of - your custom vimscript-based configuration to Lua. As for how to do that, you - will have to consult the Neovim documentation and your search engine. -- After migrating your Vimscript-based configuration to Lua, you might not be - able to use the same entry names in `vim.luaConfigRC`, because those have also - slightly changed. See the new [DAG entries in nvf manual] for more details. - -**Why?** - -Neovim being an aggressive refactor of Vim, is designed to be mainly Lua based; -making good use of its extensive Lua API. Additionally, Vimscript is slow and -brings unnecessary performance overhead while working with different -configuration formats. - -### `vim.maps` rewrite {#sec-vim-maps-rewrite} - -Instead of specifying map modes using submodules (e.g., `vim.maps.normal`), a -new `vim.keymaps` submodule with support for a `mode` option has been -introduced. It can be either a string, or a list of strings, where a string -represents the short-name of the map mode(s), that the mapping should be set -for. See `:help map-modes` for more information. - -For example: - -```nix -vim.maps.normal."m" = { ... }; -``` - -has to be replaced by - -```nix -vim.keymaps = [ - { - key = "m"; - mode = "n"; - } - ... -]; -``` - -### `vim.lsp.nvimCodeActionMenu` removed in favor of `vim.ui.fastaction` {#sec-nvim-code-action-menu-deprecation} - -The nvim-code-action-menu plugin has been archived and broken for a long time, -so it's being replaced with a young, but better alternative called -fastaction.nvim. Simply remove everything set under -`vim.lsp.nvimCodeActionMenu`, and set `vim.ui.fastaction.enable` to `true`. - -Note that we are looking to add more alternatives in the future like -dressing.nvim and actions-preview.nvim, in case fastaction doesn't work for -everyone. - -### `type` based modules removed {#sec-type-based-modules-removed} - -As part of the autocompletion rewrite, modules that used to use a `type` option -have been replaced by per-plugin modules instead. Since both modules only had -one type, you can simply change - -- `vim.autocomplete.*` -> `vim.autocomplete.nvim-cmp.*` -- `vim.autopairs.enable` -> `vim.autopairs.nvim-autopairs.enable` - -### `nixpkgs-fmt` removed in favor of `nixfmt` {#sec-nixpkgs-fmt-deprecation} - -`nixpkgs-fmt` has been archived for a while, and it's finally being removed in -favor of nixfmt (more information can be found -[here](https://github.com/nix-community/nixpkgs-fmt?tab=readme-ov-file#nixpkgs-fmt---nix-code-formatter-for-nixpkgs). - -To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to -`nixfmt`. - -### leader changes {#sec-leader-changes} - -This has been deprecated in favor of using the more generic `vim.globals` (you -can use `vim.globals.mapleader` to change this instead). - -Rust specific keymaps now use `maplocalleader` instead of `localleader` by -default. This is to avoid conflicts with other modules. You can change -`maplocalleader` with `vim.globals.maplocalleader`, but it's recommended to set -it to something other than `mapleader` to avoid conflicts. - -### `vim.*` changes {#sec-vim-opt-changes} - -Inline with the [leader changes](#sec-leader-changes), we have removed some -options that were under `vim` as convenient shorthands for `vim.o.*` options. - -::: {.warning} - -As v0.7 features the addition of {option}`vim.options`, those options are now -considered as deprecated. You should migrate to the appropriate options in the -`vim.options` submodule. - -::: - -The changes are, in no particular order: - -- `colourTerm`, `mouseSupport`, `cmdHeight`, `updateTime`, `mapTime`, - `cursorlineOpt`, `splitBelow`, `splitRight`, `autoIndent` and `wordWrap` have - been mapped to their {option}`vim.options` equivalents. Please see the module - definition for the updated options. - -- `tabWidth` has been **removed** as it lead to confusing behaviour. You can - replicate the same functionality by setting `shiftwidth`, `tabstop` and - `softtabstop` under `vim.options` as you see fit. - -## Changelog {#sec-release-0-7-changelog} - -[ItsSorae](https://github.com/ItsSorae): - -- Add support for [typst](https://typst.app/) under `vim.languages.typst` This - will enable the `typst-lsp` language server, and the `typstfmt` formatter - -[frothymarrow](https://github.com/frothymarrow): - -- Modified type for - {option}`vim.visuals.fidget-nvim.setupOpts.progress.display.overrides` from - `anything` to a `submodule` for better type checking. - -- Fix null `vim.lsp.mappings` generating an error and not being filtered out. - -- Add basic transparency support for `oxocarbon` theme by setting the highlight - group for `Normal`, `NormalFloat`, `LineNr`, `SignColumn` and optionally - `NvimTreeNormal` to `none`. - -- Fix {option}`vim.ui.smartcolumn.setupOpts.custom_colorcolumn` using the wrong - type `int` instead of the expected type `string`. - -[horriblename](https://github.com/horriblename): - -- Fix broken treesitter-context keybinds in visual mode -- Deprecate use of `__empty` to define empty tables in Lua. Empty attrset are no - longer filtered and thus should be used instead. -- Add dap-go for better dap configurations -- Make noice.nvim customizable -- Standardize border style options and add custom borders -- Remove `vim.disableDefaultRuntimePaths` in wrapper options. - - As nvf uses `$NVIM_APP_NAME` as of recent changes, we can safely assume any - configuration in `$XDG_CONFIG_HOME/nvf` is intentional. - -[rust-tools.nvim]: https://github.com/simrat39/rust-tools.nvim -[rustaceanvim]: https://github.com/mrcjkb/rustaceanvim - -- Switch from [rust-tools.nvim] to the more feature-packed [rustaceanvim]. This - switch entails a whole bunch of new features and options, so you are - recommended to go through rustacean.nvim's README to take a closer look at its - features and usage - -[lz.n]: https://github.com/mrcjkb/lz.n - -- Add [lz.n] support and lazy-load some builtin plugins. -- Add simpler helper functions for making keymaps - -[poz](https://poz.pet): - -[ocaml-lsp]: https://github.com/ocaml/ocaml-lsp -[new-file-template.nvim]: https://github.com/otavioschwanck/new-file-template.nvim -[neo-tree.nvim]: https://github.com/nvim-neo-tree/neo-tree.nvim - -- Add [ocaml-lsp] support - -- Fix "Emac" typo - -- Add [new-file-template.nvim] to automatically fill new file contents using - templates - -- Make [neo-tree.nvim] display file icons properly by enabling - `visuals.nvimWebDevicons` - -[diniamo](https://github.com/diniamo): - -- Move the `theme` dag entry to before `luaScript`. - -- Add rustfmt as the default formatter for Rust. - -- Enabled the terminal integration of catppuccin for theming Neovim's built-in - terminal (this also affects toggleterm). - -- Migrate bufferline to setupOpts for more customizability - -- Use `clangd` as the default language server for C languages - -- Expose `lib.nvim.types.pluginType`, which for example allows the user to - create abstractions for adding plugins - -- Migrate indent-blankline to setupOpts for more customizability. While the - plugin's options can now be found under `indentBlankline.setupOpts`, the - previous iteration of the module also included out of place/broken options, - which have been removed for the time being. These are: - - - `listChar` - this was already unused - - `fillChar` - this had nothing to do with the plugin, please configure it - yourself by adding `vim.opt.listchars:append({ space = '' })` to your - lua configuration - - `eolChar` - this also had nothing to do with the plugin, please configure it - yourself by adding `vim.opt.listchars:append({ eol = '' })` to your - lua configuration - -- Replace `vim.lsp.nvimCodeActionMenu` with `vim.ui.fastaction`, see the - breaking changes section above for more details - -- Add a `setupOpts` option to nvim-surround, which allows modifying options that - aren't defined in nvf. Move the alternate nvim-surround keybinds to use - `setupOpts`. - -- Remove `autopairs.type`, and rename `autopairs.enable` to - `autopairs.nvim-autopairs.enable`. The new - {option}`vim.autopairs.nvim-autopairs.enable` supports `setupOpts` format by - default. - -- Refactor of `nvim-cmp` and completion related modules - - - Remove `autocomplete.type` in favor of per-plugin enable options such as - {option}`vim.autocomplete.nvim-cmp.enable`. - - Deprecate legacy Vimsnip in favor of Luasnip, and integrate - friendly-snippets for bundled snippets. - {option}`vim.snippets.luasnip.enable` can be used to toggle Luasnip. - - Add sorting function options for completion sources under - {option}`vim.autocomplete.nvim-cmp.setupOpts.sorting.comparators` - -- Add C# support under `vim.languages.csharp`, with support for both - omnisharp-roslyn and csharp-language-server. - -- Add Julia support under `vim.languages.julia`. Note that the entirety of Julia - is bundled with nvf, if you enable the module, since there is no way to - provide only the LSP server. - -- Add [`run.nvim`](https://github.com/diniamo/run.nvim) support for running code - using cached commands. - -[Neovim documentation on `vim.cmd`]: https://neovim.io/doc/user/lua.html#vim.cmd() - -- Make Neovim's configuration file entirely Lua based. This comes with a few - breaking changes: - - - `vim.configRC` has been removed. You will need to migrate your entries to - Neovim-compliant Lua code, and add them to `vim.luaConfigRC` instead. - Existing vimscript configurations may be preserved in `vim.cmd` functions. - Please see [Neovim documentation on `vim.cmd`] - - `vim.luaScriptRC` is now the top-level DAG, and the internal `vim.pluginRC` - has been introduced for setting up internal plugins. See the "DAG entries in - nvf" manual page for more information. - -- Rewrite `vim.maps`, see the breaking changes section above. - -[NotAShelf](https://github.com/notashelf): - -[ts-error-translator.nvim]: https://github.com/dmmulroy/ts-error-translator.nvim -[credo]: https://github.com/rrrene/credo -[tiny-devicons-auto-colors]: https://github.com/rachartier/tiny-devicons-auto-colors.nvim - -- Add `deno fmt` as the default Markdown formatter. This will be enabled - automatically if you have autoformatting enabled, but can be disabled manually - if you choose to. - -- Add `vim.extraLuaFiles` for optionally sourcing additional lua files in your - configuration. - -- Refactor `programs.languages.elixir` to use lspconfig and none-ls for LSP and - formatter setups respectively. Diagnostics support is considered, and may be - added once the [credo] linter has been added to nixpkgs. A pull request is - currently open. - -- Remove vim-tidal and friends. - -- Clean up Lualine module to reduce theme dependency on Catppuccin, and fixed - blending issues in component separators. - -- Add [ts-ereror-translator.nvim] extension of the TS language module, under - `vim.languages.ts.extensions.ts-error-translator` to aid with Typescript - development. - -- Add [neo-tree.nvim] as an alternative file-tree plugin. It will be available - under `vim.filetree.neo-tree`, similar to nvimtree. - -- Add `nvf-print-config` & `nvf-print-config-path` helper scripts to Neovim - closure. Both of those scripts have been automatically added to your PATH upon - using neovimConfig or `programs.nvf.enable`. - - - `nvf-print-config` will display your `init.lua`, in full. - - `nvf-print-config-path` will display the path to _a clone_ of your - `init.lua`. This is not the path used by the Neovim wrapper, but an - identical clone. - -- Add `vim.ui.breadcrumbs.lualine` to allow fine-tuning breadcrumbs behaviour on - Lualine. Only `vim.ui.breadcrumbs.lualine.winbar` is supported for the time - being. - - - {option}`vim.ui.breadcrumbs.lualine.winbar.enable` has been added to allow - controlling the default behaviour of the `nvim-navic` component on Lualine, - which used to occupy `winbar.lualine_c` as long as breadcrumbs are enabled. - - `vim.ui.breadcrumbs.alwaysRender` has been renamed to - {option}`vim.ui.breadcrumbs.lualine.winbar.alwaysRender` to be conform to - the new format. - -- Add [basedpyright](https://github.com/detachhead/basedpyright) as a Python LSP - server and make it default. - -- Add [python-lsp-server](https://github.com/python-lsp/python-lsp-server) as an - additional Python LSP server. - -- Add {option}`vim.options` to set `vim.o` values in in your nvf configuration - without using additional Lua. See option documentation for more details. - -- Add {option}`vim.dashboard.dashboard-nvim.setupOpts` to allow user - configuration for [dashboard.nvim](https://github.com/nvimdev/dashboard-nvim) - -- Update `lualine.nvim` input and add missing themes: - - - Adds `ayu`, `gruvbox_dark`, `iceberg`, `moonfly`, `onedark`, - `powerline_dark` and `solarized_light` themes. - -- Add {option}`vim.spellcheck.extraSpellWords` to allow adding arbitrary - spellfiles to Neovim's runtime with ease. - -- Add combined nvf configuration (`config.vim`) into the final package's - `passthru` as `passthru.neovimConfiguration` for easier debugging. - -- Add support for [tiny-devicons-auto-colors] under - `vim.visuals.tiny-devicons-auto-colors` - -- Move options that used to set `vim.o` values (e.g. `vim.wordWrap`) into - `vim.options` as default values. Some are left as they don't have a direct - equivalent, but expect a switch eventually. - -[ppenguin](https://github.com/ppenguin): - -- Telescope: - - Fixed `project-nvim` command and keybinding - - Added default ikeybind/command for `Telescope resume` (`fr`) -- Add `hcl` lsp/formatter (not the same as `terraform`, which is not useful for - e.g. `nomad` config files). - -[Soliprem](https://github.com/Soliprem): - -- Add LSP and Treesitter support for R under `vim.languages.R`. - - Add formatter support for R, with styler and formatR as options -- Add Otter support under `vim.lsp.otter` and an assert to prevent conflict with - ccc -- Fixed typo in Otter's setupOpts -- Add Neorg support under `vim.notes.neorg` -- Add LSP, diagnostics, formatter and Treesitter support for Kotlin under - `vim.languages.kotlin` -- changed default keybinds for leap.nvim to avoid altering expected behavior -- Add LSP, formatter and Treesitter support for Vala under `vim.languages.vala` -- Add [Tinymist](https://github.com/Myriad-Dreamin/tinymist] as a formatter for - the Typst language module. -- Add LSP and Treesitter support for Assembly under `vim.languages.assembly` -- Move [which-key](https://github.com/folke/which-key.nvim) to the new spec -- Add LSP and Treesitter support for Nushell under `vim.languages.nu` -- Add LSP and Treesitter support for Gleam under `vim.languages.gleam` - -[Bloxx12](https://github.com/Bloxx12) - -- Add support for [base16 theming](https://github.com/RRethy/base16-nvim) under - `vim.theme` -- Fix internal breakage in `elixir-tools` setup. - -[ksonj](https://github.com/ksonj): - -- Add LSP support for Scala via - [nvim-metals](https://github.com/scalameta/nvim-metals) - -[nezia1](https://github.com/nezia1): - -- Add [biome](https://github.com/biomejs/biome) support for Typescript, CSS and - Svelte. Enable them via {option}`vim.languages.ts.format.type`, - {option}`vim.languages.css.format.type` and - {option}`vim.languages.svelte.format.type` respectively. -- Replace [nixpkgs-fmt](https://github.com/nix-community/nixpkgs-fmt) with - [nixfmt](https://github.com/NixOS/nixfmt) (nixfmt-rfc-style). - -[Nowaaru](https://github.com/Nowaaru): - -- Add `precognition-nvim`. - -[DamitusThyYeeticus123](https://github.com/DamitusThyYeetus123): - -- Add support for [Astro](https://astro.build/) language server. diff --git a/docs/manual/release-notes/rl-0.8.md b/docs/manual/release-notes/rl-0.8.md deleted file mode 100644 index fadb2e69..00000000 --- a/docs/manual/release-notes/rl-0.8.md +++ /dev/null @@ -1,629 +0,0 @@ -# Release 0.8 {#sec-release-0-8} - -## Breaking changes - -[Lspsaga documentation]: https://nvimdev.github.io/lspsaga/ - -- `git-conflict` keybinds are now prefixed with `` to avoid conflicting - with builtins. - -- `alpha` is now configured with nix, default config removed. - -- Lspsaga module no longer ships default keybindings. The keybind format has - been changed by upstream, and old keybindings do not have equivalents under - the new API they provide. Please manually set your keybinds according to - [Lspsaga documentation] following the new API. - -- none-ls has been updated to the latest version. If you have been using raw Lua - configuration to _manually_ configure it, some of the formats may become - unavailable as they have been refactored out of the main none-ls repository - upstream. - -- `vim.useSystemClipboard` has been deprecated as a part of removing most - top-level convenience options, and should instead be configured in the new - module interface. You may set {option}`vim.clipboard.registers` appropriately - to configure Neovim to use the system clipboard. - -- Changed which-key group used for gitsigns from `g` to `h` to - align with the "hunks" themed mapping and avoid conflict with the new [neogit] - group. - -- LSP keybinds and related plugin integrations are now attached in an LspAttach - autocmd event. If you were calling `default_on_attach()` in your LSP setup you - can remove them now. - -## Changelog {#sec-release-0-8-changelog} - -[NotAShelf](https://github.com/notashelf): - -[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim -[render-markdown.nvim]: https://github.com/MeanderingProgrammer/render-markdown.nvim -[yanky.nvim]: https://github.com/gbprod/yanky.nvim -[yazi.nvim]: https://github.com/mikavilpas/yazi.nvim -[snacks.nvim]: https://github.com/folke/snacks.nvim -[colorful-menu.nvim]: https://github.com/xzbdmw/colorful-menu.nvim -[oil.nvim]: https://github.com/stevearc/oil.nvim -[hunk.nvim]: https://github.com/julienvincent/hunk.nvim -[undotree]: https://github.com/mbbill/undotree - -- Add [typst-preview.nvim] under - `languages.typst.extensions.typst-preview-nvim`. - -- Add a search widget to the options page in the nvf manual. - -- Add [render-markdown.nvim] under - `languages.markdown.extensions.render-markdown-nvim`. - -- Implement {option}`vim.git.gitsigns.setupOpts` for user-specified setup table - in gitsigns configuration. - -- {option}`vim.options.mouse` no longer compares values to an enum of available - mouse modes. This means you can provide any string without the module system - warning you that it is invalid. Do keep in mind that this value is no longer - checked, so you will be responsible for ensuring its validity. - -- Deprecate `vim.enableEditorconfig` in favor of - {option}`vim.globals.editorconfig`. - -- Deprecate rnix-lsp as it has been abandoned and archived upstream. - -- Hardcoded indentation values for the Nix language module have been removed. To - replicate previous behaviour, you must either consolidate Nix indentation in - your Editorconfig configuration, or use an autocommand to set indentation - values for buffers with the Nix filetype. - -- Add {option}`vim.lsp.lightbulb.autocmd.enable` for manually managing the - previously managed lightbulb autocommand. - - A warning will occur if {option} vim-lsp-lightbulb-autocmd-enable) and - `vim.lsp.lightbulb.setupOpts.autocmd.enabled` are both set at the same time. - Pick only one. - -- Add [yanky.nvim] to available plugins, under `vim.utility.yanky-nvim`. - -- Fix plugin `setupOpts` for yanky.nvim and assert if shada is configured as a - backend while shada is disabled in Neovim options. - -- Add [yazi.nvim] as a companion plugin for Yazi, the terminal file manager. - -- Add {option}`vim.autocmds` and {option}`vim-augroups` to allow declaring - autocommands via Nix. - -- Fix plugin `setupOpts` for yanky.nvim and assert if shada is configured as a - backend while shada is disabled in Neovim options. - -- Add [yazi.nvim] as a companion plugin for Yazi, the terminal file manager. - -- Add [snacks.nvim] under `vim.utility.snacks-nvim` as a general-purpose utility - plugin. - -- Move LSPSaga to `setupOpts` format, allowing freeform configuration in - `vim.lsp.lspsaga.setupOpts`. - -- Lazyload Lspsaga and remove default keybindings for it. - -- Add [colorful-menu.nvim] to enhance the completion menus, with optional - integration for blink-cmp and nvim-cmp -- Add [oil.nvim] as an alternative file explorer. It will be available under - `vim.utility.oil-nvim`. -- Add `vim.diagnostics` to interact with Neovim's diagnostics module. Available - options for `vim.diagnostic.config()` can now be customized through the - {option}`vim.diagnostics.config` in nvf. - -- Add `vim.clipboard` module for easily managing Neovim clipboard providers and - relevant packages in a simple UI. - - This deprecates `vim.useSystemClipboard` as well, see breaking changes - section above for migration options. -- Add [hunk.nvim], Neovim plugin & tool for splitting diffs in Neovim. Available - as `vim.git.hunk-nvim` - -- Move `crates.nvim` into `languages.rust.extensions and support` `setupOpts` - for the plugin. Deprecates the top level "crates" option in `languages.rust`. - -[sjcobb2022](https://github.com/sjcobb2022): - -- Migrate all current lsp configurations to `vim.lsp.server` and remove internal - dependency on `nvim-lspconfig` - -[amadaluzia](https://github.com/amadaluzia): - -[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim - -- Add Haskell support under `vim.languages.haskell` using [haskell-tools.nvim]. - -[horriblename](https://github.com/horriblename): - -[blink.cmp]: https://github.com/saghen/blink.cmp - -- Add [aerial.nvim]. -- Add [nvim-ufo]. -- Add [blink.cmp] support. -- Add `LazyFile` user event. -- Migrate language modules from none-ls to conform/nvim-lint -- Add tsx support in conform and lint -- Moved code setting `additionalRuntimePaths` and `enableLuaLoader` out of - `luaConfigPre`'s default to prevent being overridden -- Use conform over custom autocmds for LSP format on save -- Move LSP keybinds and other related plugin integrations into an LspAttach - event. -- Allow multiple formatters in language modules. -- Fixed `prettier` in astro and svelte, and removed `prettierd` due to high - complexity that would be needed to support it. - -[diniamo](https://github.com/diniamo): - -- Add Odin support under `vim.languages.odin`. - -- Disable the built-in format-on-save feature of zls. Use `vim.lsp.formatOnSave` - instead. - -[LilleAila](https://github.com/LilleAila): - -- Remove `vim.notes.obsidian.setupOpts.dir`, which was set by default. Fixes - issue with setting the workspace directory. -- Add `vim.snippets.luasnip.setupOpts`, which was previously missing. -- Add `"prettierd"` as a formatter option in - `vim.languages.markdown.format.type`. -- Add the following plugins from - [mini.nvim](https://github.com/echasnovski/mini.nvim) - - `mini.ai` - - `mini.align` - - `mini.animate` - - `mini.base16` - - `mini.basics` - - `mini.bracketed` - - `mini.bufremove` - - `mini.clue` - - `mini.colors` - - `mini.comment` - - `mini.completion` - - `mini.deps` - - `mini.diff` - - `mini.doc` - - `mini.extra` - - `mini.files` - - `mini.fuzzy` - - `mini.git` - - `mini.hipatterns` - - `mini.hues` - - `mini.icons` - - `mini.indentscope` - - `mini.jump` - - `mini.jump2d` - - `mini.map` - - `mini.misc` - - `mini.move` - - `mini.notify` - - `mini.operators` - - `mini.pairs` - - `mini.pick` - - `mini.sessions` - - `mini.snippets` - - `mini.splitjoin` - - `mini.starter` - - `mini.statusline` - - `mini.surround` - - `mini.tabline` - - `mini.test` - - `mini.trailspace` - - `mini.visits` -- Add [fzf-lua](https://github.com/ibhagwan/fzf-lua) in `vim.fzf-lua` -- Add [rainbow-delimiters](https://github.com/HiPhish/rainbow-delimiters.nvim) - in `vim.visuals.rainbow-delimiters` -- Add options to define highlights under {option}`vim.highlight` - -[kaktu5](https://github.com/kaktu5): - -- Add WGSL support under `vim.languages.wgsl`. - -[tomasguinzburg](https://github.com/tomasguinzburg): - -[solargraph]: https://github.com/castwide/solargraph -[gbprod/nord.nvim]: https://github.com/gbprod/nord.nvim - -- Add Ruby support under `vim.languages.ruby` using [solargraph]. -- Add `nord` theme from [gbprod/nord.nvim]. - -[thamenato](https://github.com/thamenato): - -[ruff]: https://github.com/astral-sh/ruff -[cue]: https://cuelang.org/ - -- Add [ruff] as a formatter option in `vim.languages.python.format.type`. -- Add [cue] support under `vim.languages.cue`. - -[ARCIII](https://github.com/ArmandoCIII): - -[leetcode.nvim]: https://github.com/kawre/leetcode.nvim -[codecompanion-nvim]: https://github.com/olimorris/codecompanion.nvim - -- Add `vim.languages.zig.dap` support through pkgs.lldb dap adapter. Code - Inspiration from `vim.languages.clang.dap` implementation. -- Add [leetcode.nvim] plugin under `vim.utility.leetcode-nvim`. -- Add [codecompanion.nvim] plugin under `vim.assistant.codecompanion-nvim`. -- Fix [codecompanion-nvim] plugin: nvim-cmp error and setupOpts defaults. - -[nezia1](https://github.com/nezia1): - -- Add support for [nixd](https://github.com/nix-community/nixd) language server. - -[jahanson](https://github.com/jahanson): - -- Add [multicursors.nvim](https://github.com/smoka7/multicursors.nvim) to - available plugins, under `vim.utility.multicursors`. -- Add [hydra.nvim](https://github.com/nvimtools/hydra.nvim) as dependency for - `multicursors.nvim` and lazy loads by default. - -[folospior](https://github.com/folospior): - -- Fix plugin name for lsp/lspkind. - -- Move `vim-illuminate` to `setupOpts format` - -[iynaix](https://github.com/iynaix): - -- Add lsp options support for [nixd](https://github.com/nix-community/nixd) - language server. - -[Mr-Helpful](https://github.com/Mr-Helpful): - -- Corrects pin names used for nvim themes. - -[Libadoxon](https://github.com/Libadoxon): - -- Add [git-conflict](https://github.com/akinsho/git-conflict.nvim) plugin for - resolving git conflicts. -- Add formatters for go: [gofmt](https://go.dev/blog/gofmt), - [golines](https://github.com/segmentio/golines) and - [gofumpt](https://github.com/mvdan/gofumpt). - -[UltraGhostie](https://github.com/UltraGhostie) - -- Add [harpoon](https://github.com/ThePrimeagen/harpoon) plugin for navigation - -[MaxMur](https://github.com/TheMaxMur): - -- Add YAML support under `vim.languages.yaml`. - -[alfarel](https://github.com/alfarelcynthesis): - -[conform.nvim]: https://github.com/stevearc/conform.nvim - -- Add missing `yazi.nvim` dependency (`snacks.nvim`). -- Add [mkdir.nvim](https://github.com/jghauser/mkdir.nvim) plugin for automatic - creation of parent directories when editing a nested file. -- Add [nix-develop.nvim](https://github.com/figsoda/nix-develop.nvim) plugin for - in-neovim `nix develop`, `nix shell` and more. -- Add [direnv.vim](https://github.com/direnv/direnv.vim) plugin for automatic - syncing of nvim shell environment with direnv's. -- Add [blink.cmp] source options and some default-disabled sources. -- Add [blink.cmp] option to add - [friendly-snippets](https://github.com/rafamadriz/friendly-snippets) so - blink.cmp can source snippets from it. -- Fix [blink.cmp] breaking when built-in sources were modified. -- Fix [conform.nvim] not allowing disabling formatting on and after save. Use - `null` value to disable them if conform is enabled. -- Add [markdown-oxide](https://github.com/Feel-ix-343/markdown-oxide) option to - markdown language module. -- Fix Helm-YAML language module integration. YAML diagnostics will now remain in - `helmfile`s when both are enabled. -- Fix YAML language module not activating LSP keybinds if the Helm language - module was also enabled. -- Fix `json` language module (default) language server not activating. - -[TheColorman](https://github.com/TheColorman): - -- Fix plugin `setupOpts` for `neovim-session-manager` having an invalid value - for `autoload_mode`. - -[esdevries](https://github.com/esdevries): - -[projekt0n/github-nvim-theme]: https://github.com/projekt0n/github-nvim-theme - -- Add `github-nvim-theme` theme from [projekt0n/github-nvim-theme]. - -[BANanaD3V](https://github.com/BANanaD3V): - -- `alpha` is now configured with nix. -- Add `markview-nvim` markdown renderer. - -[viicslen](https://github.com/viicslen): - -- Add `intelephense` language server support under - `vim.languages.php.lsp.server` - -[Butzist](https://github.com/butzist): - -- Add Helm chart support under `vim.languages.helm`. - -[rice-cracker-dev](https://github.com/rice-cracker-dev): - -- `eslint_d` now checks for configuration files to load. -- Fix an error where `eslint_d` fails to load. -- Add required files support for linters under - `vim.diagnostics.nvim-lint.linters.*.required_files`. -- Add global function `nvf_lint` under - `vim.diagnostics.nvim-lint.lint_function`. -- Deprecate `vim.scrollOffset` in favor of `vim.options.scrolloff`. -- Fix `svelte-language-server` not reloading .js/.ts files on change. - -[Sc3l3t0n](https://github.com/Sc3l3t0n): - -- Add F# support under `vim.languages.fsharp`. - -[venkyr77](https://github.com/venkyr77): - -- Add lint (luacheck) and formatting (stylua) support for Lua. -- Add lint (markdownlint-cli2) support for Markdown. -- Add catppuccin integration for Bufferline, Lspsaga. -- Add `neo-tree`, `snacks.explorer` integrations to `bufferline`. -- Add more applicable filetypes to illuminate denylist. -- Disable mini.indentscope for applicable filetypes. -- Fix fzf-lua having a hard dependency on fzf. -- Enable inlay hints support - `config.vim.lsp.inlayHints`. -- Add `neo-tree`, `snacks.picker` extensions to `lualine`. -- Add support for `vim.lsp.formatOnSave` and - `vim.lsp.mappings.toggleFormatOnSave` - -[tebuevd](https://github.com/tebuevd): - -- Fix `pickers` configuration for `telescope` by nesting it under `setupOpts` -- Fix `find_command` configuration for `telescope` by nesting it under - `setupOpts.pickers.find_files` -- Update default `telescope.setupOpts.pickers.find_files.find_command` to only - include files (and therefore exclude directories from results) - -[ckoehler](https://github.com/ckoehler): - -[flash.nvim]: https://github.com/folke/flash.nvim -[gitlinker.nvim]: https://github.com/linrongbin16/gitlinker.nvim -[nvim-treesitter-textobjects]: https://github.com/nvim-treesitter/nvim-treesitter-textobjects - -- Fix oil config referencing snacks -- Add [flash.nvim] plugin to `vim.utility.motion.flash-nvim` -- Fix default telescope ignore list entry for '.git/' to properly match -- Add [gitlinker.nvim] plugin to `vim.git.gitlinker-nvim` -- Add [nvim-treesitter-textobjects] plugin to `vim.treesitter.textobjects` -- Default to disabling Conform for Rust if rust-analyzer is used - - To force using Conform, set `languages.rust.format.enable = true`. - -[rrvsh](https://github.com/rrvsh): - -- Add custom snippet support to `vim.snippets.luasnip` -- Fix namespace of python-lsp-server by changing it to python3Packages - -[Noah765](https://github.com/Noah765): - -[vim-sleuth]: https://github.com/tpope/vim-sleuth - -- Add missing `flutter-tools.nvim` dependency `plenary.nvim`. -- Add necessary dependency of `flutter-tools.nvim` on lsp. -- Add the `vim.languages.dart.flutter-tools.flutterPackage` option. -- Fix the type of the `highlight` color options. -- Add [vim-sleuth] plugin under `vim.utility.sleuth`. - -[howird](https://github.com/howird): - -- Change python dap adapter name from `python` to commonly expected `debugpy`. - -[aionoid](https://github.com/aionoid): - -[avante.nvim]: https://github.com/yetone/avante.nvim - -- Fix [render-markdown.nvim] file_types option type to list, to accept merging. -- Add [avante.nvim] plugin under `vim.assistant.avante-nvim`. - -[poz](https://poz.pet): - -[everforest]: https://github.com/sainnhe/everforest -[oil]: https://github.com/stevearc/oil.nvim -[oil-git-status]: https://github.com/refractalize/oil-git-status.nvim - -- Fix gitsigns null-ls issue. -- Add [everforest] theme support. -- Add [oil-git-status] support to [oil] module. - -[Haskex](https://github.com/haskex): - -[Hardtime.nvim]: https://github.com/m4xshen/hardtime.nvim - -- Add Plugin [Hardtime.nvim] under `vim.binds.hardtime-nvim` with `enable` and - `setupOpts` options - -[taylrfnt](https://github.com/taylrfnt): - -[nvim-tree](https://github.com/nvim-tree/nvim-tree.lua): - -- Add missing `right_align` option for existing `renderer.icons` options. -- Add missing `render.icons` options (`hidden_placement`, - `diagnostics_placement`, and `bookmarks_placement`). - -[cramt](https://github.com/cramt): - -- Add `rubylsp` option in `vim.languages.ruby.lsp.server` to use shopify's - ruby-lsp language server - -[Haskex](https://github.com/haskex): - -[solarized-osaka.nvim]: https://github.com/craftzdog/solarized-osaka.nvim - -- Add [solarized-osaka.nvim] theme - -[img-clip.nvim]: https://github.com/hakonharnes/img-clip.nvim - -- Add [img-clip.nvim] plugin in `vim.utility.images.img-clip` with `enable` and - `setupOpts` -- Add `vim.utility.images.img-clip.enable = isMaximal` in configuration.nix - -[anil9](https://github.com/anil9): - -[clojure-lsp]: https://github.com/clojure-lsp/clojure-lsp -[conjure]: https://github.com/Olical/conjure - -- Add Clojure support under `vim.languages.clojure` using [clojure-lsp] -- Add code evaluation environment [conjure] under `vim.repl.conjure` - -[CallumGilly](https://github.com/CallumGilly): - -- Add missing `transparent` option for existing - [onedark.nvim](https://github.com/navarasu/onedark.nvim) theme. - -[theutz](https://github.com/theutz): - -- Added "auto" flavour for catppuccin theme - -[lackac](https://github.com/lackac): - -[solarized.nvim]: https://github.com/maxmx03/solarized.nvim -[smart-splits.nvim]: https://github.com/mrjones2014/smart-splits.nvim -[neogit]: https://github.com/NeogitOrg/neogit - -- Add [solarized.nvim] theme with support for multiple variants -- Add [smart-splits.nvim] for navigating between Neovim windows and terminal - multiplexer panes. Available at `vim.utility.smart-splits`. -- Restore vim-dirtytalk plugin and fix ordering with spellcheck in generated - config. -- Fix lualine separator options -- Add [neogit], an interactive and powerful Git interface for Neovim, inspired - by Magit -- Allow deregistering which-key binds or groups by setting them to `null` - -[justDeeevin](https://github.com/justDeeevin): - -[supermaven-nvim]: https://github.com/supermaven-inc/supermaven-nvim - -- Add [supermaven-nvim] plugin in `vim.assistant.supermaven-nvim` with `enable` - and `setupOpts` - -[trueNAHO](https://github.com/trueNAHO): - -- `flake-parts`'s `nixpkgs-lib` input follows nvf's `nixpkgs` input to reduce - download size. - -- `flake-utils`'s `systems` inputs follows nvf's `systems` input to transitively - leverage the pattern introduced in commit - [fc8206e7a61d ("flake: utilize - nix-systems for overridable flake systems")](https://github.com/NotAShelf/nvf/commit/fc8206e7a61d7eb02006f9010e62ebdb3336d0d2). - -[soliprem](https://github.com/soliprem): - -- fix broken `neorg` grammars -- remove obsolete warning in the `otter` module -- add mainProgram attribute to vala language server wrapper -- fix `crates-nvim`'s completions by using the in-program lsp - -[JManch](https://github.com/JManch): - -- Fix default [blink.cmp] sources "path" and "buffer" not working when - `autocomplete.nvim-cmp.enable` was disabled and - `autocomplete.nvim-cmp.sources` had not been modified. - -[Poseidon](https://github.com/poseidon-rises): - -[nvim-biscuits]: https://github.com/code-biscuits/nvim-biscuits -[just-lsp]: https://github.com/terror/just-lsp -[roslyn-ls]: https://github.com/dotnet/vscode-csharp -[jsonls]: https://github.com/microsoft/vscode/tree/1.101.2/extensions/json-language-features/server -[jsonfmt]: https://github.com/caarlos0/jsonfmt -[superhtml]: https://github.com/kristoff-it/superhtml -[htmlHINT]: https://github.com/htmlhint/HTMLHint -[qmk-nvim]: https://github.com/codethread/qmk.nvim -[qmlls]: https://doc.qt.io/qt-6/qtqml-tooling-qmlls.html -[qmlformat]: https://doc.qt.io/qt-6/qtqml-tooling-qmlformat.html - -- Add [nvim-biscuits] support under `vim.utility.nvim-biscuits`. -- Add just support under `vim.languages.just` using [just-lsp]. -- Add [roslyn-ls] to the `vim.languages.csharp` module. -- Add JSON support under `vim.languages.json` using [jsonls] and [jsonfmt]. -- Add advanced HTML support under `vim.languages.html` using [superhtml] and - [htmlHINT]. -- Add QMK support under `vim.utility.qmk-nvim` via [qmk-nvim]. -- Add QML support under `vim.languages.qml` using [qmlls] and [qmlformat]. - -[Morsicus](https://github.com/Morsicus): - -- Add [EEx Treesitter Grammar](https://github.com/connorlay/tree-sitter-eex) for - Elixir -- Add - [HEEx Treesitter Grammar](https://github.com/phoenixframework/tree-sitter-heex) - for Elixir - -[diced](https://github.com/diced): - -- Fixed `typescript` treesitter grammar not being included by default. - -[valterschutz](https://github.com/valterschutz): - -[ruff]: https://github.com/astral-sh/ruff - -- Add [ruff-fix] as a formatter option in `vim.languages.python.format.type`. - -[gmvar](https://github.com/gmvar): - -[harper-ls]: https://github.com/Automattic/harper - -- Add [harper-ls] to the `vim.lsp` module. - -[derethil](https://github.com/derethil): - -- Fix `vim.lazy.plugins..enabled` Lua evaluation. - -[Jules](https://github.com/jules-sommer): - -[nvim-highlight-colors]: https://github.com/brenoprata10/nvim-highlight-colors - -- Add [nvim-highlight-colors] plugin in `vim.ui.nvim-highlight-colors` with - `enable` and `setupOpts` - -- Fix [blink.cmp] keymap preset types to allow alternate cmdline, terminal, etc - modes to `inherit` the default mode keymaps. This is an option as per the - [blink.cmp] docs and is now supported in nvf. - -[PartyWumpus](https://github.com/PartyWumpus): - -[typst-concealer]: https://github.com/PartyWumpus/typst-concealer - -- Add inline typst concealing support under `vim.languages.typst` using - [typst-concealer]. - -[KrappRamiro](https://github.com/KrappRamiro): - -[phaazon/hop.nvim]: https://github.com/hadronized/hop.nvim -[smoka7/hop.nvim]: https://github.com/smoka7/hop.nvim - -- Migrate [phaazon/hop.nvim] to [smoka7/hop.nvim] - -[simon-wg](https://github.com/simon-wg): - -- Update `python` language module to use correct lsp binary. -- Fix `python` pyright and basedpyright language servers not using default on - attach behavior. - -[critical](https://github.com/critical): - -[mellow.nvim]: https://github.com/mellow-theme/mellow.nvim - -- Add [mellow.nvim] plugin for vim and lualine theme support - -[valyntyler](https://github.com/valyntyler): - -[emmet-ls]: https://github.com/aca/emmet-ls - -- Enable `languages.ts.format` for `.js` files -- Add [emmet-ls] to `html.lsp.servers` - -[axelbdt](https://github.com/axelbdt): - -[neocodeium]: https://github.com/monkoose/neocodeium - -- Add [neocodeium] plugin in `vim.assistant.neocodeium` with `enable`, - `setupOpts` and `keymaps` - -[JudahZF](https://github.com/JudahZF): - -- Added gitFiles mapping option to telescope - -[Ring-A-Ding-Ding-Baby](https://github.com/Ring-A-Ding-Ding-Baby) - -- Aligned `codelldb` adapter setup with [rustaceanvim]’s built-in logic. -- Added `languages.rust.dap.backend` option to choose between `codelldb` and - `lldb-dap` adapters. diff --git a/docs/manual/tips.md b/docs/manual/tips.md deleted file mode 100644 index 0a121ae9..00000000 --- a/docs/manual/tips.md +++ /dev/null @@ -1,14 +0,0 @@ -# Helpful Tips {#ch-helpful-tips} - -This section provides helpful tips that may be considered "unorthodox" or "too -advanced" for some users. We will cover basic debugging steps, offline -documentation, configuring **nvf** with pure Lua and using custom plugin sources -in **nvf** in this section. For general configuration tips, please see previous -chapters. - -```{=include=} -tips/debugging-nvf.md -tips/offline-docs.md -tips/pure-lua-config.md -tips/plugin-sources.md -``` diff --git a/docs/manual/tips/debugging-nvf.md b/docs/manual/tips/debugging-nvf.md deleted file mode 100644 index ed0214ae..00000000 --- a/docs/manual/tips/debugging-nvf.md +++ /dev/null @@ -1,25 +0,0 @@ -# Debugging nvf {#sec-debugging-nvf} - -There may be instances where the your Nix configuration evaluates to invalid -Lua, or times when you will be asked to provide your built Lua configuration for -easier debugging by nvf maintainers. nvf provides two helpful utilities out of -the box. - -**nvf-print-config** and **nvf-print-config-path** will be bundled with nvf as -lightweight utilities to help you view or share your built configuration when -necessary. - -To view your configuration with syntax highlighting, you may use the -[bat pager](https://github.com/sharkdp/bat). - -```bash -nvf-print-config | bat --language=lua -``` - -Alternatively, `cat` or `less` may also be used. - -## Accessing `neovimConfig` {#sec-accessing-config} - -It is also possible to access the configuration for the wrapped package. The -_built_ Neovim package will contain a `neovimConfig` attribute in its -`passthru`. diff --git a/docs/manual/tips/offline-docs.md b/docs/manual/tips/offline-docs.md deleted file mode 100644 index ed11d965..00000000 --- a/docs/manual/tips/offline-docs.md +++ /dev/null @@ -1,11 +0,0 @@ -# Offline Documentation {#sec-offline-documentation} - -[https://notashelf.github.io/nvf/options.html]: https://notashelf.github.io/nvf/options.html - -The manpages provided by nvf contains an offline version of the option search -normally available at [https://notashelf.github.io/nvf/options.html]. You may -use the `man 5 nvf` command to view option documentation from the comfort of -your terminal. - -Note that this is only available for NixOS and Home-Manager module -installations. diff --git a/docs/manual/tips/plugin-sources.md b/docs/manual/tips/plugin-sources.md deleted file mode 100644 index a6f8d71d..00000000 --- a/docs/manual/tips/plugin-sources.md +++ /dev/null @@ -1,131 +0,0 @@ -# Adding Plugins From Different Sources {#sec-plugin-sources} - -**nvf** attempts to avoid depending on Nixpkgs for Neovim plugins. For the most -part, this is accomplished by defining each plugin's source and building them -from source. - -[npins]: https://github.com/andir/npins - -To define plugin sources, we use [npins] and pin each plugin source using -builtin fetchers. You are not bound by this restriction. In your own -configuration, any kind of fetcher or plugin source is fine. - -## Nixpkgs & Friends {#ch-plugins-from-nixpkgs} - -`vim.startPlugins` and `vim.optPlugins` options take either a **string**, in -which case a plugin from nvf's internal plugins registry will be used, or a -**package**. If your plugin does not require any setup, or ordering for it s -configuration, then it is possible to add it to `vim.startPlugins` to load it on -startup. - -```nix -{pkgs, ...}: { - # Aerial does require some setup. In the case you pass a plugin that *does* - # require manual setup, then you must also call the setup function. - vim.startPlugins = [pkgs.vimPlugins.aerial-nvim]; -} -``` - -[`vim.extraPlugins`]: ./options.html#option-vim-extraPlugins - -This will fetch aerial.nvim from nixpkgs, and add it to Neovim's runtime path to -be loaded manually. Although for plugins that require manual setup, you are -encouraged to use [`vim.extraPlugins`]. - -```nix -{ - vim.extraPlugins = { - aerial = { - package = pkgs.vimPlugins.aerial-nvim; - setup = "require('aerial').setup {}"; - }; - }; -} -``` - -[custom plugins section]: ./configuring.html#ch-custom-plugins - -More details on the extraPlugins API is documented in the -[custom plugins section]. - -## Building Your Own Plugins {#ch-plugins-from-source} - -In the case a plugin is not available in Nixpkgs, or the Nixpkgs package is -outdated (or, more likely, broken) it is possible to build the plugins from -source using a tool, such as [npins]. You may also use your _flake inputs_ as -sources. - -Example using plugin inputs: - -```nix -{ - # In your flake.nix - inputs = { - aerial-nvim = { - url = "github:stevearc/aerial.nvim" - flake = false; - }; - }; - - # Make sure that 'inputs' is properly propagated into Nvf, for example, through - # specialArgs. - outputs = { ... }; -} -``` - -In the case, you may use the input directly for the plugin's source attribute in -`buildVimPlugin`. - -```nix -# Make sure that 'inputs' is properly propagated! It will be missing otherwise -# and the resulting errors might be too obscure. -{inputs, ...}: let - aerial-from-source = pkgs.vimUtils.buildVimPlugin { - name = "aerial-nvim"; - src = inputs.aerial-nvim; - }; -in { - vim.extraPlugins = { - aerial = { - package = aerial-from-source; - setup = "require('aerial').setup {}"; - }; - }; -} -``` - -Alternatively, if you do not want to keep track of the source using flake inputs -or npins, you may call `fetchFromGitHub` (or other fetchers) directly. An -example would look like this. - -```nix -regexplainer = buildVimPlugin { - name = "nvim-regexplainer"; - src = fetchFromGitHub { - owner = "bennypowers"; - repo = "nvim-regexplainer"; - rev = "4250c8f3c1307876384e70eeedde5149249e154f"; - hash = "sha256-15DLbKtOgUPq4DcF71jFYu31faDn52k3P1x47GL3+b0="; - }; - - # The 'buildVimPlugin' imposes some "require checks" on all plugins build from - # source. Failing tests, if they are not relevant, can be disabled using the - # 'nvimSkipModule' argument to the 'buildVimPlugin' function. - nvimSkipModule = [ - "regexplainer" - "regexplainer.buffers.init" - "regexplainer.buffers.popup" - "regexplainer.buffers.register" - "regexplainer.buffers.shared" - "regexplainer.buffers.split" - "regexplainer.component.descriptions" - "regexplainer.component.init" - "regexplainer.renderers.narrative.init" - "regexplainer.renderers.narrative.narrative" - "regexplainer.renderers.init" - "regexplainer.utils.defer" - "regexplainer.utils.init" - "regexplainer.utils.treesitter" - ]; -} -``` diff --git a/docs/manual/tips/pure-lua-config.md b/docs/manual/tips/pure-lua-config.md deleted file mode 100644 index d81d9ee5..00000000 --- a/docs/manual/tips/pure-lua-config.md +++ /dev/null @@ -1,117 +0,0 @@ -# Pure Lua Configuration {#sec-pure-lua-config} - -We recognize that you might not always want to configure your setup purely in -Nix, sometimes doing things in Lua is simply the "superior" option. In such a -case you might want to configure your Neovim instance using Lua, and nothing but -Lua. It is also possible to mix Lua and Nix configurations. - -Pure Lua or hybrid Lua/Nix configurations can be achieved in two different ways. -_Purely_, by modifying Neovim's runtime directory or _impurely_ by placing Lua -configuration in a directory found in `$HOME`. For your convenience, this -section will document both methods as they can be used. - -## Pure Runtime Directory {#sec-pure-nvf-runtime} - -As of 0.6, nvf allows you to modify Neovim's runtime path to suit your needs. -One of the ways the new runtime option is to add a configuration **located -relative to your `flake.nix`**, which must be version controlled in pure flakes -manner. - -```nix -{ - # Let us assume we are in the repository root, i.e., the same directory as the - # flake.nix. For the sake of the argument, we will assume that the Neovim lua - # configuration is in a nvim/ directory relative to flake.nix. - vim = { - additionalRuntimePaths = [ - # This will be added to Neovim's runtime paths. Conceptually, this behaves - # very similarly to ~/.config/nvim but you may not place a top-level - # init.lua to be able to require it directly. - ./nvim - ]; - }; -} -``` - -This will add the `nvim` directory, or rather, the _store path_ that will be -realised after your flake gets copied to the Nix store, to Neovim's runtime -directory. You may now create a `lua/myconfig` directory within this nvim -directory, and call it with {option}`vim.luaConfigRC`. - -```nix -{pkgs, ...}: { - vim = { - additionalRuntimePaths = [ - # You can list more than one file here. - ./nvim-custom-1 - - # To make sure list items are ordered, use lib.mkBefore or lib.mkAfter - # Simply placing list items in a given order will **not** ensure that - # this list will be deterministic. - ./nvim-custom-2 - ]; - - startPlugins = [pkgs.vimPlugins.gitsigns]; - - # Neovim supports in-line syntax highlighting for multi-line strings. - # Simply place the filetype in a /* comment */ before the line. - luaConfigRC.myconfig = /* lua */ '' - -- Call the Lua module from ./nvim/lua/myconfig - require("myconfig") - - -- Any additional Lua configuration that you might want *after* your own - -- configuration. For example, a plugin setup call. - require('gitsigns').setup({}) - ''; - }; -} -``` - -## Impure Absolute Directory {#sec-impure-absolute-dir} - -[Neovim 0.9]: https://github.com/neovim/neovim/pull/22128 - -As of [Neovim 0.9], {var}`$NVIM_APPNAME` is a variable expected by Neovim to -decide on the configuration directory. nvf sets this variable as `"nvf"`, -meaning `~/.config/nvf` will be regarded as _the_ configuration directory by -Neovim, similar to how `~/.config/nvim` behaves in regular installations. This -allows some degree of Lua configuration, backed by our low-level wrapper -[mnw](https://github.com/Gerg-L/mnw). Creating a `lua/` directory located in -`$NVIM_APPNAME` ("nvf" by default) and placing your configuration in, e.g., -`~/.config/nvf/lua/myconfig` will allow you to `require` it as a part of the Lua -module system through nvf's module system. - -Let's assume your `~/.config/nvf/lua/myconfig/init.lua` consists of the -following: - -```lua --- init.lua -vim.keymap.set("n", " ", "", { silent = true, remap = false }) -vim.g.mapleader = " " -``` - -The following Nix configuration via {option}`vim.luaConfigRC` will allow loading -this - -```nix -{ - # The attribute name "myconfig-dir" here is arbitrary. It is required to be - # a *named* attribute by the DAG system, but the name is entirely up to you. - vim.luaConfigRC.myconfig-dir = '' - require("myconfig") - - -- Any additional Lua - ''; -} -``` - -[DAG system]: ./configuring.html#ch-using-dags - -After you load your custom configuration, you may use an `init.lua` located in -your custom configuration directory to configure Neovim exactly as you would -without a wrapper like nvf. If you want to place your `require` call in a -specific position (i.e., before or after options you set in nvf) the -[DAG system] will let you place your configuration in a location of your -choosing. - -[top-level DAG system]: https://notashelf.github.io/nvf/index.xhtml#ch-vim-luaconfigrc diff --git a/docs/manual/try-it-out.md b/docs/manual/try-it-out.md new file mode 100644 index 00000000..70aee50c --- /dev/null +++ b/docs/manual/try-it-out.md @@ -0,0 +1,45 @@ +# Try it out {#ch-try-it-out} + +Thanks to the portability of Nix, you can try out nvf without actually installing it to your machine. +Below are the commands you may run to try out different configurations provided by this flake. As of v0.5, three +configurations are provided: + +- Nix +- Tidal +- Maximal + +You may try out any of the provided configurations using the `nix run` command on a system where Nix is installed. + +```console +$ cachix use nvf # Optional: it'll save you CPU resources and time +$ nix run github:notashelf/nvf#nix # will run the default minimal configuration +``` + +Do keep in mind that this is **susceptible to garbage collection** meaning it will be removed from your Nix store +once you garbage collect. + +## Using Prebuilt Configs {#sec-using-prebuild-configs} + +```console +$ nix run github:notashelf/nvf#nix +$ nix run github:notashelf/nvf#tidal +$ nix run github:notashelf/nvf#maximal +``` + +### Available Configs {#sec-available-configs} + +#### Nix {#sec-configs-nix} + +`Nix` configuration by default provides LSP/diagnostic support for Nix alongisde a set of visual and functional plugins. +By running `nix run .#`, which is the default package, you will build Neovim with this config. + +#### Tidal {#sec-configs-tidal} + +Tidal is an alternative config that adds vim-tidal on top of the plugins from the Nix configuration. + +#### Maximal {#sec-configs-maximal} + +`Maximal` is the ultimate configuration that will enable support for more commonly used language as well as additional +complementary plugins. Keep in mind, however, that this will pull a lot of dependencies. + +You are _strongly_ recommended to use the binary cache if you would like to try the Maximal configuration. diff --git a/docs/release-notes/release-notes.md b/docs/release-notes/release-notes.md new file mode 100644 index 00000000..ae115bfe --- /dev/null +++ b/docs/release-notes/release-notes.md @@ -0,0 +1,13 @@ +# Release Notes {#ch-release-notes} + +This section lists the release notes for tagged version of **nvf** and +the current main current main branch + +```{=include=} chapters +rl-0.1.md +rl-0.2.md +rl-0.3.md +rl-0.4.md +rl-0.5.md +rl-0.6.md +``` diff --git a/docs/release-notes/rl-0.1.md b/docs/release-notes/rl-0.1.md new file mode 100644 index 00000000..99daa5b1 --- /dev/null +++ b/docs/release-notes/rl-0.1.md @@ -0,0 +1,40 @@ +# Release 0.1 {#sec-release-0.1} + +This is the current master branch and information here is not final. These are changes from the v0.01 tag. + +Special thanks to [home-manager](https://github.com/nix-community/home-manager/) for this release. +Docs/manual generation, the new module evaluation system, and DAG implementation are from them. + +## Changelog {#sec-release-0.1-changelog} + +[jordanisaacs](https://github.com/jordanisaacs): + +- Removed hare language support (lsp/tree-sitter/etc). `vim.lsp.hare` is no longer defined. + If you use hare and would like it added back, please file an issue. + +- [vim.stratPlugins](opt-vim.startPlugins) & [vim.optPlugins](opt-vim.optPlugins) are now + an enum of `string` for options sourced from the flake inputs. Users can still provide vim + plugin packages. + + - If you are contributing and adding a new plugin, add the plugin name to `availablePlugins` in + [types-plugin.nix](https://github.com/jordanisaacs/neovim-flake/blob/20cec032bd74bc3d20ac17ce36cd84786a04fd3e/modules/lib/types-plugin.nix). + +- `neovimBuilder` has been removed for configuration. Using an overlay is no longer required. + See the manual for the new way to configuration. + +- Treesitter grammars are now configurable with [vim.treesitter.grammars](opt-vim.treesitter.grammars). + Utilizes the nixpkgs `nvim-treesitter` plugin rather than a custom input in order to take advantage of build support of pinned versions. + See [relevant discourse post](https://discourse.nixos.org/t/psa-if-you-are-on-unstable-try-out-nvim-treesitter-withallgrammars/23321?u=snowytrees) + for more information. Packages can be found under the `vimPlugins.nvim-treesitter.builtGrammars` namespace. + +- [vim.configRC](opt-vim.configRC) and [vim.luaConfigRC](opt-vim.luaConfigRC) are now of type DAG lines. + This allows for ordering of the config. Usage is the same is in home-manager's `home.activation` option. + +```nix +vim.luaConfigRC = lib.nvim.dag.entryAnywhere "config here" +``` + +[MoritzBoehme](https://github.com/MoritzBoehme): + +- `catppuccin` theme is now available as a neovim theme [vim.theme.style](opt-vim.theme.style) and lualine theme + [vim.statusline.lualine.theme](opt-vim.statusline.lualine.theme). diff --git a/docs/release-notes/rl-0.2.md b/docs/release-notes/rl-0.2.md new file mode 100644 index 00000000..acb0e3c8 --- /dev/null +++ b/docs/release-notes/rl-0.2.md @@ -0,0 +1,53 @@ +# Release 0.2 {#sec-release-0.2} + +Release notes for release 0.2 + +## Changelog {#sec-release-0.2-changelog} + +[notashelf](https://github.com/notashelf): + +- Added two minimap plugins under `vim.minimap`. `codewindow.nvim` is enabled by default, while `minimap.vim` is + available with its code-minimap dependency. +- A complementary plugin, `obsidian.nvim` and the Neovim alternative for Emacs' orgmode with `orgmode.nvim` have been + added. Both will be disabled by default. + +- Smooth scrolling for ANY movement command is now available with `cinnamon.nvim` + +- You will now notice a dashboard on startup. This is provided by the `alpha.nvim` plugin. You can use any of the + three available dashboard plugins, or disable them entirely. + +- There is now a scrollbar on active buffers, which can highlight errors by hooking to your LSPs. This is on by + default, but can be toggled off under `vim.visuals` if seen necessary. + +- Discord Rich Presence has been added through `presence.nvim` for those who want to flex that they are using + the _superior_ text editor. + +- An icon picker is now available with telescope integration. You can use `:IconPickerInsert` or `:IconPickerYank` + to add icons to your code. + +- A general-purpose cheatsheet has been added through `cheatsheet.nvim`. Forget no longer! + +- `ccc.nvim` has been added to the default plugins to allow picking colors with ease. + +- Most UI components of Neovim have been replaced through the help of `noice.nvim`. There are also notifications + and custom UI elements available for Neovim messages and prompts. + +- A (floating by default) terminal has been added through `toggleterm.nvim`. + +- Harness the power of ethical (`tabnine.nvim`) and not-so-ethical (`copilot.lua`) AI by those new assistant plugins. + Both are off by default, TabNine needs to be wrapped before it's working. + +- Experimental mouse gestures have been added through `gesture.nvim`. See plugin page and the relevant module for + more details on how to use. + +- Re-open last visited buffers via `nvim-session-manager`. Disabled by default as deleting buffers seems to be + problematic at the moment. + +- Most of NvimTree's configuration options have been changed with some options being toggled to off by default. + +- Lualine had its configuration simplified and style toned down. Less color, more info. + +- Modules where multiple plugin configurations were in the same directory have been simplified. Each plugin inside + a single module gets its directory to be imported. + +- Separate config options with the same parent attribute have been merged into one for simplicity. diff --git a/docs/release-notes/rl-0.3.md b/docs/release-notes/rl-0.3.md new file mode 100644 index 00000000..0eefcb82 --- /dev/null +++ b/docs/release-notes/rl-0.3.md @@ -0,0 +1,81 @@ +# Release 0.3 {#sec-release-0.3} + +Release 0.3 had to come out beore I wanted it to due to Neovim 0.9 dropping into nixpkgs-unstable. +The treesitter changes have prompted a treesitter rework, which was followed by reworking the languages system. +Most of the changes to those are downstreamed from the original repository. The feature requests that was originally +planned for 0.3 have been moved to 0.4, which should come out soon. + +## Changelog {#sec-release-0.3-changelog} + +- We have transitioned to flake-parts, from flake-utils to extend the flexibility of this flake. This means the flake structure + is different than usual, but the functionality remains the same. + +- We now provide a home-manager module. Do note that it is still far from perfect, but it works. + +- `nodejs_16` is now bundled with `Copilot.lua` if the user has enabled Copilot assistant. + +- which-key section titles have been fixed. This is to be changed once again in a possible keybind rewrite, but now it should + display the correct titles instad of `+prefix` + +- Most of `presence.nvim`'s options have been made fully configurable through your configuration file. + +- Most of the modules have been refactored to separate `config` and `options` attributes. + +- Darwin has been deprecated as the zig package is marked as broken. We will attempt to use the zig overlay to return Darwin + support. + +- `Fidget.nvim` has been added as a neat visual addition for LSP installations. + +- `diffview.nvim` has been added to provide a convenient diff utility. + +- Treesitter grammars are now configurable with [vim.treesitter.grammars](vim.treesitter.grammars). + Utilizes the nixpkgs `nvim-treesitter` plugin rather than a custom input in order to take advantage of build support of pinned versions. + See [discourse](https://discourse.nixos.org/t/psa-if-you-are-on-unstable-try-out-nvim-treesitter-withallgrammars/23321?u=snowytrees) for more information. + Packages can be found under the `pkgs.vimPlugins.nvim-treesitter.builtGrammars` attribute. Treesitter grammars for supported languages should be + enabled within the module. By default no grammars are installed, thus the following grammars which do not have a language section are not included anymore: + **comment**, **toml**, **make**, **html**, **css**, **graphql**, **json**. + +- A new section has been added for language support: `vim.languages.`. + + - The options [vim.languages.enableLSP](vim.languages.enableLSP), [vim.languages.enableTreesitter](vim.languages.enableTreesitter), etc. + will enable the respective section for all languages that have been enabled. + - All LSP languages have been moved here + - `plantuml` and `markdown` have been moved here + - A new section has been added for `html`. The old `vim.treesitter.autotagHtml` can be found at <>. + +- [vim.git.gitsigns.codeActions](vim.git.gitsigns.codeActions) has been added allowing you to turn on gitsigns codeactions. + +- Removed the plugins document in the docs. Was too unwieldy to keep updated. + +- `vim.visual.lspkind` has been moved to [vim.lsp.lspkind.enable](vim.lsp.lspkind.enable) + +- Improved handling of completion formatting. When setting [vim.autocomplete.sources](vim.autocomplete.sources), can also include optional menu mapping. + And can provide your own function with [vim.autocomplete.formatting.format](vim.autocomplete.formatting.format). + +- For [vim.visuals.indentBlankline.fillChar](vim.visuals.indentBlankline.fillChar) and [vim.visuals.indentBlankline.eolChar](vim.visuals.indentBlankline.eolChar) + turning them off should use `null` rather than `""` now. + +- Transparency has been made optional and has been disabled by default. [vim.theme.transparent](vim.theme.transparent) option can be used to enable or + disable transparency for your configuration. + +- Fixed deprecated configuration method for Tokyonight, and added new style "moon" + +- Dart language support as well as extended flutter support has been added. Thanks to @FlafyDev for his contributions towards Dart + language support. + +- Elixir language support has been added through `elixir-tools.nvim`. + +- `hop.nvim` and `leap.nvim` have been added for fast navigation. + +- `modes.nvim` has been added to the UI plugins as a minor error highlighter. + +- `smartcollumn.nvim` has been added to dynamically display a colorcolumn when the limit has been exceeded, providing + per-buftype column position and more. + +- `project.nvim` has been added for better project management inside Neovim. + +- More configuration options have been added to `nvim-session-manager`. + +- Editorconfig support has been added to the core functionality, with an enable option. + +- `venn-nvim` has been dropped due to broken keybinds. diff --git a/docs/manual/release-notes/rl-0.4.md b/docs/release-notes/rl-0.4.md similarity index 63% rename from docs/manual/release-notes/rl-0.4.md rename to docs/release-notes/rl-0.4.md index ce788413..2f7b0a63 100644 --- a/docs/manual/release-notes/rl-0.4.md +++ b/docs/release-notes/rl-0.4.md @@ -1,18 +1,14 @@ -# Release 0.4 {#sec-release-0-4} +# Release 0.4 {#sec-release-0.4} -Following the release of v0.3, I have decided to release v0.4 with a massive new -change: customizable keybinds. As of the 0.4 release, keybinds will no longer be -hardcoded and instead provided by each module's own keybinds section. The old -keybind system (`vim.keybinds = {}`) is now considered deprecated and the new -lib functions are recommended to be used for adding keybinds for new plugins, or -adding keybinds to existing plugins. +Following the release of v0.3, I have decided to release v0.4 with a massive new change: customizable keybinds. +As of the 0.4 release, keybinds will no longer be hardcoded and instead provided by each module's own keybinds section. +The old keybind system (`vim.keybinds = {}`) is now considered deprecated and the new lib functions are recommended to be +used for adding keybinds for new plugins, or adding keybinds to existing plugins. -Alongside customizable keybinds, there are a few quality of life updates, such -as `lazygit` integration and the new experimental Lua loader of Neovim 0.9 -thanks to our awesome contributors who made this update possible during my -absence. +Alongside customizable keybinds, there are a few quality of life updates, such as `lazygit` integration and the +new experimental Lua loader of Neovim 0.9 thanks to our awesome contributors who made this update possible during my absence. -## Changelog {#sec-release-0-4-changelog} +## Changelog {#sec-release-0.4-changelog} [n3oney](https://github.com/n3oney): @@ -22,8 +18,7 @@ absence. - Simplified luaConfigRC and configRC setting - they can now just take strings -- Refactored the resolveDag function - you can just provide a string now, which - will default to dag.entryAnywhere +- Refactored the resolveDag function - you can just provide a string now, which will default to dag.entryAnywhere - Fixed formatting sometimes removing parts of files @@ -37,8 +32,7 @@ absence. - Added `toggleterm` integration for `lazygit`. -- Added new option `enableluaLoader` to enable neovim's experimental module - loader for faster startup time. +- Added new option `enableluaLoader` to enable neovim's experimental module loader for faster startup time. - Fixed bug where flutter-tools can't find `dart` LSP @@ -46,28 +40,23 @@ absence. [notashelf](https://github.com/notashelf): -- Made Copilot's Node package configurable. It is recommended to keep as - default, but providing a different NodeJS version is now possible. +- Made Copilot's Node package configurable. It is recommended to keep as default, but providing a different NodeJS version is now possible. -- Added `vim.cursorlineOpt` for configuring Neovim's `vim.o.cursorlineopt`. +- Added [vim.cursorlineOpt](vim.cursorlineOpt) for configuring Neovim's cursorlineOpt. -- Added `filetree.nvimTreeLua.view.cursorline`, default false, to enable - cursorline in nvimtre. +- Added `filetree.nvimTreeLua.view.cursorline`, default false, to enable cursorline in nvimtre. - Added Fidget.nvim support for the Catppuccin theme. -- Updated bundled NodeJS version used by `Copilot.lua`. v16 is now marked as - insecure on Nixpkgs, and we updated to v18 +- Updated bundled NodeJS version used by `Copilot.lua`. v16 is now marked as insecure on Nixpkgs, and we updated to v18 - Enabled Catppuccin modules for plugins available by default. - Added experimental Svelte support under `vim.languages`. -- Removed unnecessary scrollbar element from notifications and codeaction - warning UI. +- Removed unnecessary scrollbar element from notifications and codeaction warning UI. -- `vim.utility.colorizer` has been renamed to `vim.utility.ccc` after the plugin - it uses +- `vim.utility.colorizer` has been renamed to `vim.utility.ccc` after the plugin it uses - Color preview via `nvim-colorizer.lua` @@ -77,8 +66,7 @@ absence. - Added a module for enabling Neovim's spellchecker -- Added prettierd as an alternative formatter to prettier - currently defaults - to prettier +- Added prettierd as an alternative formatter to prettier - currently defaults to prettier - Fixed presence.nvim inheriting the wrong client id diff --git a/docs/release-notes/rl-0.5.md b/docs/release-notes/rl-0.5.md new file mode 100644 index 00000000..083d9d58 --- /dev/null +++ b/docs/release-notes/rl-0.5.md @@ -0,0 +1,107 @@ +# Release 0.5 {#sec-release-0.5} + +Release notes for release 0.5 + +## Changelog {#sec-release-0.5-changelog} + +[vagahbond](https://github.com/vagahbond): + +- Added phan language server for PHP + +- Added phpactor language server for PHP + +[horriblename](https://github.com/horriblename): + +- Added transparency support for tokyonight theme + +- Fixed a bug where cmp's close and scrollDocs mappings wasn't working + +- Streamlined and simplified extra plugin API with the addition of [vim.extraPlugins](vim.extraPlugins) + +- Allow using command names in place of LSP packages to avoid automatic installation + +- Add lua LSP and treesitter support, and neodev.nvim plugin support + +- Add [vim.lsp.mappings.toggleFormatOnSave](vim.lsp.mappings.toggleFormatOnSave) keybind + +[amanse](https://github.com/amanse): + +- Added daily notes options for obsidian plugin + +- Added jdt-language-server for Java + +[yavko](https://github.com/yavko): + +- Added Deno Language Server for javascript/typescript + +- Added support for multiple languages [vim.spellChecking.languages](vim.spellChecking.languages), and added + vim-dirtytalk through [vim.spellChecking.enableProgrammingWordList](vim.spellChecking.enableProgrammingWordList) + +[frothymarrow](https://github.com/FrothyMarrow): + +- Renamed `vim.visuals.cursorWordline` to [vim.visuals.cursorline.enable](vim.visuals.cursorline.enable) + +- Added [vim.visuals.cursorline.lineNumbersOnly](vim.visuals.cursorline.lineNumbersOnly) to display cursorline + only in the presence of line numbers + +- Added Oxocarbon to the list of available themes. + +[notashelf](https://github.com/notashelf): + +- Added GitHub Copilot to nvim-cmp completion sources. + +- Added [vim.ui.borders.enable](vim.ui.borders.enable) for global and individual plugin border configuration. + +- LSP integrated breadcrumbs with [vim.ui.breadcrumbs.enable](vim.ui.breadcrumbs.enable) through nvim-navic + +- LSP navigation helper with nvim-navbuddy, depends on nvim-navic (automatically enabled if navic is enabled) + +- Addeed nvim-navic integration for catppuccin theme + +- Fixed mismatching zig language description + +- Added support for `statix` and `deadnix` through [vim.languages.nix.extraDiagnostics.types](vim.languages.nix.extraDiagnostics.types) + +- Added `lsp_lines` plugin for showing diagnostic messages + +- Added a configuration option for choosing the leader key + +- The package used for neovim is now customizable by the user, using [vim.package](vim.package). + For best results, always use an unwrapped package + +- Added highlight-undo plugin for highlighting undo/redo targets + +- Added bash LSP and formatter support + +- Disabled Lualine LSP status indicator for toggleterm buffer + +- Added `nvim-docs-view`, a plugin to display lsp hover documentation in a side panel + +- Switched to `nixosOptionsDoc` in option documentation. + To quote home-manager commit: "Output is mostly unchanged aside from some minor typographical and + formatting changes, along with better source links." + +- Updated indent-blankine.nvim to v3 - this comes with a few option changes, which will be migrated with `renamedOptionModule` + +[jacekpoz](https://github.com/jacekpoz): + +- Fixed scrollOffset not being used + +- Updated clangd to 16 + +- Disabled `useSystemClipboard` by default + +[ksonj](https://github.com/ksonj): + +- Add support to change mappings to utility/surround + +- Add black-and-isort python formatter + +- Removed redundant "Enable ..." in `mkEnableOption` descriptions + +- Add options to modify LSP key bindings and add proper whichkey descriptions + +- Changed type of `statusline.lualine.activeSection` and `statusline.lualine.inactiveSection` + from `attrsOf str` to `attrsOf (listOf str)` + +- Added `statusline.lualine.extraActiveSection` and `statusline.lualine.extraInactiveSection` diff --git a/docs/release-notes/rl-0.6.md b/docs/release-notes/rl-0.6.md new file mode 100644 index 00000000..437c916e --- /dev/null +++ b/docs/release-notes/rl-0.6.md @@ -0,0 +1,158 @@ +# Release 0.6 {#sec-release-0.6} + +Release notes for release 0.6 + +## Breaking Changes and Migration Guide {#sec-breaking-changes-and-migration-guide} + +In v0.6 we are introducing `setupOpts`: many plugin related options are moved into their respective `setupOpts` +submodule, e.g. `nvimTree.disableNetrw` is renamed to `nvimTree.setupOpts.disable_netrw`. + +_Why?_ in short, you can now pass in anything to setupOpts and it will be passed to your `require'plugin'.setup{...}`. +No need to wait for us to support every single plugin option. + +The warnings when you rebuild your config should be enough to guide you through what you need to do, if there's an +option that was renamed but wasn't listed in the warning, please file a bug report! + +To make your migration process less annoying, here's a keybind that will help you with renaming stuff from camelCase to +snake_case (you'll be doing that a lot): + +```lua +-- paste this in a temp.lua file and load it in vim with :source /path/to/temp.lua +function camelToSnake() + -- Get the current word under the cursor + local word = vim.fn.expand("") + -- Replace each capital letter with an underscore followed by its lowercase equivalent + local snakeCase = string.gsub(word, "%u", function(match) + return "_" .. string.lower(match) + end) + -- Remove the leading underscore if present + if string.sub(snakeCase, 1, 1) == "_" then + snakeCase = string.sub(snakeCase, 2) + end + vim.fn.setreg(vim.v.register, snakeCase) + -- Select the word under the cursor and paste + vim.cmd("normal! viwP") +end + +vim.api.nvim_set_keymap('n', 'a', ':lua camelToSnake()', { noremap = true, silent = true }) +``` + +## Changelog {#sec-release-0.6-changelog} + +[ksonj](https://github.com/ksonj): + +- Added Terraform language support. + +- Added `ChatGPT.nvim`, which can be enabled with [`vim.assistant.chatgpt`](vim.assistant.chatgpt). Do + keep in mind that this option requires `OPENAI_API_KEY` environment variable to be set. + +[donnerinoern](https://github.com/donnerinoern): + +- Added Gruvbox theme. + +- Added marksman LSP for Markdown. + +- Fixed markdown preview with Glow not working and added an option for changing the preview keybind. + +- colorizer.nvim: switched to a maintained fork. + +- Added `markdown-preview.nvim`, moved `glow.nvim` to a brand new `vim.utility.preview` category. + +[elijahimmer](https://github.com/elijahimmer) + +- Added rose-pine theme. + +[jacekpoz](https://github.com/jacekpoz): + +- Added `vim.autocomplete.alwaysComplete`. Allows users to have the autocomplete window popup only when manually activated. + +[horriblename](https://github.com/horriblename): + +- Fixed empty winbar when breadcrumbs are disabled. + +- Added custom `setupOpts` for various plugins. + +- Removed support for deprecated plugin "nvim-compe". + +- Moved most plugins to `setupOpts` method. + +[frothymarrow](https://github.com/frothymarrow): + +- Added option `vim.luaPackages` to wrap neovim with extra Lua packages. + +- Rewrote the entire `fidget.nvim` module to include extensive configuration options. Option `vim.fidget-nvim.align.bottom` has + been removed in favor of [vim.fidget-nvim.notification.window.align](vim.fidget-nvim.notification.window.align), which now supports + `top` and `bottom` values. `vim.fidget-nvim.align.right` has no longer any equivalent and also has been removed. + +- `which-key.nvim` categories can now be customized through [vim.binds.whichKey.register](vim.binds.whichKey.register) + +- Added `magick` to `vim.luaPackages` for `image.nvim`. + +- Added `alejandra` to the default devShell. + +- Migrated neovim-flake to `makeNeovimUnstable` wrapper. + +[notashelf](https://github.com/notashelf): + +- Finished moving to `nixosOptionsDoc` in the documentation and changelog. All documentation options + and files are fully free of Asciidoc, and will now use Nixpkgs flavored markdown. + +- Bumped plugin inputs to their latest versions. + +- Deprecated `presence.nvim` in favor of `neocord`. This means `vim.rich-presence.presence-nvim` is removed and will throw + a warning if used. You are recommended to rewrite your neocord configuration from scratch based on the. + [official documentation](https://github.com/IogaMaster/neocord) + +- Removed Tabnine plugin due to the usage of imperative tarball downloads. If you'd like to see it back, please create an issue. + +- Added support for css and tailwindcss through vscode-language-servers-extracted & tailwind-language-server. + Those can be enabled through `vim.languages.css` and `vim.languages.tailwind`. + +- Lualine module now allows customizing `always_divide_middle`, `ignore_focus` and `disabled_filetypes` through the new + options: [vim.statusline.lualine.alwaysDivideMiddle](vim.statusline.lualine.alwaysDivideMiddle), + [vim.statusline.lualine.ignoreFocus](vim.statusline.lualine.ignoreFocus) and + [vim.statusline.lualine.disabledFiletypes](vim.statusline.lualine.disabledFiletypes). + +- Updated all plugin inputs to their latest versions (**21.04.2024**) - this brought minor color changes to the Catppuccin + theme. + +- Moved home-manager module entrypoint to `flake/modules` and added an experimental Nixos module. This requires further testing + before it can be considered ready for use. + +- Made lib calls explicit. E.g. `lib.strings.optionalString` instead of `lib.optionalString`. This is a pattern expected + to be followed by all contributors in the future. + +- Added `image.nvim` for image previews. + +- The final neovim package is now exposed. This means you can build the neovim package that will be added to your + package list without rebuilding your system to test if your configuration yields a broken package. + +- Changed the tree structure to distinguish between core options and plugin options. + +- Added plugin auto-discovery from plugin inputs. This is mostly from + [JordanIsaac's neovim-flake](https://github.com/jordanisaacs/neovim-flake). Allows contributors to add plugin inputs + with the `plugin-` prefix to have them automatically discovered for the `plugin` type in `lib/types`. + +- Moved internal `wrapLuaConfig` to the extended library, structured its arguments to take `luaBefore`, `luaConfig` + and `luaAfter` as strings, which are then concatted inside a lua block. + +- Added [`vim.luaConfigBefore`](vim.luaConfigBefore) and [`vim.luaConfigAfter`](vim.luaConfigAfter) + for inserting verbatim Lua configuration before and after the resolved Lua DAG respectively. Both of those options + take strings as the type, so you may read the contents of a Lua file from a given path. + +- Added [`vim.spellChecking.ignoredFiletypes`](vim.spellChecking.ignoredFiletypes) + and [`vim.spellChecking.programmingWordlist.enable`](vim.spellChecking.programmingWordlist.enable) for ignoring certain filetypes + in spellchecking and enabling `vim-dirtytalk` respectively. The previously used `vim.spellcheck.vim-dirtytalk` aliases to the latter + option. + +- Exposed `withRuby`, `withNodeJs`, `withPython3`, and `python3Packages` from the `makeNeovimConfig` function under their respective options. + +- Added [`vim.extraPackages`](vim.extraPackages) for appending additional packages to the wrapper PATH, making said packages available + while inside the Neovim session. + +- Made treesitter options configurable, and moved `treesitter-context to +`setupOpts` while it is enabled. + +- Added `vim.notify.nvim-notify.setupOpts.render` which takes either a string of enum or + a lua function. The default is "compact", but you may change it according to + nvim-notify documentation. diff --git a/docs/static/script/anchor-min.js b/docs/static/script/anchor-min.js deleted file mode 100644 index 70565172..00000000 --- a/docs/static/script/anchor-min.js +++ /dev/null @@ -1,10 +0,0 @@ -// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat -// -// AnchorJS - v5.0.0 - 2023-01-18 -// https://www.bryanbraun.com/anchorjs/ -// Copyright (c) 2023 Bryan Braun; Licensed MIT -// -// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat -!function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(globalThis,function(){"use strict";return function(A){function u(A){A.icon=Object.prototype.hasOwnProperty.call(A,"icon")?A.icon:"",A.visible=Object.prototype.hasOwnProperty.call(A,"visible")?A.visible:"hover",A.placement=Object.prototype.hasOwnProperty.call(A,"placement")?A.placement:"right",A.ariaLabel=Object.prototype.hasOwnProperty.call(A,"ariaLabel")?A.ariaLabel:"Anchor",A.class=Object.prototype.hasOwnProperty.call(A,"class")?A.class:"",A.base=Object.prototype.hasOwnProperty.call(A,"base")?A.base:"",A.truncate=Object.prototype.hasOwnProperty.call(A,"truncate")?Math.floor(A.truncate):64,A.titleText=Object.prototype.hasOwnProperty.call(A,"titleText")?A.titleText:""}function d(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new TypeError("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],u(this.options),this.add=function(A){var e,t,o,i,n,s,a,r,l,c,h,p=[];if(u(this.options),0!==(e=d(A=A||"h2, h3, h4, h5, h6")).length){for(null===document.head.querySelector("style.anchorjs")&&((A=document.createElement("style")).className="anchorjs",A.appendChild(document.createTextNode("")),void 0===(h=document.head.querySelector('[rel="stylesheet"],style'))?document.head.appendChild(A):document.head.insertBefore(A,h),A.sheet.insertRule(".anchorjs-link{opacity:0;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}",A.sheet.cssRules.length),A.sheet.insertRule(":hover>.anchorjs-link,.anchorjs-link:focus{opacity:1}",A.sheet.cssRules.length),A.sheet.insertRule("[data-anchorjs-icon]::after{content:attr(data-anchorjs-icon)}",A.sheet.cssRules.length),A.sheet.insertRule('@font-face{font-family:anchorjs-icons;src:url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype")}',A.sheet.cssRules.length)),h=document.querySelectorAll("[id]"),t=[].map.call(h,function(A){return A.id}),i=0;i\]./()*\\\n\t\b\v\u00A0]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),A=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||A||!1}}}); -// @license-end - diff --git a/docs/static/script/anchor-use.js b/docs/static/script/anchor-use.js deleted file mode 100644 index d2f2fe6c..00000000 --- a/docs/static/script/anchor-use.js +++ /dev/null @@ -1,4 +0,0 @@ -document.addEventListener('DOMContentLoaded', function(event) { - anchors.add('h1[id]:not(div.note h1, div.warning h1, div.tip h1, div.caution h1, div.important h1), h2[id]:not(div.note h2, div.warning h2, div.tip h2, div.caution h2, div.important h2), h3[id]:not(div.note h3, div.warning h3, div.tip h3, div.caution h3, div.important h3), h4[id]:not(div.note h4, div.warning h4, div.tip h4, div.caution h4, div.important h4), h5[id]:not(div.note h5, div.warning h5, div.tip h5, div.caution h5, div.important h5), h6[id]:not(div.note h6, div.warning h6, div.tip h6, div.caution h6, div.important h6)'); -}); - diff --git a/docs/static/script/search.js b/docs/static/script/search.js deleted file mode 100644 index e20c2314..00000000 --- a/docs/static/script/search.js +++ /dev/null @@ -1,58 +0,0 @@ -document.addEventListener("DOMContentLoaded", () => { - if (!window.location.pathname.endsWith("options.html")) return; - - const searchDiv = document.createElement("div"); - searchDiv.id = "search-bar"; - searchDiv.innerHTML = ` - -
- `; - document.body.prepend(searchDiv); - - const dtElements = Array.from(document.querySelectorAll("dt")); - const ddElements = Array.from(document.querySelectorAll("dd")); - const dtOptionIds = dtElements.map( - (dt) => dt.querySelector("a")?.id.toLowerCase() || "", - ); - - if (dtElements.length === 0 || ddElements.length === 0) { - console.warn("Something went wrong, page may be loaded incorrectly."); - return; - } - - const dtElementsData = dtElements.map((dt, index) => ({ - element: dt, - id: dtOptionIds[index], - ddElement: ddElements[index], - })); - - const hiddenClass = "hidden"; - const hiddenStyle = document.createElement("style"); - hiddenStyle.innerHTML = `.${hiddenClass} { display: none; }`; - document.head.appendChild(hiddenStyle); - - let debounceTimeout; - document.getElementById("search-input").addEventListener("input", (event) => { - clearTimeout(debounceTimeout); - debounceTimeout = setTimeout(() => { - const query = event.target.value.toLowerCase(); - - const matches = []; - const nonMatches = []; - - dtElementsData.forEach(({ element, id, ddElement }) => { - const isMatch = id.includes(query); - if (isMatch) { - matches.push(element, ddElement); - } else { - nonMatches.push(element, ddElement); - } - }); - - requestAnimationFrame(() => { - matches.forEach((el) => el?.classList.remove(hiddenClass)); - nonMatches.forEach((el) => el?.classList.add(hiddenClass)); - }); - }, 200); - }); -}); diff --git a/docs/static/style.css b/docs/static/style.css index 6e654ed4..3f803f25 100644 --- a/docs/static/style.css +++ b/docs/static/style.css @@ -1,7 +1,830 @@ -:root{--nmd-color0: #0A3E68;--nmd-color1: #268598;--nmd-color2: #B8D09E;--nmd-color3: #F6CF5E;--nmd-color4: #EC733B;--nmd-color-info: #167cb9;--nmd-color-warn: #ff6700}html{-webkit-text-size-adjust:100%}html:focus-within{scroll-behavior:smooth}body{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;min-height:100vh;position:relative;text-rendering:optimizeSpeed;width:100%}*,:after,:before{box-sizing:border-box}a:not([class]){-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto}a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{border:0;font-size:100%;font:inherit;margin:0;padding:0;vertical-align:baseline}:focus{outline:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section{display:block}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:"";content:none}input,input:required{box-shadow:none}input:-webkit-autofill,input:-webkit-autofill:active,input:-webkit-autofill:focus,input:-webkit-autofill:hover{-webkit-box-shadow:inset 0 0 0 30px #fff}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none}input[type=search]{-webkit-appearance:none;-moz-appearance:none}input:focus{outline:0}audio,canvas,video{display:inline-block;max-width:100%}audio:not([controls]){display:none;height:0}[hidden]{display:none}a:active,a:hover{outline:0}img{height:auto;max-width:100%;vertical-align:middle}img,picture{display:inline-block}button,input{line-height:normal}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;background:0 0;border:0;cursor:pointer}button[disabled],html input[disabled]{cursor:default}[disabled]{pointer-events:none}input[type=checkbox],input[type=radio]{padding:0}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button{background:0 0;border:0}textarea{overflow:auto;resize:vertical;vertical-align:top}table{border-collapse:collapse;border-spacing:0;text-indent:0}hr{background:#000;border:0;box-sizing:content-box;height:1px;line-height:0;margin:0;overflow:visible;padding:0;page-break-after:always;width:100%}pre{font-family:monospace,monospace;font-size:100%}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:none}code,kbd,pre,samp{font-family:monospace,monospace}small,sub,sup{font-size:75%}sub,sup{line-height:0;position:relative;vertical-align:baseline}sub{bottom:-5px}sup{top:-5px}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1;margin:0;padding:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;outline:0;padding:0}legend{border:0;color:inherit;display:block;max-width:100%;white-space:normal;width:100%}fieldset{min-width:0}body:not(:-moz-handler-blocked) fieldset{display:block}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}template{display:none}body{background:white;color:#111827;max-width:min(100ch, 1024px);margin:0 auto;padding:10px;font-family:"Lucida Sans",Arial,sans-serif;font-size:16px;line-height:1.4em}@media (prefers-color-scheme: dark){body{background:#111827;color:#F9FAFB}}h1,h2,h3{color:var(--nmd-color0);font-family:"Lato",sans-serif;font-weight:300;line-height:1.125}@media (prefers-color-scheme: dark){h1,h2,h3{color:var(--nmd-color4)}}h1{font-size:48px;font-weight:300;margin:4rem 0 1.5rem}h2{font-size:32px;font-weight:300;margin:2rem 0 1rem}h3{font-size:20px;font-weight:400;margin:.5rem .25rem}p{margin:.9rem 0}p:first-child{margin-top:0}p:last-child{margin-bottom:0}a{color:var(--nmd-color0);text-decoration:underline;text-underline-offset:3px}a:visited{color:var(--nmd-color1)}a:hover{color:var(--nmd-color1)}@media (prefers-color-scheme: dark){a{color:var(--nmd-color3)}a:visited{color:var(--nmd-color2)}a:hover{color:var(--nmd-color4)}}code{font-size:90%}span.command{font-size:90%;font-family:monospace}em{font-style:italic}strong{font-weight:bold}pre{background:#F9FAFB;margin:2rem 16px;padding:10px;border:1px solid #E5E7EB;border-radius:4px;box-shadow:4px 4px 8px #E5E7EB;font-size:90%;margin-bottom:1.5rem;padding:6px;overflow:auto}@media (prefers-color-scheme: dark){pre{background:#1F2937;border-color:black;box-shadow:4px 4px 8px black}}pre span img{user-select:none}pre:has(code){padding:0}td,th{padding:2px 5px}td:first-child,th:first-child{padding-left:0}td:last-child,th:last-child{padding-right:0}dt{margin:1.2rem 0 .8rem}dd{margin-left:2rem}ul{margin:.9rem 0;padding-left:30px;list-style:disc}ul:first-child{margin-top:0}ul:last-child{margin-bottom:0}ol{margin:.9rem 0;padding-left:30px;list-style:decimal}ol:first-child{margin-top:0}ol:last-child{margin-bottom:0}li{margin:.9rem 0;padding-left:5px}li:first-child{margin-top:0}li:last-child{margin-bottom:0}.navheader hr,.navfooter hr{margin:1rem 0;background:#E5E7EB}@media (prefers-color-scheme: dark){.navheader hr,.navfooter hr{background:#4B5563}}.navheader a,.navfooter a{text-decoration:none}div.titlepage{margin:40px 0}div.titlepage hr{display:none}div.toc{background:#F9FAFB;margin:2rem 16px;padding:10px;border:1px solid #E5E7EB;border-radius:4px;box-shadow:4px 4px 8px #E5E7EB}@media (prefers-color-scheme: dark){div.toc{background:#1F2937;border-color:black;box-shadow:4px 4px 8px black}}div.toc a{text-decoration:none}div.note,div.warning{background:#F9FAFB;margin:2rem 16px;padding:10px;border:1px solid #E5E7EB;border-radius:4px;box-shadow:4px 4px 8px #E5E7EB;font-style:italic}@media (prefers-color-scheme: dark){div.note,div.warning{background:#1F2937;border-color:black;box-shadow:4px 4px 8px black}}div.note h3,div.warning h3{float:right;margin:0 0 1rem 1rem;width:42px;height:42px;content:url()}div.note h3+p,div.warning h3+p{margin-top:0}div.note h3{background-color:var(--nmd-color-info);mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 8h.01'%3E%3C/path%3E%3Cpath d='M11 12h1v4h1'%3E%3C/path%3E%3Cpath d='M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z'%3E%3C/path%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 8h.01'%3E%3C/path%3E%3Cpath d='M11 12h1v4h1'%3E%3C/path%3E%3Cpath d='M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z'%3E%3C/path%3E%3C/svg%3E")}div.warning h3{background-color:var(--nmd-color-warn);mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 9v2m0 4v.01'%3E%3C/path%3E%3Cpath d='M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75'%3E%3C/path%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 9v2m0 4v.01'%3E%3C/path%3E%3Cpath d='M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75'%3E%3C/path%3E%3C/svg%3E")}.term{font-weight:300}.docbook .xref img[src^=images\/callouts\/],.screen img,.programlisting img{width:1em}.calloutlist img{width:1.3em}.programlisting.language-shell .hljs-meta.prompt_{user-select:none}/*! +:root { + --nmd-color0: #0a3e68; + --nmd-color1: #268598; + --nmd-color2: #b8d09e; + --nmd-color3: #f6cf5e; + --nmd-color4: #ec733b; + --nmd-color-info: #167cb9; + --nmd-color-warn: #ff6700; +} +html { + -webkit-text-size-adjust: 100%; +} +html:focus-within { + scroll-behavior: smooth; +} +body { + -webkit-text-size-adjust: 100%; + -moz-text-size-adjust: 100%; + text-size-adjust: 100%; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + min-height: 100vh; + position: relative; + text-rendering: optimizeSpeed; + width: 100%; +} +*, +:after, +:before { + box-sizing: border-box; +} +a:not([class]) { + -webkit-text-decoration-skip: ink; + text-decoration-skip-ink: auto; +} +a, +abbr, +acronym, +address, +applet, +article, +aside, +audio, +b, +big, +blockquote, +body, +canvas, +caption, +center, +cite, +code, +dd, +del, +details, +dfn, +div, +dl, +dt, +em, +embed, +fieldset, +figcaption, +figure, +footer, +form, +h1, +h2, +h3, +h4, +h5, +h6, +header, +hgroup, +html, +i, +iframe, +img, +ins, +kbd, +label, +legend, +li, +mark, +menu, +nav, +object, +ol, +output, +p, +pre, +q, +ruby, +s, +samp, +section, +small, +span, +strike, +strong, +sub, +summary, +sup, +table, +tbody, +td, +tfoot, +th, +thead, +time, +tr, +tt, +u, +ul, +var, +video { + border: 0; + font-size: 100%; + font: inherit; + margin: 0; + padding: 0; + vertical-align: baseline; +} +:focus { + outline: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section { + display: block; +} +ol, +ul { + list-style: none; +} +blockquote, +q { + quotes: none; +} +blockquote:after, +blockquote:before, +q:after, +q:before { + content: ""; + content: none; +} +input, +input:required { + box-shadow: none; +} +input:-webkit-autofill, +input:-webkit-autofill:active, +input:-webkit-autofill:focus, +input:-webkit-autofill:hover { + -webkit-box-shadow: inset 0 0 0 30px #fff; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration, +input[type="search"]::-webkit-search-results-button, +input[type="search"]::-webkit-search-results-decoration { + -webkit-appearance: none; + -moz-appearance: none; +} +input[type="search"] { + -webkit-appearance: none; + -moz-appearance: none; +} +input:focus { + outline: 0; +} +audio, +canvas, +video { + display: inline-block; + max-width: 100%; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden] { + display: none; +} +a:active, +a:hover { + outline: 0; +} +img { + height: auto; + max-width: 100%; + vertical-align: middle; +} +img, +picture { + display: inline-block; +} +button, +input { + line-height: normal; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + background: 0 0; + border: 0; + cursor: pointer; +} +button[disabled], +html input[disabled] { + cursor: default; +} +[disabled] { + pointer-events: none; +} +input[type="checkbox"], +input[type="radio"] { + padding: 0; +} +input[type="search"] { + -webkit-appearance: textfield; + box-sizing: content-box; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} +button { + background: 0 0; + border: 0; +} +textarea { + overflow: auto; + resize: vertical; + vertical-align: top; +} +table { + border-collapse: collapse; + border-spacing: 0; + text-indent: 0; +} +hr { + background: #000; + border: 0; + box-sizing: content-box; + height: 1px; + line-height: 0; + margin: 0; + overflow: visible; + padding: 0; + page-break-after: always; + width: 100%; +} +pre { + font-family: monospace, monospace; + font-size: 100%; +} +a { + background-color: transparent; +} +abbr[title] { + border-bottom: none; + text-decoration: none; +} +code, +kbd, +pre, +samp { + font-family: monospace, monospace; +} +small, +sub, +sup { + font-size: 75%; +} +sub, +sup { + line-height: 0; + position: relative; + vertical-align: baseline; +} +sub { + bottom: -5px; +} +sup { + top: -5px; +} +button, +input, +optgroup, +select, +textarea { + font-family: inherit; + font-size: 100%; + line-height: 1; + margin: 0; + padding: 0; +} +button, +input { + overflow: visible; +} +button, +select { + text-transform: none; +} +[type="button"], +[type="reset"], +[type="submit"], +button { + -webkit-appearance: button; +} +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner, +button::-moz-focus-inner { + border-style: none; + outline: 0; + padding: 0; +} +legend { + border: 0; + color: inherit; + display: block; + max-width: 100%; + white-space: normal; + width: 100%; +} +fieldset { + min-width: 0; +} +body:not(:-moz-handler-blocked) fieldset { + display: block; +} +progress { + vertical-align: baseline; +} +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} +[type="search"] { + -webkit-appearance: textfield; + outline-offset: -2px; +} +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +::-webkit-file-upload-button { + -webkit-appearance: button; + font: inherit; +} +summary { + display: list-item; +} +template { + display: none; +} +body { + background: white; + color: #111827; + max-width: min(100ch, 1024px); + margin: 0 auto; + padding: 10px; + font-family: "Lucida Sans", Arial, sans-serif; + font-size: 16px; + line-height: 1.4em; +} +@media (prefers-color-scheme: dark) { + body { + background: #111827; + color: #f9fafb; + } +} +h1, +h2, +h3 { + color: var(--nmd-color0); + font-family: "Lato", sans-serif; + font-weight: 300; + line-height: 1.125; +} +@media (prefers-color-scheme: dark) { + h1, + h2, + h3 { + color: var(--nmd-color4); + } +} +h1 { + font-size: 48px; + font-weight: 300; + margin: 4rem 0 1.5rem; +} +h2 { + font-size: 32px; + font-weight: 300; + margin: 2rem 0 1rem; +} +h3 { + font-size: 20px; + font-weight: 400; + margin: 0.5rem 0.25rem; +} +p { + margin: 0.9rem 0; +} +p:first-child { + margin-top: 0; +} +p:last-child { + margin-bottom: 0; +} +a { + color: var(--nmd-color0); + text-decoration: underline; + text-underline-offset: 3px; +} +a:visited { + color: var(--nmd-color1); +} +a:hover { + color: var(--nmd-color1); +} +@media (prefers-color-scheme: dark) { + a { + color: var(--nmd-color3); + } + a:visited { + color: var(--nmd-color2); + } + a:hover { + color: var(--nmd-color4); + } +} +code { + font-size: 90%; +} +span.command { + font-size: 90%; + font-family: monospace; +} +em { + font-style: italic; +} +strong { + font-weight: bold; +} +pre { + background: #f9fafb; + margin: 2rem 16px; + padding: 10px; + border: 1px solid #e5e7eb; + border-radius: 4px; + box-shadow: 4px 4px 8px #e5e7eb; + font-size: 90%; + margin-bottom: 1.5rem; + padding: 6px; + overflow: auto; +} +@media (prefers-color-scheme: dark) { + pre { + background: #1f2937; + border-color: black; + box-shadow: 4px 4px 8px black; + } +} +pre span img { + user-select: none; +} +pre:has(code) { + padding: 0; +} +td, +th { + padding: 2px 5px; +} +td:first-child, +th:first-child { + padding-left: 0; +} +td:last-child, +th:last-child { + padding-right: 0; +} +dt { + margin: 1.2rem 0 0.8rem; +} +dd { + margin-left: 2rem; +} +ul { + margin: 0.9rem 0; + padding-left: 30px; + list-style: disc; +} +ul:first-child { + margin-top: 0; +} +ul:last-child { + margin-bottom: 0; +} +ol { + margin: 0.9rem 0; + padding-left: 30px; + list-style: decimal; +} +ol:first-child { + margin-top: 0; +} +ol:last-child { + margin-bottom: 0; +} +li { + margin: 0.9rem 0; + padding-left: 5px; +} +li:first-child { + margin-top: 0; +} +li:last-child { + margin-bottom: 0; +} +.navheader hr, +.navfooter hr { + margin: 1rem 0; + background: #e5e7eb; +} +@media (prefers-color-scheme: dark) { + .navheader hr, + .navfooter hr { + background: #4b5563; + } +} +.navheader a, +.navfooter a { + text-decoration: none; +} +div.titlepage { + margin: 40px 0; +} +div.titlepage hr { + display: none; +} +div.toc { + background: #f9fafb; + margin: 2rem 16px; + padding: 10px; + border: 1px solid #e5e7eb; + border-radius: 4px; + box-shadow: 4px 4px 8px #e5e7eb; +} +@media (prefers-color-scheme: dark) { + div.toc { + background: #1f2937; + border-color: black; + box-shadow: 4px 4px 8px black; + } +} +div.toc a { + text-decoration: none; +} +div.note, +div.warning { + background: #f9fafb; + margin: 2rem 16px; + padding: 10px; + border: 1px solid #e5e7eb; + border-radius: 4px; + box-shadow: 4px 4px 8px #e5e7eb; + font-style: italic; +} +@media (prefers-color-scheme: dark) { + div.note, + div.warning { + background: #1f2937; + border-color: black; + box-shadow: 4px 4px 8px black; + } +} +div.note h3, +div.warning h3 { + float: right; + margin: 0 0 1rem 1rem; + width: 42px; + height: 42px; + content: url(); +} +div.note h3 + p, +div.warning h3 + p { + margin-top: 0; +} +div.note h3 { + background-color: var(--nmd-color-info); + mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 8h.01'%3E%3C/path%3E%3Cpath d='M11 12h1v4h1'%3E%3C/path%3E%3Cpath d='M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z'%3E%3C/path%3E%3C/svg%3E"); + -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 8h.01'%3E%3C/path%3E%3Cpath d='M11 12h1v4h1'%3E%3C/path%3E%3Cpath d='M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z'%3E%3C/path%3E%3C/svg%3E"); +} +div.warning h3 { + background-color: var(--nmd-color-warn); + mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 9v2m0 4v.01'%3E%3C/path%3E%3Cpath d='M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75'%3E%3C/path%3E%3C/svg%3E"); + -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 9v2m0 4v.01'%3E%3C/path%3E%3Cpath d='M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75'%3E%3C/path%3E%3C/svg%3E"); +} +.term { + font-weight: 300; +} +.docbook .xref img[src^="images\/callouts\/"], +.screen img, +.programlisting img { + width: 1em; +} +.calloutlist img { + width: 1.3em; +} +.programlisting.language-shell .hljs-meta.prompt_ { + user-select: none; +} /*! Theme: Tomorrow Author: Chris Kempson (http://chriskempson.com) License: ~ MIT (or more permissive) [via base16-schemes-source] Maintainer: @highlightjs/core-team Version: 2021.09.0 -*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#4d4d4c;background:#fff}.hljs ::selection,.hljs::selection{background-color:#d6d6d6;color:#4d4d4c}.hljs-comment{color:#8e908c}.hljs-tag{color:#969896}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#4d4d4c}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#c82829}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f5871f}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#eab700}.hljs-strong{font-weight:700;color:#eab700}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#718c00}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#3e999f}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#4271ae}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#8959a8}.hljs-emphasis{color:#8959a8;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a3685a}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700}@media (prefers-color-scheme: dark){/*! Theme: Tomorrow Night Author: Chris Kempson (http://chriskempson.com) License: ~ MIT (or more permissive) [via base16-schemes-source] Maintainer: @highlightjs/core-team Version: 2021.09.0*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#ccc;background:#2d2d2d}.hljs ::selection,.hljs::selection{background-color:#515151;color:#ccc}.hljs-comment{color:#999}.hljs-tag{color:#b4b7b4}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#ccc}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#f2777a}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f99157}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fc6}.hljs-strong{font-weight:700;color:#fc6}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#9c9}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#6cc}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#69c}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#c9c}.hljs-emphasis{color:#c9c;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a3685a}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700}} +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em; +} +code.hljs { + padding: 3px 5px; +} +.hljs { + color: #4d4d4c; + background: #fff; +} +.hljs ::selection, +.hljs::selection { + background-color: #d6d6d6; + color: #4d4d4c; +} +.hljs-comment { + color: #8e908c; +} +.hljs-tag { + color: #969896; +} +.hljs-operator, +.hljs-punctuation, +.hljs-subst { + color: #4d4d4c; +} +.hljs-operator { + opacity: 0.7; +} +.hljs-bullet, +.hljs-deletion, +.hljs-name, +.hljs-selector-tag, +.hljs-template-variable, +.hljs-variable { + color: #c82829; +} +.hljs-attr, +.hljs-link, +.hljs-literal, +.hljs-number, +.hljs-symbol, +.hljs-variable.constant_ { + color: #f5871f; +} +.hljs-class .hljs-title, +.hljs-title, +.hljs-title.class_ { + color: #eab700; +} +.hljs-strong { + font-weight: 700; + color: #eab700; +} +.hljs-addition, +.hljs-code, +.hljs-string, +.hljs-title.class_.inherited__ { + color: #718c00; +} +.hljs-built_in, +.hljs-doctag, +.hljs-keyword.hljs-atrule, +.hljs-quote, +.hljs-regexp { + color: #3e999f; +} +.hljs-attribute, +.hljs-function .hljs-title, +.hljs-section, +.hljs-title.function_, +.ruby .hljs-property { + color: #4271ae; +} +.diff .hljs-meta, +.hljs-keyword, +.hljs-template-tag, +.hljs-type { + color: #8959a8; +} +.hljs-emphasis { + color: #8959a8; + font-style: italic; +} +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #a3685a; +} +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: 700; +} +@media (prefers-color-scheme: dark) { + /*! Theme: Tomorrow Night Author: Chris Kempson (http://chriskempson.com) License: ~ MIT (or more permissive) [via base16-schemes-source] Maintainer: @highlightjs/core-team Version: 2021.09.0*/ + pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em; + } + code.hljs { + padding: 3px 5px; + } + .hljs { + color: #ccc; + background: #2d2d2d; + } + .hljs ::selection, + .hljs::selection { + background-color: #515151; + color: #ccc; + } + .hljs-comment { + color: #999; + } + .hljs-tag { + color: #b4b7b4; + } + .hljs-operator, + .hljs-punctuation, + .hljs-subst { + color: #ccc; + } + .hljs-operator { + opacity: 0.7; + } + .hljs-bullet, + .hljs-deletion, + .hljs-name, + .hljs-selector-tag, + .hljs-template-variable, + .hljs-variable { + color: #f2777a; + } + .hljs-attr, + .hljs-link, + .hljs-literal, + .hljs-number, + .hljs-symbol, + .hljs-variable.constant_ { + color: #f99157; + } + .hljs-class .hljs-title, + .hljs-title, + .hljs-title.class_ { + color: #fc6; + } + .hljs-strong { + font-weight: 700; + color: #fc6; + } + .hljs-addition, + .hljs-code, + .hljs-string, + .hljs-title.class_.inherited__ { + color: #9c9; + } + .hljs-built_in, + .hljs-doctag, + .hljs-keyword.hljs-atrule, + .hljs-quote, + .hljs-regexp { + color: #6cc; + } + .hljs-attribute, + .hljs-function .hljs-title, + .hljs-section, + .hljs-title.function_, + .ruby .hljs-property { + color: #69c; + } + .diff .hljs-meta, + .hljs-keyword, + .hljs-template-tag, + .hljs-type { + color: #c9c; + } + .hljs-emphasis { + color: #c9c; + font-style: italic; + } + .hljs-meta, + .hljs-meta .hljs-keyword, + .hljs-meta .hljs-string { + color: #a3685a; + } + .hljs-meta .hljs-keyword, + .hljs-meta-keyword { + font-weight: 700; + } +} diff --git a/docs/static/style.scss b/docs/static/style.scss index d6becd0c..f783c756 100644 --- a/docs/static/style.scss +++ b/docs/static/style.scss @@ -1,5 +1,3 @@ -@use "scss-reset/reset"; - :root { --nmd-color0: #0a3e68; --nmd-color1: #268598; @@ -34,6 +32,8 @@ $color-blue-700: #1d4ed8; $color-blue-800: #1e40af; $color-blue-900: #1e3a8a; +@use "scss-reset/reset"; + @mixin boxed { background: $color-gray-50; margin: 2rem 16px; @@ -189,16 +189,14 @@ th { dt { margin: 1.2rem 0 0.8rem; - content-visibility: auto; - contain-intrinsic-size: auto 42px; -} -dd { - margin-left: 2rem; - content-visibility: auto; - contain-intrinsic-size: auto 500px; } -div.book {} +dd { + margin-left: 2rem; +} + +div.book { +} ul { @include margined; @@ -235,33 +233,6 @@ li { } } -#search-bar { - position: sticky; - top: 0; - background: white; - padding: 10px; - border-bottom: 1px solid $color-gray-200; - z-index: 1000; - @media (prefers-color-scheme: dark) { - background: $color-gray-900; - color: $color-gray-50; - border-bottom: 1px solid black; - } -} - -#search-input { - width: 100%; - padding: 8px; - border: 1px solid #ccc; - border-radius: 4px; - background: inherit; - color: inherit; -} - -.hidden { - display: none; -} - div.titlepage { margin: 40px 0; diff --git a/docs/static/tomorrow-night.min.css b/docs/static/tomorrow-night.min.css index 45eee9dd..42ec3096 100644 --- a/docs/static/tomorrow-night.min.css +++ b/docs/static/tomorrow-night.min.css @@ -4,4 +4,99 @@ License: ~ MIT (or more permissive) [via base16-schemes-source] Maintainer: @highlightjs/core-team Version: 2021.09.0 -*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#ccc;background:#2d2d2d}.hljs ::selection,.hljs::selection{background-color:#515151;color:#ccc}.hljs-comment{color:#999}.hljs-tag{color:#b4b7b4}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#ccc}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#f2777a}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f99157}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fc6}.hljs-strong{font-weight:700;color:#fc6}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#9c9}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#6cc}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#69c}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#c9c}.hljs-emphasis{color:#c9c;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a3685a}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em; +} +code.hljs { + padding: 3px 5px; +} +.hljs { + color: #ccc; + background: #2d2d2d; +} +.hljs ::selection, +.hljs::selection { + background-color: #515151; + color: #ccc; +} +.hljs-comment { + color: #999; +} +.hljs-tag { + color: #b4b7b4; +} +.hljs-operator, +.hljs-punctuation, +.hljs-subst { + color: #ccc; +} +.hljs-operator { + opacity: 0.7; +} +.hljs-bullet, +.hljs-deletion, +.hljs-name, +.hljs-selector-tag, +.hljs-template-variable, +.hljs-variable { + color: #f2777a; +} +.hljs-attr, +.hljs-link, +.hljs-literal, +.hljs-number, +.hljs-symbol, +.hljs-variable.constant_ { + color: #f99157; +} +.hljs-class .hljs-title, +.hljs-title, +.hljs-title.class_ { + color: #fc6; +} +.hljs-strong { + font-weight: 700; + color: #fc6; +} +.hljs-addition, +.hljs-code, +.hljs-string, +.hljs-title.class_.inherited__ { + color: #9c9; +} +.hljs-built_in, +.hljs-doctag, +.hljs-keyword.hljs-atrule, +.hljs-quote, +.hljs-regexp { + color: #6cc; +} +.hljs-attribute, +.hljs-function .hljs-title, +.hljs-section, +.hljs-title.function_, +.ruby .hljs-property { + color: #69c; +} +.diff .hljs-meta, +.hljs-keyword, +.hljs-template-tag, +.hljs-type { + color: #c9c; +} +.hljs-emphasis { + color: #c9c; + font-style: italic; +} +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #a3685a; +} +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: 700; +} diff --git a/flake.lock b/flake.lock index de4d1484..f590525a 100644 --- a/flake.lock +++ b/flake.lock @@ -1,81 +1,191 @@ { "nodes": { + "dirt-samples-src": { + "flake": false, + "locked": { + "lastModified": 1667426233, + "narHash": "sha256-Zl2bi9QofcrhU63eMtg+R6lhV9ExQS/0XNTJ+oq65Uo=", + "owner": "tidalcycles", + "repo": "dirt-samples", + "rev": "92f2145e661b397e62ca0ff3965819e7c7db0dad", + "type": "github" + }, + "original": { + "owner": "tidalcycles", + "ref": "master", + "repo": "dirt-samples", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { - "lastModified": 1751685974, - "narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=", - "ref": "refs/heads/main", - "rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1", - "revCount": 92, - "type": "git", - "url": "https://git.lix.systems/lix-project/flake-compat.git" + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" }, "original": { - "type": "git", - "url": "https://git.lix.systems/lix-project/flake-compat.git" + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" } }, "flake-parts": { "inputs": { - "nixpkgs-lib": [ + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1712014858, + "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "naersk": { + "inputs": { + "nixpkgs": [ + "rnix-lsp", "nixpkgs" ] }, "locked": { - "lastModified": 1760948891, - "narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04", + "lastModified": 1655042882, + "narHash": "sha256-9BX8Fuez5YJlN7cdPO63InoyBy7dm3VlJkkmTt6fS1A=", + "owner": "nix-community", + "repo": "naersk", + "rev": "cddffb5aa211f50c4b8750adbec0bbbdfb26bb9f", "type": "github" }, "original": { - "owner": "hercules-ci", - "repo": "flake-parts", + "owner": "nix-community", + "repo": "naersk", "type": "github" } }, - "mnw": { - "locked": { - "lastModified": 1758834834, - "narHash": "sha256-Y7IvY4F8vajZyp3WGf+KaiIVwondEkMFkt92Cr9NZmg=", - "owner": "Gerg-L", - "repo": "mnw", - "rev": "cfbc7d1cc832e318d0863a5fc91d940a96034001", - "type": "github" - }, - "original": { - "owner": "Gerg-L", - "repo": "mnw", - "type": "github" - } - }, - "ndg": { + "nil": { "inputs": { - "nixpkgs": "nixpkgs" + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1765720983, - "narHash": "sha256-tWtukpABmux6EC/FuCJEgA1kmRjcRPtED44N+GGPq+4=", - "owner": "feel-co", - "repo": "ndg", - "rev": "f399ace8bb8e1f705dd8942b24d207aa4d75c936", + "lastModified": 1704611696, + "narHash": "sha256-4ZCgV5oHdEc3q+XaIzy//gh20uC/aSuAtMU9bsfgLZk=", + "owner": "oxalica", + "repo": "nil", + "rev": "059d33a24bb76d2048740bcce936362bf54b5bc9", "type": "github" }, "original": { - "owner": "feel-co", - "repo": "ndg", + "owner": "oxalica", + "repo": "nil", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1764242076, - "narHash": "sha256-sKoIWfnijJ0+9e4wRvIgm/HgE27bzwQxcEmo2J/gNpI=", + "lastModified": 1713895582, + "narHash": "sha256-cfh1hi+6muQMbi9acOlju3V1gl8BEaZBXBR9jQfQi4U=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "572af610f6151fd41c212f897c71f7056e3fb518", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1711703276, + "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2fad6eac6077f03fe109c4d4eb171cf96791faa4", + "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1656753965, + "narHash": "sha256-BCrB3l0qpJokOnIVc3g2lHiGhnjUi0MoXiw6t1o8H1E=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "0ea7a8f1b939d74e5df8af9a8f7342097cdf69eb", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1693844670, + "narHash": "sha256-t69F2nBB8DNQUWHD809oJZJVE+23XBrth4QZuVd6IE0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3c15feef7770eb5500a4b8792623e2d6f598c9c1", "type": "github" }, "original": { @@ -85,30 +195,1761 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_4": { "locked": { - "lastModified": 1764081664, - "narHash": "sha256-sUoHmPr/EwXzRMpv1u/kH+dXuvJEyyF2Q7muE+t0EU4=", - "owner": "nixos", + "lastModified": 1702350026, + "narHash": "sha256-A+GNZFZdfl4JdDphYKBJ5Ef1HOiFsP18vQe9mqjmUis=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "dc205f7b4fdb04c8b7877b43edb7b73be7730081", + "rev": "9463103069725474698139ab10f17a9d125da859", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", + "owner": "NixOS", + "ref": "nixos-23.05", "repo": "nixpkgs", "type": "github" } }, + "nmd": { + "flake": false, + "locked": { + "lastModified": 1705050560, + "narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=", + "owner": "~rycee", + "repo": "nmd", + "rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3", + "type": "sourcehut" + }, + "original": { + "owner": "~rycee", + "repo": "nmd", + "type": "sourcehut" + } + }, + "plugin-alpha-nvim": { + "flake": false, + "locked": { + "lastModified": 1708891191, + "narHash": "sha256-kTVPKZ/e1us/uHfSwFwR38lFYN8EotJq2jKz6xm/eqg=", + "owner": "goolord", + "repo": "alpha-nvim", + "rev": "41283fb402713fc8b327e60907f74e46166f4cfd", + "type": "github" + }, + "original": { + "owner": "goolord", + "repo": "alpha-nvim", + "type": "github" + } + }, + "plugin-bufdelete-nvim": { + "flake": false, + "locked": { + "lastModified": 1708814161, + "narHash": "sha256-ljUNfmpImtxFCS19HC9kFlaLlqaPDltKtnx1+/6Y33U=", + "owner": "famiu", + "repo": "bufdelete.nvim", + "rev": "f6bcea78afb3060b198125256f897040538bcb81", + "type": "github" + }, + "original": { + "owner": "famiu", + "repo": "bufdelete.nvim", + "type": "github" + } + }, + "plugin-catppuccin": { + "flake": false, + "locked": { + "lastModified": 1713105352, + "narHash": "sha256-yTVou/WArEWygBBs2NFPI9Dm9iSGfwVftKFbOAGl8tk=", + "owner": "catppuccin", + "repo": "nvim", + "rev": "a1439ad7c584efb3d0ce14ccb835967f030450fe", + "type": "github" + }, + "original": { + "owner": "catppuccin", + "repo": "nvim", + "type": "github" + } + }, + "plugin-ccc": { + "flake": false, + "locked": { + "lastModified": 1712580766, + "narHash": "sha256-G96++Bmuklb3eDfmyKPKFUDHuopTMmIFa/ILdf11N/I=", + "owner": "uga-rosa", + "repo": "ccc.nvim", + "rev": "1283eef5494c092a047baa34ed3e667f3cb2715e", + "type": "github" + }, + "original": { + "owner": "uga-rosa", + "repo": "ccc.nvim", + "type": "github" + } + }, + "plugin-cellular-automaton": { + "flake": false, + "locked": { + "lastModified": 1693589931, + "narHash": "sha256-szbd6m7hH7NFI0UzjWF83xkpSJeUWCbn9c+O8F8S/Fg=", + "owner": "Eandrju", + "repo": "cellular-automaton.nvim", + "rev": "b7d056dab963b5d3f2c560d92937cb51db61cb5b", + "type": "github" + }, + "original": { + "owner": "Eandrju", + "repo": "cellular-automaton.nvim", + "type": "github" + } + }, + "plugin-chatgpt": { + "flake": false, + "locked": { + "lastModified": 1709721561, + "narHash": "sha256-vD3NEsYmPRWlxBSOxyIMIQiJXQXxx0hhsw4zIxxXB3o=", + "owner": "jackMort", + "repo": "ChatGPT.nvim", + "rev": "df53728e05129278d6ea26271ec086aa013bed90", + "type": "github" + }, + "original": { + "owner": "jackMort", + "repo": "ChatGPT.nvim", + "type": "github" + } + }, + "plugin-cheatsheet-nvim": { + "flake": false, + "locked": { + "lastModified": 1640255456, + "narHash": "sha256-TYkGB7cON2t4GwMaR9H1MDG2j3btBv2AR37ade8kqTY=", + "owner": "sudormrfbin", + "repo": "cheatsheet.nvim", + "rev": "9716f9aaa94dd1fd6ce59b5aae0e5f25e2a463ef", + "type": "github" + }, + "original": { + "owner": "sudormrfbin", + "repo": "cheatsheet.nvim", + "type": "github" + } + }, + "plugin-cinnamon-nvim": { + "flake": false, + "locked": { + "lastModified": 1711005384, + "narHash": "sha256-LNikkGldBpUsfyH8ThtX7RS1p/z3JzSPonT9qUU84jw=", + "owner": "declancm", + "repo": "cinnamon.nvim", + "rev": "559fe02fae00ffd78377e9c242b2faa25a428592", + "type": "github" + }, + "original": { + "owner": "declancm", + "repo": "cinnamon.nvim", + "type": "github" + } + }, + "plugin-cmp-buffer": { + "flake": false, + "locked": { + "lastModified": 1660101488, + "narHash": "sha256-dG4U7MtnXThoa/PD+qFtCt76MQ14V1wX8GMYcvxEnbM=", + "owner": "hrsh7th", + "repo": "cmp-buffer", + "rev": "3022dbc9166796b644a841a02de8dd1cc1d311fa", + "type": "github" + }, + "original": { + "owner": "hrsh7th", + "repo": "cmp-buffer", + "type": "github" + } + }, + "plugin-cmp-nvim-lsp": { + "flake": false, + "locked": { + "lastModified": 1702205473, + "narHash": "sha256-/0sh9vJBD9pUuD7q3tNSQ1YLvxFMNykdg5eG+LjZAA8=", + "owner": "hrsh7th", + "repo": "cmp-nvim-lsp", + "rev": "5af77f54de1b16c34b23cba810150689a3a90312", + "type": "github" + }, + "original": { + "owner": "hrsh7th", + "repo": "cmp-nvim-lsp", + "type": "github" + } + }, + "plugin-cmp-path": { + "flake": false, + "locked": { + "lastModified": 1664784283, + "narHash": "sha256-thppiiV3wjIaZnAXmsh7j3DUc6ceSCvGzviwFUnoPaI=", + "owner": "hrsh7th", + "repo": "cmp-path", + "rev": "91ff86cd9c29299a64f968ebb45846c485725f23", + "type": "github" + }, + "original": { + "owner": "hrsh7th", + "repo": "cmp-path", + "type": "github" + } + }, + "plugin-cmp-treesitter": { + "flake": false, + "locked": { + "lastModified": 1702163214, + "narHash": "sha256-K7F9iqmB13ONenwsbaND8F4010MvHQXp7DxMFfcsZ4A=", + "owner": "ray-x", + "repo": "cmp-treesitter", + "rev": "13e4ef8f4dd5639fca2eb9150e68f47639a9b37d", + "type": "github" + }, + "original": { + "owner": "ray-x", + "repo": "cmp-treesitter", + "type": "github" + } + }, + "plugin-cmp-vsnip": { + "flake": false, + "locked": { + "lastModified": 1669100283, + "narHash": "sha256-2mkN03noOr5vBvRbSb35xZKorSH+8savQNZtgM9+QcM=", + "owner": "hrsh7th", + "repo": "cmp-vsnip", + "rev": "989a8a73c44e926199bfd05fa7a516d51f2d2752", + "type": "github" + }, + "original": { + "owner": "hrsh7th", + "repo": "cmp-vsnip", + "type": "github" + } + }, + "plugin-codewindow-nvim": { + "flake": false, + "locked": { + "lastModified": 1695487629, + "narHash": "sha256-/u2Zjbd9m3/iJU3I3HzFzXWxuvoycwJoIq7UFeHNtKM=", + "owner": "gorbit99", + "repo": "codewindow.nvim", + "rev": "8c8f5ff66e123491c946c04848d744fcdc7cac6c", + "type": "github" + }, + "original": { + "owner": "gorbit99", + "repo": "codewindow.nvim", + "type": "github" + } + }, + "plugin-comment-nvim": { + "flake": false, + "locked": { + "lastModified": 1691409559, + "narHash": "sha256-+dF1ZombrlO6nQggufSb0igXW5zwU++o0W/5ZA07cdc=", + "owner": "numToStr", + "repo": "Comment.nvim", + "rev": "0236521ea582747b58869cb72f70ccfa967d2e89", + "type": "github" + }, + "original": { + "owner": "numToStr", + "repo": "Comment.nvim", + "type": "github" + } + }, + "plugin-copilot-cmp": { + "flake": false, + "locked": { + "lastModified": 1694286652, + "narHash": "sha256-srgNohm/aJpswNJ5+T7p+zi9Jinp9e5FA8/wdk6VRiY=", + "owner": "zbirenbaum", + "repo": "copilot-cmp", + "rev": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3", + "type": "github" + }, + "original": { + "owner": "zbirenbaum", + "repo": "copilot-cmp", + "type": "github" + } + }, + "plugin-copilot-lua": { + "flake": false, + "locked": { + "lastModified": 1709095198, + "narHash": "sha256-JX3sdsnOnjkY7r9fCtC2oauo0PXF3SQ+SHUo8ifBvAc=", + "owner": "zbirenbaum", + "repo": "copilot.lua", + "rev": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6", + "type": "github" + }, + "original": { + "owner": "zbirenbaum", + "repo": "copilot.lua", + "type": "github" + } + }, + "plugin-crates-nvim": { + "flake": false, + "locked": { + "lastModified": 1713995074, + "narHash": "sha256-09+mBhh5hAXENPzrvwNNQEyM7ZtuPYAWrtAG/pzBOV8=", + "owner": "Saecki", + "repo": "crates.nvim", + "rev": "f00e11e8282b94f2a2e938d32712c99f0e0bdeb4", + "type": "github" + }, + "original": { + "owner": "Saecki", + "repo": "crates.nvim", + "type": "github" + } + }, + "plugin-dashboard-nvim": { + "flake": false, + "locked": { + "lastModified": 1713420371, + "narHash": "sha256-zcWBgDM409n6rmb06FqVXbC+HU9HJN0+ADoTJDWHvbA=", + "owner": "glepnir", + "repo": "dashboard-nvim", + "rev": "6d06924b562de6f0bb136edf1bf549afbf6b7d00", + "type": "github" + }, + "original": { + "owner": "glepnir", + "repo": "dashboard-nvim", + "type": "github" + } + }, + "plugin-diffview-nvim": { + "flake": false, + "locked": { + "lastModified": 1700506468, + "narHash": "sha256-3EdnBUka9Rh5Brl6TWpN6GlD9z32mmY3Ip+wyiKob/8=", + "owner": "sindrets", + "repo": "diffview.nvim", + "rev": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f", + "type": "github" + }, + "original": { + "owner": "sindrets", + "repo": "diffview.nvim", + "type": "github" + } + }, + "plugin-dracula": { + "flake": false, + "locked": { + "lastModified": 1708834650, + "narHash": "sha256-I3rtbJYv1D+kniOLL9hmTF3ucp/qSNewnO2GmYAERko=", + "owner": "Mofiqul", + "repo": "dracula.nvim", + "rev": "8d8bddb8814c3e7e62d80dda65a9876f97eb699c", + "type": "github" + }, + "original": { + "owner": "Mofiqul", + "repo": "dracula.nvim", + "type": "github" + } + }, + "plugin-dressing-nvim": { + "flake": false, + "locked": { + "lastModified": 1713925216, + "narHash": "sha256-46r7X8CNuMgSB9X1jFLTQAiiBVqszkBP6DPlo6nBAxI=", + "owner": "stevearc", + "repo": "dressing.nvim", + "rev": "5162edb1442a729a885c45455a07e9a89058be2f", + "type": "github" + }, + "original": { + "owner": "stevearc", + "repo": "dressing.nvim", + "type": "github" + } + }, + "plugin-elixir-ls": { + "flake": false, + "locked": { + "lastModified": 1713724318, + "narHash": "sha256-1kLMxznNRRJ7M10zkuWexA/sPFaN449M0SKUjLrnc8c=", + "owner": "elixir-lsp", + "repo": "elixir-ls", + "rev": "8486de473a219dcdb72408702f8d56d0227c7366", + "type": "github" + }, + "original": { + "owner": "elixir-lsp", + "repo": "elixir-ls", + "type": "github" + } + }, + "plugin-elixir-tools": { + "flake": false, + "locked": { + "lastModified": 1713617654, + "narHash": "sha256-pJgtW51FLs+Yr+tlQckRmGkRnSUQNI3fEROn3D51mMs=", + "owner": "elixir-tools", + "repo": "elixir-tools.nvim", + "rev": "3c4f8344a341818417b3d75c04eb96d894cb4640", + "type": "github" + }, + "original": { + "owner": "elixir-tools", + "repo": "elixir-tools.nvim", + "type": "github" + } + }, + "plugin-fidget-nvim": { + "flake": false, + "locked": { + "lastModified": 1712242924, + "narHash": "sha256-fZhK5opGXRRryhNpdaEPLpBq4tTibZREelXmasMLHzw=", + "owner": "j-hui", + "repo": "fidget.nvim", + "rev": "1ba38e4cbb24683973e00c2e36f53ae64da38ef5", + "type": "github" + }, + "original": { + "owner": "j-hui", + "repo": "fidget.nvim", + "type": "github" + } + }, + "plugin-flutter-tools": { + "flake": false, + "locked": { + "lastModified": 1713525182, + "narHash": "sha256-krcaaDPJsftkrcEov1QdKQUQBH6+PgjNwFamWpmNFkU=", + "owner": "akinsho", + "repo": "flutter-tools.nvim", + "rev": "f04131d6b2c82c2a7624a8843642d6269b50b437", + "type": "github" + }, + "original": { + "owner": "akinsho", + "repo": "flutter-tools.nvim", + "type": "github" + } + }, + "plugin-gesture-nvim": { + "flake": false, + "locked": { + "lastModified": 1713872849, + "narHash": "sha256-npryXJ92l65gOGltTd3jE3fdhiEgqbxCdK5w/C/BQV0=", + "owner": "notomo", + "repo": "gesture.nvim", + "rev": "47175ed2741ba46fe7f14d6ee37ebbc5b9614c5a", + "type": "github" + }, + "original": { + "owner": "notomo", + "repo": "gesture.nvim", + "type": "github" + } + }, + "plugin-gitsigns-nvim": { + "flake": false, + "locked": { + "lastModified": 1713620636, + "narHash": "sha256-UK3DyvrQ0kLm9wrMQ6tLDoDunoThbY/Yfjn+eCZpuMw=", + "owner": "lewis6991", + "repo": "gitsigns.nvim", + "rev": "035da036e68e509ed158414416c827d022d914bd", + "type": "github" + }, + "original": { + "owner": "lewis6991", + "repo": "gitsigns.nvim", + "type": "github" + } + }, + "plugin-glow-nvim": { + "flake": false, + "locked": { + "lastModified": 1703345545, + "narHash": "sha256-GsNcASzVvY0066kak2nvUY5luzanoBclqcUOsODww8g=", + "owner": "ellisonleao", + "repo": "glow.nvim", + "rev": "238070a686c1da3bccccf1079700eb4b5e19aea4", + "type": "github" + }, + "original": { + "owner": "ellisonleao", + "repo": "glow.nvim", + "type": "github" + } + }, + "plugin-gruvbox": { + "flake": false, + "locked": { + "lastModified": 1706538659, + "narHash": "sha256-jWnrRy/PT7D0UcPGL+XTbKHWvS0ixvbyqPtTzG9HY84=", + "owner": "ellisonleao", + "repo": "gruvbox.nvim", + "rev": "6e4027ae957cddf7b193adfaec4a8f9e03b4555f", + "type": "github" + }, + "original": { + "owner": "ellisonleao", + "repo": "gruvbox.nvim", + "type": "github" + } + }, + "plugin-highlight-undo": { + "flake": false, + "locked": { + "lastModified": 1713721901, + "narHash": "sha256-5zYUpfSR56gCufR+Y18qo8ZpMRg8N3ejkRZNJswJ4wQ=", + "owner": "tzachar", + "repo": "highlight-undo.nvim", + "rev": "a0dbc6afa19b438ca5a6f54bc7f1a10399f21a15", + "type": "github" + }, + "original": { + "owner": "tzachar", + "repo": "highlight-undo.nvim", + "type": "github" + } + }, + "plugin-hop-nvim": { + "flake": false, + "locked": { + "lastModified": 1694283445, + "narHash": "sha256-SnuFeD/lrMxKtpBRPgIwdG0kVF7BWe02PiV7URVDASI=", + "owner": "phaazon", + "repo": "hop.nvim", + "rev": "1a1eceafe54b5081eae4cb91c723abd1d450f34b", + "type": "github" + }, + "original": { + "owner": "phaazon", + "repo": "hop.nvim", + "type": "github" + } + }, + "plugin-icon-picker-nvim": { + "flake": false, + "locked": { + "lastModified": 1704321319, + "narHash": "sha256-VZKsVeSmPR3AA8267Mtd5sSTZl2CAqnbgqceCptgp4w=", + "owner": "ziontee113", + "repo": "icon-picker.nvim", + "rev": "3ee9a0ea9feeef08ae35e40c8be6a2fa2c20f2d3", + "type": "github" + }, + "original": { + "owner": "ziontee113", + "repo": "icon-picker.nvim", + "type": "github" + } + }, + "plugin-image-nvim": { + "flake": false, + "locked": { + "lastModified": 1713989303, + "narHash": "sha256-UBrusfIYWURI1Auo3XayswA8NXgZhqwazg6wmmgWygA=", + "owner": "3rd", + "repo": "image.nvim", + "rev": "2d4b479c59fd70cc26f63d48b5cd76a44dda8873", + "type": "github" + }, + "original": { + "owner": "3rd", + "repo": "image.nvim", + "type": "github" + } + }, + "plugin-indent-blankline": { + "flake": false, + "locked": { + "lastModified": 1710388427, + "narHash": "sha256-Xp8ZQBz0in2MX3l0bnLUsSbH0lDPE+QvdmFpBFry5yY=", + "owner": "lukas-reineke", + "repo": "indent-blankline.nvim", + "rev": "3d08501caef2329aba5121b753e903904088f7e6", + "type": "github" + }, + "original": { + "owner": "lukas-reineke", + "repo": "indent-blankline.nvim", + "type": "github" + } + }, + "plugin-leap-nvim": { + "flake": false, + "locked": { + "lastModified": 1712927908, + "narHash": "sha256-sSnofCInXuqaDEawT4vN1WdYl1cjK++BjSFnR1wXjr4=", + "owner": "ggandor", + "repo": "leap.nvim", + "rev": "626be4c4ec040aeaf6466c9aae17ee0ab09f1a5b", + "type": "github" + }, + "original": { + "owner": "ggandor", + "repo": "leap.nvim", + "type": "github" + } + }, + "plugin-lsp-lines": { + "flake": false, + "locked": { + "lastModified": 1709989705, + "narHash": "sha256-opViLzbwtyUgDoaVKz4z6SN06N8jCQ0YmoqPIht8e64=", + "owner": "~whynothugo", + "repo": "lsp_lines.nvim", + "rev": "6f3defec73f7c87939e800e9afa5d0571b19b401", + "type": "sourcehut" + }, + "original": { + "owner": "~whynothugo", + "repo": "lsp_lines.nvim", + "type": "sourcehut" + } + }, + "plugin-lsp-signature": { + "flake": false, + "locked": { + "lastModified": 1710647656, + "narHash": "sha256-O7y7pcCvF0xUFamG+wMLe4mC6hUQ679rJV+ZUoWB0oY=", + "owner": "ray-x", + "repo": "lsp_signature.nvim", + "rev": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8", + "type": "github" + }, + "original": { + "owner": "ray-x", + "repo": "lsp_signature.nvim", + "type": "github" + } + }, + "plugin-lspkind": { + "flake": false, + "locked": { + "lastModified": 1704982040, + "narHash": "sha256-/QLdBU/Zwmkw1NGuLBD48tvrmIP9d9WHhgcLEQgRTWo=", + "owner": "onsails", + "repo": "lspkind-nvim", + "rev": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf", + "type": "github" + }, + "original": { + "owner": "onsails", + "repo": "lspkind-nvim", + "type": "github" + } + }, + "plugin-lspsaga": { + "flake": false, + "locked": { + "lastModified": 1670360222, + "narHash": "sha256-7ENInq3LAPPTdm0Fb7klOc630j8m4LRj1kLZZFYLh68=", + "owner": "tami5", + "repo": "lspsaga.nvim", + "rev": "5faeec9f2508d2d49a66c0ac0d191096b4e3fa81", + "type": "github" + }, + "original": { + "owner": "tami5", + "repo": "lspsaga.nvim", + "type": "github" + } + }, + "plugin-lualine": { + "flake": false, + "locked": { + "lastModified": 1712310396, + "narHash": "sha256-WcH2dWdRDgMkwBQhcgT+Z/ArMdm+VbRhmQftx4t2kNI=", + "owner": "hoob3rt", + "repo": "lualine.nvim", + "rev": "0a5a66803c7407767b799067986b4dc3036e1983", + "type": "github" + }, + "original": { + "owner": "hoob3rt", + "repo": "lualine.nvim", + "type": "github" + } + }, + "plugin-mind-nvim": { + "flake": false, + "locked": { + "lastModified": 1679526071, + "narHash": "sha256-JIhAhQYGLLRucwlhzfckQYU5qjqbHtNH52JlGS5a79w=", + "owner": "phaazon", + "repo": "mind.nvim", + "rev": "002137dd7cf97865ebd01b6a260209d2daf2da66", + "type": "github" + }, + "original": { + "owner": "phaazon", + "repo": "mind.nvim", + "type": "github" + } + }, + "plugin-minimap-vim": { + "flake": false, + "locked": { + "lastModified": 1710689313, + "narHash": "sha256-GR8VAHla5HWry1TAZQv0Xp7iG256vIGeQcBGMxyt310=", + "owner": "wfxr", + "repo": "minimap.vim", + "rev": "395378137e6180762d5b963ca9ad5ac2db5d3283", + "type": "github" + }, + "original": { + "owner": "wfxr", + "repo": "minimap.vim", + "type": "github" + } + }, + "plugin-modes-nvim": { + "flake": false, + "locked": { + "lastModified": 1702245923, + "narHash": "sha256-Kd2hf5obrPvCVLtRcFjLd75byyrB2o3uYCSEMW6IeCc=", + "owner": "mvllow", + "repo": "modes.nvim", + "rev": "4035a46aaabe43faf1b54740575af9dd5bb03809", + "type": "github" + }, + "original": { + "owner": "mvllow", + "repo": "modes.nvim", + "type": "github" + } + }, + "plugin-neocord": { + "flake": false, + "locked": { + "lastModified": 1713923379, + "narHash": "sha256-oVWdnQlgXIMzMiybMq7yR/WfEW+Fm5RmhWx0RWprlfQ=", + "owner": "IogaMaster", + "repo": "neocord", + "rev": "aa7a58023166533da83ca7b11c0d2569e45d7381", + "type": "github" + }, + "original": { + "owner": "IogaMaster", + "repo": "neocord", + "type": "github" + } + }, + "plugin-neodev-nvim": { + "flake": false, + "locked": { + "lastModified": 1711715247, + "narHash": "sha256-mAJOMVN7/xO7ykVNAeTeX+z2A/7yB8zdqlEKHL6Pb74=", + "owner": "folke", + "repo": "neodev.nvim", + "rev": "ce9a2e8eaba5649b553529c5498acb43a6c317cd", + "type": "github" + }, + "original": { + "owner": "folke", + "repo": "neodev.nvim", + "type": "github" + } + }, + "plugin-noice-nvim": { + "flake": false, + "locked": { + "lastModified": 1711471279, + "narHash": "sha256-y6gHNkWVsIuwBf7MblCTKTZSqjGDxqeFeQZWexzwk94=", + "owner": "folke", + "repo": "noice.nvim", + "rev": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12", + "type": "github" + }, + "original": { + "owner": "folke", + "repo": "noice.nvim", + "type": "github" + } + }, + "plugin-none-ls": { + "flake": false, + "locked": { + "lastModified": 1708525772, + "narHash": "sha256-VCDUKiy9C3Bu9suf2bI6XSis1+j01oFC3GFPyQxi74c=", + "owner": "nvimtools", + "repo": "none-ls.nvim", + "rev": "bb680d752cec37949faca7a1f509e2fe67ab418a", + "type": "github" + }, + "original": { + "owner": "nvimtools", + "repo": "none-ls.nvim", + "rev": "bb680d752cec37949faca7a1f509e2fe67ab418a", + "type": "github" + } + }, + "plugin-nui-nvim": { + "flake": false, + "locked": { + "lastModified": 1710740032, + "narHash": "sha256-Zr5CNx6BIM6naCXW8YBc/Oj1qOtWV/3tuMoaaZjoSZA=", + "owner": "MunifTanjim", + "repo": "nui.nvim", + "rev": "cbd2668414331c10039278f558630ed19b93e69b", + "type": "github" + }, + "original": { + "owner": "MunifTanjim", + "repo": "nui.nvim", + "type": "github" + } + }, + "plugin-nvim-autopairs": { + "flake": false, + "locked": { + "lastModified": 1712441622, + "narHash": "sha256-ta+0jw7P0ESThP8q2c+CD+nCzPMyHH2Cy3kjjysH0TE=", + "owner": "windwp", + "repo": "nvim-autopairs", + "rev": "4f41e5940bc0443fdbe5f995e2a596847215cd2a", + "type": "github" + }, + "original": { + "owner": "windwp", + "repo": "nvim-autopairs", + "type": "github" + } + }, + "plugin-nvim-bufferline-lua": { + "flake": false, + "locked": { + "lastModified": 1713769392, + "narHash": "sha256-bHlmaNXfZTlTm/8v48FwCde9ljZFLv25efYF5355bnw=", + "owner": "akinsho", + "repo": "nvim-bufferline.lua", + "rev": "73540cb95f8d95aa1af3ed57713c6720c78af915", + "type": "github" + }, + "original": { + "owner": "akinsho", + "repo": "nvim-bufferline.lua", + "type": "github" + } + }, + "plugin-nvim-cmp": { + "flake": false, + "locked": { + "lastModified": 1713837627, + "narHash": "sha256-rz+JMd/hsUEDNVan2sCuEGtbsOVi6oRmPtps+7qSXQE=", + "owner": "hrsh7th", + "repo": "nvim-cmp", + "rev": "8f3c541407e691af6163e2447f3af1bd6e17f9a3", + "type": "github" + }, + "original": { + "owner": "hrsh7th", + "repo": "nvim-cmp", + "type": "github" + } + }, + "plugin-nvim-code-action-menu": { + "flake": false, + "locked": { + "lastModified": 1702287297, + "narHash": "sha256-pY+aP9iBuJhvDZzVEsOHZmnfaq3vUP7TfKEEQrj+Mo8=", + "owner": "weilbith", + "repo": "nvim-code-action-menu", + "rev": "8c7672a4b04d3cc4edd2c484d05b660a9cb34a1b", + "type": "github" + }, + "original": { + "owner": "weilbith", + "repo": "nvim-code-action-menu", + "type": "github" + } + }, + "plugin-nvim-colorizer-lua": { + "flake": false, + "locked": { + "lastModified": 1703321305, + "narHash": "sha256-oKvFN2K+ASlPNwj2rhptR/ErYgo6XKBPhXSZotDdCP0=", + "owner": "NvChad", + "repo": "nvim-colorizer.lua", + "rev": "85855b38011114929f4058efc97af1059ab3e41d", + "type": "github" + }, + "original": { + "owner": "NvChad", + "repo": "nvim-colorizer.lua", + "type": "github" + } + }, + "plugin-nvim-cursorline": { + "flake": false, + "locked": { + "lastModified": 1650034925, + "narHash": "sha256-Uhw65p1KBjs8KsVOmTzuiu3XKclxBob8AVdWEt30C/8=", + "owner": "yamatsum", + "repo": "nvim-cursorline", + "rev": "804f0023692653b2b2368462d67d2a87056947f9", + "type": "github" + }, + "original": { + "owner": "yamatsum", + "repo": "nvim-cursorline", + "type": "github" + } + }, + "plugin-nvim-dap": { + "flake": false, + "locked": { + "lastModified": 1713432622, + "narHash": "sha256-kEn2INrNMQSLHY3gpSVV+cTx9f1nFeUCM6by9WGn5Sg=", + "owner": "mfussenegger", + "repo": "nvim-dap", + "rev": "6ae8a14828b0f3bff1721a35a1dfd604b6a933bb", + "type": "github" + }, + "original": { + "owner": "mfussenegger", + "repo": "nvim-dap", + "type": "github" + } + }, + "plugin-nvim-dap-ui": { + "flake": false, + "locked": { + "lastModified": 1710867604, + "narHash": "sha256-KAwCt8E3lC0fzXQ9GpPsdb9wdWC6G2P4C/YFQFY9AAM=", + "owner": "rcarriga", + "repo": "nvim-dap-ui", + "rev": "edfa93f60b189e5952c016eee262d0685d838450", + "type": "github" + }, + "original": { + "owner": "rcarriga", + "repo": "nvim-dap-ui", + "type": "github" + } + }, + "plugin-nvim-docs-view": { + "flake": false, + "locked": { + "lastModified": 1705711563, + "narHash": "sha256-N5PrJKhF6pHkel4EyAllNdEYQRninfSyaAXPbuAiD+s=", + "owner": "amrbashir", + "repo": "nvim-docs-view", + "rev": "78d88bca16f32a430572758677f9246f6d7f7b94", + "type": "github" + }, + "original": { + "owner": "amrbashir", + "repo": "nvim-docs-view", + "type": "github" + } + }, + "plugin-nvim-lightbulb": { + "flake": false, + "locked": { + "lastModified": 1689887436, + "narHash": "sha256-Meoop66jINllnxN6aohuPmU7DEjn64FMq/b8zuy9FEQ=", + "owner": "kosayoda", + "repo": "nvim-lightbulb", + "rev": "8f00b89dd1b1dbde16872bee5fbcee2e58c9b8e9", + "type": "github" + }, + "original": { + "owner": "kosayoda", + "repo": "nvim-lightbulb", + "type": "github" + } + }, + "plugin-nvim-lspconfig": { + "flake": false, + "locked": { + "lastModified": 1713908193, + "narHash": "sha256-VdIoInJj2u49WHN4+WX0kNHdbXgh0AqIPU+OAiUaBck=", + "owner": "neovim", + "repo": "nvim-lspconfig", + "rev": "cfa386fc4027e847156ee16141ea1f4c0bc2f0a4", + "type": "github" + }, + "original": { + "owner": "neovim", + "repo": "nvim-lspconfig", + "type": "github" + } + }, + "plugin-nvim-navbuddy": { + "flake": false, + "locked": { + "lastModified": 1711239174, + "narHash": "sha256-EZXzFjGsZHkb2Ui5uvOottPHA8X15F6xyikab4dBlYk=", + "owner": "SmiteshP", + "repo": "nvim-navbuddy", + "rev": "f34237e8a41ebc6e2716af2ebf49854d8c5289c8", + "type": "github" + }, + "original": { + "owner": "SmiteshP", + "repo": "nvim-navbuddy", + "type": "github" + } + }, + "plugin-nvim-navic": { + "flake": false, + "locked": { + "lastModified": 1701345631, + "narHash": "sha256-0p5n/V8Jlj9XyxV/fuMwsbQ7oV5m9H2GqZZEA/njxCQ=", + "owner": "SmiteshP", + "repo": "nvim-navic", + "rev": "8649f694d3e76ee10c19255dece6411c29206a54", + "type": "github" + }, + "original": { + "owner": "SmiteshP", + "repo": "nvim-navic", + "type": "github" + } + }, + "plugin-nvim-neoclip": { + "flake": false, + "locked": { + "lastModified": 1701664728, + "narHash": "sha256-QtqLKdrDGzIiSEo3DZtv0C7wx3KlrcyePoIYdvH6vpk=", + "owner": "AckslD", + "repo": "nvim-neoclip.lua", + "rev": "798cd0592a81c185465db3a091a0ff8a21af60fd", + "type": "github" + }, + "original": { + "owner": "AckslD", + "repo": "nvim-neoclip.lua", + "type": "github" + } + }, + "plugin-nvim-nio": { + "flake": false, + "locked": { + "lastModified": 1712221544, + "narHash": "sha256-ZRYclqsgAvlRBwb59XHlqVat7CxUJTH1rD6QLwh1ang=", + "owner": "nvim-neotest", + "repo": "nvim-nio", + "rev": "5800f585def265d52f1d8848133217c800bcb25d", + "type": "github" + }, + "original": { + "owner": "nvim-neotest", + "repo": "nvim-nio", + "type": "github" + } + }, + "plugin-nvim-notify": { + "flake": false, + "locked": { + "lastModified": 1708161547, + "narHash": "sha256-xJYPOX4YLcWojMCdP1RO22/7FMrbcBQxqxrcVCE2TrU=", + "owner": "rcarriga", + "repo": "nvim-notify", + "rev": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15", + "type": "github" + }, + "original": { + "owner": "rcarriga", + "repo": "nvim-notify", + "type": "github" + } + }, + "plugin-nvim-session-manager": { + "flake": false, + "locked": { + "lastModified": 1708284146, + "narHash": "sha256-+TDWY8mprJfUp9ZFKbz83to7XW8iiovja22jHms+N1A=", + "owner": "Shatur", + "repo": "neovim-session-manager", + "rev": "d8e1ba3bbcf3fdc6a887bcfbd94c48ae4707b457", + "type": "github" + }, + "original": { + "owner": "Shatur", + "repo": "neovim-session-manager", + "type": "github" + } + }, + "plugin-nvim-surround": { + "flake": false, + "locked": { + "lastModified": 1712807644, + "narHash": "sha256-gXWSCAJhOJKzTFi6QiDqDWPNgBtG5KgyF2t4gposqSY=", + "owner": "kylechui", + "repo": "nvim-surround", + "rev": "a4e30d33add8a9743b4f518b3a788b3c8e5def71", + "type": "github" + }, + "original": { + "owner": "kylechui", + "repo": "nvim-surround", + "type": "github" + } + }, + "plugin-nvim-tree-lua": { + "flake": false, + "locked": { + "lastModified": 1713946472, + "narHash": "sha256-iD8c/dXt/UcTYDK8/zkTkFW/1Ial8ulCUWojjyXpG8k=", + "owner": "nvim-tree", + "repo": "nvim-tree.lua", + "rev": "62008e5cf2e8745c9d23bb599ef642963131057e", + "type": "github" + }, + "original": { + "owner": "nvim-tree", + "repo": "nvim-tree.lua", + "type": "github" + } + }, + "plugin-nvim-treesitter-context": { + "flake": false, + "locked": { + "lastModified": 1713984790, + "narHash": "sha256-QAudKglQGDRJKrsEcMSjbrxTgQRXO60ZcfOvEnPLUoE=", + "owner": "nvim-treesitter", + "repo": "nvim-treesitter-context", + "rev": "4fe0a54e86859744968e1a5c7867b49c86855774", + "type": "github" + }, + "original": { + "owner": "nvim-treesitter", + "repo": "nvim-treesitter-context", + "type": "github" + } + }, + "plugin-nvim-ts-autotag": { + "flake": false, + "locked": { + "lastModified": 1707265789, + "narHash": "sha256-cPIEIjcYxX3ZkOyou2mYlHMdhBxCoVTpJVXZtiWe9Ks=", + "owner": "windwp", + "repo": "nvim-ts-autotag", + "rev": "531f48334c422222aebc888fd36e7d109cb354cd", + "type": "github" + }, + "original": { + "owner": "windwp", + "repo": "nvim-ts-autotag", + "type": "github" + } + }, + "plugin-nvim-web-devicons": { + "flake": false, + "locked": { + "lastModified": 1713675782, + "narHash": "sha256-AW2W6H7OTv52hfZCcYQc5UjFArBWKLeVclrwMt13HOM=", + "owner": "nvim-tree", + "repo": "nvim-web-devicons", + "rev": "beb6367ab8496c9e43f22e0252735fdadae1872d", + "type": "github" + }, + "original": { + "owner": "nvim-tree", + "repo": "nvim-web-devicons", + "type": "github" + } + }, + "plugin-obsidian-nvim": { + "flake": false, + "locked": { + "lastModified": 1713538455, + "narHash": "sha256-nIAaQa0DBYBQyfTEJi3Lzqs7QJqyw0Cemq6Hm704K60=", + "owner": "epwalsh", + "repo": "obsidian.nvim", + "rev": "ec0f44e1921d2701bd99a542031d280f1e3930b5", + "type": "github" + }, + "original": { + "owner": "epwalsh", + "repo": "obsidian.nvim", + "type": "github" + } + }, + "plugin-onedark": { + "flake": false, + "locked": { + "lastModified": 1706527208, + "narHash": "sha256-1+aO8vrUGEe/NIVI1C1xJyuQVPQZ1s510lopkEVP7No=", + "owner": "navarasu", + "repo": "onedark.nvim", + "rev": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429", + "type": "github" + }, + "original": { + "owner": "navarasu", + "repo": "onedark.nvim", + "type": "github" + } + }, + "plugin-orgmode-nvim": { + "flake": false, + "locked": { + "lastModified": 1713539113, + "narHash": "sha256-0Ayu2kVpnsxu/ER0nx+t7nyU9oNN8URLrGQtAKKb7Ls=", + "owner": "nvim-orgmode", + "repo": "orgmode", + "rev": "389e91f6f935aa845bc0cd13dd80f75431c34751", + "type": "github" + }, + "original": { + "owner": "nvim-orgmode", + "repo": "orgmode", + "type": "github" + } + }, + "plugin-oxocarbon": { + "flake": false, + "locked": { + "lastModified": 1701119822, + "narHash": "sha256-++JALLPklok9VY2ChOddTYDvDNVadmCeB98jCAJYCZ0=", + "owner": "nyoom-engineering", + "repo": "oxocarbon.nvim", + "rev": "c5846d10cbe4131cc5e32c6d00beaf59cb60f6a2", + "type": "github" + }, + "original": { + "owner": "nyoom-engineering", + "repo": "oxocarbon.nvim", + "type": "github" + } + }, + "plugin-plenary-nvim": { + "flake": false, + "locked": { + "lastModified": 1713788468, + "narHash": "sha256-orGs1npIGIk7MUYadatYrcEXygK7JTj6OqQwy2TLDn0=", + "owner": "nvim-lua", + "repo": "plenary.nvim", + "rev": "5129a3693c482fcbc5ab99a7706ffc4360b995a0", + "type": "github" + }, + "original": { + "owner": "nvim-lua", + "repo": "plenary.nvim", + "type": "github" + } + }, + "plugin-project-nvim": { + "flake": false, + "locked": { + "lastModified": 1680567592, + "narHash": "sha256-avV3wMiDbraxW4mqlEsKy0oeewaRj9Q33K8NzWoaptU=", + "owner": "ahmedkhalf", + "repo": "project.nvim", + "rev": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb", + "type": "github" + }, + "original": { + "owner": "ahmedkhalf", + "repo": "project.nvim", + "type": "github" + } + }, + "plugin-registers": { + "flake": false, + "locked": { + "lastModified": 1703954003, + "narHash": "sha256-/MwIOR7H6ZkH/uLZOcMgg9XOWQB0yYYonbSKl51bXzo=", + "owner": "tversteeg", + "repo": "registers.nvim", + "rev": "22bb98f93a423252fffeb3531f7bc12a3e07b63f", + "type": "github" + }, + "original": { + "owner": "tversteeg", + "repo": "registers.nvim", + "type": "github" + } + }, + "plugin-rose-pine": { + "flake": false, + "locked": { + "lastModified": 1713451685, + "narHash": "sha256-AdPSz5+nCOnLWexBasHuxRxEKbL4WVg+uV78//W5nLs=", + "owner": "rose-pine", + "repo": "neovim", + "rev": "17b466e79479758b332a3cac12544a3ad2be6241", + "type": "github" + }, + "original": { + "owner": "rose-pine", + "repo": "neovim", + "type": "github" + } + }, + "plugin-rust-tools": { + "flake": false, + "locked": { + "lastModified": 1704259376, + "narHash": "sha256-kFane5ze7VDiOzF7jdmXkr50XQsNvdb+a9HQtybEVE0=", + "owner": "simrat39", + "repo": "rust-tools.nvim", + "rev": "676187908a1ce35ffcd727c654ed68d851299d3e", + "type": "github" + }, + "original": { + "owner": "simrat39", + "repo": "rust-tools.nvim", + "type": "github" + } + }, + "plugin-scrollbar-nvim": { + "flake": false, + "locked": { + "lastModified": 1684886154, + "narHash": "sha256-zLBexSxQCn9HPY04a9w/UCJP1F5ShI2X12I9xE9H0cM=", + "owner": "petertriho", + "repo": "nvim-scrollbar", + "rev": "35f99d559041c7c0eff3a41f9093581ceea534e8", + "type": "github" + }, + "original": { + "owner": "petertriho", + "repo": "nvim-scrollbar", + "type": "github" + } + }, + "plugin-smartcolumn": { + "flake": false, + "locked": { + "lastModified": 1710067624, + "narHash": "sha256-DHIeDNUF9n9s14GVeojIwc5QUPwJMYYl3gRvhvO/rdE=", + "owner": "m4xshen", + "repo": "smartcolumn.nvim", + "rev": "cefb17be095ad5526030a21bb2a80553cae09127", + "type": "github" + }, + "original": { + "owner": "m4xshen", + "repo": "smartcolumn.nvim", + "type": "github" + } + }, + "plugin-sqls-nvim": { + "flake": false, + "locked": { + "lastModified": 1684697500, + "narHash": "sha256-jKFut6NZAf/eIeIkY7/2EsjsIhvZQKCKAJzeQ6XSr0s=", + "owner": "nanotee", + "repo": "sqls.nvim", + "rev": "4b1274b5b44c48ce784aac23747192f5d9d26207", + "type": "github" + }, + "original": { + "owner": "nanotee", + "repo": "sqls.nvim", + "type": "github" + } + }, + "plugin-tabular": { + "flake": false, + "locked": { + "lastModified": 1550598128, + "narHash": "sha256-irolBA/m3YIaezl+90h5G+xUOpad+3u44uJqDs4JCUs=", + "owner": "godlygeek", + "repo": "tabular", + "rev": "339091ac4dd1f17e225fe7d57b48aff55f99b23a", + "type": "github" + }, + "original": { + "owner": "godlygeek", + "repo": "tabular", + "type": "github" + } + }, + "plugin-telescope": { + "flake": false, + "locked": { + "lastModified": 1713665692, + "narHash": "sha256-wlRiwT1TCtwPXnIwnzqa6ZABUzJYn+lSRyvkqe6Dbsw=", + "owner": "nvim-telescope", + "repo": "telescope.nvim", + "rev": "7d1698f3d88b448e0639974248cc17f49b7b8acf", + "type": "github" + }, + "original": { + "owner": "nvim-telescope", + "repo": "telescope.nvim", + "type": "github" + } + }, + "plugin-todo-comments": { + "flake": false, + "locked": { + "lastModified": 1711553769, + "narHash": "sha256-BJNU01iTRDNrPv48fgiJRS+ouaHkoqw2AYXKDRgDzfw=", + "owner": "folke", + "repo": "todo-comments.nvim", + "rev": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d", + "type": "github" + }, + "original": { + "owner": "folke", + "repo": "todo-comments.nvim", + "type": "github" + } + }, + "plugin-toggleterm-nvim": { + "flake": false, + "locked": { + "lastModified": 1713792255, + "narHash": "sha256-mM5bGgAemsRJD9U6U5K6ia5qb8NaTusM99x6xrtEBfw=", + "owner": "akinsho", + "repo": "toggleterm.nvim", + "rev": "066cccf48a43553a80a210eb3be89a15d789d6e6", + "type": "github" + }, + "original": { + "owner": "akinsho", + "repo": "toggleterm.nvim", + "type": "github" + } + }, + "plugin-tokyonight": { + "flake": false, + "locked": { + "lastModified": 1713855116, + "narHash": "sha256-vUEPbgDen3ubcyJZdWCgnChOo1T0LFvZI++8RgGGx1Y=", + "owner": "folke", + "repo": "tokyonight.nvim", + "rev": "67afeaf7fd6ebba000633e89f63c31694057edde", + "type": "github" + }, + "original": { + "owner": "folke", + "repo": "tokyonight.nvim", + "type": "github" + } + }, + "plugin-trouble": { + "flake": false, + "locked": { + "lastModified": 1711693365, + "narHash": "sha256-kIQ72fqAsiMF9jq0MzC6peaHJddYn5PRNXfYFHTQB5Q=", + "owner": "folke", + "repo": "trouble.nvim", + "rev": "b9cf677f20bb2faa2dacfa870b084e568dca9572", + "type": "github" + }, + "original": { + "owner": "folke", + "repo": "trouble.nvim", + "type": "github" + } + }, + "plugin-vim-dirtytalk": { + "flake": false, + "locked": { + "lastModified": 1713047519, + "narHash": "sha256-azU5jkv/fD/qDDyCU1bPNXOH6rmbDauG9jDNrtIXc0Y=", + "owner": "psliwka", + "repo": "vim-dirtytalk", + "rev": "aa57ba902b04341a04ff97214360f56856493583", + "type": "github" + }, + "original": { + "owner": "psliwka", + "repo": "vim-dirtytalk", + "type": "github" + } + }, + "plugin-vim-fugitive": { + "flake": false, + "locked": { + "lastModified": 1712554826, + "narHash": "sha256-pmY1EQbupKvsqok9O5omkOWi0BEZ8df7HL0F7ubdY9Q=", + "owner": "tpope", + "repo": "vim-fugitive", + "rev": "dac8e5c2d85926df92672bf2afb4fc48656d96c7", + "type": "github" + }, + "original": { + "owner": "tpope", + "repo": "vim-fugitive", + "type": "github" + } + }, + "plugin-vim-illuminate": { + "flake": false, + "locked": { + "lastModified": 1713467568, + "narHash": "sha256-o0D1edrsHkaljrzBFZXjdxiK/5ziCGJxM/kYNJgBI1E=", + "owner": "RRethy", + "repo": "vim-illuminate", + "rev": "e522e0dd742a83506db0a72e1ced68c9c130f185", + "type": "github" + }, + "original": { + "owner": "RRethy", + "repo": "vim-illuminate", + "type": "github" + } + }, + "plugin-vim-markdown": { + "flake": false, + "locked": { + "lastModified": 1709279705, + "narHash": "sha256-eKwWdyvMZ7FV3FvOtqWVD7pulXNnhbEEjHq7MYg1woU=", + "owner": "preservim", + "repo": "vim-markdown", + "rev": "a657e697376909c41475a686eeef7fc7a4972d94", + "type": "github" + }, + "original": { + "owner": "preservim", + "repo": "vim-markdown", + "type": "github" + } + }, + "plugin-vim-repeat": { + "flake": false, + "locked": { + "lastModified": 1611544268, + "narHash": "sha256-8rfZa3uKXB3TRCqaDHZ6DfzNbm7WaYnLvmTNzYtnKHg=", + "owner": "tpope", + "repo": "vim-repeat", + "rev": "24afe922e6a05891756ecf331f39a1f6743d3d5a", + "type": "github" + }, + "original": { + "owner": "tpope", + "repo": "vim-repeat", + "type": "github" + } + }, + "plugin-vim-startify": { + "flake": false, + "locked": { + "lastModified": 1695213983, + "narHash": "sha256-W5N/Dqxf9hSXEEJsrEkXInFwBXNBJe9Dzx9TVS12mPk=", + "owner": "mhinz", + "repo": "vim-startify", + "rev": "4e089dffdad46f3f5593f34362d530e8fe823dcf", + "type": "github" + }, + "original": { + "owner": "mhinz", + "repo": "vim-startify", + "type": "github" + } + }, + "plugin-vim-vsnip": { + "flake": false, + "locked": { + "lastModified": 1704937299, + "narHash": "sha256-gvm6z4pgSULBVPukewRyjwxZ0vZgreQWbG/0kOB1QBo=", + "owner": "hrsh7th", + "repo": "vim-vsnip", + "rev": "02a8e79295c9733434aab4e0e2b8c4b7cea9f3a9", + "type": "github" + }, + "original": { + "owner": "hrsh7th", + "repo": "vim-vsnip", + "type": "github" + } + }, + "plugin-which-key": { + "flake": false, + "locked": { + "lastModified": 1697801635, + "narHash": "sha256-uvghPj/teWrRMm09Gh8iQ/LV2nYJw0lmoiZK6L4+1cY=", + "owner": "folke", + "repo": "which-key.nvim", + "rev": "4433e5ec9a507e5097571ed55c02ea9658fb268a", + "type": "github" + }, + "original": { + "owner": "folke", + "repo": "which-key.nvim", + "type": "github" + } + }, + "rnix-lsp": { + "inputs": { + "naersk": "naersk", + "nixpkgs": "nixpkgs_2", + "utils": "utils" + }, + "locked": { + "lastModified": 1669555118, + "narHash": "sha256-F0s0m62S5bHNVWNHLZD6SeHiLrsDx98VQbRjDyIu+qQ=", + "owner": "nix-community", + "repo": "rnix-lsp", + "rev": "95d40673fe43642e2e1144341e86d0036abd95d9", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "rnix-lsp", + "type": "github" + } + }, "root": { "inputs": { - "flake-compat": "flake-compat", "flake-parts": "flake-parts", - "mnw": "mnw", - "ndg": "ndg", - "nixpkgs": "nixpkgs_2", - "systems": "systems" + "flake-utils": "flake-utils", + "nil": "nil", + "nixpkgs": "nixpkgs", + "nmd": "nmd", + "plugin-alpha-nvim": "plugin-alpha-nvim", + "plugin-bufdelete-nvim": "plugin-bufdelete-nvim", + "plugin-catppuccin": "plugin-catppuccin", + "plugin-ccc": "plugin-ccc", + "plugin-cellular-automaton": "plugin-cellular-automaton", + "plugin-chatgpt": "plugin-chatgpt", + "plugin-cheatsheet-nvim": "plugin-cheatsheet-nvim", + "plugin-cinnamon-nvim": "plugin-cinnamon-nvim", + "plugin-cmp-buffer": "plugin-cmp-buffer", + "plugin-cmp-nvim-lsp": "plugin-cmp-nvim-lsp", + "plugin-cmp-path": "plugin-cmp-path", + "plugin-cmp-treesitter": "plugin-cmp-treesitter", + "plugin-cmp-vsnip": "plugin-cmp-vsnip", + "plugin-codewindow-nvim": "plugin-codewindow-nvim", + "plugin-comment-nvim": "plugin-comment-nvim", + "plugin-copilot-cmp": "plugin-copilot-cmp", + "plugin-copilot-lua": "plugin-copilot-lua", + "plugin-crates-nvim": "plugin-crates-nvim", + "plugin-dashboard-nvim": "plugin-dashboard-nvim", + "plugin-diffview-nvim": "plugin-diffview-nvim", + "plugin-dracula": "plugin-dracula", + "plugin-dressing-nvim": "plugin-dressing-nvim", + "plugin-elixir-ls": "plugin-elixir-ls", + "plugin-elixir-tools": "plugin-elixir-tools", + "plugin-fidget-nvim": "plugin-fidget-nvim", + "plugin-flutter-tools": "plugin-flutter-tools", + "plugin-gesture-nvim": "plugin-gesture-nvim", + "plugin-gitsigns-nvim": "plugin-gitsigns-nvim", + "plugin-glow-nvim": "plugin-glow-nvim", + "plugin-gruvbox": "plugin-gruvbox", + "plugin-highlight-undo": "plugin-highlight-undo", + "plugin-hop-nvim": "plugin-hop-nvim", + "plugin-icon-picker-nvim": "plugin-icon-picker-nvim", + "plugin-image-nvim": "plugin-image-nvim", + "plugin-indent-blankline": "plugin-indent-blankline", + "plugin-leap-nvim": "plugin-leap-nvim", + "plugin-lsp-lines": "plugin-lsp-lines", + "plugin-lsp-signature": "plugin-lsp-signature", + "plugin-lspkind": "plugin-lspkind", + "plugin-lspsaga": "plugin-lspsaga", + "plugin-lualine": "plugin-lualine", + "plugin-mind-nvim": "plugin-mind-nvim", + "plugin-minimap-vim": "plugin-minimap-vim", + "plugin-modes-nvim": "plugin-modes-nvim", + "plugin-neocord": "plugin-neocord", + "plugin-neodev-nvim": "plugin-neodev-nvim", + "plugin-noice-nvim": "plugin-noice-nvim", + "plugin-none-ls": "plugin-none-ls", + "plugin-nui-nvim": "plugin-nui-nvim", + "plugin-nvim-autopairs": "plugin-nvim-autopairs", + "plugin-nvim-bufferline-lua": "plugin-nvim-bufferline-lua", + "plugin-nvim-cmp": "plugin-nvim-cmp", + "plugin-nvim-code-action-menu": "plugin-nvim-code-action-menu", + "plugin-nvim-colorizer-lua": "plugin-nvim-colorizer-lua", + "plugin-nvim-cursorline": "plugin-nvim-cursorline", + "plugin-nvim-dap": "plugin-nvim-dap", + "plugin-nvim-dap-ui": "plugin-nvim-dap-ui", + "plugin-nvim-docs-view": "plugin-nvim-docs-view", + "plugin-nvim-lightbulb": "plugin-nvim-lightbulb", + "plugin-nvim-lspconfig": "plugin-nvim-lspconfig", + "plugin-nvim-navbuddy": "plugin-nvim-navbuddy", + "plugin-nvim-navic": "plugin-nvim-navic", + "plugin-nvim-neoclip": "plugin-nvim-neoclip", + "plugin-nvim-nio": "plugin-nvim-nio", + "plugin-nvim-notify": "plugin-nvim-notify", + "plugin-nvim-session-manager": "plugin-nvim-session-manager", + "plugin-nvim-surround": "plugin-nvim-surround", + "plugin-nvim-tree-lua": "plugin-nvim-tree-lua", + "plugin-nvim-treesitter-context": "plugin-nvim-treesitter-context", + "plugin-nvim-ts-autotag": "plugin-nvim-ts-autotag", + "plugin-nvim-web-devicons": "plugin-nvim-web-devicons", + "plugin-obsidian-nvim": "plugin-obsidian-nvim", + "plugin-onedark": "plugin-onedark", + "plugin-orgmode-nvim": "plugin-orgmode-nvim", + "plugin-oxocarbon": "plugin-oxocarbon", + "plugin-plenary-nvim": "plugin-plenary-nvim", + "plugin-project-nvim": "plugin-project-nvim", + "plugin-registers": "plugin-registers", + "plugin-rose-pine": "plugin-rose-pine", + "plugin-rust-tools": "plugin-rust-tools", + "plugin-scrollbar-nvim": "plugin-scrollbar-nvim", + "plugin-smartcolumn": "plugin-smartcolumn", + "plugin-sqls-nvim": "plugin-sqls-nvim", + "plugin-tabular": "plugin-tabular", + "plugin-telescope": "plugin-telescope", + "plugin-todo-comments": "plugin-todo-comments", + "plugin-toggleterm-nvim": "plugin-toggleterm-nvim", + "plugin-tokyonight": "plugin-tokyonight", + "plugin-trouble": "plugin-trouble", + "plugin-vim-dirtytalk": "plugin-vim-dirtytalk", + "plugin-vim-fugitive": "plugin-vim-fugitive", + "plugin-vim-illuminate": "plugin-vim-illuminate", + "plugin-vim-markdown": "plugin-vim-markdown", + "plugin-vim-repeat": "plugin-vim-repeat", + "plugin-vim-startify": "plugin-vim-startify", + "plugin-vim-vsnip": "plugin-vim-vsnip", + "plugin-which-key": "plugin-which-key", + "rnix-lsp": "rnix-lsp", + "systems": "systems_2", + "tidalcycles": "tidalcycles", + "zig": "zig" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": [ + "nil", + "flake-utils" + ], + "nixpkgs": [ + "nil", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1704593904, + "narHash": "sha256-nDoXZDTRdgF3b4n3m011y99nYFewvOl9UpzFvP8Rb3c=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "c36fd70a99decfa6e110c86f296a97613034a680", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "superdirt-src": { + "flake": false, + "locked": { + "lastModified": 1611740180, + "narHash": "sha256-GtnqZeMFqFkVhgx2Exu0wY687cHa7mNnVCgjQd6fiIA=", + "owner": "musikinformatik", + "repo": "superdirt", + "rev": "7abb62e89649daa1232b9cbd6427241868abd30e", + "type": "github" + }, + "original": { + "owner": "musikinformatik", + "ref": "master", + "repo": "superdirt", + "type": "github" } }, "systems": { @@ -125,6 +1966,163 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tidal-src": { + "flake": false, + "locked": { + "lastModified": 1654350756, + "narHash": "sha256-tONM5SYYBca0orTLH1EUOilSC1FCluWrFt8AetUx+YQ=", + "owner": "tidalcycles", + "repo": "tidal", + "rev": "fda9c1ecb3722698935245e5409ef8ccdfca16c8", + "type": "github" + }, + "original": { + "owner": "tidalcycles", + "ref": "main", + "repo": "tidal", + "type": "github" + } + }, + "tidalcycles": { + "inputs": { + "dirt-samples-src": "dirt-samples-src", + "nixpkgs": "nixpkgs_3", + "superdirt-src": "superdirt-src", + "tidal-src": "tidal-src", + "utils": "utils_2", + "vim-tidal-src": "vim-tidal-src", + "vowel-src": "vowel-src" + }, + "locked": { + "lastModified": 1694087816, + "narHash": "sha256-GMV5ONQhLwa6xRYhZkmwc2W2jbjAfHfB/OR9vR0+PFA=", + "owner": "mitchmindtree", + "repo": "tidalcycles.nix", + "rev": "1b1c4df5303e07930d23e8361ab8253ebec0c7bb", + "type": "github" + }, + "original": { + "owner": "mitchmindtree", + "repo": "tidalcycles.nix", + "type": "github" + } + }, + "utils": { + "locked": { + "lastModified": 1656928814, + "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "utils_2": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1692799911, + "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "vim-tidal-src": { + "flake": false, + "locked": { + "lastModified": 1685703852, + "narHash": "sha256-8gyk17YLeKpLpz3LRtxiwbpsIbZka9bb63nK5/9IUoA=", + "owner": "tidalcycles", + "repo": "vim-tidal", + "rev": "e440fe5bdfe07f805e21e6872099685d38e8b761", + "type": "github" + }, + "original": { + "owner": "tidalcycles", + "repo": "vim-tidal", + "type": "github" + } + }, + "vowel-src": { + "flake": false, + "locked": { + "lastModified": 1641306144, + "narHash": "sha256-zfF6cvAGDNYWYsE8dOIo38b+dIymd17Pexg0HiPFbxM=", + "owner": "supercollider-quarks", + "repo": "vowel", + "rev": "ab59caa870201ecf2604b3efdd2196e21a8b5446", + "type": "github" + }, + "original": { + "owner": "supercollider-quarks", + "ref": "master", + "repo": "vowel", + "type": "github" + } + }, + "zig": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1713960597, + "narHash": "sha256-WAryNIrMfZ48iZSTh8hcHIX9vwh78LMFUtewgY7kp1Y=", + "owner": "mitchellh", + "repo": "zig-overlay", + "rev": "71894accd2dd096f5a84166a628b1f075311aafe", + "type": "github" + }, + "original": { + "owner": "mitchellh", + "repo": "zig-overlay", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 31e8d0f1..e63f7ca6 100644 --- a/flake.nix +++ b/flake.nix @@ -1,112 +1,629 @@ { description = "A neovim flake with a modular configuration"; outputs = { + nixpkgs, flake-parts, self, ... - } @ inputs: let - # Call the extended library with `inputs`. - # inputs is used to get the original standard library, and to pass inputs - # to the plugin autodiscovery function - lib = import ./lib/stdlib-extended.nix {inherit inputs self;}; - in - flake-parts.lib.mkFlake { - inherit inputs; - specialArgs = {inherit lib;}; - } { - # Allow users to bring their own systems. - # «https://github.com/nix-systems/nix-systems» + } @ inputs: + flake-parts.lib.mkFlake {inherit inputs;} { + # provide overridable systems + # https://github.com/nix-systems/nix-systems systems = import inputs.systems; + imports = [ - ./flake/templates + # add lib to module args + {_module.args = {inherit (nixpkgs) lib;};} ./flake/apps.nix + ./flake/legacyPackages.nix + ./flake/overlays.nix ./flake/packages.nix - ./flake/develop.nix ]; flake = { lib = { - inherit (lib) nvim; - inherit (lib.nvim) neovimConfiguration; + inherit (import ./lib/stdlib-extended.nix nixpkgs.lib inputs) nvim; + inherit (import ./configuration.nix inputs) neovimConfiguration; }; - inherit (lib.importJSON ./npins/sources.json) pins; - homeManagerModules = { - nvf = import ./flake/modules/home-manager.nix {inherit lib inputs;}; - default = self.homeManagerModules.nvf; neovim-flake = - lib.warn '' - 'homeManagerModules.neovim-flake' has been deprecated, and will be removed - in a future release. Please use 'homeManagerModules.nvf' instead. + nixpkgs.lib.warn '' + homeManagerModules.neovim-flake has been deprecated. + Plese use the homeManagereModules.nvf instead '' self.homeManagerModules.nvf; + + nvf = { + imports = [(import ./flake/modules/home-manager.nix self.packages inputs)]; + }; + + default = self.homeManagerModules.nvf; }; nixosModules = { - nvf = import ./flake/modules/nixos.nix {inherit lib inputs;}; - default = self.nixosModules.nvf; neovim-flake = - lib.warn '' - 'nixosModules.neovim-flake' has been deprecated, and will be removed - in a future release. Please use 'nixosModules.nvf' instead. + nixpkgs.lib.warn '' + nixosModules.neovim-flake has been deprecated. + Please use the nixosModules.nvf instead '' - self.nixosModules.nvf; + self.nixosModules.neovim-flake; + + nvf = { + imports = [(import ./flake/modules/nixos.nix self.packages inputs)]; + }; + + default = self.nixosModules.nvf; }; }; - perSystem = {pkgs, ...}: { - # Provides the default formatter for 'nix fmt', which will format the - # entire tree with Alejandra. The wrapper script is necessary due to - # changes to the behaviour of Nix, which now encourages wrappers for - # tree-wide formatting. - formatter = pkgs.writeShellApplication { - name = "nix3-fmt-wrapper"; - - runtimeInputs = [ - pkgs.alejandra - pkgs.fd - ]; - - text = '' - # Find Nix files in the tree and format them with Alejandra - fd "$@" -t f -e nix -x alejandra -q '{}' - ''; - }; - - # Provides checks to be built an ran on 'nix flake check'. They can also - # be built individually with 'nix build' as described below. - checks = { - # Check if codebase is properly formatted. - # This can be initiated with `nix build .#checks..nix-fmt` - # or with `nix flake check` - nix-fmt = pkgs.runCommand "nix-fmt-check" {nativeBuildInputs = [pkgs.alejandra];} '' - alejandra --check ${self} < /dev/null | tee $out - ''; + perSystem = { + self', + config, + pkgs, + ... + }: { + formatter = pkgs.alejandra; + devShells = { + default = self'.devShells.lsp; + nvim-nix = pkgs.mkShell {nativeBuildInputs = [config.packages.nix];}; + lsp = pkgs.mkShell { + nativeBuildInputs = with pkgs; [nil statix deadnix alejandra]; + }; }; }; }; + # Flake inputs inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + flake-utils.url = "github:numtide/flake-utils"; systems.url = "github:nix-systems/default"; - ## Basic Inputs - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - - flake-parts = { - url = "github:hercules-ci/flake-parts"; - inputs.nixpkgs-lib.follows = "nixpkgs"; - }; - - flake-compat = { - url = "git+https://git.lix.systems/lix-project/flake-compat.git"; + # For generating documentation website + nmd = { + url = "sourcehut:~rycee/nmd"; flake = false; }; - # Alternate neovim-wrapper - mnw.url = "github:Gerg-L/mnw"; + # TODO: get zig from the zig overlay instead of nixpkgs + zig.url = "github:mitchellh/zig-overlay"; - # Alternative documentation generator - ndg.url = "github:feel-co/ndg"; + # Langauge server (use master instead of nixpkgs) + rnix-lsp.url = "github:nix-community/rnix-lsp"; + nil = { + url = "github:oxalica/nil"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + }; + + ### Plugins + # Tidal cycles + tidalcycles = { + url = "github:mitchmindtree/tidalcycles.nix"; + inputs.vim-tidal-src.url = "github:tidalcycles/vim-tidal"; + }; + + # LSP plugins + plugin-nvim-lspconfig = { + url = "github:neovim/nvim-lspconfig"; + flake = false; + }; + + plugin-lspsaga = { + url = "github:tami5/lspsaga.nvim"; + flake = false; + }; + + plugin-lspkind = { + url = "github:onsails/lspkind-nvim"; + flake = false; + }; + + plugin-trouble = { + url = "github:folke/trouble.nvim"; + flake = false; + }; + + plugin-nvim-treesitter-context = { + url = "github:nvim-treesitter/nvim-treesitter-context"; + flake = false; + }; + + plugin-nvim-lightbulb = { + url = "github:kosayoda/nvim-lightbulb"; + flake = false; + }; + + plugin-nvim-code-action-menu = { + url = "github:weilbith/nvim-code-action-menu"; + flake = false; + }; + + plugin-lsp-signature = { + url = "github:ray-x/lsp_signature.nvim"; + flake = false; + }; + + plugin-lsp-lines = { + url = "sourcehut:~whynothugo/lsp_lines.nvim"; + flake = false; + }; + + plugin-none-ls = { + # https://github.com/nvimtools/none-ls.nvim/issues/58 + url = "github:nvimtools/none-ls.nvim/bb680d752cec37949faca7a1f509e2fe67ab418a"; + flake = false; + }; + + plugin-nvim-docs-view = { + url = "github:amrbashir/nvim-docs-view"; + flake = false; + }; + + # language support + plugin-sqls-nvim = { + url = "github:nanotee/sqls.nvim"; + flake = false; + }; + + plugin-rust-tools = { + url = "github:simrat39/rust-tools.nvim"; + flake = false; + }; + + plugin-flutter-tools = { + url = "github:akinsho/flutter-tools.nvim"; + flake = false; + }; + + plugin-neodev-nvim = { + url = "github:folke/neodev.nvim"; + flake = false; + }; + + plugin-elixir-ls = { + url = "github:elixir-lsp/elixir-ls"; + flake = false; + }; + + plugin-elixir-tools = { + url = "github:elixir-tools/elixir-tools.nvim"; + flake = false; + }; + + plugin-glow-nvim = { + url = "github:ellisonleao/glow.nvim"; + flake = false; + }; + + plugin-image-nvim = { + url = "github:3rd/image.nvim"; + flake = false; + }; + + # Copying/Registers + plugin-registers = { + url = "github:tversteeg/registers.nvim"; + flake = false; + }; + + plugin-nvim-neoclip = { + url = "github:AckslD/nvim-neoclip.lua"; + flake = false; + }; + + # Telescope + plugin-telescope = { + url = "github:nvim-telescope/telescope.nvim"; + flake = false; + }; + + # Debuggers + plugin-nvim-dap = { + url = "github:mfussenegger/nvim-dap"; + flake = false; + }; + + plugin-nvim-dap-ui = { + url = "github:rcarriga/nvim-dap-ui"; + flake = false; + }; + + # Filetrees + plugin-nvim-tree-lua = { + url = "github:nvim-tree/nvim-tree.lua"; + flake = false; + }; + + # Tablines + plugin-nvim-bufferline-lua = { + url = "github:akinsho/nvim-bufferline.lua"; + flake = false; + }; + + # Statuslines + plugin-lualine = { + url = "github:hoob3rt/lualine.nvim"; + flake = false; + }; + + plugin-nvim-cmp = { + url = "github:hrsh7th/nvim-cmp"; + flake = false; + }; + + plugin-cmp-buffer = { + url = "github:hrsh7th/cmp-buffer"; + flake = false; + }; + + plugin-cmp-nvim-lsp = { + url = "github:hrsh7th/cmp-nvim-lsp"; + flake = false; + }; + + plugin-cmp-vsnip = { + url = "github:hrsh7th/cmp-vsnip"; + flake = false; + }; + + plugin-cmp-path = { + url = "github:hrsh7th/cmp-path"; + flake = false; + }; + + plugin-cmp-treesitter = { + url = "github:ray-x/cmp-treesitter"; + flake = false; + }; + + # snippets + plugin-vim-vsnip = { + url = "github:hrsh7th/vim-vsnip"; + flake = false; + }; + + # Presence + plugin-neocord = { + url = "github:IogaMaster/neocord"; + flake = false; # uses flake-utils, avoid the flake + }; + + # Autopairs + plugin-nvim-autopairs = { + url = "github:windwp/nvim-autopairs"; + flake = false; + }; + + plugin-nvim-ts-autotag = { + url = "github:windwp/nvim-ts-autotag"; + flake = false; + }; + + # Commenting + plugin-comment-nvim = { + url = "github:numToStr/Comment.nvim"; + flake = false; + }; + + plugin-todo-comments = { + url = "github:folke/todo-comments.nvim"; + flake = false; + }; + + # Buffer tools + plugin-bufdelete-nvim = { + url = "github:famiu/bufdelete.nvim"; + flake = false; + }; + + # Dashboard Utilities + plugin-dashboard-nvim = { + url = "github:glepnir/dashboard-nvim"; + flake = false; + }; + + plugin-alpha-nvim = { + url = "github:goolord/alpha-nvim"; + flake = false; + }; + + plugin-vim-startify = { + url = "github:mhinz/vim-startify"; + flake = false; + }; + + # Themes + plugin-tokyonight = { + url = "github:folke/tokyonight.nvim"; + flake = false; + }; + + plugin-onedark = { + url = "github:navarasu/onedark.nvim"; + flake = false; + }; + + plugin-catppuccin = { + url = "github:catppuccin/nvim"; + flake = false; + }; + + plugin-dracula = { + url = "github:Mofiqul/dracula.nvim"; + flake = false; + }; + + plugin-oxocarbon = { + url = "github:nyoom-engineering/oxocarbon.nvim"; + flake = false; + }; + + plugin-gruvbox = { + url = "github:ellisonleao/gruvbox.nvim"; + flake = false; + }; + + plugin-rose-pine = { + url = "github:rose-pine/neovim"; + flake = false; + }; + + # Rust crates + plugin-crates-nvim = { + url = "github:Saecki/crates.nvim"; + flake = false; + }; + + # Project Management + plugin-project-nvim = { + url = "github:ahmedkhalf/project.nvim"; + flake = false; + }; + + # Visuals + plugin-nvim-cursorline = { + url = "github:yamatsum/nvim-cursorline"; + flake = false; + }; + + plugin-scrollbar-nvim = { + url = "github:petertriho/nvim-scrollbar"; + flake = false; + }; + + plugin-cinnamon-nvim = { + url = "github:declancm/cinnamon.nvim"; + flake = false; + }; + + plugin-cellular-automaton = { + url = "github:Eandrju/cellular-automaton.nvim"; + flake = false; + }; + + plugin-indent-blankline = { + url = "github:lukas-reineke/indent-blankline.nvim"; + flake = false; + }; + + plugin-nvim-web-devicons = { + url = "github:nvim-tree/nvim-web-devicons"; + flake = false; + }; + + plugin-gitsigns-nvim = { + url = "github:lewis6991/gitsigns.nvim"; + flake = false; + }; + + plugin-vim-fugitive = { + url = "github:tpope/vim-fugitive"; + flake = false; + }; + + plugin-fidget-nvim = { + url = "github:j-hui/fidget.nvim"; + flake = false; + }; + + plugin-highlight-undo = { + url = "github:tzachar/highlight-undo.nvim"; + flake = false; + }; + + # Minimap + plugin-minimap-vim = { + url = "github:wfxr/minimap.vim"; + flake = false; + }; + + plugin-codewindow-nvim = { + url = "github:gorbit99/codewindow.nvim"; + flake = false; + }; + + # Notifications + plugin-nvim-notify = { + url = "github:rcarriga/nvim-notify"; + flake = false; + }; + + # Utilities + plugin-ccc = { + url = "github:uga-rosa/ccc.nvim"; + flake = false; + }; + + plugin-diffview-nvim = { + url = "github:sindrets/diffview.nvim"; + flake = false; + }; + + plugin-icon-picker-nvim = { + url = "github:ziontee113/icon-picker.nvim"; + flake = false; + }; + + plugin-which-key = { + url = "github:folke/which-key.nvim"; + flake = false; + }; + + plugin-cheatsheet-nvim = { + url = "github:sudormrfbin/cheatsheet.nvim"; + flake = false; + }; + + plugin-gesture-nvim = { + url = "github:notomo/gesture.nvim"; + flake = false; + }; + + plugin-hop-nvim = { + url = "github:phaazon/hop.nvim"; + flake = false; + }; + + plugin-leap-nvim = { + url = "github:ggandor/leap.nvim"; + flake = false; + }; + + plugin-smartcolumn = { + url = "github:m4xshen/smartcolumn.nvim"; + flake = false; + }; + + plugin-nvim-surround = { + url = "github:kylechui/nvim-surround"; + flake = false; + }; + + # Note-taking + plugin-obsidian-nvim = { + url = "github:epwalsh/obsidian.nvim"; + flake = false; + }; + + plugin-orgmode-nvim = { + url = "github:nvim-orgmode/orgmode"; + flake = false; + }; + + plugin-mind-nvim = { + url = "github:phaazon/mind.nvim"; + flake = false; + }; + + # Spellchecking + plugin-vim-dirtytalk = { + url = "github:psliwka/vim-dirtytalk"; + flake = false; + }; + + # Terminal + plugin-toggleterm-nvim = { + url = "github:akinsho/toggleterm.nvim"; + flake = false; + }; + + # UI + plugin-nvim-navbuddy = { + url = "github:SmiteshP/nvim-navbuddy"; + flake = false; + }; + + plugin-nvim-navic = { + url = "github:SmiteshP/nvim-navic"; + flake = false; + }; + + plugin-noice-nvim = { + url = "github:folke/noice.nvim"; + flake = false; + }; + + plugin-modes-nvim = { + url = "github:mvllow/modes.nvim"; + flake = false; + }; + + plugin-nvim-colorizer-lua = { + url = "github:NvChad/nvim-colorizer.lua"; + flake = false; + }; + + plugin-vim-illuminate = { + url = "github:RRethy/vim-illuminate"; + flake = false; + }; + + # Assistant + plugin-chatgpt = { + url = "github:jackMort/ChatGPT.nvim"; + flake = false; + }; + + plugin-copilot-lua = { + url = "github:zbirenbaum/copilot.lua"; + flake = false; + }; + + plugin-copilot-cmp = { + url = "github:zbirenbaum/copilot-cmp"; + flake = false; + }; + + # Session management + plugin-nvim-session-manager = { + url = "github:Shatur/neovim-session-manager"; + flake = false; + }; + + # Dependencies + plugin-plenary-nvim = { + # (required by crates-nvim) + url = "github:nvim-lua/plenary.nvim"; + flake = false; + }; + + plugin-dressing-nvim = { + # (required by icon-picker-nvim) + url = "github:stevearc/dressing.nvim"; + flake = false; + }; + + plugin-vim-markdown = { + # (required by obsidian-nvim) + url = "github:preservim/vim-markdown"; + flake = false; + }; + + plugin-tabular = { + # (required by vim-markdown) + url = "github:godlygeek/tabular"; + flake = false; + }; + + plugin-nui-nvim = { + # (required by noice.nvim) + url = "github:MunifTanjim/nui.nvim"; + flake = false; + }; + + plugin-vim-repeat = { + # (required by leap.nvim) + url = "github:tpope/vim-repeat"; + flake = false; + }; + + plugin-nvim-nio = { + # (required nvim-dap-ui) + url = "github:nvim-neotest/nvim-nio"; + flake = false; + }; }; } diff --git a/flake/apps.nix b/flake/apps.nix index 583e297e..6b53adf9 100644 --- a/flake/apps.nix +++ b/flake/apps.nix @@ -1,11 +1,21 @@ -{lib, ...}: let - inherit (lib.meta) getExe; -in { - perSystem = {config, ...}: { - apps = { - nix.program = getExe config.packages.nix; - maximal.program = getExe config.packages.maximal; - default = config.apps.nix; - }; +{lib, ...}: { + perSystem = { + system, + config, + ... + }: { + apps = + { + nix.program = lib.getExe config.packages.nix; + maximal.program = lib.getExe config.packages.maximal; + default = config.apps.nix; + } + // ( + if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"]) + then { + tidal.program = lib.getExe config.packages.tidal; + } + else {} + ); }; } diff --git a/flake/develop.nix b/flake/develop.nix deleted file mode 100644 index 71c13688..00000000 --- a/flake/develop.nix +++ /dev/null @@ -1,30 +0,0 @@ -{lib, ...}: { - perSystem = { - pkgs, - config, - self', - ... - }: { - devShells = { - default = self'.devShells.lsp; - nvim-nix = pkgs.mkShellNoCC {packages = [config.packages.nix];}; - lsp = pkgs.mkShellNoCC { - packages = with pkgs; [nil statix deadnix alejandra npins]; - }; - }; - - # This package exists to make development easier by providing the place and - # boilerplate to build a test nvf configuration. Feel free to use this for - # testing, but make sure to discard the changes before creating a pull - # request. - packages.dev = let - configuration = {}; - - customNeovim = lib.nvim.neovimConfiguration { - inherit pkgs; - modules = [configuration]; - }; - in - customNeovim.neovim; - }; -} diff --git a/flake/legacyPackages.nix b/flake/legacyPackages.nix new file mode 100644 index 00000000..d6fb73c7 --- /dev/null +++ b/flake/legacyPackages.nix @@ -0,0 +1,19 @@ +{inputs, ...}: { + perSystem = { + system, + inputs', + ... + }: { + legacyPackages = import inputs.nixpkgs { + inherit system; + overlays = [ + inputs.tidalcycles.overlays.default + inputs.self.overlays.default + (_: _: { + rnix-lsp = inputs'.rnix-lsp.defaultPackage; + nil = inputs'.nil.packages.default; + }) + ]; + }; + }; +} diff --git a/flake/modules/home-manager.nix b/flake/modules/home-manager.nix index f305558b..bcefcf1e 100644 --- a/flake/modules/home-manager.nix +++ b/flake/modules/home-manager.nix @@ -1,50 +1,40 @@ # Home Manager module -{ - inputs, - lib, -}: { +packages: inputs: { config, pkgs, + lib ? pkgs.lib, ... }: let - inherit (inputs.self) packages; inherit (lib) maintainers; - inherit (lib.modules) mkIf mkAliasOptionModule; + inherit (lib.modules) mkIf; inherit (lib.lists) optional; inherit (lib.options) mkOption mkEnableOption literalExpression; - inherit (lib.types) anything bool submoduleWith; + inherit (lib.types) attrsOf anything bool; - cfg = config.programs.nvf; + cfg = config.programs.neovim-flake; + inherit (import ../../configuration.nix inputs) neovimConfiguration; - nvfModule = submoduleWith { - description = "Nvf module"; - class = "nvf"; - specialArgs = { - inherit pkgs lib inputs; - }; - modules = import ../../modules/modules.nix {inherit pkgs lib;}; + neovimConfigured = neovimConfiguration { + inherit pkgs; + modules = [cfg.settings]; }; in { - imports = [ - (mkAliasOptionModule ["programs" "neovim-flake"] ["programs" "nvf"]) - ]; - meta.maintainers = with maintainers; [NotAShelf]; - options.programs.nvf = { - enable = mkEnableOption "nvf, the extensible neovim configuration wrapper"; + options.programs.neovim-flake = { + enable = mkEnableOption "neovim-flake, the extensible neovim configuration wrapper"; enableManpages = mkOption { type = bool; default = false; - description = "Whether to enable manpages for nvf."; + description = "Whether to enable manpages for neovim-flake."; }; defaultEditor = mkOption { type = bool; default = false; description = '' - Whether to set `nvf` as the default editor. + Whether to set `neovim-flake` as the default editor. This will set the `EDITOR` environment variable as `nvim` if set to true. @@ -56,14 +46,14 @@ in { visible = false; readOnly = true; description = '' - The built nvf package, wrapped with the user's configuration. + The built neovim-flake package, wrapped with the user's configuration. ''; }; settings = mkOption { - type = nvfModule; + type = attrsOf anything; default = {}; - description = "Attribute set of nvf preferences."; + description = "Attribute set of neovim-flake preferences."; example = literalExpression '' { vim.viAlias = false; @@ -73,6 +63,7 @@ in { formatOnSave = true; lightbulb.enable = true; lspsaga.enable = false; + nvimCodeActionMenu.enable = true; trouble.enable = true; lspSignature.enable = true; rust.enable = false; @@ -84,7 +75,7 @@ in { }; config = mkIf cfg.enable { - programs.nvf.finalPackage = cfg.settings.vim.build.finalPackage; + programs.neovim-flake.finalPackage = neovimConfigured.neovim; home = { sessionVariables = mkIf cfg.defaultEditor {EDITOR = "nvim";}; @@ -93,5 +84,4 @@ in { ++ optional cfg.enableManpages packages.${pkgs.stdenv.system}.docs-manpages; }; }; - _file = ./home-manager.nix; } diff --git a/flake/modules/nixos.nix b/flake/modules/nixos.nix index 8f95a12a..de234c73 100644 --- a/flake/modules/nixos.nix +++ b/flake/modules/nixos.nix @@ -1,50 +1,40 @@ # NixOS module -{ - inputs, - lib, -}: { +packages: inputs: { config, pkgs, + lib ? pkgs.lib, ... }: let - inherit (inputs.self) packages; inherit (lib) maintainers; - inherit (lib.modules) mkIf mkOverride mkAliasOptionModule; + inherit (lib.modules) mkIf mkOverride; inherit (lib.lists) optional; inherit (lib.options) mkOption mkEnableOption literalExpression; - inherit (lib.types) anything bool submoduleWith; + inherit (lib.types) attrsOf anything bool; - cfg = config.programs.nvf; + cfg = config.programs.neovim-flake; + inherit (import ../../configuration.nix inputs) neovimConfiguration; - nvfModule = submoduleWith { - description = "Nvf module"; - class = "nvf"; - specialArgs = { - inherit pkgs lib inputs; - }; - modules = import ../../modules/modules.nix {inherit pkgs lib;}; + neovimConfigured = neovimConfiguration { + inherit pkgs; + modules = [cfg.settings]; }; in { - imports = [ - (mkAliasOptionModule ["programs" "neovim-flake"] ["programs" "nvf"]) - ]; - meta.maintainers = with maintainers; [NotAShelf]; - options.programs.nvf = { - enable = mkEnableOption "nvf, the extensible neovim configuration wrapper"; + options.programs.neovim-flake = { + enable = mkEnableOption "neovim-flake, the extensible neovim configuration wrapper"; enableManpages = mkOption { type = bool; default = false; - description = "Whether to enable manpages for nvf."; + description = "Whether to enable manpages for neovim-flake."; }; defaultEditor = mkOption { type = bool; default = false; description = '' - Whether to set `nvf` as the default editor. + Whether to set `neovim-flake` as the default editor. This will set the `EDITOR` environment variable as `nvim` if set to true. @@ -56,14 +46,14 @@ in { visible = false; readOnly = true; description = '' - The built nvf package, wrapped with the user's configuration. + The built neovim-flake package, wrapped with the user's configuration. ''; }; settings = mkOption { - type = nvfModule; + type = attrsOf anything; default = {}; - description = "Attribute set of nvf preferences."; + description = "Attribute set of neovim-flake preferences."; example = literalExpression '' { vim.viAlias = false; @@ -73,6 +63,7 @@ in { formatOnSave = true; lightbulb.enable = true; lspsaga.enable = false; + nvimCodeActionMenu.enable = true; trouble.enable = true; lspSignature.enable = true; rust.enable = false; @@ -84,7 +75,7 @@ in { }; config = mkIf cfg.enable { - programs.nvf.finalPackage = cfg.settings.vim.build.finalPackage; + programs.neovim-flake.finalPackage = neovimConfigured.neovim; environment = { variables.EDITOR = mkIf cfg.defaultEditor (mkOverride 900 "nvim"); @@ -93,5 +84,4 @@ in { ++ optional cfg.enableManpages packages.${pkgs.stdenv.system}.docs-manpages; }; }; - _file = ./nixos.nix; } diff --git a/flake/overlays.nix b/flake/overlays.nix new file mode 100644 index 00000000..c73f2c0b --- /dev/null +++ b/flake/overlays.nix @@ -0,0 +1,21 @@ +{ + inputs, + pkgs, + ... +}: let + inherit (import ../configuration.nix inputs) neovimConfiguration mainConfig; + + buildPkg = pkgs: modules: (neovimConfiguration {inherit pkgs modules;}).neovim; + + nixConfig = mainConfig false; + maximalConfig = mainConfig true; + tidalConfig = {config.vim.tidal.enable = true;}; +in { + flake.overlays.default = _final: prev: { + inherit neovimConfiguration; + neovim-nix = buildPkg prev [nixConfig]; + neovim-maximal = buildPkg prev [maximalConfig]; + neovim-tidal = buildPkg prev [tidalConfig]; + devPkg = buildPkg pkgs [nixConfig {config.vim.languages.html.enable = pkgs.lib.mkForce true;}]; + }; +} diff --git a/flake/packages.nix b/flake/packages.nix index 7d39afcb..eb6c9461 100644 --- a/flake/packages.nix +++ b/flake/packages.nix @@ -1,122 +1,62 @@ -{ - inputs, - self, - ... -} @ args: { +{inputs, ...}: { perSystem = { + system, config, pkgs, - lib, ... }: let - inherit (lib.customisation) makeScope; - inherit (lib.attrsets) isDerivation isAttrs concatMapAttrs; - inherit (lib.strings) concatStringsSep; - inherit (lib.filesystem) packagesFromDirectoryRecursive; - - # Entrypoint for nvf documentation and relevant packages. - docs = import ../docs {inherit pkgs inputs lib;}; - - # Helper function for creating demo configurations for nvf - # TODO: make this more generic. - buildPkg = maximal: - (args.config.flake.lib.nvim.neovimConfiguration { - inherit pkgs; - modules = [(import ../configuration.nix maximal)]; - }).neovim; - - # This constructs a by-name overlay similar to the one found in Nixpkgs. - # The goal is to automatically discover and packages found in pkgs/by-name - # as long as they have a 'package.nix' in the package directory. We also - # pass 'inputs' and 'pins' to all packages in the 'callPackage' scope, therefore - # they are always available in the relevant 'package.nix' files. - # --- - # The logic is borrowed from drupol/pkgs-by-name-for-flake-parts, available - # under the MIT license. - flattenPkgs = separator: path: value: - if isDerivation value - then { - ${concatStringsSep separator path} = value; - } - else if isAttrs value - then concatMapAttrs (name: flattenPkgs separator (path ++ [name])) value - else - # Ignore the functions which makeScope returns - {}; - - inputsScope = makeScope pkgs.newScope (_: { - inherit inputs; - inherit (self) pins; - }); - - scopeFromDirectory = directory: - packagesFromDirectoryRecursive { - inherit directory; - inherit (inputsScope) newScope callPackage; - }; - - legacyPackages = scopeFromDirectory ./pkgs/by-name; + docs = import ../docs {inherit pkgs inputs;}; in { packages = - (flattenPkgs "/" [] legacyPackages) - // { - inherit (docs.manual) htmlOpenTool; - + { # Documentation docs = docs.manual.html; docs-html = docs.manual.html; docs-manpages = docs.manPages; docs-json = docs.options.json; - docs-linkcheck = let - site = config.packages.docs; - in - pkgs.testers.lycheeLinkCheck { - inherit site; - remap = { - "https://notashelf.github.io/nvf/" = site; - }; - - extraConfig = { - exclude = []; - include_mail = true; - include_verbatim = true; - }; - }; - - # Helper utility for building the HTML manual and opening it in the - # browser with $BROWSER or using xdg-open as a fallback tool. - # Adapted from Home-Manager, available under the MIT license. - docs-html-wrapped = let - xdg-open = lib.getExe' pkgs.xdg-utils "xdg-open"; - docs-html = docs.manual.html + /share/doc/nvf; - in - pkgs.writeShellScriptBin "docs-html-wrapped" '' - set -euo pipefail - - if [[ ! -v BROWSER || -z $BROWSER ]]; then - for candidate in xdg-open open w3m; do - BROWSER="$(type -P $candidate || true)" - if [[ -x $BROWSER ]]; then - break; - fi - done - fi - - if [[ ! -v BROWSER || -z $BROWSER ]]; then - echo "$0: unable to start a web browser; please set \$BROWSER" - echo "$0: Trying xdg-open as a fallback" - ${xdg-open} ${docs-html}/index.xhtml - else - echo "\$BROWSER is set. Attempting to open manual" - exec "$BROWSER" "${docs-html}/index.xhtml" - fi - ''; + # Build and open the built manual in your system browser + docs-html-wrapped = pkgs.writeScriptBin "docs-html-wrapped" '' + #!${pkgs.stdenv.shell} + # use xdg-open to open the docs in the browser + ${pkgs.xdg_utils}/bin/xdg-open ${docs.manual.html} + ''; # Exposed neovim configurations - nix = buildPkg false; - maximal = buildPkg true; - default = config.packages.nix; - }; + nix = config.legacyPackages.neovim-nix; + maximal = config.legacyPackages.neovim-maximal; + default = config.legacyPackages.neovim-nix; + + # Published docker images + docker-nix = let + inherit (pkgs) bash gitFull buildEnv dockerTools; + inherit (config.legacyPackages) neovim-nix; + in + dockerTools.buildImage { + name = "nvf"; + tag = "latest"; + + copyToRoot = buildEnv { + name = "neovim-root"; + pathsToLink = ["/bin"]; + paths = [ + neovim-nix + gitFull + bash + ]; + }; + + config = { + Cmd = ["${neovim-nix}/bin/nvim"]; + WorkingDir = "/home/neovim/demo"; + Volumes = {"/home/neovim/demo" = {};}; + }; + }; + } + // ( + if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"]) + then {tidal = config.legacyPackages.neovim-tidal;} + else {} + ); }; } diff --git a/flake/pkgs/by-name/avante-nvim/package.nix b/flake/pkgs/by-name/avante-nvim/package.nix deleted file mode 100644 index 20b6f3c5..00000000 --- a/flake/pkgs/by-name/avante-nvim/package.nix +++ /dev/null @@ -1,82 +0,0 @@ -{ - lib, - pins, - openssl, - pkg-config, - rustPlatform, - stdenv, - vimUtils, - makeWrapper, - pkgs, - ... -}: let - # From npins - pin = pins.avante-nvim; - - pname = "avante-nvim-lib"; - version = pin.branch; - src = pkgs.fetchFromGitHub { - inherit (pin.repository) owner repo; - rev = pin.revision; - sha256 = pin.hash; - }; - - avante-nvim-lib = rustPlatform.buildRustPackage { - inherit pname version src; - - cargoHash = "sha256-pTWCT2s820mjnfTscFnoSKC37RE7DAPKxP71QuM+JXQ="; - - nativeBuildInputs = [ - pkg-config - makeWrapper - pkgs.perl - ]; - - buildInputs = [ - openssl - ]; - - buildFeatures = ["luajit"]; - - checkFlags = [ - # Disabled because they access the network. - "--skip=test_hf" - "--skip=test_public_url" - "--skip=test_roundtrip" - "--skip=test_fetch_md" - ]; - - env.RUSTFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-C link-arg=-undefined -C link-arg=dynamic_lookup"; - }; -in - vimUtils.buildVimPlugin { - pname = "avante-nvim"; - inherit version src; - - doCheck = false; - - postInstall = let - ext = stdenv.hostPlatform.extensions.sharedLibrary; - in '' - mkdir -p $out/build - for lib in "avante_repo_map" "avante_templates" "avante_tokenizers" "avante_html2md"; do - ln -s ${avante-nvim-lib}/lib/lib$lib${ext} $out/build/$lib${ext} - done - ''; - - nvimSkipModules = [ - # Requires setup with corresponding provider - "avante.providers.azure" - "avante.providers.copilot" - "avante.providers.gemini" - "avante.providers.ollama" - "avante.providers.vertex" - "avante.providers.vertex_claude" - ]; - - meta = { - description = "Neovim plugin designed to emulate the behaviour of the Cursor AI IDE"; - homepage = "https://github.com/yetone/avante.nvim"; - license = lib.licenses.asl20; - }; - } diff --git a/flake/pkgs/by-name/blink-cmp/package.nix b/flake/pkgs/by-name/blink-cmp/package.nix deleted file mode 100644 index 7c6371d1..00000000 --- a/flake/pkgs/by-name/blink-cmp/package.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ - lib, - stdenv, - rustPlatform, - fetchFromGitHub, - writeShellScriptBin, -}: -rustPlatform.buildRustPackage (finalAttrs: { - pname = "blink-cmp"; - version = "1.8.0"; - - src = fetchFromGitHub { - owner = "Saghen"; - repo = "blink.cmp"; - tag = "v${finalAttrs.version}"; - hash = "sha256-JjlcPj7v9J+v1SDBYIub6jFEslLhZGHmsipV1atUAFo="; - }; - - forceShare = [ - "man" - "info" - ]; - - postInstall = '' - cp -r {lua,plugin} "$out" - - mkdir -p "$out/doc" - cp 'doc/'*'.txt' "$out/doc/" - - mkdir -p "$out/target" - mv "$out/lib" "$out/target/release" - ''; - - cargoHash = "sha256-Qdt8O7IGj2HySb1jxsv3m33ZxJg96Ckw26oTEEyQjfs="; - - nativeBuildInputs = [ - (writeShellScriptBin "git" "exit 1") - ]; - - env = { - RUSTC_BOOTSTRAP = true; - - # Those are the Linker args used by upstream. Without those, the build fails. - # See: - # - RUSTFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-C link-arg=-undefined -C link-arg=dynamic_lookup"; - }; - - meta = { - description = "Performant, batteries-included completion plugin for Neovim"; - homepage = "https://github.com/saghen/blink.cmp"; - changelog = "https://github.com/Saghen/blink.cmp/blob/v${finalAttrs.version}/CHANGELOG.md"; - }; -}) diff --git a/flake/pkgs/by-name/prettier-plugin-astro/package.nix b/flake/pkgs/by-name/prettier-plugin-astro/package.nix deleted file mode 100644 index d893da7c..00000000 --- a/flake/pkgs/by-name/prettier-plugin-astro/package.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ - stdenv, - fetchFromGitHub, - nodejs, - pnpm_9, - pins, -}: let - pin = pins.prettier-plugin-astro; -in - stdenv.mkDerivation (finalAttrs: { - pname = "prettier-plugin-astro"; - version = pin.version or pin.revision; - - src = fetchFromGitHub { - inherit (pin.repository) owner repo; - rev = finalAttrs.version; - sha256 = pin.hash; - }; - - pnpmDeps = pnpm_9.fetchDeps { - inherit (finalAttrs) pname src; - fetcherVersion = 2; - hash = "sha256-K7pIWLkIIbUKDIcysfEtcf/eVMX9ZgyFHdqcuycHCNE="; - }; - - nativeBuildInputs = [ - nodejs - pnpm_9.configHook - ]; - - buildPhase = '' - runHook preBuild - - pnpm run build - - runHook postBuild - ''; - - installPhase = '' - runHook preInstall - - # mkdir -p $out/dist - cp -r dist/ $out - cp -r node_modules $out - - runHook postInstall - ''; - }) diff --git a/flake/pkgs/by-name/prettier-plugin-svelte/package.nix b/flake/pkgs/by-name/prettier-plugin-svelte/package.nix deleted file mode 100644 index 540ff2b7..00000000 --- a/flake/pkgs/by-name/prettier-plugin-svelte/package.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - buildNpmPackage, - fetchFromGitHub, - pins, -}: let - pin = pins.prettier-plugin-svelte; -in - buildNpmPackage (finalAttrs: { - pname = "prettier-plugin-svelte"; - version = pin.version or pin.revision; - - src = fetchFromGitHub { - inherit (pin.repository) owner repo; - rev = finalAttrs.version; - sha256 = pin.hash; - }; - - npmDepsHash = "sha256-D+gDdKiIG38jV+M/BqTKf0yYj1KXpbIodtQFdzocpn8="; - }) diff --git a/flake/templates/default.nix b/flake/templates/default.nix deleted file mode 100644 index 58cd7fa7..00000000 --- a/flake/templates/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - flake.templates = { - standalone = { - path = ./standalone; - description = "Standalone flake template for nvf"; - welcomeText = '' - Template flake.nix has been created in flake.nix! - - Note that this is a very basic example to bootstrap nvf for you. Please edit your - configuration as described in the nvf manual before using this template. The - configured packages will be ran with 'nix run .' or 'nix run .#neovimConfigured' - - Happy editing! - ''; - }; - }; -} diff --git a/flake/templates/standalone/flake.nix b/flake/templates/standalone/flake.nix deleted file mode 100644 index 1057a6d5..00000000 --- a/flake/templates/standalone/flake.nix +++ /dev/null @@ -1,74 +0,0 @@ -{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - nvf.url = "github:notashelf/nvf"; - }; - - outputs = { - self, - nixpkgs, - ... - } @ inputs: let - # An abstraction over systems to easily provide the same package - # for multiple systems. This is preferable to abstraction libraries. - forEachSystem = nixpkgs.lib.genAttrs ["x86_64-linux"]; - in { - packages = forEachSystem (system: let - pkgs = inputs.nixpkgs.legacyPackages.${system}; - - # A module to be evaluated via lib.evalModules inside nvf's module system. - # All options supported by nvf will go under config.vim to create the final - # wrapped package. You may also add some new *options* under options.* to - # expand the module system. - configModule = { - # You may browse available options for nvf on the online manual. Please see - # - config.vim = { - theme.enable = true; - - lsp = { - # Enable LSP functionality globally. This is required for modules found - # in `vim.languages` to enable relevant LSPs. - enable = true; - - # You may define your own LSP configurations using `vim.lsp.servers` in - # nvf without ever needing lspconfig to do it. This will use the native - # API provided by Neovim > 0.11 - servers = {}; - }; - - # Language support and automatic configuration of companion plugins. - # Note that enabling, e.g., languages..diagnostics will automatically - # enable top-level options such as enableLSP or enableExtraDiagnostics as - # they are needed. - languages = { - enableFormat = true; - enableTreesitter = true; - enableExtraDiagnostics = true; - - # Nix language and diagnostics. - nix.enable = true; - }; - }; - }; - - # Evaluate any and all modules to create the wrapped Neovim package. - neovimConfigured = inputs.nvf.lib.neovimConfiguration { - inherit pkgs; - - modules = [ - # Configuration module to be imported. You may define multiple modules - # or even import them from other files (e.g., ./modules/lsp.nix) to - # better modularize your configuration. - configModule - ]; - }; - in { - # Packages to be exposed under packages.. Those can accessed - # directly from package outputs in other flakes if this flake is added - # as an input. You may run those packages with 'nix run .#' - default = self.packages.${system}.neovim; - neovimConfigured = neovimConfigured.neovim; - }); - }; -} diff --git a/lib/attrsets.nix b/lib/attrsets.nix deleted file mode 100644 index 59275af9..00000000 --- a/lib/attrsets.nix +++ /dev/null @@ -1,5 +0,0 @@ -{lib}: let - inherit (builtins) listToAttrs; -in { - mapListToAttrs = f: list: listToAttrs (map f list); -} diff --git a/lib/binds.nix b/lib/binds.nix index bb40a89e..d42a4142 100644 --- a/lib/binds.nix +++ b/lib/binds.nix @@ -66,9 +66,7 @@ mkSetLuaBinding = binding: action: mkLuaBinding binding.value action binding.description; - pushDownDefault = attr: mapAttrs (_: mkDefault) attr; - - mkKeymap = mode: key: action: opt: opt // {inherit mode key action;}; + pushDownDefault = attr: mapAttrs (_: value: mkDefault value) attr; }; in binds diff --git a/lib/dag.nix b/lib/dag.nix index db5d53b7..ccb2a61c 100644 --- a/lib/dag.nix +++ b/lib/dag.nix @@ -8,10 +8,10 @@ # - the addition of the function `entryBefore` indicating a "wanted # by" relationship. {lib}: let - inherit (builtins) isAttrs attrValues attrNames elem all head tail length toJSON isString removeAttrs; + inherit (builtins) isAttrs attrValues attrNames elem all head tail length; inherit (lib.attrsets) filterAttrs mapAttrs; inherit (lib.lists) toposort; - inherit (lib.nvim.dag) empty isEntry entryBetween entryAfter entriesBetween entryAnywhere topoSort; + inherit (lib.nvim.dag) empty isEntry entryBetween entryAfter entriesBetween; in { empty = {}; @@ -24,7 +24,7 @@ in { entryAfter, and entryBefore to a topologically sorted list of entries. - Internally this function uses the `topoSort` function in + Internally this function uses the `toposort` function in `` and its value is accordingly. Specifically, the result on success is @@ -84,7 +84,7 @@ in { normalizedDag = mapAttrs (n: v: { name = n; - inherit (v) data; + data = v.data; after = v.after ++ dagBefore dag n; }) dag; @@ -117,6 +117,7 @@ in { entriesBetween = tag: let go = i: before: after: entries: let name = "${tag}-${toString i}"; + i' = i + 1; in if entries == [] then empty @@ -136,44 +137,19 @@ in { entriesAfter = tag: entriesBetween tag []; entriesBefore = tag: before: entriesBetween tag before []; - # mkLuarcSection takes a section DAG, containing 'name' and 'data' fields - # then returns a string containing a comment to identify the section, and - # the data contained within the section. + # mkLuarcSection and mkVimrcSection take a section DAG + # and return a string containing a comment to identify # the section, and the data contained within the section # - # All operations are done without any modifications to the inputted section - # data, but if a non-string is passed to name or data, then it will try to - # coerce it into a string, which may fail. Setting data to "" or null will - # return an empty string. - # - # section.data should never be null, though taking 'null' as a value that - # can "clear" the DAG might come in handy for filtering sections more easily. - # Or perhaps simply unsetting them from an user perspective. - mkLuarcSection = section: - if section.data == "" || section.data == null - then "" - else '' - -- SECTION: ${section.name} - ${section.data} - ''; + # all operations are done without any modifications + # to the inputted section data + mkLuarcSection = section: '' + -- SECTION: ${section.name} + ${section.data} + ''; - resolveDag = { - name, - dag, - mapResult, - }: let - # When the value is a string, default it to dag.entryAnywhere - finalDag = mapAttrs (_: value: - if isString value - then entryAnywhere value - else value) - dag; - sortedDag = topoSort finalDag; - loopDetail = map (loops: removeAttrs loops ["data"]) sortedDag.loops; - result = - if sortedDag ? result - then mapResult sortedDag.result - else abort ("Dependency cycle in ${name}: " + toJSON loopDetail); - in - result; + mkVimrcSection = section: '' + " SECTION: ${section.name} + ${section.data} + ''; } diff --git a/lib/default.nix b/lib/default.nix index c4388e82..eade2e2f 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,16 +1,15 @@ { - self, inputs, lib, ... }: { - types = import ./types {inherit lib self;}; + types = import ./types {inherit inputs lib;}; + config = import ./config.nix {inherit lib;}; binds = import ./binds.nix {inherit lib;}; dag = import ./dag.nix {inherit lib;}; languages = import ./languages.nix {inherit lib;}; lists = import ./lists.nix {inherit lib;}; - attrsets = import ./attrsets.nix {inherit lib;}; lua = import ./lua.nix {inherit lib;}; - neovimConfiguration = import ../modules {inherit self inputs lib;}; + vim = import ./vim.nix; } diff --git a/lib/languages.nix b/lib/languages.nix index 899d9ea8..e47202ee 100644 --- a/lib/languages.nix +++ b/lib/languages.nix @@ -1,80 +1,37 @@ +# From home-manager: https://github.com/nix-community/home-manager/blob/master/modules/lib/booleans.nix {lib}: let inherit (builtins) isString getAttr; inherit (lib.options) mkOption; - inherit (lib.types) listOf bool str submodule attrsOf anything either nullOr uniq; - inherit (lib.nvim.attrsets) mapListToAttrs; - inherit (lib.nvim.types) luaInline; + inherit (lib.attrsets) listToAttrs; + inherit (lib.types) bool; in { - # TODO: remove + # Converts a boolean to a yes/no string. This is used in lots of + # configuration formats. diagnosticsToLua = { lang, config, diagnosticsProviders, }: - mapListToAttrs - (v: let - type = - if isString v - then v - else getAttr v.type; - package = - if isString v - then diagnosticsProviders.${type}.package - else v.package; - in { - name = "${lang}-diagnostics-${type}"; - value = diagnosticsProviders.${type}.nullConfig package; - }) - config; + listToAttrs + (map (v: let + type = + if isString v + then v + else getAttr v.type; + package = + if isString v + then diagnosticsProviders.${type}.package + else v.package; + in { + name = "${lang}-diagnostics-${type}"; + value = diagnosticsProviders.${type}.nullConfig package; + }) + config); mkEnable = desc: mkOption { - default = false; - type = bool; description = "Turn on ${desc} for enabled languages by default"; + type = bool; + default = false; }; - - lspOptions = submodule { - freeformType = attrsOf anything; - options = { - enable = mkOption { - type = bool; - default = true; - description = "Whether to enable this LSP server."; - }; - - capabilities = mkOption { - type = nullOr (either luaInline (attrsOf anything)); - default = null; - description = "LSP capabilities to pass to LSP server configuration"; - }; - - on_attach = mkOption { - type = nullOr luaInline; - default = null; - description = "Function to execute when an LSP server attaches to a buffer"; - }; - - filetypes = mkOption { - type = nullOr (listOf str); - default = null; - description = "Filetypes to auto-attach LSP server in"; - }; - - cmd = mkOption { - type = nullOr (either luaInline (uniq (listOf str))); - default = null; - description = "Command used to start the LSP server"; - }; - - root_markers = mkOption { - type = nullOr (listOf str); - default = null; - description = '' - "root markers" used to determine the root directory of the workspace, and - the filetypes associated with this LSP server. - ''; - }; - }; - }; } diff --git a/lib/lua.nix b/lib/lua.nix index bf879031..9e67b3f5 100644 --- a/lib/lua.nix +++ b/lib/lua.nix @@ -1,52 +1,102 @@ # Helpers for converting values to lua {lib}: let + 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 { + wrapLuaConfig = { + luaBefore ? "", + luaConfig, + luaAfter ? "", + }: '' + lua << EOF + ${concatStringsSep "\n" [luaBefore luaConfig luaAfter]} + EOF + ''; + + # Convert a null value to lua's nil + nullString = value: + if value == null + then "nil" + else "'${value}'"; + + # convert an expression to lua + expToLua = exp: + if isList exp + then listToLuaTable exp # if list, convert to lua table + else if isAttrs exp + then attrsetToLuaTable exp # if attrs, convert to table + 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 (toJSON exp); # otherwise jsonify the value and print as is + + # convert list to a lua table + listToLuaTable = list: + "{ " + (concatStringsSep ", " (map expToLua list)) + " }"; + + # convert attrset to a lua table + attrsetToLuaTable = attrset: + "{ " + + ( + concatStringsSep ", " + ( + mapAttrsToList ( + name: value: + name + + " = " + + (expToLua value) + ) + attrset + ) + ) + + " }"; + # Convert a list of lua expressions to a lua table. The difference to listToLuaTable is that the elements here are expected to be lua expressions already, whereas listToLuaTable converts from nix types to lua first + luaTable = items: ''{${concatStringsSep "," items}}''; + isLuaInline = object: (object._type or null) == "lua-inline"; toLuaObject = args: - { - int = toString args; - float = toString args; - - # escapes \ and quotes - string = builtins.toJSON args; - path = builtins.toJSON args; - - bool = lib.boolToString args; - null = "nil"; - - list = "{${lib.concatMapStringsSep ",\n" toLuaObject args}}"; - - set = - if lib.isDerivation args - then ''"${args}"'' - else if isLuaInline args - then args.expr - else "{${ - lib.pipe args [ - (lib.filterAttrs (_: v: v != null)) - (builtins.mapAttrs ( - n: v: - if lib.hasPrefix "@" n - then toLuaObject v - else "[${toLuaObject n}] = ${toLuaObject v}" - )) - builtins.attrValues - (lib.concatStringsSep ",\n") - ] - }}"; - } - .${ - builtins.typeOf args - } - or (builtins.throw "Could not convert object of type `${builtins.typeOf args}` to lua object"); -in - { - inherit isLuaInline toLuaObject; - luaTable = x: (toLuaObject (map lib.mkLuaInline x)); - } - // lib.genAttrs [ - "nullString" - "expToLua" - "listToLuaTable" - "attrsetToLuaTable" - ] (name: lib.warn "${name} is deprecated use toLuaObject instead" toLuaObject) + if isAttrs args + then + if isLuaInline args + then args.expr + else if hasAttr "__empty" args + then "{ }" + else + "{" + + (concatStringsSep "," + (mapAttrsToList + (n: v: + if head (stringToCharacters n) == "@" + then toLuaObject v + else "[${toLuaObject n}] = " + (toLuaObject v)) + (filterAttrs + ( + _: v: + (v != null) && (toLuaObject v != "{}") + ) + args))) + + "}" + else if isList args + then "{" + concatMapStringsSep "," toLuaObject args + "}" + else if isString args + then + # This should be enough! + toJSON args + else if isPath args + then toJSON (toString args) + else if isBool args + then "${boolToString args}" + else if isFloat args + then "${toString args}" + else if isInt args + then "${toString args}" + else if (args == null) + then "nil" + else throw "could not convert object of type `${typeOf args}` to lua object"; +} diff --git a/lib/stdlib-extended.nix b/lib/stdlib-extended.nix index 403c7b28..4bd63b98 100644 --- a/lib/stdlib-extended.nix +++ b/lib/stdlib-extended.nix @@ -1,7 +1,7 @@ # Convenience function that returns the given Nixpkgs standard library # extended with our functions using `lib.extend`. -{inputs, ...} @ args: -inputs.nixpkgs.lib.extend (self: super: { +nixpkgsLib: inputs: +nixpkgsLib.extend (self: super: { # WARNING: New functions should not be added here, but to files # imported by `./default.nix` under their own categories. If your # function does not fit to any of the existing categories, create @@ -12,7 +12,7 @@ inputs.nixpkgs.lib.extend (self: super: { # E.g. for an input called `nvf`, `inputs.nvf.lib.nvim` will return the set # below. nvim = import ./. { - inherit (args) inputs self; + inherit inputs; lib = self; }; diff --git a/lib/types/custom.nix b/lib/types/custom.nix deleted file mode 100644 index f6905b02..00000000 --- a/lib/types/custom.nix +++ /dev/null @@ -1,42 +0,0 @@ -{lib}: let - inherit (builtins) toJSON; - inherit (lib.options) mergeEqualOption; - inherit (lib.lists) singleton; - inherit (lib.strings) isString stringLength match; - inherit (lib.types) listOf mkOptionType coercedTo; - inherit (lib.trivial) warn; -in { - mergelessListOf = elemType: - mkOptionType { - name = "mergelessListOf"; - description = "mergeless list of ${elemType.description or "values"}"; - inherit (lib.types.listOf elemType) check; - merge = mergeEqualOption; - }; - - char = mkOptionType { - name = "char"; - description = "character"; - descriptionClass = "noun"; - check = value: stringLength value < 2; - merge = mergeEqualOption; - }; - - hexColor = mkOptionType { - name = "hex-color"; - descriptionClass = "noun"; - description = "RGB color in hex format"; - check = v: isString v && (match "#?[0-9a-fA-F]{6}" v) != null; - }; - - # no compound types please - deprecatedSingleOrListOf = option: t: - coercedTo - t - (x: - warn '' - ${option} no longer accepts non-list values, use [${toJSON x}] instead - '' - (singleton x)) - (listOf t); -} diff --git a/lib/types/dag.nix b/lib/types/dag.nix index 6d289e27..a42ed513 100644 --- a/lib/types/dag.nix +++ b/lib/types/dag.nix @@ -62,13 +62,7 @@ in rec { inherit (elemType) getSubModules; getSubOptions = prefix: elemType.getSubOptions (prefix ++ [""]); substSubModules = m: dagOf (elemType.substSubModules m); - functor = { - name = name; - type = dagOf; - wrapped = elemType; - payload = elemType; - binOp = a: b: a; - }; + functor = (defaultFunctor name) // {wrapped = elemType;}; nestedTypes.elemType = elemType; }; } diff --git a/lib/types/default.nix b/lib/types/default.nix index 66adfbbc..d00be95e 100644 --- a/lib/types/default.nix +++ b/lib/types/default.nix @@ -1,14 +1,13 @@ { + inputs, lib, - self, + ... }: let typesDag = import ./dag.nix {inherit lib;}; - typesPlugin = import ./plugins.nix {inherit lib self;}; + typesPlugin = import ./plugins.nix {inherit inputs lib;}; typesLanguage = import ./languages.nix {inherit lib;}; - customTypes = import ./custom.nix {inherit lib;}; in { inherit (typesDag) dagOf; - inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType; + inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline; inherit (typesLanguage) diagnostics mkGrammarOption; - inherit (customTypes) char hexColor mergelessListOf deprecatedSingleOrListOf; } diff --git a/lib/types/languages.nix b/lib/types/languages.nix index b1865c41..e47f9644 100644 --- a/lib/types/languages.nix +++ b/lib/types/languages.nix @@ -1,37 +1,31 @@ -{lib}: let - inherit (lib.options) mkOption mkPackageOption; - inherit (lib.attrsets) attrNames; - inherit (lib.types) listOf either enum submodule package; - +{lib}: +with lib; let diagnosticSubmodule = _: { options = { type = mkOption { description = "Type of diagnostic to enable"; type = attrNames diagnostics; }; - package = mkOption { - type = package; description = "Diagnostics package"; + type = types.package; }; }; }; - +in { diagnostics = { langDesc, diagnosticsProviders, defaultDiagnosticsProvider, }: mkOption { - type = listOf (either (enum (attrNames diagnosticsProviders)) (submodule diagnosticSubmodule)); - default = defaultDiagnosticsProvider; description = "List of ${langDesc} diagnostics to enable"; + type = with types; listOf (either (enum (attrNames diagnosticsProviders)) (submodule diagnosticSubmodule)); + default = defaultDiagnosticsProvider; }; mkGrammarOption = pkgs: grammar: mkPackageOption pkgs ["${grammar} treesitter"] { default = ["vimPlugins" "nvim-treesitter" "builtGrammars" grammar]; }; -in { - inherit diagnostics diagnosticSubmodule mkGrammarOption; } diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index 4be39289..d9cc5f2b 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -1,11 +1,12 @@ { + inputs, lib, - self, + ... }: let inherit (lib.options) mkOption; inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair; - inherit (lib.strings) hasPrefix removePrefix; - inherit (lib.types) submodule either package enum str lines anything listOf nullOr; + inherit (lib.strings) hasPrefix removePrefix isString; + inherit (lib.types) submodule either package enum str lines attrsOf anything listOf nullOr; # Get the names of all flake inputs that start with the given prefix. fromInputs = { @@ -14,8 +15,11 @@ }: mapAttrs' (n: v: nameValuePair (removePrefix prefix n) {src = v;}) (filterAttrs (n: _: hasPrefix prefix n) inputs); - # Get the names of all npins - pluginInputNames = ["blink-cmp"] ++ attrNames self.pins; + # Get the names of all flake inputs that start with the given prefix. + pluginInputNames = attrNames (fromInputs { + inherit inputs; + prefix = "plugin-"; + }); # You can either use the name of the plugin or a package. pluginType = nullOr ( @@ -47,12 +51,8 @@ }; }; }; - - borderPresets = ["none" "single" "double" "rounded" "solid" "shadow"]; in { - inherit extraPluginType fromInputs pluginType; - - borderType = either (enum borderPresets) (listOf (either str (listOf str))); + inherit extraPluginType fromInputs; pluginsOpt = { description, @@ -93,7 +93,7 @@ in { default = {}; type = submodule { - freeformType = anything; + freeformType = attrsOf anything; options = opts; }; }; diff --git a/lib/vim.nix b/lib/vim.nix new file mode 100644 index 00000000..da5bf558 --- /dev/null +++ b/lib/vim.nix @@ -0,0 +1,26 @@ +let + inherit (builtins) isInt isBool toJSON toString; +in rec { + # yes? no. + yesNo = value: + if value + then "yes" + else "no"; + + # convert a boolean to a vim compliant boolean string + mkVimBool = val: + if val + then "1" + else "0"; + + # convert a literal value to a vim compliant value + valToVim = val: + if (isInt val) + then (toString val) + else + ( + if (isBool val) + then (mkVimBool val) + else (toJSON val) + ); +} diff --git a/modules/default.nix b/modules/default.nix index a479bae2..fa72b9b4 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,51 +1,124 @@ -{ - self, - inputs, - lib, -}: { +inputs: { + configuration, pkgs, + lib ? pkgs.lib, + check ? true, extraSpecialArgs ? {}, - modules ? [], - # deprecated extraModules ? [], - configuration ? {}, }: let - inherit (lib.strings) toString; - inherit (lib.lists) concatLists; + inherit (builtins) map filter isString toString getAttr; + inherit (pkgs) wrapNeovimUnstable vimPlugins; + inherit (pkgs.vimUtils) buildVimPlugin; + inherit (pkgs.neovimUtils) makeNeovimConfig; + inherit (lib.strings) makeBinPath escapeShellArgs concatStringsSep; + inherit (lib.lists) concatLists optional; + inherit (lib.attrsets) recursiveUpdate; + inherit (lib.asserts) assertMsg; + + # call the extedended library with `lib` and `inputs` as arguments + # lib is used to provide the standard library functions to the extended library + # but it can be overridden while this file is being called + # inputs is used to pass inputs to the plugin autodiscovery function + extendedLib = import ../lib/stdlib-extended.nix lib inputs; # import modules.nix with `check`, `pkgs` and `lib` as arguments # check can be disabled while calling this file is called # to avoid checking in all modules - nvimModules = import ./modules.nix {inherit pkgs lib;}; + nvimModules = import ./modules.nix { + inherit check pkgs; + lib = extendedLib; + }; # evaluate the extended library with the modules # optionally with any additional modules passed by the user - module = lib.evalModules { - specialArgs = - extraSpecialArgs - // { - inherit self inputs; - modulesPath = toString ./.; - }; - modules = concatLists [ - nvimModules - modules - (lib.optional (configuration != {}) (lib.warn '' - nvf: passing 'configuration' to lib.neovimConfiguration is deprecated. - '' - configuration)) - - (lib.optionals (extraModules != []) (lib.warn '' - nvf: passing 'extraModules' to lib.neovimConfiguration is deprecated, use 'modules' instead. - '' - extraModules)) - ]; + module = extendedLib.evalModules { + specialArgs = recursiveUpdate {modulesPath = toString ./.;} extraSpecialArgs; + modules = concatLists [[configuration] nvimModules extraModules]; }; + + # alias to the internal configuration + vimOptions = module.config.vim; + + # build a vim plugin with the given name and arguments + # if the plugin is nvim-treesitter, warn the user to use buildTreesitterPlug + # instead + buildPlug = {pname, ...} @ args: + assert assertMsg (pname != "nvim-treesitter") "Use buildTreesitterPlug for building nvim-treesitter."; + buildVimPlugin (args + // { + version = "master"; + src = getAttr ("plugin-" + pname) inputs; + }); + + buildTreesitterPlug = grammars: vimPlugins.nvim-treesitter.withPlugins (_: grammars); + + buildConfigPlugins = plugins: + map + (plug: ( + if (isString plug) + then + ( + if (plug == "nvim-treesitter") + then (buildTreesitterPlug vimOptions.treesitter.grammars) + else if (plug == "flutter-tools-patched") + then + (buildPlug { + pname = "flutter-tools"; + patches = [../patches/flutter-tools.patch]; + }) + else (buildPlug {pname = plug;}) + ) + else plug + )) + (filter + (f: f != null) + plugins); + + # built (or "normalized") plugins that are modified + builtStartPlugins = buildConfigPlugins vimOptions.startPlugins; + builtOptPlugins = map (package: { + plugin = package; + optional = false; + }) (buildConfigPlugins vimOptions.optPlugins); + + # combine built start and optional plugins + # into a single list + plugins = builtStartPlugins ++ builtOptPlugins; + + # additional Lua and Python3 packages, mapped to their respective functions + # to conform to the format makeNeovimConfig expects. end user should + # only ever need to pass a list of packages, which are modified + # here + extraLuaPackages = ps: map (x: ps.${x}) vimOptions.luaPackages; + extraPython3Packages = ps: map (x: ps.${x}) vimOptions.python3Packages; + + extraWrapperArgs = + concatStringsSep " " (optional (vimOptions.extraPackages != []) ''--prefix PATH : "${makeBinPath vimOptions.extraPackages}"''); + + # wrap user's desired neovim package with the desired neovim configuration + # using wrapNeovimUnstable and makeNeovimConfig from nixpkgs. + # the makeNeovimConfig function takes the following arguments: + # - withPython (bool) + # - extraPython3Packages (lambda) + # - withNodeJs (bool) + # - withRuby (bool) + # - extraLuaPackages (lambda) + # - plugins (list) + # - customRC (string) + # and returns the wrapped package + neovimConfigured = makeNeovimConfig { + inherit (vimOptions) viAlias vimAlias withRuby withNodeJs withPython3; + inherit plugins extraLuaPackages extraPython3Packages; + customRC = vimOptions.builtConfigRC; + }; + + neovim-wrapped = wrapNeovimUnstable vimOptions.package (recursiveUpdate neovimConfigured { + wrapperArgs = escapeShellArgs neovimConfigured.wrapperArgs + " " + extraWrapperArgs; + }); in { inherit (module) options config; inherit (module._module.args) pkgs; - # Expose wrapped neovim-package for userspace - # or module consumption. - neovim = module.config.vim.build.finalPackage; + # expose wrapped neovim-package + neovim = neovim-wrapped; } diff --git a/modules/extra/deprecations.nix b/modules/extra/deprecations.nix deleted file mode 100644 index 7012feac..00000000 --- a/modules/extra/deprecations.nix +++ /dev/null @@ -1,312 +0,0 @@ -{lib, ...}: let - inherit (builtins) head; - inherit (lib.modules) mkRemovedOptionModule mkRenamedOptionModule doRename; - inherit (lib.lists) concatLists; - inherit (lib.nvim.config) batchRenameOptions; - inherit (lib.trivial) warn; - - renamedVimOpts = batchRenameOptions ["vim"] ["vim" "options"] { - # 2024-12-01 - colourTerm = "termguicolors"; - mouseSupport = "mouse"; - cmdHeight = "cmdheight"; - updateTime = "updatetime"; - mapTimeout = "tm"; - cursorlineOpt = "cursorlineopt"; - splitBelow = "splitbelow"; - splitRight = "splitright"; - autoIndent = "autoindent"; - wordWrap = "wrap"; - showSignColumn = "signcolumn"; - - # 2025-02-07 - scrollOffset = "scrolloff"; - }; - - mkRemovedLspOpt = lang: (mkRemovedOptionModule ["vim" "languages" lang "lsp" "opts"] '' - `vim.languages.${lang}.lsp.opts` is now moved to `vim.lsp.servers..init_options` - ''); - - mkRemovedLspPackage = lang: (mkRemovedOptionModule ["vim" "languages" lang "lsp" "package"] '' - `vim.languages.${lang}.lsp.package` is now moved to `vim.lsp.servers..cmd` - ''); - - mkRenamedLspServer = lang: - doRename - { - from = ["vim" "languages" lang "lsp" "server"]; - to = ["vim" "languages" lang "lsp" "servers"]; - visible = false; - warn = true; - use = x: - warn - "Obsolete option `vim.languages.${lang}.lsp.server` used, use `vim.languages.${lang}.lsp.servers` instead." - (head x); - }; - - mkRemovedFormatPackage = lang: (mkRemovedOptionModule ["vim" "languages" lang "format" "package"] '' - `vim.languages.${lang}.format.package` is removed, please use `vim.formatter.conform-nvim.formatters..command` instead. - ''); -in { - imports = concatLists [ - [ - # 2024-06-06 - (mkRemovedOptionModule ["vim" "tidal"] '' - Tidalcycles language support has been removed as of 2024-06-06 as it was long unmaintained. If - you depended on this functionality, please open an issue. - '') - - # 2024-07-20 - (mkRemovedOptionModule ["vim" "lsp" "nvimCodeActionMenu"] '' - nvimCodeActionMenu has been deprecated and removed upstream. As of 0.7, fastaction will be - available under `vim.ui.fastaction` as a replacement. Simply remove everything under - `vim.lsp.nvimCodeActionMenu`, and set `vim.ui.fastaction.enable` to `true`. - '') - - (mkRemovedOptionModule ["vim" "autopairs" "enable"] '' - vim.autopairs.enable has been removed in favor of per-plugin modules. - You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead. - '') - - (mkRemovedOptionModule ["vim" "autopairs" "type"] '' - vim.autopairs.type has been removed in favor of per-plugin modules. - You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead. - '') - - (mkRemovedOptionModule ["vim" "autocomplete" "enable"] '' - vim.autocomplete.enable has been removed in favor of per-plugin modules. - You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead. - '') - - (mkRemovedOptionModule ["vim" "autocomplete" "type"] '' - vim.autocomplete.type has been removed in favor of per-plugin modules. - You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead. - '') - - (mkRemovedOptionModule ["vim" "autocomplete" "sources"] '' - vim.autocomplete.sources has been removed in favor of per-plugin modules. - You can add nvim-cmp sources with vim.autocomplete.nvim-cmp.sources - instead. - '') - - (mkRemovedOptionModule ["vim" "snippets" "vsnip" "enable"] '' - vim.snippets.vsnip.enable has been removed in favor of the more modern luasnip. - '') - (mkRenamedOptionModule ["vim" "lsp" "lspkind" "mode"] ["vim" "lsp" "lspkind" "setupOpts" "mode"]) - - # 2024-10-14 - (mkRemovedOptionModule ["vim" "configRC"] '' - Please migrate your configRC sections to Neovim's Lua format, and - add them to `vim.luaConfigRC`. - - See the v0.7 release notes for more information on why and how to - migrate your existing configurations to the new format. - '') - - (mkRemovedOptionModule ["vim" "disableDefaultRuntimePaths"] '' - Nvf now uses $NVIM_APP_NAME so there is no longer the problem of - (accidental) leaking of user configuration. - '') - - (mkRemovedOptionModule ["vim" "lsp" "trouble" "mappings" "toggle"] '' - With Trouble having so many different modes, and breaking changes - upstream, it no longer makes sense, nor works, to toggle only Trouble. - '') - - # 2024-11-30 - (mkRenamedOptionModule ["vim" "leaderKey"] ["vim" "globals" "mapleader"]) - - (mkRemovedOptionModule ["vim" "tabWidth"] '' - Previous behaviour of this option was confusing and undocumented. Please set - `tabstop` and `shiftwidth` manually in `vim.options` or per-filetype in a - `ftplugin` directory added to your runtime path. - '') - - # 2024-12-02 - (mkRenamedOptionModule ["vim" "enableEditorconfig"] ["vim" "globals" "editorconfig"]) - - # 2025-02-06 - (mkRemovedOptionModule ["vim" "disableArrows"] '' - Top-level convenience options are now in the process of being removed from nvf as - their behaviour was abstract, and confusing. Please use 'vim.options' or 'vim.luaConfigRC' - to replicate previous behaviour. - '') - - # 2025-04-04 - (mkRemovedOptionModule ["vim" "lsp" "lsplines"] '' - lsplines module has been removed from nvf, as its functionality is now built into Neovim - under the diagnostics module. Please consider using one of 'vim.diagnostics.config' or - 'vim.luaConfigRC' to configure LSP lines for Neovim through its own diagnostics API. - '') - - # 2025-05-04 - (mkRemovedOptionModule ["vim" "useSystemClipboard"] '' - Clipboard behaviour should now be controlled through the new, more fine-grained module - interface found in 'vim.clipboard'. To replicate previous behaviour, you may either - add 'vim.opt.clipboard:append("unnamedplus")' in luaConfigRC, or preferably set it - in 'vim.clipboard.registers'. Please see the documentation for the new module for more - details, or open an issue if you are confused. - '') - - # 2025-07-12 - (mkRenamedLspServer "assembly") - - (mkRenamedLspServer "astro") - (mkRemovedLspPackage "astro") - - (mkRenamedLspServer "bash") - (mkRemovedLspPackage "bash") - - (mkRemovedLspOpt "clang") - (mkRemovedLspPackage "clang") - (mkRenamedLspServer "clang") - - (mkRemovedLspPackage "clojure") - - (mkRenamedLspServer "csharp") - (mkRemovedLspPackage "csharp") - - (mkRenamedLspServer "css") - (mkRemovedLspPackage "css") - - (mkRemovedLspPackage "cue") - - (mkRenamedLspServer "dart") - (mkRemovedLspPackage "dart") - (mkRemovedLspOpt "dart") - - (mkRenamedLspServer "elixir") - (mkRemovedLspPackage "elixir") - - (mkRenamedLspServer "fsharp") - (mkRemovedLspPackage "fsharp") - - (mkRenamedLspServer "gleam") - (mkRemovedLspPackage "gleam") - - (mkRenamedLspServer "go") - (mkRemovedLspPackage "go") - - (mkRemovedLspPackage "haskell") - - (mkRemovedLspPackage "hcl") - - (mkRenamedLspServer "helm") - (mkRemovedLspPackage "helm") - - (mkRemovedLspPackage "java") - - (mkRenamedLspServer "julia") - (mkRemovedLspPackage "julia") - - (mkRemovedLspPackage "kotlin") - - (mkRemovedLspPackage "lua") - - (mkRenamedLspServer "markdown") - (mkRemovedLspPackage "markdown") - - (mkRenamedLspServer "nim") - (mkRemovedLspPackage "nim") - - (mkRenamedLspServer "nix") - (mkRemovedLspPackage "nix") - (mkRemovedOptionModule ["vim" "languages" "nix" "lsp" "options"] '' - `vim.languages.nix.lsp.options` has been moved to `vim.lsp.servers..init_options`. - '') - - (mkRenamedLspServer "nu") - (mkRemovedLspPackage "nu") - - (mkRenamedLspServer "ocaml") - (mkRemovedLspPackage "ocaml") - - (mkRenamedLspServer "odin") - (mkRemovedLspPackage "odin") - - (mkRenamedLspServer "php") - (mkRemovedLspPackage "php") - - (mkRenamedLspServer "python") - (mkRemovedLspPackage "python") - - (mkRenamedLspServer "r") - (mkRemovedLspPackage "r") - - (mkRenamedLspServer "ruby") - (mkRemovedLspPackage "ruby") - - (mkRenamedLspServer "sql") - (mkRemovedLspPackage "sql") - - (mkRenamedLspServer "svelte") - (mkRemovedLspPackage "svelte") - - (mkRenamedLspServer "tailwind") - (mkRemovedLspPackage "tailwind") - - (mkRemovedLspPackage "terraform") - - (mkRenamedLspServer "ts") - (mkRemovedLspPackage "ts") - - (mkRenamedLspServer "typst") - (mkRemovedLspPackage "typst") - - (mkRenamedLspServer "vala") - (mkRemovedLspPackage "vala") - - (mkRenamedLspServer "wgsl") - (mkRemovedLspPackage "wgsl") - - (mkRenamedLspServer "yaml") - (mkRemovedLspPackage "yaml") - - (mkRenamedLspServer "zig") - (mkRemovedLspPackage "zig") - - # 2025-10-22 - (mkRenamedOptionModule ["vim" "languages" "rust" "crates" "enable"] ["vim" "languages" "rust" "extensions" "crates-nvim" "enable"]) - (mkRemovedOptionModule ["vim" "languages" "rust" "crates" "codeActions"] '' - 'vim.languages.rust.crates' option has been moved to 'vim.languages.rust.extensions.crates-nvim' in full and the - codeActions option has been removed. To set up code actions again, you may use the the new 'setupOpts' option - located under 'vim.languages.rust.extensions.crates-nvim'. Refer to crates.nvim documentation for setup steps: - - - '') - - (mkRemovedOptionModule ["vim" "language" "astro" "format"] '' - This option has been removed due to being broken for a long time. - '') - (mkRemovedOptionModule ["vim" "language" "svelte" "format"] '' - This option has been removed due to being broken for a long time. - '') - ] - - (map mkRemovedFormatPackage [ - "bash" - "css" - "elixir" - "fsharp" - "go" - "hcl" - "html" - "json" - "lua" - "markdown" - "nim" - "nix" - "ocaml" - "python" - "qml" - "r" - "ruby" - "rust" - "sql" - "ts" - "typst" - ]) - # Migrated via batchRenameOptions. Further batch renames must be below this line. - renamedVimOpts - ]; -} diff --git a/modules/modules.nix b/modules/modules.nix index 1eca042a..620111f8 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -1,79 +1,71 @@ { pkgs, lib, + check ? true, }: let inherit (lib.modules) mkDefault; inherit (lib.lists) concatLists; - allModules = let - # The core neovim modules. - # Contains configuration for core neovim features - # such as spellchecking, mappings, and the init script (init.vim). - neovim = map (p: ./neovim + "/${p}") [ - "init" - "mappings" - ]; - # Individual plugin modules, separated by the type of plugin. - # While adding a new type, you must make sure your type is - # included in the list below. - plugins = map (p: ./plugins + "/${p}") [ - "assistant" - "autopairs" - "comments" - "completion" - "dashboard" - "debugger" - "diagnostics" - "filetree" - "formatter" - "git" - "languages" - "lsp" - "mini" - "minimap" - "notes" - "projects" - "repl" - "rich-presence" - "runner" - "session" - "snippets" - "spellcheck" - "statusline" - "tabline" - "terminal" - "theme" - "treesitter" - "ui" - "utility" - "visuals" - ]; + # The core neovim modules. + # Contains configuration for core neovim features + # such as spellchecking, mappings, and the init script (init.vim). + neovim = map (p: ./neovim + "/${p}") [ + "init" + "mappings" + ]; - # The neovim wrapper, used to build a wrapped neovim package - # using the configuration passed in `neovim` and `plugins` modules. - wrapper = map (p: ./wrapper + "/${p}") [ - "build" - "environment" - "rc" - "warnings" - "lazy" - ]; + # Individual plugin modules, separated by the type of plugin. + # While adding a new type, you must make sure your type is + # included in the list below. + plugins = map (p: ./plugins + "/${p}") [ + "assistant" + "autopairs" + "comments" + "completion" + "dashboard" + "debugger" + "filetree" + "git" + "languages" + "lsp" + "minimap" + "notes" + "projects" + "rich-presence" + "session" + "snippets" + # "spellcheck" # FIXME: see neovim/init/spellcheck.nix + "statusline" + "tabline" + "terminal" + "theme" + "treesitter" + "ui" + "utility" + "visuals" + ]; - # Extra modules, such as deprecation warnings - # or renames in one place. - extra = map (p: ./extra + "/${p}") [ - "deprecations.nix" - ]; - in - concatLists [neovim plugins wrapper extra]; -in - allModules - ++ [ - { - _module.args = { - baseModules = allModules; - pkgsPath = mkDefault pkgs.path; - pkgs = mkDefault pkgs; + # The neovim wrapper, used to build a wrapped neovim package + # using the configuration passed in `neovim` and `plugins` modules. + wrapper = map (p: ./wrapper + "/${p}") [ + "build" + "rc" + "warnings" + ]; + + allModules = concatLists [neovim plugins wrapper]; + + pkgsModule = {config, ...}: { + config = { + _module = { + inherit check; + args = { + baseModules = allModules; + pkgsPath = mkDefault pkgs.path; + pkgs = mkDefault pkgs; + }; }; - } - ] + }; + }; +in + allModules ++ [pkgsModule] diff --git a/modules/neovim/init/autocmds.nix b/modules/neovim/init/autocmds.nix deleted file mode 100644 index 579a211e..00000000 --- a/modules/neovim/init/autocmds.nix +++ /dev/null @@ -1,188 +0,0 @@ -{ - config, - lib, - ... -}: let - inherit (lib.options) mkOption mkEnableOption literalExpression; - inherit (lib.lists) filter; - inherit (lib.strings) optionalString; - inherit (lib.types) nullOr submodule listOf str bool; - inherit (lib.nvim.types) luaInline; - inherit (lib.nvim.lua) toLuaObject; - inherit (lib.nvim.dag) entryAfter entryBetween; - - autocommandType = submodule { - options = { - enable = - mkEnableOption "" - // { - default = true; - description = "Whether to enable this autocommand."; - }; - - event = mkOption { - type = nullOr (listOf str); - default = null; - example = ["BufRead" "BufWritePre"]; - description = "The event(s) that trigger the autocommand."; - }; - - pattern = mkOption { - type = nullOr (listOf str); - default = null; - example = ["*.lua" "*.vim"]; - description = "The file pattern(s) that determine when the autocommand applies."; - }; - - callback = mkOption { - type = nullOr luaInline; - default = null; - example = literalExpression '' - lib.generators.mkLuaInline ''' - function() - print("Saving a Lua file...") - end - '''' - ''; - description = "Lua function to be called when the event(s) are triggered."; - }; - - command = mkOption { - type = nullOr str; - default = null; - description = '' - Vim command to be executed when the event(s) are triggered. - Cannot be defined if the `callback` option is already defined. - ''; - }; - - group = mkOption { - type = nullOr str; - default = null; - example = "MyAutoCmdGroup"; - description = "An optional autocommand group to manage related autocommands."; - }; - - desc = mkOption { - type = nullOr str; - default = null; - example = "Notify when saving a Lua file"; - description = "A description for the autocommand."; - }; - - once = mkOption { - type = bool; - default = false; - description = "Whether to run the autocommand only once."; - }; - - nested = mkOption { - type = bool; - default = false; - description = "Whether to allow nested autocommands to trigger."; - }; - }; - }; - - autogroupType = submodule { - options = { - enable = - mkEnableOption "" - // { - default = true; - description = "Whether to enable this autocommand group."; - }; - - name = mkOption { - type = str; - example = "MyAutoCmdGroup"; - description = "The name of the autocommand group."; - }; - - clear = mkOption { - type = bool; - default = true; - description = '' - Whether to clear existing autocommands in this group before defining new ones. - This helps avoid duplicate autocommands. - ''; - }; - }; - }; - - cfg = config.vim; -in { - options.vim = { - augroups = mkOption { - type = listOf autogroupType; - default = []; - description = '' - A list of Neovim autogroups, which are used to organize and manage related - autocommands together. Groups allow multiple autocommands to be cleared - or redefined collectively, preventing duplicate definitions. - - Each autogroup consists of a name and a boolean indicating whether to clear - existing autocommands. - ''; - }; - - autocmds = mkOption { - type = listOf autocommandType; - default = []; - description = '' - A list of Neovim autocommands to be registered. - - Each entry defines an autocommand, specifying events, patterns, a callback or Vim - command, an optional group, a description, and execution settings. - ''; - }; - }; - - config = { - vim = let - enabledAutocommands = filter (cmd: cmd.enable) cfg.autocmds; - enabledAutogroups = filter (au: au.enable) cfg.augroups; - in { - luaConfigRC = { - augroups = entryBetween ["autocmds"] ["pluginConfigs"] (optionalString (enabledAutogroups != []) '' - local nvf_autogroups = {} - for _, group in ipairs(${toLuaObject enabledAutogroups}) do - if group.name then - nvf_autogroups[group.name] = { clear = group.clear } - end - end - - for group_name, options in pairs(nvf_autogroups) do - vim.api.nvim_create_augroup(group_name, options) - end - ''); - - autocmds = entryAfter ["pluginConfigs"] (optionalString (enabledAutocommands != []) '' - local nvf_autocommands = ${toLuaObject enabledAutocommands} - for _, autocmd in ipairs(nvf_autocommands) do - vim.api.nvim_create_autocmd( - autocmd.event, - { - group = autocmd.group, - pattern = autocmd.pattern, - buffer = autocmd.buffer, - desc = autocmd.desc, - callback = autocmd.callback, - command = autocmd.command, - once = autocmd.once, - nested = autocmd.nested - } - ) - end - ''); - }; - }; - - assertions = [ - { - assertion = builtins.all (cmd: (cmd.command == null || cmd.callback == null)) cfg.autocmds; - message = "An autocommand cannot have both 'command' and 'callback' defined at the same time."; - } - ]; - }; -} diff --git a/modules/neovim/init/basic.nix b/modules/neovim/init/basic.nix index 2f3934ae..3c8f0b3d 100644 --- a/modules/neovim/init/basic.nix +++ b/modules/neovim/init/basic.nix @@ -3,47 +3,123 @@ lib, ... }: let - inherit (lib.options) mkOption mkEnableOption literalMD; + inherit (lib.options) mkOption literalExpression; inherit (lib.strings) optionalString; - inherit (lib.attrsets) optionalAttrs; - inherit (lib.types) enum bool str either; - inherit (lib.generators) mkLuaInline; + inherit (lib.types) enum bool str int nullOr; inherit (lib.nvim.dag) entryAfter; - inherit (lib.nvim.binds) pushDownDefault; - inherit (lib.nvim.types) luaInline; cfg = config.vim; in { options.vim = { + leaderKey = mkOption { + type = nullOr str; + default = null; + description = "The leader key to be used internally"; + }; + + colourTerm = mkOption { + type = bool; + default = true; + description = "Set terminal up for 256 colours"; + }; + + disableArrows = mkOption { + type = bool; + default = false; + description = "Set to prevent arrow keys from moving cursor"; + }; + hideSearchHighlight = mkOption { type = bool; default = false; description = "Hide search highlight so it doesn't stay highlighted"; }; + scrollOffset = mkOption { + type = int; + default = 8; + description = "Start scrolling this number of lines from the top or bottom of the page."; + }; + + wordWrap = mkOption { + type = bool; + default = true; + description = "Enable word wrapping."; + }; + syntaxHighlighting = mkOption { type = bool; default = !config.vim.treesitter.highlight.enable; description = "Enable syntax highlighting"; }; + mapLeaderSpace = mkOption { + type = bool; + default = true; + description = "Map the space key to leader key"; + }; + + useSystemClipboard = mkOption { + type = bool; + default = false; + description = "Make use of the clipboard for default yank and paste operations. Don't use * and +"; + }; + + mouseSupport = mkOption { + type = enum ["a" "n" "v" "i" "c"]; + default = "a"; + description = '' + Set modes for mouse support. + + * a - all + * n - normal + * v - visual + * i - insert + * c - command + ''; + }; + lineNumberMode = mkOption { type = enum ["relative" "number" "relNumber" "none"]; default = "relNumber"; - example = "none"; + example = literalExpression "none"; description = "How line numbers are displayed."; }; preventJunkFiles = mkOption { type = bool; - default = true; - example = false; - description = '' - Prevent swapfile and backupfile from being created. + default = false; + description = "Prevent swapfile and backupfile from being created"; + }; - `false` is the default Neovim behaviour. If you wish to create - backup and swapfiles, set this option to `false`. - ''; + tabWidth = mkOption { + type = int; + default = 4; + description = "Set the width of tabs"; + }; + + autoIndent = mkOption { + type = bool; + default = true; + description = "Enable auto indent"; + }; + + cmdHeight = mkOption { + type = int; + default = 1; + description = "Height of the command pane"; + }; + + updateTime = mkOption { + type = int; + default = 300; + description = "The number of milliseconds till Cursor Hold event is fired"; + }; + + showSignColumn = mkOption { + type = bool; + default = true; + description = "Show the sign column"; }; bell = mkOption { @@ -52,108 +128,154 @@ in { description = "Set how bells are handled. Options: on, visual or none"; }; + mapTimeout = mkOption { + type = int; + default = 500; + description = "Timeout in ms that neovim will wait for mapped action to complete"; + }; + + splitBelow = mkOption { + type = bool; + default = true; + description = "New splits will open below instead of on top"; + }; + + splitRight = mkOption { + type = bool; + default = true; + description = "New splits will open to the right"; + }; + + enableEditorconfig = mkOption { + type = bool; + default = true; + description = "Follow editorconfig rules in current directory"; + }; + + cursorlineOpt = mkOption { + type = enum ["line" "screenline" "number" "both"]; + default = "line"; + description = "Highlight the text line of the cursor with CursorLine hl-CursorLine"; + }; + searchCase = mkOption { type = enum ["ignore" "smart" "sensitive"]; default = "sensitive"; description = "Set the case sensitivity of search"; }; - - undoFile = { - enable = mkEnableOption "undofile for persistent undo behaviour"; - path = mkOption { - type = either str luaInline; - default = mkLuaInline "vim.fn.stdpath('state') .. '/undo'"; - defaultText = literalMD '' - ```nix - mkLuaInline "vim.fn.stdpath('state') .. '/undo'" - ``` - ''; - example = literalMD '' - ```nix - mkLuaInline "os.getenv('XDG_DATA_HOME') .. '/nvf/undo'" - ``` - ''; - description = "Path to the directory in which undo history will be stored"; - }; - }; }; - config.vim = { - # Set options that were previously interpolated in 'luaConfigRC.basic' as vim.options (vim.o) - # and 'vim.globals' (vim.g). Future options, if possible, should be added here instead of the - # luaConfigRC section below. - options = pushDownDefault (lib.mergeAttrsList [ - { - # Options that are always set, with a lower priority - encoding = "utf-8"; - hidden = true; - expandtab = true; + config.vim.configRC.basic = entryAfter ["globalsScript"] '' + " Settings that are set for everything + set encoding=utf-8 + set hidden + set shortmess+=c + set expandtab + set mouse=${cfg.mouseSupport} + set tabstop=${toString cfg.tabWidth} + set shiftwidth=${toString cfg.tabWidth} + set softtabstop=${toString cfg.tabWidth} + set cmdheight=${toString cfg.cmdHeight} + set updatetime=${toString cfg.updateTime} + set tm=${toString cfg.mapTimeout} + set cursorlineopt=${toString cfg.cursorlineOpt} + set scrolloff=${toString cfg.scrollOffset} - # Junkfile Behaviour - swapfile = !cfg.preventJunkFiles; - backup = !cfg.preventJunkFiles; - writebackup = !cfg.preventJunkFiles; - } + ${optionalString cfg.splitBelow '' + set splitbelow + ''} - (optionalAttrs cfg.undoFile.enable { - undofile = true; - undodir = cfg.undoFile.path; - }) + ${optionalString cfg.splitRight '' + set splitright + ''} - (optionalAttrs (cfg.bell == "none") { - errorbells = false; - visualbell = false; - }) + ${optionalString cfg.showSignColumn '' + set signcolumn=yes + ''} - (optionalAttrs (cfg.bell == "on") { - visualbell = false; - }) + ${optionalString cfg.autoIndent '' + set autoindent + ''} - (optionalAttrs (cfg.bell == "visual") { - visualbell = false; - }) + ${optionalString cfg.preventJunkFiles '' + set noswapfile + set nobackup + set nowritebackup + ''} - (optionalAttrs (cfg.lineNumberMode == "relative") { - relativenumber = true; - }) + ${optionalString (cfg.bell == "none") '' + set noerrorbells + set novisualbell + ''} - (optionalAttrs (cfg.lineNumberMode == "number") { - number = true; - }) + ${optionalString (cfg.bell == "on") '' + set novisualbell + ''} - (optionalAttrs (cfg.lineNumberMode == "relNumber") { - number = true; - relativenumber = true; - }) - ]); + ${optionalString (cfg.bell == "visual") '' + set noerrorbells + ''} - # Options that are more difficult to set through 'vim.options'. Namely, appending values - # to pre-set Neovim options. Fear not, though as the Lua DAG is still as powerful as it - # could be. - luaConfigRC.basic = entryAfter ["globalsScript"] '' - ${optionalString cfg.syntaxHighlighting '' - vim.cmd("syntax on") - ''} + ${optionalString (cfg.lineNumberMode == "relative") '' + set relativenumber + ''} - ${optionalString cfg.hideSearchHighlight '' - vim.o.hlsearch = false - vim.o.incsearch = true - ''} + ${optionalString (cfg.lineNumberMode == "number") '' + set number + ''} - ${optionalString (cfg.searchCase == "ignore") '' - vim.o.smartcase = false - vim.o.ignorecase = true - ''} + ${optionalString (cfg.lineNumberMode == "relNumber") '' + set number relativenumber + ''} - ${optionalString (cfg.searchCase == "smart") '' - vim.o.smartcase = true - vim.o.ignorecase = true - ''} + ${optionalString cfg.useSystemClipboard '' + set clipboard+=unnamedplus + ''} - ${optionalString (cfg.searchCase == "sensitive") '' - vim.o.smartcase = false - vim.o.ignorecase = false - ''} - ''; - }; + ${optionalString cfg.mapLeaderSpace '' + let mapleader=" " + let maplocalleader=" " + ''} + + ${optionalString cfg.syntaxHighlighting '' + syntax on + ''} + + ${optionalString (!cfg.wordWrap) '' + set nowrap + ''} + + ${optionalString cfg.hideSearchHighlight '' + set nohlsearch + set incsearch + ''} + + ${optionalString cfg.colourTerm '' + set termguicolors + set t_Co=256 + ''} + + ${optionalString (!cfg.enableEditorconfig) '' + let g:editorconfig = v:false + ''} + + ${optionalString (cfg.leaderKey != null) '' + let mapleader = "${toString cfg.leaderKey}" + ''} + + ${optionalString (cfg.searchCase == "ignore") '' + set nosmartcase + set ignorecase + ''} + + ${optionalString (cfg.searchCase == "smart") '' + set smartcase + set ignorecase + ''} + + ${optionalString (cfg.searchCase == "sensitive") '' + set nosmartcase + set noignorecase + ''} + ''; } diff --git a/modules/neovim/init/clipboard.nix b/modules/neovim/init/clipboard.nix deleted file mode 100644 index b99f5508..00000000 --- a/modules/neovim/init/clipboard.nix +++ /dev/null @@ -1,80 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - inherit (lib.modules) mkIf; - inherit (lib.options) mkOption mkEnableOption mkPackageOption; - inherit (lib.types) str submodule; - inherit (lib.attrsets) mapAttrs mapAttrsToList filterAttrs; - cfg = config.vim.clipboard; -in { - options = { - vim = { - clipboard = { - enable = mkEnableOption '' - clipboard management for Neovim. Users may still choose to manage their - clipboard through {option}`vim.options` should they wish to avoid using - this module. - ''; - - registers = mkOption { - type = str; - default = ""; - example = "unnamedplus"; - description = '' - The register to be used by the Neovim clipboard. Recognized types are: - - * unnamed: Vim will use the clipboard register `"*"` for all yank, delete, - change and put operations which would normally go to the unnamed register. - - * unnamedplus: A variant of the "unnamed" flag which uses the clipboard register - `"+"` ({command}`:h quoteplus`) instead of register `"*"` for all yank, delete, - change and put operations which would normally go to the unnamed register. - - When `unnamed` and `unnamedplus` is included simultaneously as `"unnamed,unnamedplus"`, - yank and delete operations (but not put) will additionally copy the text into register `"*"`. - - Please see {command}`:h clipboard` for more details. - - ''; - }; - - providers = mkOption { - type = submodule { - options = let - clipboards = { - # name = "package name"; - wl-copy = "wl-clipboard"; - xclip = "xclip"; - xsel = "xsel"; - }; - in - mapAttrs (name: pname: { - enable = mkEnableOption name; - package = mkPackageOption pkgs pname {nullable = true;}; - }) - clipboards; - }; - default = {}; - description = '' - Clipboard providers for which packages will be added to nvf's - {option}`extraPackages`. The `package` field may be set to `null` - if related packages are already found in system packages to - potentially reduce closure sizes. - ''; - }; - }; - }; - }; - - config = mkIf cfg.enable { - vim = { - options.clipboard = cfg.registers; - extraPackages = mapAttrsToList (_: v: v.package) ( - filterAttrs (_: v: v.enable && v.package != null) cfg.providers - ); - }; - }; -} diff --git a/modules/neovim/init/default.nix b/modules/neovim/init/default.nix index 3f195085..11d9cf59 100644 --- a/modules/neovim/init/default.nix +++ b/modules/neovim/init/default.nix @@ -1,13 +1,7 @@ { imports = [ - ./autocmds.nix ./basic.nix - ./clipboard.nix ./debug.nix - ./diagnostics.nix - ./highlight.nix - ./lsp.nix ./spellcheck.nix - ./util.nix ]; } diff --git a/modules/neovim/init/diagnostics.nix b/modules/neovim/init/diagnostics.nix deleted file mode 100644 index 27f46efc..00000000 --- a/modules/neovim/init/diagnostics.nix +++ /dev/null @@ -1,116 +0,0 @@ -{ - config, - lib, - ... -}: let - inherit (lib.modules) mkIf; - inherit (lib.options) mkOption mkEnableOption literalExpression; - inherit (lib.types) attrsOf anything oneOf bool submodule; - inherit (lib.nvim.dag) entryAfter; - inherit (lib.nvim.types) luaInline; - inherit (lib.nvim.lua) toLuaObject; - - cfg = config.vim.diagnostics; - - # Takes a boolean, a table, or a Lua list ({key = value}). We - # would like to allow all of those types, while clearly expressing - # them in the option's type. As such, this type is what it is. - diagnosticType = oneOf [(attrsOf anything) bool luaInline]; - diagnosticsSubmodule = submodule { - # The table might need to be extended, so let's allow that case - # with a freeform type of what is supported by diagnostics opts. - freeformType = attrsOf diagnosticType; - options = { - underline = mkOption { - type = diagnosticType; - default = true; - description = "Use underline for diagnostics."; - }; - - virtual_text = mkOption { - type = diagnosticType; - default = false; - example = literalExpression '' - { - format = lib.generators.mkLuaInline ''' - function(diagnostic) - return string.format("%s (%s)", diagnostic.message, diagnostic.source) - end - '''; - } - ''; - - description = '' - Use virtual text for diagnostics. If multiple diagnostics are set for a namespace, - one prefix per diagnostic + the last diagnostic message are shown. - ''; - }; - - virtual_lines = mkOption { - type = diagnosticType; - default = false; - description = '' - Use virtual lines for diagnostics. - ''; - }; - - signs = mkOption { - type = diagnosticType; - default = false; - example = literalExpression '' - signs.text = lib.generators.mkLuaInline ''' - { - [vim.diagnostic.severity.ERROR] = "󰅚 ", - [vim.diagnostic.severity.WARN] = "󰀪 ", - } - '''; - ''; - description = '' - Use signs for diagnostics. See {command}`:help diagnostic-signs`. - - :::{.note} - The code presented in that example section uses Lua expressions as object keys which - only translate well if you use `lib.generators.mkLuaInline` as in the example. - ::: - ''; - }; - - update_in_insert = mkOption { - type = bool; - default = false; - description = '' - Update diagnostics in Insert mode. If `false`, diagnostics will - be updated on InsertLeave ({command}`:help InsertLeave`). - ''; - }; - }; - }; -in { - options.vim = { - diagnostics = { - enable = mkEnableOption "diagnostics module for Neovim"; - config = mkOption { - type = diagnosticsSubmodule; - default = {}; - description = '' - Values that will be passed to `vim.diagnostic.config` after being converted - to a Lua table. Possible values for each key can be found in the help text - for `vim.diagnostics.Opts`. You may find more about the diagnostics API of - Neovim in {command}`:help diagnostic-api`. - - :::{.note} - This option is freeform. You may set values that are not present in nvf - documentation, but those values will not be fully type checked. Please - refer to the help text for `vim.diagnostic.Opts` for appropriate values. - ::: - ''; - }; - }; - }; - - config.vim = mkIf cfg.enable { - luaConfigRC.diagnostics = entryAfter ["basic"] '' - vim.diagnostic.config(${toLuaObject cfg.config}) - ''; - }; -} diff --git a/modules/neovim/init/highlight.nix b/modules/neovim/init/highlight.nix deleted file mode 100644 index 9c6b7214..00000000 --- a/modules/neovim/init/highlight.nix +++ /dev/null @@ -1,118 +0,0 @@ -{ - config, - lib, - ... -}: let - inherit (lib.options) mkOption; - inherit (lib.types) nullOr attrsOf listOf submodule bool ints str enum; - inherit (lib.strings) concatLines; - inherit (lib.attrsets) mapAttrsToList; - inherit (lib.nvim.dag) entryBetween; - inherit (lib.nvim.lua) toLuaObject; - - mkColorOption = target: - mkOption { - type = nullOr str; - default = null; - example = "#ebdbb2"; - description = '' - The ${target} color to use. Written as color name or hex "#RRGGBB". - ''; - }; - - mkBoolOption = name: - mkOption { - type = nullOr bool; - default = null; - example = false; - description = "Whether to enable ${name}"; - }; - - cfg = config.vim.highlight; -in { - options.vim.highlight = mkOption { - type = attrsOf (submodule { - # See :h nvim_set_hl - options = { - bg = mkColorOption "background"; - fg = mkColorOption "foreground"; - sp = mkColorOption "special"; - blend = mkOption { - type = nullOr (ints.between 0 100); - default = null; - description = "Blend as an integer between 0 and 100"; - }; - bold = mkBoolOption "bold"; - standout = mkBoolOption "standout"; - underline = mkBoolOption "underline"; - undercurl = mkBoolOption "undercurl"; - underdouble = mkBoolOption "underdouble"; - underdotted = mkBoolOption "underdotted"; - underdashed = mkBoolOption "underdashed"; - strikethrough = mkBoolOption "strikethrough"; - italic = mkBoolOption "italic"; - reverse = mkBoolOption "reverse"; - nocombine = mkBoolOption "nocombine"; - link = mkOption { - type = nullOr str; - default = null; - description = "The name of another highlight group to link to"; - }; - default = mkOption { - type = nullOr bool; - default = null; - description = "Don't override existing definition"; - }; - ctermfg = mkOption { - type = nullOr str; - default = null; - description = "The cterm foreground color to use"; - }; - ctermbg = mkOption { - type = nullOr str; - default = null; - description = "The cterm background color to use"; - }; - cterm = mkOption { - type = nullOr (listOf (enum [ - "bold" - "underline" - "undercurl" - "underdouble" - "underdotted" - "underdashed" - "strikethrough" - "reverse" - "inverse" - "italic" - "standout" - "altfont" - "nocombine" - "NONE" - ])); - default = null; - description = "The cterm arguments to use. See ':h highlight-args'"; - }; - force = mkBoolOption "force update"; - }; - }); - default = {}; - example = { - SignColumn = { - bg = "#282828"; - }; - }; - description = "Custom highlights to apply"; - }; - - config = { - vim.luaConfigRC.highlight = let - highlights = - mapAttrsToList ( - name: value: ''vim.api.nvim_set_hl(0, ${toLuaObject name}, ${toLuaObject value})'' - ) - cfg; - in - entryBetween ["lazyConfigs" "pluginConfigs" "extraPluginConfigs"] ["theme"] (concatLines highlights); - }; -} diff --git a/modules/neovim/init/lsp.nix b/modules/neovim/init/lsp.nix deleted file mode 100644 index b17c5554..00000000 --- a/modules/neovim/init/lsp.nix +++ /dev/null @@ -1,93 +0,0 @@ -{ - config, - lib, - ... -}: let - inherit (builtins) filter; - inherit (lib.modules) mkIf mkMerge mkDefault; - inherit (lib.options) mkOption mkEnableOption; - inherit (lib.types) attrsOf; - inherit (lib.strings) concatLines; - inherit (lib.attrsets) mapAttrsToList attrNames filterAttrs; - inherit (lib.generators) mkLuaInline; - inherit (lib.nvim.languages) lspOptions; - inherit (lib.nvim.dag) entryAnywhere; - inherit (lib.nvim.lua) toLuaObject; - - cfg = config.vim.lsp; - - # TODO: lspConfigurations filter on enabledServers instead of cfg.servers? - lspConfigurations = - mapAttrsToList ( - name: value: '' - vim.lsp.config["${name}"] = ${toLuaObject value} - '' - ) - cfg.servers; - - enabledServers = filterAttrs (_: u: u.enable) cfg.servers; -in { - options = { - vim.lsp = { - enable = mkEnableOption '' - global LSP functionality for Neovim. - - This option controls whether to enable LSP functionality within modules under - {option}`vim.languages`. You do not need to set this to `true` for language - servers defined in {option}`vim.lsp.servers` to take effect, since they are - enabled automatically. - ''; - - servers = mkOption { - type = attrsOf lspOptions; - default = {}; - example = '' - { - "*" = { - root_markers = [".git"]; - capabilities = { - textDocument = { - semanticTokens = { - multilineTokenSupport = true; - }; - }; - }; - }; - - "clangd" = { - filetypes = ["c"]; - }; - } - ''; - description = '' - LSP configurations that will be managed using `vim.lsp.config()` and related - utilities added in Neovim 0.11. LSPs defined here will be added to the - resulting {file}`init.lua` using `vim.lsp.config` and enabled through - `vim.lsp.enable()` API from Neovim below the configuration table. - - You may review the generated configuration by running {command}`nvf-print-config` - in a shell. Please see {command}`:help lsp-config` for more details - on the underlying API. - ''; - }; - }; - }; - - config = mkMerge [ - { - vim.lsp.servers."*" = { - capabilities = mkDefault (mkLuaInline "capabilities"); - }; - } - - (mkIf (cfg.servers != {}) { - vim.luaConfigRC.lsp-servers = entryAnywhere '' - -- Individual LSP configurations managed by nvf. - ${concatLines lspConfigurations} - - -- Enable configured LSPs explicitly - vim.lsp.enable(${toLuaObject (filter (name: name != "*") (attrNames enabledServers))}) - ''; - }) - ]; -} diff --git a/modules/neovim/init/spellcheck.nix b/modules/neovim/init/spellcheck.nix index 724b432d..d8957ef9 100644 --- a/modules/neovim/init/spellcheck.nix +++ b/modules/neovim/init/spellcheck.nix @@ -1,15 +1,12 @@ { config, - pkgs, lib, ... }: let inherit (lib.modules) mkIf mkRenamedOptionModule; inherit (lib.options) mkOption mkEnableOption literalExpression; - inherit (lib.strings) concatLines concatStringsSep optionalString; - inherit (lib.attrsets) mapAttrsToList; - inherit (lib.types) listOf str attrsOf; - inherit (lib.nvim.lua) toLuaObject; + inherit (lib.types) listOf str; + inherit (lib.nvim.lua) listToLuaTable; inherit (lib.nvim.dag) entryAfter; cfg = config.vim.spellcheck; @@ -27,48 +24,10 @@ in { description = '' A list of languages that should be used for spellchecking. - To add your own language files, you may place your `spell` directory in either - {file}`$XDG_CONFIG_HOME/nvf` or in a path that is included in the - [additionalRuntimePaths](./options.html#option-vim-additionalRuntimePaths) list provided by nvf. - ''; - }; - - extraSpellWords = mkOption { - type = attrsOf (listOf str); - default = {}; - example = literalExpression ''{"en.utf-8" = ["nvf" "word_you_want_to_add"];}''; - description = '' - Additional words to be used for spellchecking. The names of each key will be - used as the language code for the spell file. For example - - ```nix - "en.utf-8" = [ ... ]; - ``` - - will result in `en.utf-8.add.spl` being added to Neovim's runtime in the - {file}`spell` directory. - - ::: {.warning} - The attribute keys must be in `"."` format for Neovim to - compile your spellfiles without mangling the resulting file names. Please - make sure that you enter the correct value, as nvf does not do any kind of - internal checking. Please see {command}`:help mkspell` for more details. - - Example: - - ```nix - # "en" is the name, and "utf-8" is the encoding. For most use cases, utf-8 - # will be enough, however, you may change it to any encoding format Neovim - # accepts, e.g., utf-16. - "en.utf-8" = ["nvf" "word_you_want_to_add"]; - => $out/spell/en-utf-8.add.spl - ``` - ::: - - Note that while adding a new language, you will still need to add the name of - the language (e.g. "en") to the {option}`vim.spellcheck.languages` list by name - in order to enable spellchecking for the language. By default only `"en"` is in - the list. + To add your own language files, you may place your `spell` + directory in either `~/.config/nvim` or the + [additionalRuntimePaths](#opt-vim.additionalRuntimePaths) + directory provided by **nvf**. ''; }; @@ -79,85 +38,38 @@ in { description = '' A list of filetypes for which spellchecking will be disabled. - ::: {.tip} - You may use {command}`:echo &filetype` in Neovim to find out the + You may use `echo &filetype` in Neovim to find out the filetype for a specific buffer. - ::: ''; }; + /* + # FIXME: This needs to be revisited. It tries to install + # the spellfile to an user directory, but it cannot do so + # as we sanitize runtime paths. programmingWordlist.enable = mkEnableOption '' vim-dirtytalk, a wordlist for programmers containing common programming terms. - ::: {.note} - Enabling this option will unconditionally set - {option}`vim.spellcheck.enable` to true as vim-dirtytalk - depends on spellchecking having been set up. - - Run {command}`:DirtytalkUpdate` on first use to download the spellfile. - ::: + Setting this value as `true` has the same effect + as setting {option}`vim.spellCheck.enable` ''; + */ }; config = mkIf cfg.enable { - vim = { - additionalRuntimePaths = let - compileJoinedSpellfiles = - pkgs.runCommandLocal "nvf-compile-spellfiles" { - # Use the same version of Neovim as the user's configuration - nativeBuildInputs = [config.vim.package]; + vim.luaConfigRC.spellcheck = entryAfter ["basic"] '' + vim.opt.spell = true + vim.opt.spelllang = ${listToLuaTable cfg.languages} - spellfilesJoined = pkgs.symlinkJoin { - name = "nvf-spellfiles-joined"; - paths = mapAttrsToList (name: value: pkgs.writeTextDir "spell/${name}.add" (concatLines value)) cfg.extraSpellWords; - postBuild = "echo Spellfiles joined"; - }; - } '' - # Fail on unset variables and non-zero exit codes - # this might be the only way to trace when `nvim --headless` - # fails in batch mode - set -eu - - mkdir -p "$out/spell" - for spellfile in "$spellfilesJoined"/spell/*.add; do - name="$(basename "$spellfile" ".add")" - echo "Compiling spellfile: $spellfile" - nvim --headless --clean \ - --cmd "mkspell $out/spell/$name.add.spl $spellfile" -Es -n - done - ''; - in - mkIf (cfg.extraSpellWords != {}) [ - # If .outPath is missing, additionalRuntimePaths receives the *function* - # instead of a path, causing errors. - compileJoinedSpellfiles.outPath - ]; - - options = { - spell = true; - - # Workaround for Neovim's spelllang setup. It can be - # - a string, e.g., "en" - # - multiple strings, separated with commas, e.g., "en,de" - # toLuaObject cannot generate the correct type here, unless we take a string here. - spelllang = concatStringsSep "," cfg.languages; - }; - - # Register an autocommand to disable spellchecking in buffers with given filetypes. - # If the list is empty, the autocommand does not need to be registered. - luaConfigRC.spellcheck = entryAfter ["basic"] (optionalString (cfg.ignoredFiletypes != []) '' - -- Disable spellchecking for certain filetypes - -- as configured by `vim.spellcheck.ignoredFiletypes` - vim.api.nvim_create_augroup("nvf_autocmds", {clear = false}) - vim.api.nvim_create_autocmd({ "FileType" }, { - group = "nvf_autocmds", - pattern = ${toLuaObject cfg.ignoredFiletypes}, - callback = function() - vim.opt_local.spell = false - end, - }) - ''); - }; + -- Disable spellchecking for certain filetypes + -- as configured by `vim.spellcheck.ignoredFiletypes` + vim.api.nvim_create_autocmd({ "FileType" }, { + pattern = ${listToLuaTable cfg.ignoredFiletypes}, + callback = function() + vim.opt_local.spell = false + end, + }) + ''; }; } diff --git a/modules/neovim/init/util.nix b/modules/neovim/init/util.nix deleted file mode 100644 index d151e53a..00000000 --- a/modules/neovim/init/util.nix +++ /dev/null @@ -1,177 +0,0 @@ -{ - config, - lib, - ... -}: let - inherit (lib.modules) mkIf mkMerge; - inherit (lib.nvim.dag) entryBefore; - - cfg = config.vim.lsp; -in { - config = mkMerge [ - (mkIf (cfg.servers != {}) { - vim.luaConfigRC.lsp-util = - entryBefore ["lsp-servers"] - /* - lua - */ - '' - -- Port of nvim-lspconfig util - local util = { path = {} } - - util.default_config = { - log_level = vim.lsp.protocol.MessageType.Warning, - message_level = vim.lsp.protocol.MessageType.Warning, - settings = vim.empty_dict(), - init_options = vim.empty_dict(), - handlers = {}, - autostart = true, - capabilities = vim.lsp.protocol.make_client_capabilities(), - } - - -- global on_setup hook - util.on_setup = nil - - do - local validate = vim.validate - local api = vim.api - local lsp = vim.lsp - local nvim_eleven = vim.fn.has 'nvim-0.11' == 1 - - local iswin = vim.uv.os_uname().version:match 'Windows' - - local function escape_wildcards(path) - return path:gsub('([%[%]%?%*])', '\\%1') - end - - local function is_fs_root(path) - if iswin then - return path:match '^%a:$' - else - return path == '/' - end - end - - local function traverse_parents(path, cb) - path = vim.uv.fs_realpath(path) - local dir = path - -- Just in case our algo is buggy, don't infinite loop. - for _ = 1, 100 do - dir = vim.fs.dirname(dir) - if not dir then - return - end - -- If we can't ascend further, then stop looking. - if cb(dir, path) then - return dir, path - end - if is_fs_root(dir) then - break - end - end - end - - util.root_pattern = function(...) - local patterns = util.tbl_flatten { ... } - return function(startpath) - startpath = util.strip_archive_subpath(startpath) - for _, pattern in ipairs(patterns) do - local match = util.search_ancestors(startpath, function(path) - for _, p in ipairs(vim.fn.glob(table.concat({ escape_wildcards(path), pattern }, '/'), true, true)) do - if vim.uv.fs_stat(p) then - return path - end - end - end) - - if match ~= nil then - return match - end - end - end - end - - util.root_markers_with_field = function(root_files, new_names, field, fname) - local path = vim.fn.fnamemodify(fname, ':h') - local found = vim.fs.find(new_names, { path = path, upward = true }) - - for _, f in ipairs(found or {}) do - -- Match the given `field`. - for line in io.lines(f) do - if line:find(field) then - root_files[#root_files + 1] = vim.fs.basename(f) - break - end - end - end - - return root_files - end - - util.insert_package_json = function(root_files, field, fname) - return util.root_markers_with_field(root_files, { 'package.json', 'package.json5' }, field, fname) - end - - util.strip_archive_subpath = function(path) - -- Matches regex from zip.vim / tar.vim - path = vim.fn.substitute(path, 'zipfile://\\(.\\{-}\\)::[^\\\\].*$', '\\1', ''') - path = vim.fn.substitute(path, 'tarfile:\\(.\\{-}\\)::.*$', '\\1', ''') - return path - end - - util.get_typescript_server_path = function(root_dir) - local project_roots = vim.fs.find('node_modules', { path = root_dir, upward = true, limit = math.huge }) - for _, project_root in ipairs(project_roots) do - local typescript_path = project_root .. '/typescript' - local stat = vim.loop.fs_stat(typescript_path) - if stat and stat.type == 'directory' then - return typescript_path .. '/lib' - end - end - return ''' - end - - util.search_ancestors = function(startpath, func) - if nvim_eleven then - validate('func', func, 'function') - end - if func(startpath) then - return startpath - end - local guard = 100 - for path in vim.fs.parents(startpath) do - -- Prevent infinite recursion if our algorithm breaks - guard = guard - 1 - if guard == 0 then - return - end - - if func(path) then - return path - end - end - end - - util.path.is_descendant = function(root, path) - if not path then - return false - end - - local function cb(dir, _) - return dir == root - end - - local dir, _ = traverse_parents(path, cb) - - return dir == root - end - - util.tbl_flatten = function(t) - --- @diagnostic disable-next-line:deprecated - return nvim_eleven and vim.iter(t):flatten(math.huge):totable() or vim.tbl_flatten(t) - end - end - ''; - }) - ]; -} diff --git a/modules/neovim/mappings/config.nix b/modules/neovim/mappings/config.nix index a62a6ca2..8bc58af7 100644 --- a/modules/neovim/mappings/config.nix +++ b/modules/neovim/mappings/config.nix @@ -3,47 +3,57 @@ lib, ... }: let - inherit (lib.modules) mkMerge; - inherit (lib.trivial) pipe; - inherit (lib.attrsets) mapAttrsToList; - inherit (lib.lists) flatten; - - legacyMapModes = { - normal = ["n"]; - insert = ["i"]; - select = ["s"]; - visual = ["v"]; - terminal = ["t"]; - normalVisualOp = ["n" "v" "o"]; - visualOnly = ["n" "x"]; - operator = ["o"]; - insertCommand = ["i" "c"]; - lang = ["l"]; - command = ["c"]; - }; + inherit (lib.modules) mkIf; cfg = config.vim; in { config = { - vim.keymaps = mkMerge [ - ( - pipe cfg.maps - [ - (mapAttrsToList ( - oldMode: keybinds: - mapAttrsToList ( - key: bind: - bind - // { - inherit key; - mode = legacyMapModes.${oldMode}; - } - ) - keybinds - )) - flatten - ] - ) - ]; + vim.maps = { + normal = + mkIf cfg.disableArrows { + "" = { + action = ""; + + noremap = false; + }; + "" = { + action = ""; + + noremap = false; + }; + "" = { + action = ""; + noremap = false; + }; + "" = { + action = ""; + noremap = false; + }; + } + // mkIf cfg.mapLeaderSpace { + "" = { + action = ""; + }; + }; + + insert = mkIf cfg.disableArrows { + "" = { + action = ""; + noremap = false; + }; + "" = { + action = ""; + noremap = false; + }; + "" = { + action = ""; + noremap = false; + }; + "" = { + action = ""; + noremap = false; + }; + }; + }; }; } diff --git a/modules/neovim/mappings/options.nix b/modules/neovim/mappings/options.nix index 98e04a65..3b1f2634 100644 --- a/modules/neovim/mappings/options.nix +++ b/modules/neovim/mappings/options.nix @@ -1,97 +1,101 @@ {lib, ...}: let - inherit (lib.options) mkOption literalMD; - inherit (lib.types) either str listOf attrsOf nullOr submodule; + inherit (lib.options) mkOption; + inherit (lib.types) bool str attrsOf nullOr submodule; inherit (lib.nvim.config) mkBool; - + # Most of the keybindings code is highly inspired by pta2002/nixvim. + # Thank you! mapConfigOptions = { + silent = + mkBool false + "Whether this mapping should be silent. Equivalent to adding to a map."; + + nowait = + mkBool false + "Whether to wait for extra input on ambiguous mappings. Equivalent to adding to a map."; + + script = + mkBool false + "Equivalent to adding