mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-08 22:45:30 +00:00
Merge branch 'main' into weekly-plugin-bumps
This commit is contained in:
commit
e9f782bc4e
262 changed files with 4977 additions and 1878 deletions
|
|
@ -19,13 +19,12 @@ indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
tab_width = 2
|
tab_width = 2
|
||||||
|
|
||||||
[*.{diff,patch}]
|
[*.{diff,patch,lock}]
|
||||||
end_of_line = unset
|
end_of_line = unset
|
||||||
insert_final_newline = unset
|
insert_final_newline = unset
|
||||||
trim_trailing_whitespace = unset
|
trim_trailing_whitespace = unset
|
||||||
|
|
||||||
[*.lock]
|
|
||||||
indent_size = unset
|
|
||||||
|
|
||||||
[npins/sources.json]
|
[npins/sources.json]
|
||||||
insert_final_newline = unset
|
indent_style = unset
|
||||||
|
indent_size = unset
|
||||||
|
trim_trailing_whitespace = unset
|
||||||
|
|
|
||||||
80
.github/CONTRIBUTING.md
vendored
80
.github/CONTRIBUTING.md
vendored
|
|
@ -2,48 +2,72 @@
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
- [Welcome](#welcome)
|
- [Preface](#preface)
|
||||||
- [Contributing](#contributing)
|
- [Contributing Process](#contributing-process)
|
||||||
- [Code of Conduct](#code-of-conduct)
|
- [Code of Conduct](#code-of-conduct)
|
||||||
|
|
||||||
## Welcome
|
## Preface
|
||||||
|
|
||||||
I'm glad you are thinking about contributing to nvf! If you're unsure about
|
[LICENSE]: ../LICENSE
|
||||||
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.
|
|
||||||
|
|
||||||
Before you contribute, I encourage you to read this project's CONTRIBUTING
|
I am glad you are thinking about contributing to nvf! The project is shaped by
|
||||||
policy (you are here) and its [LICENSE](../LICENSE) to understand how your
|
contributors and user feedback, and all contributions are appreciated.
|
||||||
contributions are licensed.
|
|
||||||
|
|
||||||
If you have any questions regarding those files, feel free to open an issue or
|
If you are unsure about anything, whether a change is necessary or if it would
|
||||||
[shoot me an email](mailto:me@notashelf.dev). Discussions tab is also available
|
be accepted _had_ you created a PR, please just ask! Or submit the issue or pull
|
||||||
for more informal discussions.
|
request anyway, the worst that can happen is that you will be politely asked to
|
||||||
|
change something. Friendly contributions are _always_ welcome.
|
||||||
|
|
||||||
## Contributing
|
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.
|
||||||
|
|
||||||
The contribution process is mostly documented in the
|
If you have any questions regarding those files, or would like to ask a question
|
||||||
[pull request template](PULL_REQUEST_TEMPLATE/pull_request_template.md). You
|
that is not covered by any of them, please feel free to open an issue!
|
||||||
will find a checklist of items to complete before submitting a pull request.
|
Discussions tab is also available for less formal discussions. You may also
|
||||||
Please make sure you complete it before submitting a pull request. If you are
|
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.
|
unsure about any of the items, please ask.
|
||||||
|
|
||||||
### Guidelines
|
### Guidelines
|
||||||
|
|
||||||
We provide instructions on a healthy contribution to neovim-flake - including
|
We provide instructions for a healthy contribution to nvf. This includes
|
||||||
styling, commit formats, how-to guides for adding new modules and options. You
|
**styling**, **commit formats**, **how-to guides for common contributions**. You
|
||||||
are very well recommended to read the contributing guidelines over at
|
are strongly encouraged to read the contributing guidelines in full over at
|
||||||
[the documentation](https://notashelf.github.io/nvf#hacking)
|
[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.
|
||||||
|
|
||||||
### Code of Conduct
|
### Code of Conduct
|
||||||
|
|
||||||
This project does not quite have a code of conduct yet. And to be perfectly
|
This project does not have a formal code of conduct yet, and to be perfectly
|
||||||
honest, I'm not sure if I want one or if it will ever have one. I'm not
|
honest I am not entirely positive if I want one or if it will _ever_ have one.
|
||||||
expecting this project to be a hotbed of activity, but I do want to make sure
|
This project is not expected to be a hotbed of activity, and I trust my
|
||||||
that everyone who does contribute feels welcome and safe. As such, I will do my
|
contributors to keep it civil and respectful.
|
||||||
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
|
If you feel that you are not being treated with respect, please contact me
|
||||||
directly.
|
directly.
|
||||||
|
|
|
||||||
120
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
120
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
|
|
@ -1,60 +1,120 @@
|
||||||
name: "🐛 Bug Report"
|
name: "🐛 Bug Report"
|
||||||
description: "Submit a bug report to help us improve"
|
description: "Submit a bug report to help us improve nvf"
|
||||||
#title: "[Bug] "
|
title: "<short description of the bug>"
|
||||||
labels: [bug]
|
labels: [bug]
|
||||||
body:
|
body:
|
||||||
- type: checkboxes
|
- type: checkboxes
|
||||||
id: no-duplicate-issues
|
|
||||||
attributes:
|
attributes:
|
||||||
label: "⚠️ Please verify that this bug has NOT been reported before."
|
label: I have confirmed that this is a bug related to nvf
|
||||||
description: "Search in the issues sections by clicking [HERE](https://github.com/notashelf/neovim-flake/issues?q=)"
|
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.
|
||||||
options:
|
options:
|
||||||
- label: "I checked all existing issues and didn't find a similar issue"
|
- required: true
|
||||||
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.
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: description
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
attributes:
|
attributes:
|
||||||
label: "Description"
|
label: Description
|
||||||
description: "You could also upload screenshots, if necessary"
|
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.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: dropdown
|
||||||
|
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
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: steps-to-reproduce
|
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:
|
validations:
|
||||||
required: true
|
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
|
- type: textarea
|
||||||
id: expected-behavior
|
id: expected-behavior
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
attributes:
|
attributes:
|
||||||
label: "👀 Expected behavior"
|
label: Expected behavior
|
||||||
description: "What did you think would or should happen?"
|
description: "What did you think would or should happen?"
|
||||||
placeholder: "..."
|
placeholder: "..."
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: actual-behavior
|
id: actual-behavior
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
attributes:
|
attributes:
|
||||||
label: "😓 Actual Behavior"
|
label: Actual Behavior
|
||||||
description: "What actually happen?"
|
description: "What actually happen?"
|
||||||
placeholder: "..."
|
placeholder: "..."
|
||||||
- type: input
|
|
||||||
id: nix-metadata
|
|
||||||
attributes:
|
|
||||||
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:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
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:
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: logs
|
id: logs
|
||||||
attributes:
|
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
|
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:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
|
||||||
76
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
76
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
|
|
@ -1,58 +1,72 @@
|
||||||
name: 🚀 Feature Request
|
name: 🚀 Feature Request
|
||||||
description: "Propose a new feature"
|
description: "Propose a new feature"
|
||||||
#title: "[Feature] "
|
title: "<short description of the desired addition>"
|
||||||
labels: [feature-request]
|
labels: [feature-request]
|
||||||
body:
|
body:
|
||||||
- type: checkboxes
|
- type: checkboxes
|
||||||
id: no-duplicate-issues
|
|
||||||
attributes:
|
attributes:
|
||||||
label: "⚠️ Please verify that this feature request has NOT been suggested before."
|
label: I have verified that this feature request has not been made before
|
||||||
description: "Search in the issues sections by clicking [HERE](https://github.com/notashelf/neovim-flake/issues?q=)"
|
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)
|
||||||
options:
|
options:
|
||||||
- label: "I checked and didn't find a similar feature request"
|
- required: true
|
||||||
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.
|
||||||
|
|
||||||
- type: dropdown
|
- type: dropdown
|
||||||
id: feature-area
|
id: feature-area
|
||||||
attributes:
|
attributes:
|
||||||
label: "🏷️ Feature Type"
|
label: Feature Type
|
||||||
description: "What kind of a feature request is this?"
|
description: Please describe the kind of addition this is
|
||||||
multiple: true
|
multiple: true
|
||||||
options:
|
options:
|
||||||
- New Command
|
- New Plugin
|
||||||
- New Addon
|
- Update Request (Plugin/Nixpkgs)
|
||||||
- API Additions
|
- Documentation Updates
|
||||||
- Other
|
- Other
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: feature-description
|
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:
|
validations:
|
||||||
required: true
|
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
|
- type: textarea
|
||||||
id: alternatives
|
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:
|
validations:
|
||||||
required: false
|
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
|
- type: textarea
|
||||||
id: additional-context
|
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:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
attributes:
|
|
||||||
label: "📝 Additional Context"
|
|
||||||
description: "Add any other context or screenshots about the feature request here."
|
|
||||||
placeholder: "..."
|
|
||||||
|
|
|
||||||
55
.github/labels.yml
vendored
Normal file
55
.github/labels.yml
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
# 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
|
||||||
1
.github/typos.toml
vendored
1
.github/typos.toml
vendored
|
|
@ -5,6 +5,7 @@ default.extend-ignore-words-re = [
|
||||||
"befores",
|
"befores",
|
||||||
"annote",
|
"annote",
|
||||||
"viw",
|
"viw",
|
||||||
|
"typ",
|
||||||
"BA", # somehow "BANanaD3V" is valid, but BA is not...
|
"BA", # somehow "BANanaD3V" is valid, but BA is not...
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
||||||
33
.github/workflows/backport.yml
vendored
Normal file
33
.github/workflows/backport.yml
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
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@v5
|
||||||
|
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+)?)$'
|
||||||
11
.github/workflows/cachix.yml
vendored
11
.github/workflows/cachix.yml
vendored
|
|
@ -21,16 +21,7 @@ jobs:
|
||||||
- nix
|
- nix
|
||||||
- maximal
|
- maximal
|
||||||
steps:
|
steps:
|
||||||
- uses: easimon/maximize-build-space@v10
|
- uses: actions/checkout@v5
|
||||||
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: Checkout
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
|
|
|
||||||
28
.github/workflows/check.yml
vendored
28
.github/workflows/check.yml
vendored
|
|
@ -17,7 +17,7 @@ jobs:
|
||||||
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
|
@ -31,7 +31,7 @@ jobs:
|
||||||
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
|
@ -39,13 +39,24 @@ jobs:
|
||||||
- name: Check formatting via Alejandra
|
- name: Check formatting via Alejandra
|
||||||
run: nix run nixpkgs#alejandra -- --check . --exclude npins
|
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:
|
check-typos:
|
||||||
name: "Check source tree for typos"
|
name: "Check source tree for typos"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Check for typos
|
- name: Check for typos
|
||||||
uses: crate-ci/typos@master
|
uses: crate-ci/typos@master
|
||||||
|
|
@ -76,7 +87,7 @@ jobs:
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Set default git branch (to reduce log spam)
|
- name: Set default git branch (to reduce log spam)
|
||||||
run: git config --global init.defaultBranch main
|
run: git config --global init.defaultBranch main
|
||||||
|
|
@ -90,7 +101,7 @@ jobs:
|
||||||
run: echo "date=$(date +'%Y-%m-%d-%H%M%S')" >> ${GITHUB_OUTPUT}
|
run: echo "date=$(date +'%Y-%m-%d-%H%M%S')" >> ${GITHUB_OUTPUT}
|
||||||
|
|
||||||
- name: Upload doc artifacts
|
- name: Upload doc artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: "${{ matrix.package }}"
|
name: "${{ matrix.package }}"
|
||||||
path: result/share/doc/nvf
|
path: result/share/doc/nvf
|
||||||
|
|
@ -104,7 +115,7 @@ jobs:
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Build linkcheck package
|
- name: Build linkcheck package
|
||||||
run: nix build .#docs-linkcheck -Lv
|
run: nix build .#docs-linkcheck -Lv
|
||||||
|
|
@ -115,7 +126,7 @@ jobs:
|
||||||
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2 # slows down checkout, but we need to compare against the previous commit on push events
|
fetch-depth: 2 # slows down checkout, but we need to compare against the previous commit on push events
|
||||||
|
|
||||||
|
|
@ -142,7 +153,8 @@ jobs:
|
||||||
- name: Checking Editorconfig conformance
|
- name: Checking Editorconfig conformance
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
< "$HOME/changed_files" nix-shell -p editorconfig-checker --run 'xargs -r editorconfig-checker -disable-indent-size'
|
< "$HOME/changed_files" nix-shell -p editorconfig-checker \
|
||||||
|
--run 'xargs -r editorconfig-checker -disable-indent-size --exclude flake.lock'
|
||||||
|
|
||||||
- if: ${{ failure() }}
|
- if: ${{ failure() }}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
||||||
2
.github/workflows/cleanup.yml
vendored
2
.github/workflows/cleanup.yml
vendored
|
|
@ -14,7 +14,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: "Delete old branches"
|
- name: "Delete old branches"
|
||||||
uses: beatlabs/delete-old-branches-action@v0.0.11
|
uses: beatlabs/delete-old-branches-action@v0.0.11
|
||||||
|
|
|
||||||
12
.github/workflows/docs-preview.yml
vendored
12
.github/workflows/docs-preview.yml
vendored
|
|
@ -28,7 +28,7 @@ jobs:
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Set default git branch (to reduce log spam)
|
- name: Set default git branch (to reduce log spam)
|
||||||
run: git config --global init.defaultBranch main
|
run: git config --global init.defaultBranch main
|
||||||
|
|
@ -90,7 +90,7 @@ jobs:
|
||||||
echo "Preview can be found at ${URL}" >> "$GITHUB_STEP_SUMMARY"
|
echo "Preview can be found at ${URL}" >> "$GITHUB_STEP_SUMMARY"
|
||||||
|
|
||||||
- name: Find Comment
|
- name: Find Comment
|
||||||
uses: peter-evans/find-comment@v3
|
uses: peter-evans/find-comment@v4
|
||||||
id: fc
|
id: fc
|
||||||
with:
|
with:
|
||||||
comment-author: "github-actions[bot]"
|
comment-author: "github-actions[bot]"
|
||||||
|
|
@ -98,7 +98,7 @@ jobs:
|
||||||
body-includes: "Live preview deployed"
|
body-includes: "Live preview deployed"
|
||||||
|
|
||||||
- name: Post live preview comment
|
- name: Post live preview comment
|
||||||
uses: peter-evans/create-or-update-comment@v4
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
env:
|
env:
|
||||||
COMMENT_ID: ${{ steps.fc.outputs.comment-id }}
|
COMMENT_ID: ${{ steps.fc.outputs.comment-id }}
|
||||||
URL: ${{ steps.prelude.outputs.URL }}
|
URL: ${{ steps.prelude.outputs.URL }}
|
||||||
|
|
@ -127,7 +127,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Delete preview for closed/merged PR
|
- name: Delete preview for closed/merged PR
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -164,7 +164,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Double check preview directory deletion
|
- name: Double check preview directory deletion
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -177,7 +177,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Post cleanup verification
|
- name: Post cleanup verification
|
||||||
uses: peter-evans/create-or-update-comment@v4
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
with:
|
with:
|
||||||
issue-number: ${{ github.event.pull_request.number }}
|
issue-number: ${{ github.event.pull_request.number }}
|
||||||
body: |
|
body: |
|
||||||
|
|
|
||||||
21
.github/workflows/labeler.yml
vendored
Normal file
21
.github/workflows/labeler.yml
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
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
|
||||||
4
.github/workflows/manual.yml
vendored
4
.github/workflows/manual.yml
vendored
|
|
@ -28,7 +28,7 @@ jobs:
|
||||||
outputs:
|
outputs:
|
||||||
should_run: ${{ steps.should_run.outputs.should_run }}
|
should_run: ${{ steps.should_run.outputs.should_run }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.7
|
- uses: actions/checkout@v5
|
||||||
- name: print latest_commit
|
- name: print latest_commit
|
||||||
run: echo ${{ github.sha }}
|
run: echo ${{ github.sha }}
|
||||||
|
|
||||||
|
|
@ -43,7 +43,7 @@ jobs:
|
||||||
if: ${{ needs.check_date.outputs.should_run != 'false' }}
|
if: ${{ needs.check_date.outputs.should_run != 'false' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.7
|
- uses: actions/checkout@v5
|
||||||
- uses: DeterminateSystems/nix-installer-action@main
|
- uses: DeterminateSystems/nix-installer-action@main
|
||||||
- run: |
|
- run: |
|
||||||
nix build .#docs -Lv
|
nix build .#docs -Lv
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
|
<!-- markdownlint-disable MD013 MD033 MD041-->
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<img src="assets/nvf-logo-work.svg" alt="nvf Logo" width="200">
|
<img src=".github/assets/nvf-logo-work.svg" alt="nvf Logo" width="192">
|
||||||
<br/>
|
<br/>
|
||||||
<h1>nvf</h1>
|
<h1>nvf</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -46,11 +47,10 @@
|
||||||
[Features]: #features
|
[Features]: #features
|
||||||
[Get Started]: #get-started
|
[Get Started]: #get-started
|
||||||
[Documentation]: #documentation
|
[Documentation]: #documentation
|
||||||
[Help]: #help
|
[Help]: #getting-help
|
||||||
[Contribute]: #contributing
|
[Contribute]: #contributing
|
||||||
[FAQ]: #frequently-asked-questions
|
[FAQ]: #frequently-asked-questions
|
||||||
[Credits]: #credits
|
[Credits]: #credits
|
||||||
[License]: #license
|
|
||||||
|
|
||||||
**[<kbd><br> Features <br></kbd>][Features]**
|
**[<kbd><br> Features <br></kbd>][Features]**
|
||||||
**[<kbd><br> Get Started <br></kbd>][Get Started]**
|
**[<kbd><br> Get Started <br></kbd>][Get Started]**
|
||||||
|
|
@ -84,21 +84,22 @@
|
||||||
customizable through the Nix module system.
|
customizable through the Nix module system.
|
||||||
- Not comfortable with a full-nix config or want to bring your Lua config? You
|
- Not comfortable with a full-nix config or want to bring your Lua config? You
|
||||||
can do just that, no unnecessary restrictions.
|
can do just that, no unnecessary restrictions.
|
||||||
- Lazyloading 💤? We got it! Lazyload both internal and external plugins at
|
- Lazyloading? We got it! Lazyload both internal and external plugins at will
|
||||||
will.
|
💤 .
|
||||||
- nvf allows _ordering configuration bits_ using [DAG] (_Directed acyclic
|
- nvf allows _ordering configuration bits_ using [DAG] (_Directed acyclic
|
||||||
graph_)s. It has never been easier to construct an editor configuration
|
graph_)s. It has never been easier to construct an editor configuration
|
||||||
deterministically!
|
deterministically!
|
||||||
- nvf exposes everything you need to avoid a vendor lock-in. Which means you
|
- 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
|
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.
|
for them! Though, of course, feel free to request them.
|
||||||
- Use plugins from anywhere. Inputs, npins, nixpkgs... You name it.
|
- Use plugins from anywhere: inputs, npins, nixpkgs... You name it.
|
||||||
- Add your own modules, with ease. It's all built-in!
|
- Add your own modules with ease. It's all built-in!
|
||||||
- **Well-documented**: Documentation is priority. You will _never_ face
|
- **Well-documented**: Documentation is priority. You will _never_ face
|
||||||
undocumented, obscure behaviour.
|
undocumented, obscure behaviour.
|
||||||
- Changes, breaking or otherwise, will be communicated in the [release notes]
|
- Any and all changes, breaking or otherwise, will be communicated in the
|
||||||
|
[release notes].
|
||||||
- Refer to the [FAQ section] for answers to common questions.
|
- Refer to the [FAQ section] for answers to common questions.
|
||||||
- Your question not there? Head to the to the [discussions tab]!
|
- Your question not there? Head to the [discussions tab]!
|
||||||
- **Idiomatic**: nvf does things ✨ _the right way_ ✨ - the codebase is, and
|
- **Idiomatic**: nvf does things ✨ _the right way_ ✨ - the codebase is, and
|
||||||
will, remain maintainable for myself and any contributors.
|
will, remain maintainable for myself and any contributors.
|
||||||
- **Community-Led**: we would like nvf to be fully capable of accomplishing what
|
- **Community-Led**: we would like nvf to be fully capable of accomplishing what
|
||||||
|
|
@ -121,7 +122,7 @@ the following in order to take **nvf** out for a spin.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Run the default package
|
# Run the default package
|
||||||
nix run github:notashelf/nvf
|
$ nix run github:notashelf/nvf
|
||||||
```
|
```
|
||||||
|
|
||||||
This will get you a feel for the base configuration and UI design. Though, none
|
This will get you a feel for the base configuration and UI design. Though, none
|
||||||
|
|
@ -129,20 +130,25 @@ of the configuration options are final as **nvf** is designed to be modular and
|
||||||
configurable.
|
configurable.
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> The flake exposes `#nix` as the default package, providing minimal language
|
> The flake exposes `nix` as the default package, which will be evaluated when
|
||||||
> support and various utilities. You may also use the `#nix` or `#maximal`
|
> you run `nix build` or `nix run` on this repo. It is minimal, and providing
|
||||||
> packages provided by the this flake to get try out different configurations.
|
> 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 to get a different configuration.
|
It is as simple as changing the target output in your `nix run` command to get a
|
||||||
For example, to get a configuration with large language coverage, run:
|
different configuration. For example, to get a configuration with large language
|
||||||
|
coverage, run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Run the maximal package
|
# Run the maximal package
|
||||||
nix run github:notashelf/nvf#maximal
|
$ nix run github:notashelf/nvf#maximal
|
||||||
```
|
```
|
||||||
|
|
||||||
Similar instructions will apply for `nix profile install`. However, you are
|
Similar instructions will apply for `nix profile install`. However, you are
|
||||||
recommended to instead use the module system as described in the manual.
|
recommended to instead use the module system as described in the [nvf manual].
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> The `maximal` configuration is quite large, and might take a while to build.
|
> The `maximal` configuration is quite large, and might take a while to build.
|
||||||
|
|
@ -155,6 +161,10 @@ instructions.
|
||||||
|
|
||||||
## Documentation
|
## 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
|
### Installation
|
||||||
|
|
||||||
The _recommended_ way of installing nvf is using either the NixOS or the
|
The _recommended_ way of installing nvf is using either the NixOS or the
|
||||||
|
|
@ -163,7 +173,7 @@ install **nvf** as a standalone package, or a flake output.
|
||||||
|
|
||||||
See the rendered [nvf manual] for detailed and up-to-date installation guides,
|
See the rendered [nvf manual] for detailed and up-to-date installation guides,
|
||||||
configurations, available options, release notes and more. Tips for installing
|
configurations, available options, release notes and more. Tips for installing
|
||||||
userspace plugins is also contained in the documentation.
|
userspace plugins are also contained in the documentation.
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> While using NixOS or Home-Manager modules,
|
> While using NixOS or Home-Manager modules,
|
||||||
|
|
@ -180,16 +190,18 @@ requests are also welcome, and appreciated.
|
||||||
If you are confused, stuck or would like to ask a simple question; you may
|
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.
|
create an issue on the [issue tracker] to ask questions or report bugs.
|
||||||
|
|
||||||
We are not not yet on spaces like matrix or IRC, so please use the issue tracker
|
We are not yet on spaces like matrix or IRC, so please use the issue tracker for
|
||||||
for now.
|
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
|
||||||
|
|
||||||
|
[contributing guide]: .github/CONTRIBUTING.md
|
||||||
|
|
||||||
I am always looking for new ways to help improve this flake. If you would like
|
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
|
to contribute, please read the [contributing guide] before submitting a pull
|
||||||
submitting a pull request. You can also create an issue on the [issue tracker]
|
request. You can also create an issue on the [issue tracker] before submitting a
|
||||||
before submitting a pull request if you would like to discuss a feature or bug
|
pull request if you would like to discuss a feature or bug fix.
|
||||||
fix.
|
|
||||||
|
|
||||||
## Frequently Asked Questions
|
## Frequently Asked Questions
|
||||||
|
|
||||||
|
|
@ -225,7 +237,7 @@ 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
|
any activity on the main branch, consider taking a look at the
|
||||||
[list of branches] or the [list of open pull requests]. You may also consider
|
[list of branches] or the [list of open pull requests]. You may also consider
|
||||||
_testing_ those release branches to get access to new features ahead of time and
|
_testing_ those release branches to get access to new features ahead of time and
|
||||||
better prepare to breaking changes.
|
better prepare for breaking changes.
|
||||||
|
|
||||||
**Q**: Will you support non-flake installations?
|
**Q**: Will you support non-flake installations?
|
||||||
|
|
||||||
|
|
@ -240,19 +252,19 @@ of a configuration generated from Nix?
|
||||||
|
|
||||||
**A**: Yes! Add `"~/.config/nvim"` to `vim.additionalRuntimePaths = [ ... ]` and
|
**A**: Yes! Add `"~/.config/nvim"` to `vim.additionalRuntimePaths = [ ... ]` and
|
||||||
any plugins you want to load to `vim.startPlugins`. This will load your
|
any plugins you want to load to `vim.startPlugins`. This will load your
|
||||||
configuration from `~/.config/nvim`. You may still use `vim.*` to modify
|
configuration from `~/.config/nvim`. You may still use `vim.*` options in Nix to
|
||||||
Neovim's behaviour with Nix.
|
further configure Neovim.
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
### Co-Maintainers
|
### Co-Maintainers
|
||||||
|
|
||||||
Alongside [myself](https://github.com/notashelf), nvf is developed by those
|
Alongside [myself](https://github.com/notashelf), nvf is developed by those
|
||||||
talented folk. nvf would not be what it is today without their invaluable
|
talented folk. **nvf** would not be what it is today without their invaluable
|
||||||
contributions.
|
contributions.
|
||||||
|
|
||||||
- [**@horriblename**](https://github.com/horriblename)
|
- [**@horriblename**](https://github.com/horriblename)
|
||||||
([Liberapay](https://liberapay.com/horriblename/))- For actively implementing
|
([Liberapay](https://liberapay.com/horriblename/)) - For actively implementing
|
||||||
planned features and quality of life updates.
|
planned features and quality of life updates.
|
||||||
- [**@Soliprem**](https://github.com/soliprem) - For rigorously implementing
|
- [**@Soliprem**](https://github.com/soliprem) - For rigorously implementing
|
||||||
missing features and excellent work on new language modules.
|
missing features and excellent work on new language modules.
|
||||||
|
|
@ -15,15 +15,20 @@ isMaximal: {
|
||||||
|
|
||||||
spellcheck = {
|
spellcheck = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
programmingWordlist.enable = isMaximal;
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
|
# This must be enabled for the language modules to hook into
|
||||||
|
# the LSP API.
|
||||||
|
enable = true;
|
||||||
|
|
||||||
formatOnSave = true;
|
formatOnSave = true;
|
||||||
lspkind.enable = false;
|
lspkind.enable = false;
|
||||||
lightbulb.enable = true;
|
lightbulb.enable = true;
|
||||||
lspsaga.enable = false;
|
lspsaga.enable = false;
|
||||||
trouble.enable = true;
|
trouble.enable = true;
|
||||||
lspSignature.enable = true;
|
lspSignature.enable = !isMaximal; # conflicts with blink in maximal
|
||||||
otter-nvim.enable = isMaximal;
|
otter-nvim.enable = isMaximal;
|
||||||
nvim-docs-view.enable = isMaximal;
|
nvim-docs-view.enable = isMaximal;
|
||||||
};
|
};
|
||||||
|
|
@ -38,7 +43,6 @@ isMaximal: {
|
||||||
# This section does not include a comprehensive list of available language modules.
|
# This section does not include a comprehensive list of available language modules.
|
||||||
# To list all available language module options, please visit the nvf manual.
|
# To list all available language module options, please visit the nvf manual.
|
||||||
languages = {
|
languages = {
|
||||||
enableLSP = true;
|
|
||||||
enableFormat = true;
|
enableFormat = true;
|
||||||
enableTreesitter = true;
|
enableTreesitter = true;
|
||||||
enableExtraDiagnostics = true;
|
enableExtraDiagnostics = true;
|
||||||
|
|
@ -124,7 +128,15 @@ isMaximal: {
|
||||||
|
|
||||||
autopairs.nvim-autopairs.enable = true;
|
autopairs.nvim-autopairs.enable = true;
|
||||||
|
|
||||||
autocomplete.nvim-cmp.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;
|
snippets.luasnip.enable = true;
|
||||||
|
|
||||||
filetree = {
|
filetree = {
|
||||||
|
|
@ -150,6 +162,7 @@ isMaximal: {
|
||||||
enable = true;
|
enable = true;
|
||||||
gitsigns.enable = true;
|
gitsigns.enable = true;
|
||||||
gitsigns.codeActions.enable = false; # throws an annoying debug message
|
gitsigns.codeActions.enable = false; # throws an annoying debug message
|
||||||
|
neogit.enable = isMaximal;
|
||||||
};
|
};
|
||||||
|
|
||||||
minimap = {
|
minimap = {
|
||||||
|
|
@ -179,6 +192,9 @@ isMaximal: {
|
||||||
surround.enable = isMaximal;
|
surround.enable = isMaximal;
|
||||||
leetcode-nvim.enable = isMaximal;
|
leetcode-nvim.enable = isMaximal;
|
||||||
multicursors.enable = isMaximal;
|
multicursors.enable = isMaximal;
|
||||||
|
smart-splits.enable = isMaximal;
|
||||||
|
undotree.enable = isMaximal;
|
||||||
|
nvim-biscuits.enable = isMaximal;
|
||||||
|
|
||||||
motion = {
|
motion = {
|
||||||
hop.enable = true;
|
hop.enable = true;
|
||||||
|
|
@ -187,6 +203,7 @@ isMaximal: {
|
||||||
};
|
};
|
||||||
images = {
|
images = {
|
||||||
image-nvim.enable = false;
|
image-nvim.enable = false;
|
||||||
|
img-clip.enable = isMaximal;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -235,6 +252,7 @@ isMaximal: {
|
||||||
cmp.enable = isMaximal;
|
cmp.enable = isMaximal;
|
||||||
};
|
};
|
||||||
codecompanion-nvim.enable = false;
|
codecompanion-nvim.enable = false;
|
||||||
|
avante-nvim.enable = isMaximal;
|
||||||
};
|
};
|
||||||
|
|
||||||
session = {
|
session = {
|
||||||
|
|
|
||||||
15
default.nix
Normal file
15
default.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
(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
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
inherit
|
inherit
|
||||||
(
|
(
|
||||||
(lib.evalModules {
|
(lib.evalModules {
|
||||||
|
specialArgs = {inherit inputs;};
|
||||||
modules =
|
modules =
|
||||||
import ../modules/modules.nix {
|
import ../modules/modules.nix {
|
||||||
inherit lib pkgs;
|
inherit lib pkgs;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,15 @@
|
||||||
# Configuring nvf {#ch-configuring}
|
# Configuring nvf {#ch-configuring}
|
||||||
|
|
||||||
|
[helpful tips section]: #ch-helpful-tips
|
||||||
|
|
||||||
|
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 [appendix](/nvf/options.html)
|
||||||
|
|
||||||
```{=include=} chapters
|
```{=include=} chapters
|
||||||
configuring/custom-package.md
|
configuring/custom-package.md
|
||||||
configuring/custom-plugins.md
|
configuring/custom-plugins.md
|
||||||
|
|
@ -7,4 +17,5 @@ configuring/overriding-plugins.md
|
||||||
configuring/languages.md
|
configuring/languages.md
|
||||||
configuring/dags.md
|
configuring/dags.md
|
||||||
configuring/dag-entries.md
|
configuring/dag-entries.md
|
||||||
|
configuring/autocmds.md
|
||||||
```
|
```
|
||||||
|
|
|
||||||
119
docs/manual/configuring/autocmds.md
Normal file
119
docs/manual/configuring/autocmds.md
Normal file
|
|
@ -0,0 +1,119 @@
|
||||||
|
# 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.
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
# Custom Neovim Package {#ch-custom-package}
|
# Custom Neovim Package {#ch-custom-package}
|
||||||
|
|
||||||
As of v0.5, you may now specify the Neovim package that will be wrapped with
|
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.
|
your configuration. This is done with the [](#opt-vim.package) option.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{inputs, pkgs, ...}: {
|
{inputs, pkgs, ...}: {
|
||||||
# using the neovim-nightly overlay
|
# using the neovim-nightly overlay
|
||||||
vim.package = inputs.neovim-overlay.packages.${pkgs.system}.neovim;
|
vim.package = inputs.neovim-overlay.packages.${pkgs.stdenv.system}.neovim;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,33 @@
|
||||||
# Custom Plugins {#ch-custom-plugins}
|
# Custom Plugins {#ch-custom-plugins}
|
||||||
|
|
||||||
**nvf**, by default, exposes a wide variety of plugins as module options for
|
**nvf** exposes a very wide variety of plugins by default, which are consumed by
|
||||||
your convenience and bundles necessary dependencies into **nvf**'s runtime. In
|
module options. This is done for your convenience, and to bundle all necessary
|
||||||
case a plugin is not available in **nvf**, you may consider making a pull
|
dependencies into **nvf**'s runtime with full control of versioning, testing and
|
||||||
request to **nvf** to include it as a module or you may add it to your
|
dependencies. In the case a plugin you need is _not_ available, you may consider
|
||||||
configuration locally.
|
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.
|
||||||
|
|
||||||
## Adding Plugins {#ch-adding-plugins}
|
## Adding Plugins {#ch-adding-plugins}
|
||||||
|
|
||||||
There are multiple ways of adding custom plugins to your **nvf** configuration.
|
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.
|
||||||
|
|
||||||
You can use custom plugins, before they are implemented in the flake. To add a
|
:::{.info}
|
||||||
plugin to the runtime, you need to add it to the [](#opt-vim.startPlugins) list
|
|
||||||
in your configuration.
|
|
||||||
|
|
||||||
Adding a plugin to `startPlugins` will not allow you to configure the plugin
|
To add a plugin to your runtime, you will need to add it to
|
||||||
that you have added, but **nvf** provides multiple way of configuring any custom
|
[](#opt-vim.startPlugins) list in your configuration. This is akin to cloning a
|
||||||
plugins that you might have added to your configuration.
|
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.
|
||||||
|
|
||||||
```{=include=} sections
|
```{=include=} sections
|
||||||
custom-plugins/configuring.md
|
custom-plugins/configuring.md
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,20 @@
|
||||||
# Configuring {#sec-configuring-plugins}
|
# Configuring {#sec-configuring-plugins}
|
||||||
|
|
||||||
Just making the plugin to your Neovim configuration available might not always
|
Just making the plugin to your Neovim configuration available might not always
|
||||||
be enough. In that case, you can write custom lua config using either
|
be enough., for example, if the plugin requires a setup table. In that case, you
|
||||||
`config.vim.lazy.plugins.*.setupOpts` `config.vim.extraPlugins.*.setup` or
|
can write custom Lua configuration using one of
|
||||||
`config.vim.luaConfigRC`.
|
|
||||||
|
|
||||||
The first option uses an extended version of `lz.n`'s PluginSpec. `setupModule`
|
- `config.vim.lazy.plugins.*.setupOpts`
|
||||||
and `setupOpt` can be used if the plugin uses a `require('module').setup(...)`
|
- `config.vim.extraPlugins.*.setup`
|
||||||
pattern. Otherwise, the `before` and `after` hooks should do what you need.
|
- `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.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
|
|
@ -25,50 +32,61 @@ pattern. Otherwise, the `before` and `after` hooks should do what you need.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The second option uses an attribute set, which maps DAG section names to a
|
## 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
|
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
|
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
|
that the `extraPlugins` option has its own DAG scope), and the its setup code
|
||||||
respectively. For example:
|
respectively. For example:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
config.vim.extraPlugins = with pkgs.vimPlugins; {
|
{pkgs, ...}: {
|
||||||
aerial = {
|
config.vim.extraPlugins = {
|
||||||
package = aerial-nvim;
|
aerial = {
|
||||||
setup = "require('aerial').setup {}";
|
package = pkgs.vimPlugins.aerial-nvim;
|
||||||
};
|
setup = "require('aerial').setup {}";
|
||||||
|
};
|
||||||
|
|
||||||
harpoon = {
|
harpoon = {
|
||||||
package = harpoon;
|
package = pkgs.vimPlugins.harpoon;
|
||||||
setup = "require('harpoon').setup {}";
|
setup = "require('harpoon').setup {}";
|
||||||
after = ["aerial"]; # place harpoon configuration after aerial
|
after = ["aerial"]; # place harpoon configuration after aerial
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The third option also uses an attribute set, but this one is resolved as a DAG
|
### 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.
|
directly. The attribute names denote the section names, and the values lua code.
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
# this will create an "aquarium" section in your init.lua with the contents of your custom config
|
# This will create a section called "aquarium" in the 'init.lua' with the
|
||||||
# which will be *appended* to the rest of your configuration, inside your init.vim
|
# 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')";
|
config.vim.luaConfigRC.aquarium = "vim.cmd('colorscheme aquiarum')";
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- deno-fmt-ignore-start -->
|
<!-- deno-fmt-ignore-start -->
|
||||||
|
[DAG system]: #ch-using-dags
|
||||||
|
[DAG section]: #ch-dag-entries
|
||||||
|
|
||||||
::: {.note}
|
::: {.note}
|
||||||
One of the greatest strengths of nvf is the ability to order
|
One of the **greatest strengths** of **nvf** is the ability to order
|
||||||
snippets of configuration via the DAG system. It will allow specifying positions
|
configuration snippets precisely using the [DAG system]. DAGs
|
||||||
of individual sections of configuration as needed. nvf provides helper functions
|
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
|
in the extended library, usually under `inputs.nvf.lib.nvim.dag` that you may
|
||||||
use.
|
use.
|
||||||
|
|
||||||
Please refer to the [DAG section](#ch-dag-entries) in the nvf manual
|
Please refer to the [DAG section] in the nvf manual
|
||||||
to find out more about the DAG system.
|
to find out more about the DAG system.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
<!-- deno-fmt-ignore-end -->
|
<!-- deno-fmt-ignore-end -->
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
# Lazy Method {#sec-lazy-method}
|
# Lazy Method {#sec-lazy-method}
|
||||||
|
|
||||||
As of version **0.7**, we exposed an API for configuring lazy-loaded plugins via
|
As of version **0.7**, an API is exposed to allow configuring lazy-loaded
|
||||||
`lz.n` and `lzn-auto-require`.
|
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
|
```nix
|
||||||
{
|
{
|
||||||
|
|
@ -41,7 +42,8 @@ As of version **0.7**, we exposed an API for configuring lazy-loaded plugins via
|
||||||
|
|
||||||
## LazyFile event {#sec-lazyfile-event}
|
## LazyFile event {#sec-lazyfile-event}
|
||||||
|
|
||||||
You can use the `LazyFile` user event to load a plugin when a file is opened:
|
**nvf** re-implements `LazyFile` as a familiar user event to load a plugin when
|
||||||
|
a file is opened:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
|
|
@ -55,5 +57,6 @@ You can use the `LazyFile` user event to load a plugin when a file is opened:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
You can consider `LazyFile` as an alias to
|
You can consider the `LazyFile` event as an alias to the combination of
|
||||||
`["BufReadPost" "BufNewFile" "BufWritePre"]`
|
`"BufReadPost"`, `"BufNewFile"` and `"BufWritePre"`, i.e., a list containing all
|
||||||
|
three of those events: `["BufReadPost" "BufNewFile" "BufWritePre"]`
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,31 @@
|
||||||
# Legacy Method {#sec-legacy-method}
|
# Legacy Method {#sec-legacy-method}
|
||||||
|
|
||||||
Prior to version v0.5, the method of adding new plugins was adding the plugin
|
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
|
package to [](#opt-vim.startPlugins) and adding its configuration as a DAG under
|
||||||
`vim.configRC` or `vim.luaConfigRC`. Users who have not yet updated to 0.5, or
|
one of `vim.configRC` or [](#opt-vim.luaConfigRC). While `configRC` has been
|
||||||
prefer a more hands-on approach may use the old method where the load order of
|
deprecated, users who have not yet updated to 0.5 or those who prefer a more
|
||||||
the plugins is determined by DAGs.
|
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 plugins {#sec-adding-plugins}
|
## Adding New Plugins {#sec-adding-new-plugins}
|
||||||
|
|
||||||
To add a plugin not available in nvf as a module to your configuration, you may
|
To add a plugin not available in **nvf** as a module to your configuration using
|
||||||
add it to [](#opt-vim.startPlugins) in order to make it available to Neovim at
|
the legacy method, you must add it to [](#opt-vim.startPlugins) in order to make
|
||||||
runtime.
|
it available to Neovim at runtime.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
# Add a Neovim plugin from Nixpkgs to the runtime.
|
# 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];
|
vim.startPlugins = [pkgs.vimPlugins.aerial-nvim];
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
And to configure the added plugin, you can use the `luaConfigRC` option to
|
Once the package is available in Neovim's runtime, you may use the `luaConfigRC`
|
||||||
provide configuration as a DAG using the **nvf** extended library.
|
option to provide configuration as a DAG using the **nvf** extended library in
|
||||||
|
order to configure the added plugin,
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{inputs, ...}: let
|
{inputs, ...}: let
|
||||||
|
|
@ -29,6 +34,8 @@ provide configuration as a DAG using the **nvf** extended library.
|
||||||
# to specialArgs, the 'inputs' prefix may be omitted.
|
# to specialArgs, the 'inputs' prefix may be omitted.
|
||||||
inherit (inputs.nvf.lib.nvim.dag) entryAnywhere;
|
inherit (inputs.nvf.lib.nvim.dag) entryAnywhere;
|
||||||
in {
|
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 ''
|
vim.luaConfigRC.aerial-nvim= entryAnywhere ''
|
||||||
require('aerial').setup {
|
require('aerial').setup {
|
||||||
-- your configuration here
|
-- your configuration here
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
# Non-lazy Method {#sec-non-lazy-method}
|
# Non-lazy Method {#sec-non-lazy-method}
|
||||||
|
|
||||||
As of version **0.5**, we have a more extensive API for configuring plugins,
|
As of version **0.5**, we have a more extensive API for configuring plugins that
|
||||||
under `vim.extraPlugins`. Instead of using DAGs exposed by the library, you may
|
should be preferred over the legacy method. This API is available as
|
||||||
use the extra plugin module as follows:
|
[](#opt-vim.extraPlugins). Instead of using DAGs exposed by the library
|
||||||
|
_directly_, you may use the extra plugin module as follows:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{pkgs, ...}: {
|
||||||
config.vim.extraPlugins = with pkgs.vimPlugins; {
|
config.vim.extraPlugins = {
|
||||||
aerial = {
|
aerial = {
|
||||||
package = aerial-nvim;
|
package = pkgs.vimPlugins.aerial-nvim;
|
||||||
setup = ''
|
setup = ''
|
||||||
require('aerial').setup {
|
require('aerial').setup {
|
||||||
-- some lua configuration here
|
-- some lua configuration here
|
||||||
|
|
@ -17,10 +18,12 @@ use the extra plugin module as follows:
|
||||||
};
|
};
|
||||||
|
|
||||||
harpoon = {
|
harpoon = {
|
||||||
package = harpoon;
|
package = pkgs.vimPlugins.harpoon;
|
||||||
setup = "require('harpoon').setup {}";
|
setup = "require('harpoon').setup {}";
|
||||||
after = ["aerial"];
|
after = ["aerial"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This provides a level of abstraction over the DAG system for faster iteration.
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,17 @@ explains in more detail the overall usage logic of the DAG type.
|
||||||
|
|
||||||
## entryAnywhere {#sec-types-dag-entryAnywhere}
|
## entryAnywhere {#sec-types-dag-entryAnywhere}
|
||||||
|
|
||||||
> `lib.dag.entryAnywhere (value: T) : DagEntry<T>`
|
> `nvf.lib.nvim.dag.entryAnywhere (value: T) : DagEntry<T>`
|
||||||
|
|
||||||
Indicates that `value` can be placed anywhere within the DAG. This is also the
|
Indicates that `value` can be placed anywhere within the DAG. This is also the
|
||||||
default for plain attribute set entries, that is
|
default for plain attribute set entries, that is
|
||||||
|
|
||||||
```nix
|
```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 = {
|
foo.bar = {
|
||||||
a = lib.dag.entryAnywhere 0;
|
a = nvf.lib.nvim.dag.entryAnywhere 0;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -37,7 +40,7 @@ are equivalent.
|
||||||
|
|
||||||
## entryAfter {#ch-types-dag-entryAfter}
|
## entryAfter {#ch-types-dag-entryAfter}
|
||||||
|
|
||||||
> `lib.dag.entryAfter (afters: list string) (value: T) : DagEntry<T>`
|
> `nvf.lib.nvim.dag.entryAfter (afters: list string) (value: T) : DagEntry<T>`
|
||||||
|
|
||||||
Indicates that `value` must be placed _after_ each of the attribute names in the
|
Indicates that `value` must be placed _after_ each of the attribute names in the
|
||||||
given list. For example
|
given list. For example
|
||||||
|
|
@ -45,7 +48,7 @@ given list. For example
|
||||||
```nix
|
```nix
|
||||||
foo.bar = {
|
foo.bar = {
|
||||||
a = 0;
|
a = 0;
|
||||||
b = lib.dag.entryAfter [ "a" ] 1;
|
b = nvf.lib.nvim.dag.entryAfter [ "a" ] 1;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -53,14 +56,14 @@ would place `b` after `a` in the graph.
|
||||||
|
|
||||||
## entryBefore {#ch-types-dag-entryBefore}
|
## entryBefore {#ch-types-dag-entryBefore}
|
||||||
|
|
||||||
> `lib.dag.entryBefore (befores: list string) (value: T) : DagEntry<T>`
|
> `nvf.lib.nvim.dag.entryBefore (befores: list string) (value: T) : DagEntry<T>`
|
||||||
|
|
||||||
Indicates that `value` must be placed _before_ each of the attribute names in
|
Indicates that `value` must be placed _before_ each of the attribute names in
|
||||||
the given list. For example
|
the given list. For example
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
foo.bar = {
|
foo.bar = {
|
||||||
b = lib.dag.entryBefore [ "a" ] 1;
|
b = nvf.lib.nvim.dag.entryBefore [ "a" ] 1;
|
||||||
a = 0;
|
a = 0;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
@ -69,7 +72,7 @@ would place `b` before `a` in the graph.
|
||||||
|
|
||||||
## entryBetween {#sec-types-dag-entryBetween}
|
## entryBetween {#sec-types-dag-entryBetween}
|
||||||
|
|
||||||
> `lib.dag.entryBetween (befores: list string) (afters: list string) (value: T) : DagEntry<T>`
|
> `nvf.lib.nvim.dag.entryBetween (befores: list string) (afters: list string) (value: T) : DagEntry<T>`
|
||||||
|
|
||||||
Indicates that `value` must be placed _before_ the attribute names in the first
|
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
|
list and _after_ the attribute names in the second list. For example
|
||||||
|
|
@ -77,7 +80,7 @@ list and _after_ the attribute names in the second list. For example
|
||||||
```nix
|
```nix
|
||||||
foo.bar = {
|
foo.bar = {
|
||||||
a = 0;
|
a = 0;
|
||||||
c = lib.dag.entryBetween [ "b" ] [ "a" ] 2;
|
c = nvf.lib.nvim.dag.entryBetween [ "b" ] [ "a" ] 2;
|
||||||
b = 1;
|
b = 1;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
@ -92,13 +95,13 @@ functions take a `tag` as argument and the DAG entries will be named
|
||||||
|
|
||||||
## entriesAnywhere {#sec-types-dag-entriesAnywhere}
|
## entriesAnywhere {#sec-types-dag-entriesAnywhere}
|
||||||
|
|
||||||
> `lib.dag.entriesAnywhere (tag: string) (values: [T]) : Dag<T>`
|
> `nvf.lib.nvim.dag.entriesAnywhere (tag: string) (values: [T]) : Dag<T>`
|
||||||
|
|
||||||
Creates a DAG with the given values with each entry labeled using the given tag.
|
Creates a DAG with the given values with each entry labeled using the given tag.
|
||||||
For example
|
For example
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
foo.bar = lib.dag.entriesAnywhere "a" [ 0 1 ];
|
foo.bar = nvf.lib.nvim.dag.entriesAnywhere "a" [ 0 1 ];
|
||||||
```
|
```
|
||||||
|
|
||||||
is equivalent to
|
is equivalent to
|
||||||
|
|
@ -106,13 +109,13 @@ is equivalent to
|
||||||
```nix
|
```nix
|
||||||
foo.bar = {
|
foo.bar = {
|
||||||
a-0 = 0;
|
a-0 = 0;
|
||||||
a-1 = lib.dag.entryAfter [ "a-0" ] 1;
|
a-1 = nvf.lib.nvim.dag.entryAfter [ "a-0" ] 1;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## entriesAfter {#sec-types-dag-entriesAfter}
|
## entriesAfter {#sec-types-dag-entriesAfter}
|
||||||
|
|
||||||
> `lib.dag.entriesAfter (tag: string) (afters: list string) (values: [T]) : Dag<T>`
|
> `nvf.lib.nvim.dag.entriesAfter (tag: string) (afters: list string) (values: [T]) : Dag<T>`
|
||||||
|
|
||||||
Creates a DAG with the given values with each entry labeled using the given tag.
|
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
|
The list of values are placed are placed _after_ each of the attribute names in
|
||||||
|
|
@ -120,7 +123,7 @@ The list of values are placed are placed _after_ each of the attribute names in
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
foo.bar =
|
foo.bar =
|
||||||
{ b = 0; } // lib.dag.entriesAfter "a" [ "b" ] [ 1 2 ];
|
{ b = 0; } // nvf.lib.nvim.dag.entriesAfter "a" [ "b" ] [ 1 2 ];
|
||||||
```
|
```
|
||||||
|
|
||||||
is equivalent to
|
is equivalent to
|
||||||
|
|
@ -128,14 +131,14 @@ is equivalent to
|
||||||
```nix
|
```nix
|
||||||
foo.bar = {
|
foo.bar = {
|
||||||
b = 0;
|
b = 0;
|
||||||
a-0 = lib.dag.entryAfter [ "b" ] 1;
|
a-0 = nvf.lib.nvim.dag.entryAfter [ "b" ] 1;
|
||||||
a-1 = lib.dag.entryAfter [ "a-0" ] 2;
|
a-1 = nvf.lib.nvim.dag.entryAfter [ "a-0" ] 2;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## entriesBefore {#sec-types-dag-entriesBefore}
|
## entriesBefore {#sec-types-dag-entriesBefore}
|
||||||
|
|
||||||
> `lib.dag.entriesBefore (tag: string) (befores: list string) (values: [T]) : Dag<T>`
|
> `nvf.lib.nvim.dag.entriesBefore (tag: string) (befores: list string) (values: [T]) : Dag<T>`
|
||||||
|
|
||||||
Creates a DAG with the given values with each entry labeled using the given tag.
|
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`.
|
The list of values are placed _before_ each of the attribute names in `befores`.
|
||||||
|
|
@ -143,7 +146,7 @@ For example
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
foo.bar =
|
foo.bar =
|
||||||
{ b = 0; } // lib.dag.entriesBefore "a" [ "b" ] [ 1 2 ];
|
{ b = 0; } // nvf.lib.nvim.dag.entriesBefore "a" [ "b" ] [ 1 2 ];
|
||||||
```
|
```
|
||||||
|
|
||||||
is equivalent to
|
is equivalent to
|
||||||
|
|
@ -152,13 +155,13 @@ is equivalent to
|
||||||
foo.bar = {
|
foo.bar = {
|
||||||
b = 0;
|
b = 0;
|
||||||
a-0 = 1;
|
a-0 = 1;
|
||||||
a-1 = lib.dag.entryBetween [ "b" ] [ "a-0" ] 2;
|
a-1 = nvf.lib.nvim.dag.entryBetween [ "b" ] [ "a-0" ] 2;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## entriesBetween {#sec-types-dag-entriesBetween}
|
## entriesBetween {#sec-types-dag-entriesBetween}
|
||||||
|
|
||||||
> `lib.dag.entriesBetween (tag: string) (befores: list string) (afters: list string) (values: [T]) : Dag<T>`
|
> `nvf.lib.nvim.dag.entriesBetween (tag: string) (befores: list string) (afters: list string) (values: [T]) : Dag<T>`
|
||||||
|
|
||||||
Creates a DAG with the given values with each entry labeled using the given tag.
|
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`
|
The list of values are placed _before_ each of the attribute names in `befores`
|
||||||
|
|
@ -166,7 +169,7 @@ and _after_ each of the attribute names in `afters`. For example
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
foo.bar =
|
foo.bar =
|
||||||
{ b = 0; c = 3; } // lib.dag.entriesBetween "a" [ "b" ] [ "c" ] [ 1 2 ];
|
{ b = 0; c = 3; } // nvf.lib.nvim.dag.entriesBetween "a" [ "b" ] [ "c" ] [ 1 2 ];
|
||||||
```
|
```
|
||||||
|
|
||||||
is equivalent to
|
is equivalent to
|
||||||
|
|
@ -175,7 +178,7 @@ is equivalent to
|
||||||
foo.bar = {
|
foo.bar = {
|
||||||
b = 0;
|
b = 0;
|
||||||
c = 3;
|
c = 3;
|
||||||
a-0 = lib.dag.entryAfter [ "c" ] 1;
|
a-0 = nvf.lib.nvim.dag.entryAfter [ "c" ] 1;
|
||||||
a-1 = lib.dag.entryBetween [ "b" ] [ "a-0" ] 2;
|
a-1 = nvf.lib.nvim.dag.entryBetween [ "b" ] [ "a-0" ] 2;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,22 @@
|
||||||
# LSP Custom Packages/Command {#sec-languages-custom-lsp-packages}
|
# LSP Custom Packages/Command {#sec-languages-custom-lsp-packages}
|
||||||
|
|
||||||
In any of the `opt.languages.<language>.lsp.package` options you can provide
|
One of the strengths of **nvf** is convenient aliases to quickly configure LSP
|
||||||
your own LSP package, or provide the command to launch the language server, as a
|
servers through the Nix module system. By default the LSP packages for relevant
|
||||||
list of strings. You can use this to skip automatic installation of a language
|
language modules will be pulled into the closure. If this is not desirable, you
|
||||||
server, and instead use the one found in your `$PATH` during runtime, for
|
may provide **a custom LSP package** (e.g., a Bash script that calls a command)
|
||||||
example:
|
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:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
vim.languages.java = {
|
vim.languages.java = {
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# this expects jdt-language-server to be in your PATH
|
|
||||||
# or in `vim.extraPackages`
|
# 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.
|
||||||
package = ["jdt-language-server" "-data" "~/.cache/jdtls/workspace"];
|
package = ["jdt-language-server" "-data" "~/.cache/jdtls/workspace"];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
The [additional plugins section](#sec-additional-plugins) details the addition
|
The [additional plugins section](#sec-additional-plugins) details the addition
|
||||||
of new plugins to nvf under regular circumstances, i.e. while making a pull
|
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
|
request to the project. You may _override_ those plugins in your config to
|
||||||
to change source versions, e.g., to use newer versions of plugins
|
change source versions, e.g., to use newer versions of plugins that are not yet
|
||||||
that are not yet updated in **nvf**.
|
updated in **nvf**.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
vim.pluginOverrides = {
|
vim.pluginOverrides = {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
# 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
|
|
||||||
```
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
# Maximal {#sec-default-maximal}
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ nix run 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. :::
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
# 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.
|
|
||||||
|
|
@ -1,25 +1,92 @@
|
||||||
# Adding Plugins {#sec-additional-plugins}
|
# Adding Plugins {#sec-additional-plugins}
|
||||||
|
|
||||||
To add a new Neovim plugin, use `npins`
|
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.
|
||||||
|
|
||||||
Use:
|
## With npins {#sec-npins-for-plugins}
|
||||||
|
|
||||||
`nix-shell -p npins` or `nix shell nixpkgs#npins`
|
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:
|
Then run:
|
||||||
|
|
||||||
`npins add --name <plugin name> github <owner> <repo> -b <branch>`
|
```bash
|
||||||
|
npins add --name <plugin name> github <owner> <repo> -b <branch>
|
||||||
|
```
|
||||||
|
|
||||||
Be sure to replace any non-alphanumeric characters with `-` for `--name`
|
::: {.note}
|
||||||
|
|
||||||
For example
|
Be sure to replace any non-alphanumeric characters with `-` for `--name`. For
|
||||||
|
example
|
||||||
|
|
||||||
`npins add --name lazydev-nvim github folke lazydev.nvim -b main`
|
```bash
|
||||||
|
npins add --name lazydev-nvim github folke lazydev.nvim -b main
|
||||||
|
```
|
||||||
|
|
||||||
You can now reference this plugin as a **string**.
|
:::
|
||||||
|
|
||||||
|
Once the `npins` command is done, you can start referencing the plugin as a
|
||||||
|
**string**.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
config.vim.startPlugins = ["lazydev-nvim"];
|
{
|
||||||
|
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}
|
## Modular setup options {#sec-modular-setup-options}
|
||||||
|
|
@ -70,7 +137,7 @@ in {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
This above config will result in this lua script:
|
This above config will result in this Lua script:
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
require('plugin-name').setup({
|
require('plugin-name').setup({
|
||||||
|
|
@ -101,23 +168,41 @@ own fields!
|
||||||
As you've seen above, `toLuaObject` is used to convert our nix attrSet
|
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:
|
`cfg.setupOpts`, into a lua table. Here are some rules of the conversion:
|
||||||
|
|
||||||
1. nix `null` converts to lua `nil`
|
1. Nix `null` converts to lua `nil`
|
||||||
2. number and strings convert to their lua counterparts
|
2. Number and strings convert to their lua counterparts
|
||||||
3. nix attrSet/list convert into lua tables
|
3. Nix attribute sets (`{}`) and lists (`[]`) convert into Lua dictionaries and
|
||||||
4. you can write raw lua code using `lib.generators.mkLuaInline`. This function
|
tables respectively. Here is an example of Nix -> Lua conversion.
|
||||||
is part of nixpkgs.
|
- `{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:
|
||||||
|
|
||||||
Example:
|
```nix
|
||||||
|
{
|
||||||
|
_type = "lua-inline";
|
||||||
|
expr = "function add(a, b) return a + b end";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
```nix
|
The above expression will be interpreted as a Lua expression in the final
|
||||||
vim.your-plugin.setupOpts = {
|
config. Without the `mkLuaInline` function, you will only receive a string
|
||||||
on_init = lib.generators.mkLuaInline ''
|
literal. You can use it to feed plugin configuration tables Lua functions
|
||||||
function()
|
that return specific values as expected by the plugins.
|
||||||
print('we can write lua!')
|
|
||||||
end
|
```nix
|
||||||
'';
|
{
|
||||||
}
|
vim.your-plugin.setupOpts = {
|
||||||
```
|
on_init = lib.generators.mkLuaInline ''
|
||||||
|
function()
|
||||||
|
print('we can write lua!')
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Lazy plugins {#sec-lazy-plugins}
|
## Lazy plugins {#sec-lazy-plugins}
|
||||||
|
|
||||||
|
|
@ -126,25 +211,24 @@ Lazy plugins are managed by `lz.n`.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
# in modules/.../your-plugin/config.nix
|
# in modules/.../your-plugin/config.nix
|
||||||
{lib, config, ...}:
|
{config, ...}: let
|
||||||
let
|
|
||||||
cfg = config.vim.your-plugin;
|
cfg = config.vim.your-plugin;
|
||||||
in {
|
in {
|
||||||
vim.lazy.plugins.your-plugin = {
|
vim.lazy.plugins.your-plugin = {
|
||||||
# instead of vim.startPlugins, use this:
|
# Instead of vim.startPlugins, use this:
|
||||||
package = "your-plugin";
|
package = "your-plugin";
|
||||||
|
|
||||||
# if your plugin uses the `require('your-plugin').setup{...}` pattern
|
# ıf your plugin uses the `require('your-plugin').setup{...}` pattern
|
||||||
setupModule = "your-plugin";
|
setupModule = "your-plugin";
|
||||||
inherit (cfg) setupOpts;
|
inherit (cfg) setupOpts;
|
||||||
|
|
||||||
# events that trigger this plugin to be loaded
|
# Events that trigger this plugin to be loaded
|
||||||
event = ["DirChanged"];
|
event = ["DirChanged"];
|
||||||
cmd = ["YourPluginCommand"];
|
cmd = ["YourPluginCommand"];
|
||||||
|
|
||||||
# keymaps
|
# Plugin Keymaps
|
||||||
keys = [
|
keys = [
|
||||||
# we'll cover this in detail in the keymaps section
|
# We'll cover this in detail in the 'keybinds' section
|
||||||
{
|
{
|
||||||
key = "<leader>d";
|
key = "<leader>d";
|
||||||
mode = "n";
|
mode = "n";
|
||||||
|
|
@ -152,7 +236,6 @@ in {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
;
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -163,7 +246,9 @@ require('lz.n').load({
|
||||||
{
|
{
|
||||||
"name-of-your-plugin",
|
"name-of-your-plugin",
|
||||||
after = function()
|
after = function()
|
||||||
require('your-plugin').setup({--[[ your setupOpts ]]})
|
require('your-plugin').setup({
|
||||||
|
--[[ your setupOpts ]]--
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
|
|
||||||
event = {"DirChanged"},
|
event = {"DirChanged"},
|
||||||
|
|
@ -175,5 +260,7 @@ require('lz.n').load({
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
A full list of options can be found
|
[`vim.lazy.plugins` spec]: https://notashelf.github.io/nvf/options.html#opt-vim.lazy.plugins
|
||||||
[here](https://notashelf.github.io/nvf/options.html#opt-vim.lazy.plugins
|
|
||||||
|
A full list of options can be found in the [`vim.lazy.plugins` spec] on the
|
||||||
|
rendered manual.
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,8 @@ There are many settings available in the options. Please refer to the
|
||||||
[documentation](https://notashelf.github.io/nvf/options.html#opt-vim.keymaps) to
|
[documentation](https://notashelf.github.io/nvf/options.html#opt-vim.keymaps) to
|
||||||
see a list of them.
|
see a list of them.
|
||||||
|
|
||||||
**nvf** provides a helper function, so that you don't have to write the
|
**nvf** provides a helper function, so that you don't have to write the mapping
|
||||||
mapping attribute sets every time:
|
attribute sets every time:
|
||||||
|
|
||||||
- `mkKeymap`, which mimics neovim's `vim.keymap.set` function
|
- `mkKeymap`, which mimics neovim's `vim.keymap.set` function
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ An example flake that exposes your custom Neovim configuration might look like
|
||||||
theme.enable = true;
|
theme.enable = true;
|
||||||
|
|
||||||
# Enable Treesitter
|
# Enable Treesitter
|
||||||
tree-sitter.enable = true;
|
treesitter.enable = true;
|
||||||
|
|
||||||
# Other options will go here. Refer to the config
|
# Other options will go here. Refer to the config
|
||||||
# reference in Appendix B of the nvf manual.
|
# reference in Appendix B of the nvf manual.
|
||||||
|
|
|
||||||
33
docs/manual/installation/modules/flakes.md
Normal file
33
docs/manual/installation/modules/flakes.md
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
### 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" <sub-commands>
|
||||||
|
```
|
||||||
|
|
@ -5,9 +5,18 @@ 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
|
yourself. It is the recommended way to use **nvf** alongside the NixOS module
|
||||||
depending on your needs.
|
depending on your needs.
|
||||||
|
|
||||||
To use it, we first add the input flake.
|
## 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`.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
# flake.nix
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
# Optional, if you intend to follow nvf's obsidian-nvim input
|
# Optional, if you intend to follow nvf's obsidian-nvim input
|
||||||
|
|
@ -16,7 +25,7 @@ To use it, we first add the input flake.
|
||||||
|
|
||||||
# Required, nvf works best and only directly supports flakes
|
# Required, nvf works best and only directly supports flakes
|
||||||
nvf = {
|
nvf = {
|
||||||
url = "github:notashelf/nvf";
|
url = "github:NotAShelf/nvf";
|
||||||
# You can override the input nixpkgs to follow your system's
|
# You can override the input nixpkgs to follow your system's
|
||||||
# instance of nixpkgs. This is safe to do as nvf does not depend
|
# instance of nixpkgs. This is safe to do as nvf does not depend
|
||||||
# on a binary cache.
|
# on a binary cache.
|
||||||
|
|
@ -25,6 +34,8 @@ To use it, we first add the input flake.
|
||||||
# for example:
|
# for example:
|
||||||
inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs
|
inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# ...
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
@ -39,7 +50,7 @@ Followed by importing the home-manager module somewhere in your configuration.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example Installation {#sec-example-installation-hm}
|
### Example Installation {#sec-example-installation-hm}
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
|
|
@ -66,7 +77,8 @@ 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
|
`programs.nvf` module option anywhere in your configuration in order to
|
||||||
configure **nvf**.
|
configure **nvf**.
|
||||||
|
|
||||||
```nix{
|
```nix
|
||||||
|
{
|
||||||
programs.nvf = {
|
programs.nvf = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# your settings need to go into the settings attribute set
|
# your settings need to go into the settings attribute set
|
||||||
|
|
@ -89,3 +101,45 @@ installation sections of the manual. You may find all available options in the
|
||||||
[appendix](https://notashelf.github.io/nvf/options)
|
[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/<commit or tag>.tar.gz";
|
||||||
|
# Optionally, you can add 'sha256' for verification and caching
|
||||||
|
# sha256 = "<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.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,18 @@ 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
|
the recommended way to use **nvf** alongside the home-manager module depending
|
||||||
on your needs.
|
on your needs.
|
||||||
|
|
||||||
To use it, we first add the input flake.
|
## 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`.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
# flake.nix
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
# Optional, if you intend to follow nvf's obsidian-nvim input
|
# Optional, if you intend to follow nvf's obsidian-nvim input
|
||||||
|
|
@ -16,7 +25,7 @@ To use it, we first add the input flake.
|
||||||
|
|
||||||
# Required, nvf works best and only directly supports flakes
|
# Required, nvf works best and only directly supports flakes
|
||||||
nvf = {
|
nvf = {
|
||||||
url = "github:notashelf/nvf";
|
url = "github:NotAShelf/nvf";
|
||||||
# You can override the input nixpkgs to follow your system's
|
# You can override the input nixpkgs to follow your system's
|
||||||
# instance of nixpkgs. This is safe to do as nvf does not depend
|
# instance of nixpkgs. This is safe to do as nvf does not depend
|
||||||
# on a binary cache.
|
# on a binary cache.
|
||||||
|
|
@ -25,6 +34,8 @@ To use it, we first add the input flake.
|
||||||
# for example:
|
# for example:
|
||||||
inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs
|
inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# ...
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
@ -39,7 +50,7 @@ Followed by importing the NixOS module somewhere in your configuration.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example Installation {#sec-example-installation-nixos}
|
### Example Installation {#sec-example-installation-nixos}
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
|
|
@ -64,10 +75,12 @@ 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
|
`programs.nvf` module option anywhere in your configuration in order to
|
||||||
configure **nvf**.
|
configure **nvf**.
|
||||||
|
|
||||||
```nix{
|
```nix
|
||||||
|
{
|
||||||
programs.nvf = {
|
programs.nvf = {
|
||||||
enable = true;
|
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
|
# most settings are documented in the appendix
|
||||||
settings = {
|
settings = {
|
||||||
vim.viAlias = false;
|
vim.viAlias = false;
|
||||||
|
|
@ -87,3 +100,45 @@ installation sections of the manual. You may find all available options in the
|
||||||
[appendix](https://notashelf.github.io/nvf/options)
|
[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/<commit or tag>.tar.gz";
|
||||||
|
# Optionally, you can add 'sha256' for verification and caching
|
||||||
|
# sha256 = "<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.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,8 @@ the default theme enabled. You may use other options inside `config.vim` in
|
||||||
# ...
|
# ...
|
||||||
modules = [
|
modules = [
|
||||||
# This will make wrapped neovim available in your system packages
|
# This will make wrapped neovim available in your system packages
|
||||||
# Can also move this to another config file if you pass inputs/self around with specialArgs
|
# Can also move this to another config file if you pass your own
|
||||||
|
# inputs/self around with specialArgs
|
||||||
({pkgs, ...}: {
|
({pkgs, ...}: {
|
||||||
environment.systemPackages = [self.packages.${pkgs.stdenv.system}.neovim];
|
environment.systemPackages = [self.packages.${pkgs.stdenv.system}.neovim];
|
||||||
})
|
})
|
||||||
|
|
@ -58,4 +59,5 @@ the default theme enabled. You may use other options inside `config.vim` in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}```
|
}
|
||||||
|
```
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ try-it-out.md
|
||||||
```
|
```
|
||||||
|
|
||||||
```{=include=} parts
|
```{=include=} parts
|
||||||
default-configs.md
|
|
||||||
installation.md
|
installation.md
|
||||||
configuring.md
|
configuring.md
|
||||||
tips.md
|
tips.md
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,14 @@
|
||||||
# Helpful Tips {#ch-helpful-tips}
|
# 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=} chapters
|
```{=include=} chapters
|
||||||
tips/pure-lua-config.md
|
|
||||||
tips/debugging-nvf.md
|
tips/debugging-nvf.md
|
||||||
tips/offline-docs.md
|
tips/offline-docs.md
|
||||||
|
tips/pure-lua-config.md
|
||||||
|
tips/plugin-sources.md
|
||||||
```
|
```
|
||||||
|
|
|
||||||
131
docs/manual/tips/plugin-sources.md
Normal file
131
docs/manual/tips/plugin-sources.md
Normal file
|
|
@ -0,0 +1,131 @@
|
||||||
|
# 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`]: https://notashelf.github.io/nvf/options.html#opt-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]: https://notashelf.github.io/nvf/index.xhtml#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"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
@ -23,7 +23,7 @@ manner.
|
||||||
# flake.nix. For the sake of the argument, we will assume that the Neovim lua
|
# 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.
|
# configuration is in a nvim/ directory relative to flake.nix.
|
||||||
vim = {
|
vim = {
|
||||||
additionalRuntimeDirectories = [
|
additionalRuntimePaths = [
|
||||||
# This will be added to Neovim's runtime paths. Conceptually, this behaves
|
# 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
|
# very similarly to ~/.config/nvim but you may not place a top-level
|
||||||
# init.lua to be able to require it directly.
|
# init.lua to be able to require it directly.
|
||||||
|
|
@ -41,7 +41,7 @@ directory, and call it with [](#opt-vim.luaConfigRC).
|
||||||
```nix
|
```nix
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
vim = {
|
vim = {
|
||||||
additionalRuntimeDirectories = [
|
additionalRuntimePaths = [
|
||||||
# You can list more than one file here.
|
# You can list more than one file here.
|
||||||
./nvim-custom-1
|
./nvim-custom-1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,19 +5,20 @@ 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
|
different configurations provided by this flake. As of v0.5, two specialized
|
||||||
configurations are provided:
|
configurations are provided:
|
||||||
|
|
||||||
- **Nix** - Nix language server + simple utility plugins
|
- **Nix** (`packages.nix`) - Nix language server + simple utility plugins
|
||||||
- **Maximal** - Variable language servers + utility and decorative 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
|
You may try out any of the provided configurations using the `nix run` command
|
||||||
on a system where Nix is installed.
|
on a system where Nix is installed.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
$ cachix use nvf # Optional: it'll save you CPU resources and time
|
$ cachix use nvf # Optional: it'll save you CPU resources and time
|
||||||
$ nix run github:notashelf/nvf#nix # will run the default minimal configuration
|
$ 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
|
Do keep in mind that this is **susceptible to garbage collection** meaning that
|
||||||
will be removed from your Nix store once you garbage collect.
|
the built outputs will be removed from your Nix store once you garbage collect.
|
||||||
|
|
||||||
## Using Prebuilt Configs {#sec-using-prebuilt-configs}
|
## Using Prebuilt Configs {#sec-using-prebuilt-configs}
|
||||||
|
|
||||||
|
|
@ -26,7 +27,12 @@ $ nix run github:notashelf/nvf#nix
|
||||||
$ nix run github:notashelf/nvf#maximal
|
$ nix run github:notashelf/nvf#maximal
|
||||||
```
|
```
|
||||||
|
|
||||||
### Available Configs {#sec-available-configs}
|
### Available Configurations {#sec-available-configs}
|
||||||
|
|
||||||
|
::: {.info}
|
||||||
|
|
||||||
|
The below configurations are provided for demonstration purposes, and are
|
||||||
|
**not** designed to be installed as is. You may
|
||||||
|
|
||||||
#### Nix {#sec-configs-nix}
|
#### Nix {#sec-configs-nix}
|
||||||
|
|
||||||
|
|
@ -34,15 +40,33 @@ $ nix run github:notashelf/nvf#maximal
|
||||||
a set of visual and functional plugins. By running `nix run .#`, which is the
|
a set of visual and functional plugins. By running `nix run .#`, which is the
|
||||||
default package, you will build Neovim with this config.
|
default package, you will build Neovim with this config.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ nix run github:notashelf/nvf#nix test.nix
|
||||||
|
```
|
||||||
|
|
||||||
|
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 {#sec-configs-maximal}
|
||||||
|
|
||||||
`Maximal` is the ultimate configuration that will enable support for more
|
`Maximal` is the ultimate configuration that will enable support for more
|
||||||
commonly used language as well as additional complementary plugins. Keep in
|
commonly used language as well as additional complementary plugins. Keep in
|
||||||
mind, however, that this will pull a lot of dependencies.
|
mind, however, that this will pull a lot of dependencies.
|
||||||
|
|
||||||
::: {.tip}
|
```bash
|
||||||
|
$ nix run github:notashelf/nvf#maximal -- test.nix
|
||||||
|
```
|
||||||
|
|
||||||
You are _strongly_ recommended to use the binary cache if you would like to try
|
It uses the same configuration template with the [Nix](#sec-configs-nix)
|
||||||
the Maximal configuration.
|
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.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,8 @@ soon.
|
||||||
|
|
||||||
- A new section has been added for language support: `vim.languages.<language>`.
|
- A new section has been added for language support: `vim.languages.<language>`.
|
||||||
|
|
||||||
- The options [](#opt-vim.languages.enableLSP),
|
- The options `enableLSP` [](#opt-vim.languages.enableTreesitter), etc. will
|
||||||
[](#opt-vim.languages.enableTreesitter), etc. will enable the respective
|
enable the respective section for all languages that have been enabled.
|
||||||
section for all languages that have been enabled.
|
|
||||||
- All LSP languages have been moved here
|
- All LSP languages have been moved here
|
||||||
- `plantuml` and `markdown` have been moved here
|
- `plantuml` and `markdown` have been moved here
|
||||||
- A new section has been added for `html`. The old
|
- A new section has been added for `html`. The old
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ Release notes for release 0.5
|
||||||
- Updated indent-blankine.nvim to v3 - this comes with a few option changes,
|
- Updated indent-blankine.nvim to v3 - this comes with a few option changes,
|
||||||
which will be migrated with `renamedOptionModule`
|
which will be migrated with `renamedOptionModule`
|
||||||
|
|
||||||
[jacekpoz](https://jacekpoz.pl):
|
[poz](https://poz.pet):
|
||||||
|
|
||||||
- Fixed scrollOffset not being used
|
- Fixed scrollOffset not being used
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ vim.api.nvim_set_keymap('n', '<leader>a', ':lua camelToSnake()<CR>', { noremap =
|
||||||
|
|
||||||
- Added rose-pine theme.
|
- Added rose-pine theme.
|
||||||
|
|
||||||
[jacekpoz](https://jacekpoz.pl):
|
[poz](https://poz.pet):
|
||||||
|
|
||||||
- Added `vim.autocomplete.alwaysComplete`. Allows users to have the autocomplete
|
- Added `vim.autocomplete.alwaysComplete`. Allows users to have the autocomplete
|
||||||
window popup only when manually activated.
|
window popup only when manually activated.
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ The changes are, in no particular order:
|
||||||
- Add [lz.n] support and lazy-load some builtin plugins.
|
- Add [lz.n] support and lazy-load some builtin plugins.
|
||||||
- Add simpler helper functions for making keymaps
|
- Add simpler helper functions for making keymaps
|
||||||
|
|
||||||
[jacekpoz](https://jacekpoz.pl):
|
[poz](https://poz.pet):
|
||||||
|
|
||||||
[ocaml-lsp]: https://github.com/ocaml/ocaml-lsp
|
[ocaml-lsp]: https://github.com/ocaml/ocaml-lsp
|
||||||
[new-file-template.nvim]: https://github.com/otavioschwanck/new-file-template.nvim
|
[new-file-template.nvim]: https://github.com/otavioschwanck/new-file-template.nvim
|
||||||
|
|
@ -170,7 +170,7 @@ The changes are, in no particular order:
|
||||||
|
|
||||||
- Add [ocaml-lsp] support
|
- Add [ocaml-lsp] support
|
||||||
|
|
||||||
- Fix "Emac" typo
|
- Fix `Emac` typo
|
||||||
|
|
||||||
- Add [new-file-template.nvim] to automatically fill new file contents using
|
- Add [new-file-template.nvim] to automatically fill new file contents using
|
||||||
templates
|
templates
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,15 @@
|
||||||
unavailable as they have been refactored out of the main none-ls repository
|
unavailable as they have been refactored out of the main none-ls repository
|
||||||
upstream.
|
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 [](#opt-vim.clipboard.registers) appropriately
|
||||||
|
to configure Neovim to use the system clipboard.
|
||||||
|
|
||||||
|
- Changed which-key group used for gitsigns from `<leader>g` to `<leader>h` to
|
||||||
|
align with the "hunks" themed mapping and avoid conflict with the new [neogit]
|
||||||
|
group.
|
||||||
|
|
||||||
[NotAShelf](https://github.com/notashelf):
|
[NotAShelf](https://github.com/notashelf):
|
||||||
|
|
||||||
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
|
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
|
||||||
|
|
@ -26,7 +35,10 @@
|
||||||
[yanky.nvim]: https://github.com/gbprod/yanky.nvim
|
[yanky.nvim]: https://github.com/gbprod/yanky.nvim
|
||||||
[yazi.nvim]: https://github.com/mikavilpas/yazi.nvim
|
[yazi.nvim]: https://github.com/mikavilpas/yazi.nvim
|
||||||
[snacks.nvim]: https://github.com/folke/snacks.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
|
[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
|
- Add [typst-preview.nvim] under
|
||||||
`languages.typst.extensions.typst-preview-nvim`.
|
`languages.typst.extensions.typst-preview-nvim`.
|
||||||
|
|
@ -84,13 +96,21 @@
|
||||||
|
|
||||||
- Lazyload Lspsaga and remove default keybindings for it.
|
- 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
|
- Add [oil.nvim] as an alternative file explorer. It will be available under
|
||||||
`vim.utility.oil-nvim`.
|
`vim.utility.oil-nvim`.
|
||||||
|
|
||||||
- Add `vim.diagnostics` to interact with Neovim's diagnostics module. Available
|
- Add `vim.diagnostics` to interact with Neovim's diagnostics module. Available
|
||||||
options for `vim.diagnostic.config()` can now be customized through the
|
options for `vim.diagnostic.config()` can now be customized through the
|
||||||
[](#opt-vim.diagnostics.config) in nvf.
|
[](#opt-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`
|
||||||
|
|
||||||
[amadaluzia](https://github.com/amadaluzia):
|
[amadaluzia](https://github.com/amadaluzia):
|
||||||
|
|
||||||
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
|
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
|
||||||
|
|
@ -107,6 +127,9 @@
|
||||||
- Add `LazyFile` user event.
|
- Add `LazyFile` user event.
|
||||||
- Migrate language modules from none-ls to conform/nvim-lint
|
- Migrate language modules from none-ls to conform/nvim-lint
|
||||||
- Add tsx support in conform and 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
|
||||||
|
|
||||||
[diniamo](https://github.com/diniamo):
|
[diniamo](https://github.com/diniamo):
|
||||||
|
|
||||||
|
|
@ -276,6 +299,7 @@
|
||||||
[BANanaD3V](https://github.com/BANanaD3V):
|
[BANanaD3V](https://github.com/BANanaD3V):
|
||||||
|
|
||||||
- `alpha` is now configured with nix.
|
- `alpha` is now configured with nix.
|
||||||
|
- Add `markview-nvim` markdown renderer.
|
||||||
|
|
||||||
[viicslen](https://github.com/viicslen):
|
[viicslen](https://github.com/viicslen):
|
||||||
|
|
||||||
|
|
@ -289,7 +313,12 @@
|
||||||
[rice-cracker-dev](https://github.com/rice-cracker-dev):
|
[rice-cracker-dev](https://github.com/rice-cracker-dev):
|
||||||
|
|
||||||
- `eslint_d` now checks for configuration files to load.
|
- `eslint_d` now checks for configuration files to load.
|
||||||
- Fixed an error where `eslint_d` fails 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`.
|
||||||
|
|
||||||
[Sc3l3t0n](https://github.com/Sc3l3t0n):
|
[Sc3l3t0n](https://github.com/Sc3l3t0n):
|
||||||
|
|
||||||
|
|
@ -300,12 +329,14 @@
|
||||||
- Add lint (luacheck) and formatting (stylua) support for Lua.
|
- Add lint (luacheck) and formatting (stylua) support for Lua.
|
||||||
- Add lint (markdownlint-cli2) support for Markdown.
|
- Add lint (markdownlint-cli2) support for Markdown.
|
||||||
- Add catppuccin integration for Bufferline, Lspsaga.
|
- Add catppuccin integration for Bufferline, Lspsaga.
|
||||||
- Add neo-tree integration for Bufferline.
|
- Add `neo-tree`, `snacks.explorer` integrations to `bufferline`.
|
||||||
- Add more applicable filetypes to illuminate denylist.
|
- Add more applicable filetypes to illuminate denylist.
|
||||||
- Disable mini.indentscope for applicable filetypes.
|
- Disable mini.indentscope for applicable filetypes.
|
||||||
- Fix fzf-lua having a hard dependency on fzf.
|
- Fix fzf-lua having a hard dependency on fzf.
|
||||||
- Enable inlay hints support - `config.vim.lsp.inlayHints`.
|
- Enable inlay hints support - `config.vim.lsp.inlayHints`.
|
||||||
- Add `neo-tree` extension to `lualine`.
|
- Add `neo-tree`, `snacks.picker` extensions to `lualine`.
|
||||||
|
- Add support for `vim.lsp.formatOnSave` and
|
||||||
|
`vim.lsp.mappings.toggleFormatOnSave`
|
||||||
|
|
||||||
[tebuevd](https://github.com/tebuevd):
|
[tebuevd](https://github.com/tebuevd):
|
||||||
|
|
||||||
|
|
@ -319,12 +350,163 @@
|
||||||
|
|
||||||
[flash.nvim]: https://github.com/folke/flash.nvim
|
[flash.nvim]: https://github.com/folke/flash.nvim
|
||||||
[gitlinker.nvim]: https://github.com/linrongbin16/gitlinker.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
|
- Fix oil config referencing snacks
|
||||||
- Add [flash.nvim] plugin to `vim.utility.motion.flash-nvim`
|
- Add [flash.nvim] plugin to `vim.utility.motion.flash-nvim`
|
||||||
- Fix default telescope ignore list entry for '.git/' to properly match
|
- Fix default telescope ignore list entry for '.git/' to properly match
|
||||||
- Add [gitlinker.nvim] plugin to `vim.git.gitlinker-nvim`
|
- 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):
|
[rrvsh](https://github.com/rrvsh):
|
||||||
|
|
||||||
|
- Add custom snippet support to `vim.snippets.luasnip`
|
||||||
- Fix namespace of python-lsp-server by changing it to python3Packages
|
- 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
|
||||||
|
|
||||||
|
- Fix gitsigns null-ls issue.
|
||||||
|
- Add [everforest] theme support.
|
||||||
|
|
||||||
|
[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
|
||||||
|
|
||||||
|
[Cool-Game-Dev](https://github.com/Cool-Game-Dev):
|
||||||
|
|
||||||
|
[nvim-biscuits]: https://github.com/code-biscuits/nvim-biscuits
|
||||||
|
|
||||||
|
- Add [nvim-biscuits] to show block context. Available at
|
||||||
|
`vim.utility.nvim-biscuits`.
|
||||||
|
|
||||||
|
[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.
|
||||||
|
|
||||||
|
[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].
|
||||||
|
|
|
||||||
136
flake.lock
generated
136
flake.lock
generated
|
|
@ -1,48 +1,48 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-parts": {
|
"flake-compat": {
|
||||||
"inputs": {
|
"flake": false,
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
|
||||||
},
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1743550720,
|
"lastModified": 1751685974,
|
||||||
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
|
"narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=",
|
||||||
"owner": "hercules-ci",
|
"ref": "refs/heads/main",
|
||||||
"repo": "flake-parts",
|
"rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1",
|
||||||
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
|
"revCount": 92,
|
||||||
"type": "github"
|
"type": "git",
|
||||||
|
"url": "https://git.lix.systems/lix-project/flake-compat.git"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "hercules-ci",
|
"type": "git",
|
||||||
"repo": "flake-parts",
|
"url": "https://git.lix.systems/lix-project/flake-compat.git"
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems"
|
"nixpkgs-lib": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731533236,
|
"lastModified": 1760948891,
|
||||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
"narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=",
|
||||||
"owner": "numtide",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-parts",
|
||||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
"rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "numtide",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-parts",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mnw": {
|
"mnw": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1744592022,
|
"lastModified": 1758834834,
|
||||||
"narHash": "sha256-QuWrCRiF3CUM99sgj3gXbIzB1IAVWS5IEfFHadbMA2g=",
|
"narHash": "sha256-Y7IvY4F8vajZyp3WGf+KaiIVwondEkMFkt92Cr9NZmg=",
|
||||||
"owner": "Gerg-L",
|
"owner": "Gerg-L",
|
||||||
"repo": "mnw",
|
"repo": "mnw",
|
||||||
"rev": "cf9e19413b6c2d995b55565cd99facf9c751b653",
|
"rev": "cfbc7d1cc832e318d0863a5fc91d940a96034001",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -51,37 +51,13 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nil": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": [
|
|
||||||
"flake-utils"
|
|
||||||
],
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"rust-overlay": "rust-overlay"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1741118843,
|
|
||||||
"narHash": "sha256-ggXU3RHv6NgWw+vc+HO4/9n0GPufhTIUjVuLci8Za8c=",
|
|
||||||
"owner": "oxalica",
|
|
||||||
"repo": "nil",
|
|
||||||
"rev": "577d160da311cc7f5042038456a0713e9863d09e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "oxalica",
|
|
||||||
"repo": "nil",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1744473229,
|
"lastModified": 1761880412,
|
||||||
"narHash": "sha256-rGXvIsD/Hn+bJRFb7hqSx7UUZUIlxXs0fM6ix5+iT5w=",
|
"narHash": "sha256-QoJjGd4NstnyOG4mm4KXF+weBzA2AH/7gn1Pmpfcb0A=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "52d0eded529af34e91df6b2a2bc32eb636637cd2",
|
"rev": "a7fc11be66bdfb5cdde611ee5ce381c183da8386",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -91,50 +67,13 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1743296961,
|
|
||||||
"narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixpkgs.lib",
|
|
||||||
"rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixpkgs.lib",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"mnw": "mnw",
|
"mnw": "mnw",
|
||||||
"nil": "nil",
|
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"systems": "systems_2"
|
"systems": "systems"
|
||||||
}
|
|
||||||
},
|
|
||||||
"rust-overlay": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nil",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1741055476,
|
|
||||||
"narHash": "sha256-52vwEV0oS2lCnx3c/alOFGglujZTLmObit7K8VblnS8=",
|
|
||||||
"owner": "oxalica",
|
|
||||||
"repo": "rust-overlay",
|
|
||||||
"rev": "aefb7017d710f150970299685e8d8b549d653649",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "oxalica",
|
|
||||||
"repo": "rust-overlay",
|
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
|
|
@ -151,21 +90,6 @@
|
||||||
"repo": "default",
|
"repo": "default",
|
||||||
"type": "github"
|
"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"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
||||||
65
flake.nix
65
flake.nix
|
|
@ -5,8 +5,9 @@
|
||||||
self,
|
self,
|
||||||
...
|
...
|
||||||
} @ inputs: let
|
} @ inputs: let
|
||||||
# call the extended library with `inputs`
|
# Call the extended library with `inputs`.
|
||||||
# inputs is used to get the original standard library, and to pass inputs to the plugin autodiscovery function
|
# inputs is used to get the original standard library, and to pass inputs
|
||||||
|
# to the plugin autodiscovery function
|
||||||
lib = import ./lib/stdlib-extended.nix {inherit inputs self;};
|
lib = import ./lib/stdlib-extended.nix {inherit inputs self;};
|
||||||
in
|
in
|
||||||
flake-parts.lib.mkFlake {
|
flake-parts.lib.mkFlake {
|
||||||
|
|
@ -18,10 +19,7 @@
|
||||||
systems = import inputs.systems;
|
systems = import inputs.systems;
|
||||||
imports = [
|
imports = [
|
||||||
./flake/templates
|
./flake/templates
|
||||||
|
|
||||||
./flake/apps.nix
|
./flake/apps.nix
|
||||||
./flake/legacyPackages.nix
|
|
||||||
./flake/overlays.nix
|
|
||||||
./flake/packages.nix
|
./flake/packages.nix
|
||||||
./flake/develop.nix
|
./flake/develop.nix
|
||||||
];
|
];
|
||||||
|
|
@ -32,6 +30,8 @@
|
||||||
inherit (lib.nvim) neovimConfiguration;
|
inherit (lib.nvim) neovimConfiguration;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inherit (lib.importJSON ./npins/sources.json) pins;
|
||||||
|
|
||||||
homeManagerModules = {
|
homeManagerModules = {
|
||||||
nvf = import ./flake/modules/home-manager.nix {inherit lib inputs;};
|
nvf = import ./flake/modules/home-manager.nix {inherit lib inputs;};
|
||||||
default = self.homeManagerModules.nvf;
|
default = self.homeManagerModules.nvf;
|
||||||
|
|
@ -53,21 +53,33 @@
|
||||||
''
|
''
|
||||||
self.nixosModules.nvf;
|
self.nixosModules.nvf;
|
||||||
};
|
};
|
||||||
|
|
||||||
inherit (lib.importJSON ./npins/sources.json) pins;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
perSystem = {pkgs, ...}: {
|
perSystem = {pkgs, ...}: {
|
||||||
# Provide the default formatter. `nix fmt` in project root
|
# Provides the default formatter for 'nix fmt', which will format the
|
||||||
# will format available files with the correct formatter.
|
# entire tree with Alejandra. The wrapper script is necessary due to
|
||||||
# P.S: Please do not format with nixfmt! It messes with many
|
# changes to the behaviour of Nix, which now encourages wrappers for
|
||||||
# syntax elements and results in unreadable code.
|
# tree-wide formatting.
|
||||||
formatter = pkgs.alejandra;
|
formatter = pkgs.writeShellApplication {
|
||||||
|
name = "nix3-fmt-wrapper";
|
||||||
|
|
||||||
# Check if codebase is properly formatted.
|
runtimeInputs = [
|
||||||
# This can be initiated with `nix build .#checks.<system>.nix-fmt`
|
pkgs.alejandra
|
||||||
# or with `nix flake check`
|
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 = {
|
checks = {
|
||||||
|
# Check if codebase is properly formatted.
|
||||||
|
# This can be initiated with `nix build .#checks.<system>.nix-fmt`
|
||||||
|
# or with `nix flake check`
|
||||||
nix-fmt = pkgs.runCommand "nix-fmt-check" {nativeBuildInputs = [pkgs.alejandra];} ''
|
nix-fmt = pkgs.runCommand "nix-fmt-check" {nativeBuildInputs = [pkgs.alejandra];} ''
|
||||||
alejandra --check ${self} < /dev/null | tee $out
|
alejandra --check ${self} < /dev/null | tee $out
|
||||||
'';
|
'';
|
||||||
|
|
@ -75,22 +87,23 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Flake inputs
|
|
||||||
inputs = {
|
inputs = {
|
||||||
|
systems.url = "github:nix-systems/default";
|
||||||
|
|
||||||
## Basic Inputs
|
## Basic Inputs
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-parts = {
|
||||||
systems.url = "github:nix-systems/default";
|
url = "github:hercules-ci/flake-parts";
|
||||||
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
flake-compat = {
|
||||||
|
url = "git+https://git.lix.systems/lix-project/flake-compat.git";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
# Alternate neovim-wrapper
|
# Alternate neovim-wrapper
|
||||||
mnw.url = "github:Gerg-L/mnw";
|
mnw.url = "github:Gerg-L/mnw";
|
||||||
|
|
||||||
# Language servers (use master instead of nixpkgs)
|
|
||||||
nil = {
|
|
||||||
url = "github:oxalica/nil";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
inputs.flake-utils.follows = "flake-utils";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
self',
|
self',
|
||||||
|
inputs',
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
devShells = {
|
devShells = {
|
||||||
|
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
{
|
|
||||||
inputs,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
perSystem = {
|
|
||||||
system,
|
|
||||||
inputs',
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
legacyPackages = import inputs.nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
overlays = [
|
|
||||||
inputs.self.overlays.default
|
|
||||||
|
|
||||||
(final: prev: {
|
|
||||||
# Build nil from source to get most recent
|
|
||||||
# features as they are added.
|
|
||||||
nil = inputs'.nil.packages.default;
|
|
||||||
blink-cmp = let
|
|
||||||
pin = self.pins.blink-cmp;
|
|
||||||
in
|
|
||||||
final.callPackage ./legacyPackages/blink-cmp.nix {
|
|
||||||
inherit (pin) version;
|
|
||||||
src = prev.fetchFromGitHub {
|
|
||||||
inherit (pin.repository) owner repo;
|
|
||||||
rev = pin.revision;
|
|
||||||
sha256 = pin.hash;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
{
|
|
||||||
stdenv,
|
|
||||||
rustPlatform,
|
|
||||||
vimUtils,
|
|
||||||
gitMinimal,
|
|
||||||
src,
|
|
||||||
version,
|
|
||||||
}: let
|
|
||||||
blink-fuzzy-lib = rustPlatform.buildRustPackage {
|
|
||||||
pname = "blink-fuzzy-lib";
|
|
||||||
inherit version src;
|
|
||||||
|
|
||||||
# TODO: remove this if plugin stops using nightly rust
|
|
||||||
env.RUSTC_BOOTSTRAP = true;
|
|
||||||
|
|
||||||
useFetchCargoVendor = true;
|
|
||||||
cargoHash = "sha256-MWElqh7ENJ6CbLOnvz0DsP5YYu+e+y12GSUOfW1IKGU=";
|
|
||||||
|
|
||||||
nativeBuildInputs = [gitMinimal];
|
|
||||||
};
|
|
||||||
in
|
|
||||||
vimUtils.buildVimPlugin {
|
|
||||||
pname = "blink-cmp";
|
|
||||||
inherit version src;
|
|
||||||
|
|
||||||
# blink references a repro.lua which is placed outside the lua/ directory
|
|
||||||
doCheck = false;
|
|
||||||
preInstall = let
|
|
||||||
ext = stdenv.hostPlatform.extensions.sharedLibrary;
|
|
||||||
in ''
|
|
||||||
mkdir -p target/release
|
|
||||||
ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy${ext} target/release/libblink_cmp_fuzzy${ext}
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Module for reproducing issues
|
|
||||||
nvimSkipModules = ["repro"];
|
|
||||||
}
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.nvim) neovimConfiguration;
|
|
||||||
|
|
||||||
buildPkg = pkgs: modules: (neovimConfiguration {inherit pkgs modules;}).neovim;
|
|
||||||
|
|
||||||
nixConfig = import ../configuration.nix false;
|
|
||||||
maximalConfig = import ../configuration.nix true;
|
|
||||||
in {
|
|
||||||
flake.overlays.default = final: _prev: {
|
|
||||||
inherit neovimConfiguration;
|
|
||||||
neovim-nix = buildPkg final [nixConfig];
|
|
||||||
neovim-maximal = buildPkg final [maximalConfig];
|
|
||||||
devPkg = buildPkg pkgs [nixConfig {config.vim.languages.html.enable = pkgs.lib.mkForce true;}];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,69 +1,122 @@
|
||||||
{inputs, ...}: {
|
{
|
||||||
|
inputs,
|
||||||
|
self,
|
||||||
|
...
|
||||||
|
} @ args: {
|
||||||
perSystem = {
|
perSystem = {
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: 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;};
|
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;
|
||||||
in {
|
in {
|
||||||
packages = {
|
packages =
|
||||||
inherit (docs.manual) htmlOpenTool;
|
(flattenPkgs "/" [] legacyPackages)
|
||||||
# Documentation
|
// {
|
||||||
docs = docs.manual.html;
|
inherit (docs.manual) htmlOpenTool;
|
||||||
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 = {
|
# Documentation
|
||||||
"https://notashelf.github.io/nvf/" = site;
|
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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
extraConfig = {
|
# Helper utility for building the HTML manual and opening it in the
|
||||||
exclude = [];
|
# browser with $BROWSER or using xdg-open as a fallback tool.
|
||||||
include_mail = true;
|
# Adapted from Home-Manager, available under the MIT license.
|
||||||
include_verbatim = true;
|
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
|
||||||
|
|
||||||
# Helper utility for building the HTML manual and opening it in the
|
if [[ ! -v BROWSER || -z $BROWSER ]]; then
|
||||||
# browser with $BROWSER or using xdg-open as a fallback tool.
|
for candidate in xdg-open open w3m; do
|
||||||
# Adapted from Home-Manager, available under the MIT license.
|
BROWSER="$(type -P $candidate || true)"
|
||||||
docs-html-wrapped = let
|
if [[ -x $BROWSER ]]; then
|
||||||
xdg-open = lib.getExe' pkgs.xdg-utils "xdg-open";
|
break;
|
||||||
docs-html = docs.manual.html + /share/doc/nvf;
|
fi
|
||||||
in
|
done
|
||||||
pkgs.writeShellScriptBin "docs-html-wrapped" ''
|
fi
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
if [[ ! -v BROWSER || -z $BROWSER ]]; then
|
if [[ ! -v BROWSER || -z $BROWSER ]]; then
|
||||||
for candidate in xdg-open open w3m; do
|
echo "$0: unable to start a web browser; please set \$BROWSER"
|
||||||
BROWSER="$(type -P $candidate || true)"
|
echo "$0: Trying xdg-open as a fallback"
|
||||||
if [[ -x $BROWSER ]]; then
|
${xdg-open} ${docs-html}/index.xhtml
|
||||||
break;
|
else
|
||||||
fi
|
echo "\$BROWSER is set. Attempting to open manual"
|
||||||
done
|
exec "$BROWSER" "${docs-html}/index.xhtml"
|
||||||
fi
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
if [[ ! -v BROWSER || -z $BROWSER ]]; then
|
# Exposed neovim configurations
|
||||||
echo "$0: unable to start a web browser; please set \$BROWSER"
|
nix = buildPkg false;
|
||||||
echo "$0: Trying xdg-open as a fallback"
|
maximal = buildPkg true;
|
||||||
${xdg-open} ${docs-html}/index.xhtml
|
default = config.packages.nix;
|
||||||
else
|
};
|
||||||
echo "\$BROWSER is set. Attempting to open manual"
|
|
||||||
exec "$BROWSER" "${docs-html}/index.xhtml"
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Exposed neovim configurations
|
|
||||||
nix = config.legacyPackages.neovim-nix;
|
|
||||||
maximal = config.legacyPackages.neovim-maximal;
|
|
||||||
default = config.legacyPackages.neovim-nix;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
70
flake/pkgs/by-name/avante-nvim/package.nix
Normal file
70
flake/pkgs/by-name/avante-nvim/package.nix
Normal file
|
|
@ -0,0 +1,70 @@
|
||||||
|
{
|
||||||
|
pins,
|
||||||
|
openssl,
|
||||||
|
pkg-config,
|
||||||
|
rustPlatform,
|
||||||
|
stdenv,
|
||||||
|
vimUtils,
|
||||||
|
makeWrapper,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
# From npins
|
||||||
|
pin = pins.avante-nvim;
|
||||||
|
version = pin.branch;
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
inherit (pin.repository) owner repo;
|
||||||
|
rev = pin.revision;
|
||||||
|
sha256 = pin.hash;
|
||||||
|
};
|
||||||
|
|
||||||
|
avante-nvim-lib = rustPlatform.buildRustPackage {
|
||||||
|
pname = "avante-nvim-lib";
|
||||||
|
inherit 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"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
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.vertex_claude"
|
||||||
|
"avante.providers.ollama"
|
||||||
|
];
|
||||||
|
}
|
||||||
39
flake/pkgs/by-name/blink-cmp/package.nix
Normal file
39
flake/pkgs/by-name/blink-cmp/package.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
rustPlatform,
|
||||||
|
fetchFromGitHub,
|
||||||
|
writeShellScriptBin,
|
||||||
|
}:
|
||||||
|
rustPlatform.buildRustPackage (finalAttrs: {
|
||||||
|
pname = "blink-cmp";
|
||||||
|
version = "1.6.0";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "Saghen";
|
||||||
|
repo = "blink.cmp";
|
||||||
|
tag = "v${finalAttrs.version}";
|
||||||
|
hash = "sha256-IHRYgKcYP+JDGu8Vtawgzlhq25vpROFqb8KmpfVMwCk=";
|
||||||
|
};
|
||||||
|
|
||||||
|
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-QsVCugYWRri4qu64wHnbJQZBhy4tQrr+gCYbXtRBlqE=";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
(writeShellScriptBin "git" "exit 1")
|
||||||
|
];
|
||||||
|
|
||||||
|
env.RUSTC_BOOTSTRAP = true;
|
||||||
|
})
|
||||||
|
|
@ -26,12 +26,22 @@
|
||||||
config.vim = {
|
config.vim = {
|
||||||
theme.enable = true;
|
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.
|
# Language support and automatic configuration of companion plugins.
|
||||||
# Note that enabling, e.g., languages.<lang>.diagnostics will automatically
|
# Note that enabling, e.g., languages.<lang>.diagnostics will automatically
|
||||||
# enable top-level options such as enableLSP or enableExtraDiagnostics as
|
# enable top-level options such as enableLSP or enableExtraDiagnostics as
|
||||||
# they are needed.
|
# they are needed.
|
||||||
languages = {
|
languages = {
|
||||||
enableLSP = true;
|
|
||||||
enableFormat = true;
|
enableFormat = true;
|
||||||
enableTreesitter = true;
|
enableTreesitter = true;
|
||||||
enableExtraDiagnostics = true;
|
enableExtraDiagnostics = true;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
types = import ./types {inherit lib;};
|
types = import ./types {inherit lib self;};
|
||||||
config = import ./config.nix {inherit lib;};
|
config = import ./config.nix {inherit lib;};
|
||||||
binds = import ./binds.nix {inherit lib;};
|
binds = import ./binds.nix {inherit lib;};
|
||||||
dag = import ./dag.nix {inherit lib;};
|
dag = import ./dag.nix {inherit lib;};
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
# From home-manager: https://github.com/nix-community/home-manager/blob/master/modules/lib/booleans.nix
|
|
||||||
{lib}: let
|
{lib}: let
|
||||||
inherit (builtins) isString getAttr;
|
inherit (builtins) isString getAttr;
|
||||||
inherit (lib.options) mkOption;
|
inherit (lib.options) mkOption;
|
||||||
inherit (lib.types) bool;
|
inherit (lib.types) listOf bool str submodule attrsOf anything either nullOr;
|
||||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||||
|
inherit (lib.nvim.types) luaInline;
|
||||||
in {
|
in {
|
||||||
|
# TODO: remove
|
||||||
diagnosticsToLua = {
|
diagnosticsToLua = {
|
||||||
lang,
|
lang,
|
||||||
config,
|
config,
|
||||||
|
|
@ -32,4 +33,48 @@ in {
|
||||||
type = bool;
|
type = bool;
|
||||||
description = "Turn on ${desc} for enabled languages by default";
|
description = "Turn on ${desc} for enabled languages by default";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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 capabilitiess to pass to lspconfig";
|
||||||
|
};
|
||||||
|
|
||||||
|
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 in";
|
||||||
|
};
|
||||||
|
|
||||||
|
cmd = mkOption {
|
||||||
|
type = nullOr (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.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
{lib}: let
|
{lib}: let
|
||||||
inherit (builtins) hasAttr head throw typeOf isList isAttrs isBool isInt isString isPath isFloat toJSON;
|
inherit (builtins) hasAttr head throw typeOf isList isAttrs isBool isInt isString isPath isFloat toJSON;
|
||||||
inherit (lib.attrsets) mapAttrsToList filterAttrs;
|
inherit (lib.attrsets) mapAttrsToList filterAttrs;
|
||||||
inherit (lib.strings) concatStringsSep concatMapStringsSep stringToCharacters concatLines;
|
inherit (lib.strings) concatStringsSep concatMapStringsSep stringToCharacters;
|
||||||
inherit (lib.trivial) boolToString warn;
|
inherit (lib.trivial) boolToString warn;
|
||||||
in rec {
|
in rec {
|
||||||
# Convert a null value to lua's nil
|
# Convert a null value to lua's nil
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
# Convenience function that returns the given Nixpkgs standard library
|
# Convenience function that returns the given Nixpkgs standard library
|
||||||
# extended with our functions using `lib.extend`.
|
# extended with our functions using `lib.extend`.
|
||||||
{
|
{inputs, ...} @ args:
|
||||||
inputs,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
} @ args:
|
|
||||||
inputs.nixpkgs.lib.extend (self: super: {
|
inputs.nixpkgs.lib.extend (self: super: {
|
||||||
# WARNING: New functions should not be added here, but to files
|
# WARNING: New functions should not be added here, but to files
|
||||||
# imported by `./default.nix` under their own categories. If your
|
# imported by `./default.nix` under their own categories. If your
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,11 @@
|
||||||
inherit (lib.strings) isString stringLength match;
|
inherit (lib.strings) isString stringLength match;
|
||||||
inherit (lib.types) listOf mkOptionType;
|
inherit (lib.types) listOf mkOptionType;
|
||||||
in {
|
in {
|
||||||
mergelessListOf = elemType: let
|
mergelessListOf = elemType:
|
||||||
super = listOf elemType;
|
mkOptionType {
|
||||||
in
|
|
||||||
super
|
|
||||||
// {
|
|
||||||
name = "mergelessListOf";
|
name = "mergelessListOf";
|
||||||
description = "mergeless ${super.description}";
|
description = "mergeless list of ${elemType.description or "values"}";
|
||||||
|
inherit (lib.types.listOf elemType) check;
|
||||||
merge = mergeEqualOption;
|
merge = mergeEqualOption;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,13 @@ in rec {
|
||||||
inherit (elemType) getSubModules;
|
inherit (elemType) getSubModules;
|
||||||
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name>"]);
|
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name>"]);
|
||||||
substSubModules = m: dagOf (elemType.substSubModules m);
|
substSubModules = m: dagOf (elemType.substSubModules m);
|
||||||
functor = (defaultFunctor name) // {wrapped = elemType;};
|
functor = {
|
||||||
|
name = name;
|
||||||
|
type = dagOf;
|
||||||
|
wrapped = elemType;
|
||||||
|
payload = elemType;
|
||||||
|
binOp = a: b: a;
|
||||||
|
};
|
||||||
nestedTypes.elemType = elemType;
|
nestedTypes.elemType = elemType;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
{lib}: let
|
{
|
||||||
|
lib,
|
||||||
|
self,
|
||||||
|
}: let
|
||||||
typesDag = import ./dag.nix {inherit lib;};
|
typesDag = import ./dag.nix {inherit lib;};
|
||||||
typesPlugin = import ./plugins.nix {inherit lib;};
|
typesPlugin = import ./plugins.nix {inherit lib self;};
|
||||||
typesLanguage = import ./languages.nix {inherit lib;};
|
typesLanguage = import ./languages.nix {inherit lib;};
|
||||||
customTypes = import ./custom.nix {inherit lib;};
|
customTypes = import ./custom.nix {inherit lib;};
|
||||||
in {
|
in {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
{lib}: let
|
{
|
||||||
|
lib,
|
||||||
|
self,
|
||||||
|
}: let
|
||||||
inherit (lib.options) mkOption;
|
inherit (lib.options) mkOption;
|
||||||
inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair;
|
inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair;
|
||||||
inherit (lib.strings) hasPrefix removePrefix;
|
inherit (lib.strings) hasPrefix removePrefix;
|
||||||
|
|
@ -12,7 +15,7 @@
|
||||||
mapAttrs' (n: v: nameValuePair (removePrefix prefix n) {src = v;}) (filterAttrs (n: _: hasPrefix prefix n) inputs);
|
mapAttrs' (n: v: nameValuePair (removePrefix prefix n) {src = v;}) (filterAttrs (n: _: hasPrefix prefix n) inputs);
|
||||||
|
|
||||||
# Get the names of all npins
|
# Get the names of all npins
|
||||||
pluginInputNames = attrNames (lib.importJSON ../../npins/sources.json).pins;
|
pluginInputNames = ["blink-cmp"] ++ attrNames self.pins;
|
||||||
|
|
||||||
# You can either use the name of the plugin or a package.
|
# You can either use the name of the plugin or a package.
|
||||||
pluginType = nullOr (
|
pluginType = nullOr (
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
showSignColumn = "signcolumn";
|
showSignColumn = "signcolumn";
|
||||||
|
|
||||||
# 2025-02-07
|
# 2025-02-07
|
||||||
scrollOff = "scrolloff";
|
scrollOffset = "scrolloff";
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
imports = concatLists [
|
imports = concatLists [
|
||||||
|
|
@ -111,6 +111,15 @@ in {
|
||||||
under the diagnostics module. Please consider using one of 'vim.diagnostics.config' or
|
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.
|
'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.
|
||||||
|
'')
|
||||||
]
|
]
|
||||||
|
|
||||||
# Migrated via batchRenameOptions. Further batch renames must be below this line.
|
# Migrated via batchRenameOptions. Further batch renames must be below this line.
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,12 @@
|
||||||
"minimap"
|
"minimap"
|
||||||
"notes"
|
"notes"
|
||||||
"projects"
|
"projects"
|
||||||
|
"repl"
|
||||||
"rich-presence"
|
"rich-presence"
|
||||||
"runner"
|
"runner"
|
||||||
"session"
|
"session"
|
||||||
"snippets"
|
"snippets"
|
||||||
# "spellcheck" # FIXME: see neovim/init/spellcheck.nix
|
"spellcheck"
|
||||||
"statusline"
|
"statusline"
|
||||||
"tabline"
|
"tabline"
|
||||||
"terminal"
|
"terminal"
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
mkEnableOption ""
|
mkEnableOption ""
|
||||||
// {
|
// {
|
||||||
default = true;
|
default = true;
|
||||||
description = "Whether to enable this autocommand";
|
description = "Whether to enable this autocommand.";
|
||||||
};
|
};
|
||||||
|
|
||||||
event = mkOption {
|
event = mkOption {
|
||||||
|
|
@ -31,26 +31,29 @@
|
||||||
type = nullOr (listOf str);
|
type = nullOr (listOf str);
|
||||||
default = null;
|
default = null;
|
||||||
example = ["*.lua" "*.vim"];
|
example = ["*.lua" "*.vim"];
|
||||||
description = "The file pattern(s) that determine when the autocommand applies).";
|
description = "The file pattern(s) that determine when the autocommand applies.";
|
||||||
};
|
};
|
||||||
|
|
||||||
callback = mkOption {
|
callback = mkOption {
|
||||||
type = nullOr luaInline;
|
type = nullOr luaInline;
|
||||||
default = null;
|
default = null;
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
mkLuaInline '''
|
lib.generators.mkLuaInline '''
|
||||||
function()
|
function()
|
||||||
print("Saving a Lua file...")
|
print("Saving a Lua file...")
|
||||||
end
|
end
|
||||||
''''
|
''''
|
||||||
'';
|
'';
|
||||||
description = "The file pattern(s) that determine when the autocommand applies.";
|
description = "Lua function to be called when the event(s) are triggered.";
|
||||||
};
|
};
|
||||||
|
|
||||||
command = mkOption {
|
command = mkOption {
|
||||||
type = nullOr str;
|
type = nullOr str;
|
||||||
default = null;
|
default = null;
|
||||||
description = "Vim command string instead of a Lua function.";
|
description = ''
|
||||||
|
Vim command to be executed when the event(s) are triggered.
|
||||||
|
Cannot be defined if the `callback` option is already defined.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
group = mkOption {
|
group = mkOption {
|
||||||
|
|
@ -70,7 +73,7 @@
|
||||||
once = mkOption {
|
once = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "Whether autocommand run only once.";
|
description = "Whether to run the autocommand only once.";
|
||||||
};
|
};
|
||||||
|
|
||||||
nested = mkOption {
|
nested = mkOption {
|
||||||
|
|
@ -87,7 +90,7 @@
|
||||||
mkEnableOption ""
|
mkEnableOption ""
|
||||||
// {
|
// {
|
||||||
default = true;
|
default = true;
|
||||||
description = "Whether to enable this autogroup";
|
description = "Whether to enable this autocommand group.";
|
||||||
};
|
};
|
||||||
|
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
|
|
@ -118,8 +121,8 @@ in {
|
||||||
autocommands together. Groups allow multiple autocommands to be cleared
|
autocommands together. Groups allow multiple autocommands to be cleared
|
||||||
or redefined collectively, preventing duplicate definitions.
|
or redefined collectively, preventing duplicate definitions.
|
||||||
|
|
||||||
Each autogroup consists of a name, a boolean indicating whether to clear
|
Each autogroup consists of a name and a boolean indicating whether to clear
|
||||||
existing autocommands, and a list of associated autocommands.
|
existing autocommands.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -129,8 +132,8 @@ in {
|
||||||
description = ''
|
description = ''
|
||||||
A list of Neovim autocommands to be registered.
|
A list of Neovim autocommands to be registered.
|
||||||
|
|
||||||
Each entry defines an autocommand, specifying events, patterns, optional
|
Each entry defines an autocommand, specifying events, patterns, a callback or Vim
|
||||||
callbacks, commands, groups, and execution settings.
|
command, an optional group, a description, and execution settings.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,10 @@
|
||||||
inherit (lib.options) mkOption mkEnableOption literalMD;
|
inherit (lib.options) mkOption mkEnableOption literalMD;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.attrsets) optionalAttrs;
|
inherit (lib.attrsets) optionalAttrs;
|
||||||
inherit (lib.types) enum bool str int either;
|
inherit (lib.types) enum bool str either;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.nvim.dag) entryAfter;
|
inherit (lib.nvim.dag) entryAfter;
|
||||||
inherit (lib.nvim.binds) pushDownDefault;
|
inherit (lib.nvim.binds) pushDownDefault;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
|
||||||
inherit (lib.nvim.types) luaInline;
|
inherit (lib.nvim.types) luaInline;
|
||||||
|
|
||||||
cfg = config.vim;
|
cfg = config.vim;
|
||||||
|
|
@ -22,24 +21,12 @@ in {
|
||||||
description = "Hide search highlight so it doesn't stay highlighted";
|
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.";
|
|
||||||
};
|
|
||||||
|
|
||||||
syntaxHighlighting = mkOption {
|
syntaxHighlighting = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = !config.vim.treesitter.highlight.enable;
|
default = !config.vim.treesitter.highlight.enable;
|
||||||
description = "Enable syntax highlighting";
|
description = "Enable syntax highlighting";
|
||||||
};
|
};
|
||||||
|
|
||||||
useSystemClipboard = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = "Make use of the clipboard for default yank and paste operations. Don't use * and +";
|
|
||||||
};
|
|
||||||
|
|
||||||
lineNumberMode = mkOption {
|
lineNumberMode = mkOption {
|
||||||
type = enum ["relative" "number" "relNumber" "none"];
|
type = enum ["relative" "number" "relNumber" "none"];
|
||||||
default = "relNumber";
|
default = "relNumber";
|
||||||
|
|
@ -144,10 +131,6 @@ in {
|
||||||
# to pre-set Neovim options. Fear not, though as the Lua DAG is still as powerful as it
|
# to pre-set Neovim options. Fear not, though as the Lua DAG is still as powerful as it
|
||||||
# could be.
|
# could be.
|
||||||
luaConfigRC.basic = entryAfter ["globalsScript"] ''
|
luaConfigRC.basic = entryAfter ["globalsScript"] ''
|
||||||
${optionalString cfg.useSystemClipboard ''
|
|
||||||
vim.opt.clipboard:append("unnamedplus")
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString cfg.syntaxHighlighting ''
|
${optionalString cfg.syntaxHighlighting ''
|
||||||
vim.cmd("syntax on")
|
vim.cmd("syntax on")
|
||||||
''}
|
''}
|
||||||
|
|
|
||||||
80
modules/neovim/init/clipboard.nix
Normal file
80
modules/neovim/init/clipboard.nix
Normal file
|
|
@ -0,0 +1,80 @@
|
||||||
|
{
|
||||||
|
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 [](#opt-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
|
||||||
|
);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -2,9 +2,11 @@
|
||||||
imports = [
|
imports = [
|
||||||
./autocmds.nix
|
./autocmds.nix
|
||||||
./basic.nix
|
./basic.nix
|
||||||
|
./clipboard.nix
|
||||||
./debug.nix
|
./debug.nix
|
||||||
./diagnostics.nix
|
./diagnostics.nix
|
||||||
./highlight.nix
|
./highlight.nix
|
||||||
|
./lsp.nix
|
||||||
./spellcheck.nix
|
./spellcheck.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,14 +57,21 @@
|
||||||
signs = mkOption {
|
signs = mkOption {
|
||||||
type = diagnosticType;
|
type = diagnosticType;
|
||||||
default = false;
|
default = false;
|
||||||
example = {
|
example = literalExpression ''
|
||||||
signs.text = {
|
signs.text = lib.generators.mkLuaInline '''
|
||||||
"vim.diagnostic.severity.ERROR" = " ";
|
{
|
||||||
"vim.diagnostic.severity.WARN" = " ";
|
[vim.diagnostic.severity.ERROR] = " ",
|
||||||
};
|
[vim.diagnostic.severity.WARN] = " ",
|
||||||
};
|
}
|
||||||
|
''';
|
||||||
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
Use signs for diagnostics. See {command}`:help diagnostic-signs`.
|
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.
|
||||||
|
:::
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -81,7 +88,7 @@
|
||||||
in {
|
in {
|
||||||
options.vim = {
|
options.vim = {
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
enable = mkEnableOption "diagostics module for Neovim";
|
enable = mkEnableOption "diagnostics module for Neovim";
|
||||||
config = mkOption {
|
config = mkOption {
|
||||||
type = diagnosticsSubmodule;
|
type = diagnosticsSubmodule;
|
||||||
default = {};
|
default = {};
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,14 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption;
|
inherit (lib.options) mkOption;
|
||||||
inherit (lib.types) nullOr attrsOf listOf submodule bool ints str enum;
|
inherit (lib.types) nullOr attrsOf listOf submodule bool ints str enum;
|
||||||
inherit (lib.strings) hasPrefix concatLines;
|
inherit (lib.strings) concatLines;
|
||||||
inherit (lib.attrsets) mapAttrsToList;
|
inherit (lib.attrsets) mapAttrsToList;
|
||||||
inherit (lib.nvim.dag) entryBetween;
|
inherit (lib.nvim.dag) entryBetween;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
inherit (lib.nvim.types) hexColor;
|
|
||||||
|
|
||||||
mkColorOption = target:
|
mkColorOption = target:
|
||||||
mkOption {
|
mkOption {
|
||||||
type = nullOr hexColor;
|
type = nullOr str;
|
||||||
default = null;
|
default = null;
|
||||||
example = "#ebdbb2";
|
example = "#ebdbb2";
|
||||||
description = ''
|
description = ''
|
||||||
|
|
|
||||||
93
modules/neovim/init/lsp.nix
Normal file
93
modules/neovim/init/lsp.nix
Normal file
|
|
@ -0,0 +1,93 @@
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
|
||||||
|
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");
|
||||||
|
on_attach = mkDefault (mkLuaInline "default_on_attach");
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
(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))})
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -94,6 +94,8 @@ in {
|
||||||
Enabling this option will unconditionally set
|
Enabling this option will unconditionally set
|
||||||
{option}`vim.spellcheck.enable` to true as vim-dirtytalk
|
{option}`vim.spellcheck.enable` to true as vim-dirtytalk
|
||||||
depends on spellchecking having been set up.
|
depends on spellchecking having been set up.
|
||||||
|
|
||||||
|
Run {command}`:DirtytalkUpdate` on first use to download the spellfile.
|
||||||
:::
|
:::
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkMerge;
|
||||||
inherit (lib.trivial) pipe;
|
inherit (lib.trivial) pipe;
|
||||||
inherit (lib.attrsets) mapAttrsToList;
|
inherit (lib.attrsets) mapAttrsToList;
|
||||||
inherit (lib.lists) flatten;
|
inherit (lib.lists) flatten;
|
||||||
|
|
|
||||||
341
modules/plugins/assistant/avante/avante-nvim.nix
Normal file
341
modules/plugins/assistant/avante/avante-nvim.nix
Normal file
|
|
@ -0,0 +1,341 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkOption mkEnableOption literalMD;
|
||||||
|
inherit (lib.types) int str enum nullOr attrs bool;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
in {
|
||||||
|
options.vim.assistant = {
|
||||||
|
avante-nvim = {
|
||||||
|
enable = mkEnableOption "complementary Neovim plugin for avante.nvim";
|
||||||
|
setupOpts = mkPluginSetupOption "avante-nvim" {
|
||||||
|
provider = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = "The provider used in Aider mode or in the planning phase of Cursor Planning Mode.";
|
||||||
|
};
|
||||||
|
|
||||||
|
providers = mkOption {
|
||||||
|
type = nullOr attrs;
|
||||||
|
default = null;
|
||||||
|
description = "Define settings for builtin and custom providers.";
|
||||||
|
example = literalMD ''
|
||||||
|
```nix
|
||||||
|
openai = {
|
||||||
|
endpoint = "https://api.openai.com/v1";
|
||||||
|
model = "gpt-4o"; # your desired model (or use gpt-4o, etc.)
|
||||||
|
timeout = 30000; # Timeout in milliseconds, increase this for reasoning models
|
||||||
|
extra_request_body = {
|
||||||
|
temperature = 0;
|
||||||
|
max_completion_tokens = 8192; # Increase this to include reasoning tokens (for reasoning models)
|
||||||
|
reasoning_effort = "medium"; # low|medium|high, only used for reasoning models
|
||||||
|
};
|
||||||
|
};
|
||||||
|
ollama = {
|
||||||
|
endpoint = "http://127.0.0.1:11434";
|
||||||
|
timeout = 30000; # Timeout in milliseconds
|
||||||
|
extra_request_body = {
|
||||||
|
options = {
|
||||||
|
temperature = 0.75;
|
||||||
|
num_ctx = 20480;
|
||||||
|
keep_alive = "5m";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
groq = {
|
||||||
|
__inherited_from = "openai";
|
||||||
|
api_key_name = "GROQ_API_KEY";
|
||||||
|
endpoint = "https://api.groq.com/openai/v1/";
|
||||||
|
model = "llama-3.3-70b-versatile";
|
||||||
|
disable_tools = true;
|
||||||
|
extra_request_body = {
|
||||||
|
temperature = 1;
|
||||||
|
max_tokens = 32768; # remember to increase this value, otherwise it will stop generating halfway
|
||||||
|
};
|
||||||
|
};
|
||||||
|
```
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
auto_suggestions_provider = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "claude";
|
||||||
|
description = ''
|
||||||
|
Since auto-suggestions are a high-frequency operation and therefore expensive,
|
||||||
|
currently designating it as `copilot` provider is dangerous because:
|
||||||
|
https://github.com/yetone/avante.nvim/issues/1048
|
||||||
|
Of course, you can reduce the request frequency by increasing `suggestion.debounce`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
cursor_applying_provider = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
The provider used in the applying phase of Cursor Planning Mode, defaults to `nil`,
|
||||||
|
Config.provider will be used as the provider for the applying phase when `nil`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
dual_boost = {
|
||||||
|
enabled = mkEnableOption "dual_boost mode.";
|
||||||
|
|
||||||
|
first_provider = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "openai";
|
||||||
|
description = "The first provider to generate response.";
|
||||||
|
};
|
||||||
|
|
||||||
|
second_provider = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "claude";
|
||||||
|
description = "The second provider to generate response.";
|
||||||
|
};
|
||||||
|
|
||||||
|
prompt = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = ''
|
||||||
|
Based on the two reference outputs below, generate a response that incorporates
|
||||||
|
elements from both but reflects your own judgment and unique perspective.
|
||||||
|
Do not provide any explanation, just give the response directly. Reference Output 1:
|
||||||
|
[{{provider1_output}}], Reference Output 2: [{{provider2_output}}'';
|
||||||
|
description = "The prompt to generate response based on the two reference outputs.";
|
||||||
|
};
|
||||||
|
|
||||||
|
timeout = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 60000;
|
||||||
|
description = "Timeout in milliseconds.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
behaviour = {
|
||||||
|
auto_suggestions =
|
||||||
|
mkEnableOption "auto suggestions.";
|
||||||
|
|
||||||
|
auto_set_highlight_group =
|
||||||
|
mkEnableOption "automatically set the highlight group for the current line."
|
||||||
|
// {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
auto_set_keymaps =
|
||||||
|
mkEnableOption "automatically set the keymap for the current line."
|
||||||
|
// {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
auto_apply_diff_after_generation =
|
||||||
|
mkEnableOption "automatically apply diff after LLM response.";
|
||||||
|
|
||||||
|
support_paste_from_clipboard = mkEnableOption ''
|
||||||
|
pasting image from clipboard.
|
||||||
|
This will be determined automatically based whether img-clip is available or not.
|
||||||
|
'';
|
||||||
|
|
||||||
|
minimize_diff =
|
||||||
|
mkEnableOption "remove unchanged lines when applying a code block."
|
||||||
|
// {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
enable_token_counting =
|
||||||
|
mkEnableOption "token counting."
|
||||||
|
// {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
enable_cursor_planning_mode =
|
||||||
|
mkEnableOption "Cursor Planning Mode.";
|
||||||
|
|
||||||
|
enable_claude_text_editor_tool_mode =
|
||||||
|
mkEnableOption "Claude Text Editor Tool Mode.";
|
||||||
|
};
|
||||||
|
|
||||||
|
mappings = {
|
||||||
|
diff = mkOption {
|
||||||
|
type = nullOr attrs;
|
||||||
|
default = null;
|
||||||
|
description = "Define or override the default keymaps for diff.";
|
||||||
|
};
|
||||||
|
|
||||||
|
suggestion = mkOption {
|
||||||
|
type = nullOr attrs;
|
||||||
|
default = null;
|
||||||
|
description = "Define or override the default keymaps for suggestion actions.";
|
||||||
|
};
|
||||||
|
|
||||||
|
jump = mkOption {
|
||||||
|
type = nullOr attrs;
|
||||||
|
default = null;
|
||||||
|
description = "Define or override the default keymaps for jump actions.";
|
||||||
|
};
|
||||||
|
|
||||||
|
submit = mkOption {
|
||||||
|
type = nullOr attrs;
|
||||||
|
default = null;
|
||||||
|
description = "Define or override the default keymaps for submit actions.";
|
||||||
|
};
|
||||||
|
|
||||||
|
cancel = mkOption {
|
||||||
|
type = nullOr attrs;
|
||||||
|
default = null;
|
||||||
|
description = "Define or override the default keymaps for cancel actions.";
|
||||||
|
};
|
||||||
|
|
||||||
|
sidebar = mkOption {
|
||||||
|
type = nullOr attrs;
|
||||||
|
default = null;
|
||||||
|
description = "Define or override the default keymaps for sidebar actions.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
hints.enabled =
|
||||||
|
mkEnableOption ""
|
||||||
|
// {
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Whether to enable hints.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
windows = {
|
||||||
|
position = mkOption {
|
||||||
|
type = enum ["right" "left" "top" "bottom"];
|
||||||
|
default = "right";
|
||||||
|
description = "The position of the sidebar.";
|
||||||
|
};
|
||||||
|
|
||||||
|
wrap =
|
||||||
|
mkEnableOption ""
|
||||||
|
// {
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
similar to vim.o.wrap.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
width = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 30;
|
||||||
|
description = "Default % based on available width.";
|
||||||
|
};
|
||||||
|
|
||||||
|
sidebar_header = {
|
||||||
|
enabled = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "enable/disable the header.";
|
||||||
|
};
|
||||||
|
|
||||||
|
align = mkOption {
|
||||||
|
type = enum ["right" "center" "left"];
|
||||||
|
default = "center";
|
||||||
|
description = "Position of the title.";
|
||||||
|
};
|
||||||
|
|
||||||
|
rounded = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Enable rounded sidebar header";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
input = {
|
||||||
|
prefix = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "> ";
|
||||||
|
description = "The prefix used on the user input.";
|
||||||
|
};
|
||||||
|
|
||||||
|
height = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 8;
|
||||||
|
description = ''
|
||||||
|
Height of the input window in vertical layout.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
edit = {
|
||||||
|
border = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "rounded";
|
||||||
|
description = "The border type on the edit window.";
|
||||||
|
};
|
||||||
|
|
||||||
|
start_insert = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Start insert mode when opening the edit window.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
ask = {
|
||||||
|
floating = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Open the 'AvanteAsk' prompt in a floating window.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
start_insert = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Start insert mode when opening the ask window.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
border = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "rounded";
|
||||||
|
description = "The border type on the ask window.";
|
||||||
|
};
|
||||||
|
|
||||||
|
focus_on_apply = mkOption {
|
||||||
|
type = enum ["ours" "theirs"];
|
||||||
|
default = "ours";
|
||||||
|
description = "Which diff to focus after applying.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
diff = {
|
||||||
|
autojump =
|
||||||
|
mkEnableOption ""
|
||||||
|
// {
|
||||||
|
default = true;
|
||||||
|
description = "Automatically jumps to the next change.";
|
||||||
|
};
|
||||||
|
|
||||||
|
override_timeoutlen = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 500;
|
||||||
|
example = -1;
|
||||||
|
description = ''
|
||||||
|
Override the 'timeoutlen' setting while hovering over a diff (see {command}`:help timeoutlen`).
|
||||||
|
Helps to avoid entering operator-pending mode with diff mappings starting with `c`.
|
||||||
|
Disable by setting to -1.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
suggestion = {
|
||||||
|
debounce = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 600;
|
||||||
|
description = "Suggestion debounce in milliseconds.";
|
||||||
|
};
|
||||||
|
|
||||||
|
throttle = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 600;
|
||||||
|
description = "Suggestion throttle in milliseconds.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
41
modules/plugins/assistant/avante/config.nix
Normal file
41
modules/plugins/assistant/avante/config.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.lists) optionals;
|
||||||
|
|
||||||
|
cfg = config.vim.assistant.avante-nvim;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins =
|
||||||
|
[
|
||||||
|
"nvim-treesitter"
|
||||||
|
"plenary-nvim"
|
||||||
|
"dressing-nvim"
|
||||||
|
"nui-nvim"
|
||||||
|
]
|
||||||
|
++ (optionals config.vim.mini.pick.enable ["mini-pick"])
|
||||||
|
++ (optionals config.vim.telescope.enable ["telescope"])
|
||||||
|
++ (optionals config.vim.autocomplete.nvim-cmp.enable ["nvim-cmp"])
|
||||||
|
++ (optionals config.vim.fzf-lua.enable ["fzf-lua"])
|
||||||
|
++ (optionals config.vim.visuals.nvim-web-devicons.enable ["nvim-web-devicons"])
|
||||||
|
++ (optionals config.vim.utility.images.img-clip.enable ["img-clip"]);
|
||||||
|
|
||||||
|
lazy.plugins = {
|
||||||
|
avante-nvim = {
|
||||||
|
package = "avante-nvim";
|
||||||
|
setupModule = "avante";
|
||||||
|
inherit (cfg) setupOpts;
|
||||||
|
event = ["DeferredUIEnter"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
treesitter.enable = true;
|
||||||
|
|
||||||
|
languages.markdown.extensions.render-markdown-nvim.setupOpts.file_types = lib.mkAfter ["Avante"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
6
modules/plugins/assistant/avante/default.nix
Normal file
6
modules/plugins/assistant/avante/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./config.nix
|
||||||
|
./avante-nvim.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -30,7 +30,16 @@
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = ["chatgpt-nvim"];
|
startPlugins = [
|
||||||
|
"chatgpt-nvim"
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
"nui-nvim"
|
||||||
|
"plenary-nvim"
|
||||||
|
];
|
||||||
|
|
||||||
|
# ChatGPT.nvim explicitly depends on Telescope.
|
||||||
|
telescope.enable = true;
|
||||||
|
|
||||||
pluginRC.chagpt = entryAnywhere ''
|
pluginRC.chagpt = entryAnywhere ''
|
||||||
require("chatgpt").setup(${toLuaObject cfg.setupOpts})
|
require("chatgpt").setup(${toLuaObject cfg.setupOpts})
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,17 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
treesitter.enable = true;
|
treesitter = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# Codecompanion depends on the YAML grammar being added. Below is
|
||||||
|
# an easy way of adding an user-configurable grammar package exposed
|
||||||
|
# by the YAML language module *without* enabling the whole YAML language
|
||||||
|
# module. The package is defined even when the module is disabled.
|
||||||
|
grammars = [
|
||||||
|
config.vim.languages.yaml.treesitter.package
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
autocomplete.nvim-cmp = {
|
autocomplete.nvim-cmp = {
|
||||||
sources = {codecompanion-nvim = "[codecompanion]";};
|
sources = {codecompanion-nvim = "[codecompanion]";};
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) toJSON;
|
inherit (builtins) toJSON;
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.strings) optionalString;
|
|
||||||
|
|
||||||
cfg = config.vim.assistant.copilot;
|
cfg = config.vim.assistant.copilot;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ in {
|
||||||
accept = mkOption {
|
accept = mkOption {
|
||||||
type = nullOr str;
|
type = nullOr str;
|
||||||
default = "<M-l>";
|
default = "<M-l>";
|
||||||
description = "Accept suggetion";
|
description = "Accept suggestion";
|
||||||
};
|
};
|
||||||
|
|
||||||
acceptWord = mkOption {
|
acceptWord = mkOption {
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,7 @@
|
||||||
./chatgpt
|
./chatgpt
|
||||||
./copilot
|
./copilot
|
||||||
./codecompanion
|
./codecompanion
|
||||||
|
./supermaven-nvim
|
||||||
|
./avante
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
17
modules/plugins/assistant/supermaven-nvim/config.nix
Normal file
17
modules/plugins/assistant/supermaven-nvim/config.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.vim.assistant.supermaven-nvim;
|
||||||
|
in {
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
vim.lazy.plugins = {
|
||||||
|
supermaven-nvim = {
|
||||||
|
package = "supermaven-nvim";
|
||||||
|
setupModule = "supermaven-nvim";
|
||||||
|
inherit (cfg) setupOpts;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
6
modules/plugins/assistant/supermaven-nvim/default.nix
Normal file
6
modules/plugins/assistant/supermaven-nvim/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./supermaven-nvim.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,94 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit
|
||||||
|
(lib.types)
|
||||||
|
nullOr
|
||||||
|
str
|
||||||
|
bool
|
||||||
|
attrsOf
|
||||||
|
ints
|
||||||
|
enum
|
||||||
|
;
|
||||||
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
||||||
|
in {
|
||||||
|
options.vim.assistant.supermaven-nvim = {
|
||||||
|
enable = mkEnableOption "Supermaven AI assistant";
|
||||||
|
|
||||||
|
setupOpts = mkPluginSetupOption "Supermaven" {
|
||||||
|
keymaps = {
|
||||||
|
accept_suggestion = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
|
example = "<Tab>";
|
||||||
|
description = "The key to accept a suggestion";
|
||||||
|
};
|
||||||
|
clear_suggestion = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
|
example = "<C-]>";
|
||||||
|
description = "The key to clear a suggestion";
|
||||||
|
};
|
||||||
|
accept_word = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
|
example = "<C-j>";
|
||||||
|
description = "The key to accept a word";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
ignore_file = mkOption {
|
||||||
|
type = nullOr (attrsOf bool);
|
||||||
|
default = null;
|
||||||
|
example = {
|
||||||
|
markdown = true;
|
||||||
|
};
|
||||||
|
description = "List of fileto ignore";
|
||||||
|
};
|
||||||
|
color = {
|
||||||
|
suggestion_color = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
|
example = "#ffffff";
|
||||||
|
description = "The hex color of the suggestion";
|
||||||
|
};
|
||||||
|
cterm = mkOption {
|
||||||
|
type = nullOr ints.u8;
|
||||||
|
default = null;
|
||||||
|
example = 244;
|
||||||
|
description = "The cterm color of the suggestion";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
log_level = mkOption {
|
||||||
|
type = nullOr (enum [
|
||||||
|
"off"
|
||||||
|
"trace"
|
||||||
|
"debug"
|
||||||
|
"info"
|
||||||
|
"warn"
|
||||||
|
"error"
|
||||||
|
]);
|
||||||
|
default = null;
|
||||||
|
example = "info";
|
||||||
|
description = "The log level. Set to `\"off\"` to disable completely";
|
||||||
|
};
|
||||||
|
disable_inline_completion = mkOption {
|
||||||
|
type = nullOr bool;
|
||||||
|
default = null;
|
||||||
|
description = "Disable inline completion for use with cmp";
|
||||||
|
};
|
||||||
|
disable_keymaps = mkOption {
|
||||||
|
type = nullOr bool;
|
||||||
|
default = null;
|
||||||
|
description = "Disable built-in keymaps for more manual control";
|
||||||
|
};
|
||||||
|
condition = mkOption {
|
||||||
|
type = nullOr luaInline;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Condition function to check for stopping supermaven.
|
||||||
|
|
||||||
|
A returned `true` means to stop supermaven
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{lib, ...}: let
|
{lib, ...}: let
|
||||||
inherit (lib.options) mkEnableOption mkOption literalMD;
|
inherit (lib.options) mkEnableOption mkOption literalMD;
|
||||||
inherit (lib.types) bool listOf str either attrsOf submodule enum anything int nullOr;
|
inherit (lib.types) bool listOf str either attrsOf submodule enum anything int nullOr;
|
||||||
inherit (lib.generators) mkLuaInline;
|
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption luaInline pluginType;
|
inherit (lib.nvim.types) mkPluginSetupOption luaInline pluginType;
|
||||||
inherit (lib.nvim.binds) mkMappingOption;
|
inherit (lib.nvim.binds) mkMappingOption;
|
||||||
inherit (lib.nvim.config) mkBool;
|
inherit (lib.nvim.config) mkBool;
|
||||||
|
|
@ -10,7 +9,7 @@
|
||||||
freeformType = attrsOf (listOf (either str luaInline));
|
freeformType = attrsOf (listOf (either str luaInline));
|
||||||
options = {
|
options = {
|
||||||
preset = mkOption {
|
preset = mkOption {
|
||||||
type = enum ["default" "none" "super-tab" "enter"];
|
type = enum ["inherit" "default" "none" "super-tab" "enter" "cmdline"];
|
||||||
default = "none";
|
default = "none";
|
||||||
description = "keymap presets";
|
description = "keymap presets";
|
||||||
};
|
};
|
||||||
|
|
@ -48,7 +47,7 @@ in {
|
||||||
cmdline = {
|
cmdline = {
|
||||||
sources = mkOption {
|
sources = mkOption {
|
||||||
type = nullOr (listOf str);
|
type = nullOr (listOf str);
|
||||||
default = [];
|
default = null;
|
||||||
description = "List of sources to enable for cmdline. Null means use default source list.";
|
description = "List of sources to enable for cmdline. Null means use default source list.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,12 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
|
inherit (lib.attrsets) optionalAttrs;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.attrsets) attrValues filterAttrs mapAttrsToList;
|
inherit (lib.attrsets) attrValues filterAttrs mapAttrsToList;
|
||||||
inherit (lib.lists) map optional elem;
|
inherit (lib.lists) map optional optionals elem;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
inherit (builtins) concatStringsSep typeOf tryEval attrNames mapAttrs;
|
inherit (builtins) concatStringsSep typeOf tryEval attrNames mapAttrs removeAttrs;
|
||||||
|
|
||||||
cfg = config.vim.autocomplete.blink-cmp;
|
cfg = config.vim.autocomplete.blink-cmp;
|
||||||
cmpCfg = config.vim.autocomplete.nvim-cmp;
|
cmpCfg = config.vim.autocomplete.nvim-cmp;
|
||||||
|
|
@ -55,7 +56,7 @@ in {
|
||||||
after =
|
after =
|
||||||
# lua
|
# lua
|
||||||
''
|
''
|
||||||
${optionalString config.vim.lazy.enable
|
${optionalString (config.vim.lazy.enable && cmpCfg.enable)
|
||||||
(concatStringsSep "\n" (map
|
(concatStringsSep "\n" (map
|
||||||
(package: "require('lz.n').trigger_load(${toLuaObject (getPluginName package)})")
|
(package: "require('lz.n').trigger_load(${toLuaObject (getPluginName package)})")
|
||||||
cmpCfg.sourcePlugins))}
|
cmpCfg.sourcePlugins))}
|
||||||
|
|
@ -66,7 +67,10 @@ in {
|
||||||
autocomplete = {
|
autocomplete = {
|
||||||
enableSharedCmpSources = true;
|
enableSharedCmpSources = true;
|
||||||
blink-cmp.setupOpts = {
|
blink-cmp.setupOpts = {
|
||||||
sources = {
|
sources = let
|
||||||
|
# We do not want nvim-cmp compat sources overriding built-in blink sources
|
||||||
|
filteredCmpSources = removeAttrs cmpCfg.sources blinkBuiltins;
|
||||||
|
in {
|
||||||
default =
|
default =
|
||||||
[
|
[
|
||||||
"lsp"
|
"lsp"
|
||||||
|
|
@ -74,14 +78,16 @@ in {
|
||||||
"snippets"
|
"snippets"
|
||||||
"buffer"
|
"buffer"
|
||||||
]
|
]
|
||||||
++ (attrNames cmpCfg.sources)
|
++ optionals cmpCfg.enable (attrNames filteredCmpSources)
|
||||||
++ (attrNames enabledBlinkSources);
|
++ (attrNames enabledBlinkSources);
|
||||||
providers =
|
providers =
|
||||||
mapAttrs (name: _: {
|
optionalAttrs cmpCfg.enable (
|
||||||
inherit name;
|
mapAttrs (name: _: {
|
||||||
module = "blink.compat.source";
|
inherit name;
|
||||||
})
|
module = "blink.compat.source";
|
||||||
cmpCfg.sources
|
})
|
||||||
|
filteredCmpSources
|
||||||
|
)
|
||||||
// (mapAttrs (name: definition: {
|
// (mapAttrs (name: definition: {
|
||||||
inherit name;
|
inherit name;
|
||||||
inherit (definition) module;
|
inherit (definition) module;
|
||||||
|
|
@ -122,6 +128,21 @@ in {
|
||||||
"fallback"
|
"fallback"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# cmdline is not enabled by default, we're just providing keymaps in
|
||||||
|
# case the user enables them
|
||||||
|
cmdline.keymap = {
|
||||||
|
${mappings.complete} = ["show" "fallback"];
|
||||||
|
${mappings.close} = ["hide" "fallback"];
|
||||||
|
${mappings.scrollDocsUp} = ["scroll_documentation_up" "fallback"];
|
||||||
|
${mappings.scrollDocsDown} = ["scroll_documentation_down" "fallback"];
|
||||||
|
# NOTE: mappings.confirm is skipped because our default, <CR> would
|
||||||
|
# lead to accidental triggers of blink.accept instead of executing
|
||||||
|
# the cmd
|
||||||
|
|
||||||
|
${mappings.next} = ["select_next" "show" "fallback"];
|
||||||
|
${mappings.previous} = ["select_prev" "fallback"];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,10 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
|
||||||
inherit (builtins) attrNames typeOf tryEval concatStringsSep;
|
inherit (builtins) attrNames typeOf tryEval concatStringsSep;
|
||||||
|
|
||||||
borders = config.vim.ui.borders.plugins.nvim-cmp;
|
borders = config.vim.ui.borders.plugins.nvim-cmp;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkEnableOption mkOption literalExpression literalMD;
|
inherit (lib.options) mkEnableOption mkOption literalMD;
|
||||||
inherit (lib.types) str attrsOf nullOr either listOf;
|
inherit (lib.types) str attrsOf nullOr either listOf;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.nvim.binds) mkMappingOption;
|
inherit (lib.nvim.binds) mkMappingOption;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
cfg = config.vim.dashboard.alpha;
|
cfg = config.vim.dashboard.alpha;
|
||||||
|
|
|
||||||
|
|
@ -3,46 +3,47 @@
|
||||||
inherit (lib.types) listOf attrs bool enum str oneOf int;
|
inherit (lib.types) listOf attrs bool enum str oneOf int;
|
||||||
in {
|
in {
|
||||||
options.vim.dashboard.startify = {
|
options.vim.dashboard.startify = {
|
||||||
enable = mkEnableOption "dashboard via vim-startify";
|
enable = mkEnableOption "fancy start screen for Vim [vim-startify]";
|
||||||
|
|
||||||
bookmarks = mkOption {
|
bookmarks = mkOption {
|
||||||
default = [];
|
|
||||||
description = ''List of book marks to disaply on start page'';
|
|
||||||
type = listOf attrs;
|
type = listOf attrs;
|
||||||
|
default = [];
|
||||||
example = {"c" = "~/.vimrc";};
|
example = {"c" = "~/.vimrc";};
|
||||||
|
description = "List of book marks to display on start page";
|
||||||
};
|
};
|
||||||
|
|
||||||
changeToDir = mkOption {
|
changeToDir = mkOption {
|
||||||
default = true;
|
|
||||||
description = "Should vim change to the directory of the file you open";
|
|
||||||
type = bool;
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Whether Vim should change to the directory of the file you open";
|
||||||
};
|
};
|
||||||
|
|
||||||
changeToVCRoot = mkOption {
|
changeToVCRoot = mkOption {
|
||||||
default = false;
|
|
||||||
description = "Should vim change to the version control root when opening a file";
|
|
||||||
type = bool;
|
type = bool;
|
||||||
|
default = false;
|
||||||
|
description = "Whether Vim should change to the version control root when opening a file";
|
||||||
};
|
};
|
||||||
|
|
||||||
changeDirCmd = mkOption {
|
changeDirCmd = mkOption {
|
||||||
default = "lcd";
|
|
||||||
description = "Command to change the current window with. Can be cd, lcd or tcd";
|
|
||||||
type = enum ["cd" "lcd" "tcd"];
|
type = enum ["cd" "lcd" "tcd"];
|
||||||
|
default = "lcd";
|
||||||
|
description = "Command to change the current window with.";
|
||||||
};
|
};
|
||||||
|
|
||||||
customHeader = mkOption {
|
customHeader = mkOption {
|
||||||
|
type = listOf str;
|
||||||
default = [];
|
default = [];
|
||||||
description = "Text to place in the header";
|
description = "Text to place in the header";
|
||||||
type = listOf str;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
customFooter = mkOption {
|
customFooter = mkOption {
|
||||||
|
type = listOf str;
|
||||||
default = [];
|
default = [];
|
||||||
description = "Text to place in the footer";
|
description = "Text to place in the footer";
|
||||||
type = listOf str;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
lists = mkOption {
|
lists = mkOption {
|
||||||
|
type = listOf attrs;
|
||||||
default = [
|
default = [
|
||||||
{
|
{
|
||||||
type = "files";
|
type = "files";
|
||||||
|
|
@ -66,121 +67,136 @@ in {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
description = "Specify the lists and in what order they are displayed on startify.";
|
description = "Specify the lists and in what order they are displayed on startify.";
|
||||||
type = listOf attrs;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
skipList = mkOption {
|
skipList = mkOption {
|
||||||
|
type = listOf str;
|
||||||
default = [];
|
default = [];
|
||||||
description = "List of regex patterns to exclude from MRU lists";
|
description = "List of regex patterns to exclude from MRU lists";
|
||||||
type = listOf str;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
updateOldFiles = mkOption {
|
updateOldFiles = mkOption {
|
||||||
|
type = bool;
|
||||||
|
|
||||||
default = false;
|
default = false;
|
||||||
description = "Set if you want startify to always update and not just when neovim closes";
|
description = "Set if you want startify to always update and not just when neovim closes";
|
||||||
type = bool;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sessionAutoload = mkOption {
|
sessionAutoload = mkOption {
|
||||||
default = false;
|
|
||||||
description = "Make startify auto load Session.vim files from the current directory";
|
|
||||||
type = bool;
|
type = bool;
|
||||||
|
|
||||||
|
default = false;
|
||||||
|
description = "Make vim-startify auto load Session.vim files from the current directory";
|
||||||
};
|
};
|
||||||
|
|
||||||
commands = mkOption {
|
commands = mkOption {
|
||||||
|
type = listOf (oneOf [str attrs (listOf str)]);
|
||||||
default = [];
|
default = [];
|
||||||
description = "Commands that are presented to the user on startify page";
|
description = "Commands that are presented to the user on startify page";
|
||||||
type = listOf (oneOf [str attrs (listOf str)]);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
filesNumber = mkOption {
|
filesNumber = mkOption {
|
||||||
|
type = int;
|
||||||
default = 10;
|
default = 10;
|
||||||
description = "How many files to list";
|
description = "How many files to list";
|
||||||
type = int;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
customIndices = mkOption {
|
customIndices = mkOption {
|
||||||
|
type = listOf str;
|
||||||
default = [];
|
default = [];
|
||||||
description = "Specify a list of default characters to use instead of numbers";
|
description = "Specify a list of default characters to use instead of numbers";
|
||||||
type = listOf str;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
disableOnStartup = mkOption {
|
disableOnStartup = mkOption {
|
||||||
default = false;
|
|
||||||
description = "Prevent startify from opening on startup but can be called with :Startify";
|
|
||||||
type = bool;
|
type = bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Whether vim-startify should be disabled on startup.
|
||||||
|
|
||||||
|
This will prevent startify from opening on startup, but it can still
|
||||||
|
be called with `:Startify`
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
unsafe = mkOption {
|
unsafe = mkOption {
|
||||||
default = false;
|
|
||||||
description = "Turns on unsafe mode for Startify. Stops resolving links, checking files are readable and filtering bookmark list";
|
|
||||||
type = bool;
|
type = bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Whether to turn on unsafe mode for Startify.
|
||||||
|
|
||||||
|
While enabld, vim-startify will stops resolving links, checking files
|
||||||
|
are readable and filtering bookmark list
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
paddingLeft = mkOption {
|
paddingLeft = mkOption {
|
||||||
|
type = int;
|
||||||
default = 3;
|
default = 3;
|
||||||
description = "Number of spaces used for left padding.";
|
description = "Number of spaces used for left padding.";
|
||||||
type = int;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
useEnv = mkOption {
|
useEnv = mkOption {
|
||||||
|
type = bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "Show environment variables in path if name is shorter than value";
|
description = "Show environment variables in path if name is shorter than value";
|
||||||
type = bool;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sessionBeforeSave = mkOption {
|
sessionBeforeSave = mkOption {
|
||||||
|
type = listOf str;
|
||||||
default = [];
|
default = [];
|
||||||
description = "Commands to run before saving a session";
|
description = "Commands to run before saving a session";
|
||||||
type = listOf str;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sessionPersistence = mkOption {
|
sessionPersistence = mkOption {
|
||||||
|
type = bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "Persist session before leaving vim or switching session";
|
description = "Persist session before leaving vim or switching session";
|
||||||
type = bool;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sessionDeleteBuffers = mkOption {
|
sessionDeleteBuffers = mkOption {
|
||||||
|
type = bool;
|
||||||
default = true;
|
default = true;
|
||||||
description = "Delete all buffers when loading or closing a session";
|
description = "Delete all buffers when loading or closing a session";
|
||||||
type = bool;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sessionDir = mkOption {
|
sessionDir = mkOption {
|
||||||
|
type = str;
|
||||||
default = "~/.vim/session";
|
default = "~/.vim/session";
|
||||||
description = "Directory to save and load sessions from";
|
description = "Directory to save and load sessions from";
|
||||||
type = str;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
skipListServer = mkOption {
|
skipListServer = mkOption {
|
||||||
|
type = listOf str;
|
||||||
default = [];
|
default = [];
|
||||||
description = "List of vim servers to not load startify for";
|
description = "List of vim servers to not load startify for";
|
||||||
type = listOf str;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sessionRemoveLines = mkOption {
|
sessionRemoveLines = mkOption {
|
||||||
|
type = listOf str;
|
||||||
default = [];
|
default = [];
|
||||||
description = "Patterns to remove from session files";
|
description = "Patterns to remove from session files";
|
||||||
type = listOf str;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sessionSavevars = mkOption {
|
sessionSavevars = mkOption {
|
||||||
|
type = listOf str;
|
||||||
default = [];
|
default = [];
|
||||||
description = "List of variables to save into a session file.";
|
description = "List of variables to save into a session file.";
|
||||||
type = listOf str;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sessionSavecmds = mkOption {
|
sessionSavecmds = mkOption {
|
||||||
|
type = listOf str;
|
||||||
default = [];
|
default = [];
|
||||||
description = "List of commands to run when loading a session.";
|
description = "List of commands to run when loading a session.";
|
||||||
type = listOf str;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sessionSort = mkOption {
|
sessionSort = mkOption {
|
||||||
default = false;
|
|
||||||
description = "Set if you want items sorted by date rather than alphabetically";
|
|
||||||
type = bool;
|
type = bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = ''
|
||||||
|
While true, sessions will be sorted by date rather than alphabetically.
|
||||||
|
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@ in {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
nvf_lint = ${toLuaObject cfg.lint_function}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
@ -38,8 +40,8 @@ in {
|
||||||
{
|
{
|
||||||
event = ["BufWritePost"];
|
event = ["BufWritePost"];
|
||||||
callback = mkLuaInline ''
|
callback = mkLuaInline ''
|
||||||
function()
|
function(args)
|
||||||
require("lint").try_lint()
|
nvf_lint(args.buf)
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
{lib, ...}: let
|
{lib, ...}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
inherit (lib.types) nullOr attrsOf listOf str either submodule bool enum;
|
inherit (lib.types) nullOr attrsOf listOf str either submodule bool enum;
|
||||||
inherit (lib.nvim.types) luaInline;
|
inherit (lib.nvim.types) luaInline;
|
||||||
|
inherit (lib.generators) mkLuaInline;
|
||||||
|
|
||||||
linterType = submodule {
|
linterType = submodule {
|
||||||
options = {
|
options = {
|
||||||
|
|
@ -69,6 +70,23 @@
|
||||||
default = null;
|
default = null;
|
||||||
description = "Parser function";
|
description = "Parser function";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
required_files = mkOption {
|
||||||
|
type = nullOr (listOf str);
|
||||||
|
default = null;
|
||||||
|
example = ["eslint.config.js"];
|
||||||
|
description = ''
|
||||||
|
Required files to lint. These files must exist relative to the cwd
|
||||||
|
of the linter or else this linter will be skipped
|
||||||
|
|
||||||
|
::: {.note}
|
||||||
|
This option is an nvf extension that only takes effect if you
|
||||||
|
use the `nvf_lint()` lua function.
|
||||||
|
|
||||||
|
See {option}`vim.diagnostics.nvim-lint.lint_function`.
|
||||||
|
:::
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|
@ -117,5 +135,53 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lint_after_save = mkEnableOption "autocmd to lint after each save" // {default = true;};
|
lint_after_save = mkEnableOption "autocmd to lint after each save" // {default = true;};
|
||||||
|
|
||||||
|
lint_function = mkOption {
|
||||||
|
type = luaInline;
|
||||||
|
default = mkLuaInline ''
|
||||||
|
function(buf)
|
||||||
|
local ft = vim.api.nvim_get_option_value("filetype", { buf = buf })
|
||||||
|
local linters = require("lint").linters
|
||||||
|
local linters_from_ft = require("lint").linters_by_ft[ft]
|
||||||
|
|
||||||
|
-- if no linter is configured for this filetype, stops linting
|
||||||
|
if linters_from_ft == nil then return end
|
||||||
|
|
||||||
|
for _, name in ipairs(linters_from_ft) do
|
||||||
|
local linter = linters[name]
|
||||||
|
assert(linter, 'Linter with name `' .. name .. '` not available')
|
||||||
|
|
||||||
|
if type(linter) == "function" then
|
||||||
|
linter = linter()
|
||||||
|
end
|
||||||
|
-- for require("lint").lint() to work, linter.name must be set
|
||||||
|
linter.name = linter.name or name
|
||||||
|
local cwd = linter.required_files
|
||||||
|
|
||||||
|
-- if no configuration files are configured, lint
|
||||||
|
if cwd == nil then
|
||||||
|
require("lint").lint(linter)
|
||||||
|
else
|
||||||
|
-- if configuration files are configured and present in the project, lint
|
||||||
|
for _, fn in ipairs(cwd) do
|
||||||
|
local path = vim.fs.joinpath(linter.cwd or vim.fn.getcwd(), fn);
|
||||||
|
if vim.uv.fs_stat(path) then
|
||||||
|
require("lint").lint(linter)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
example = literalExpression ''
|
||||||
|
mkLuaInline '''
|
||||||
|
function(buf)
|
||||||
|
require("lint").try_lint()
|
||||||
|
end
|
||||||
|
'''
|
||||||
|
'';
|
||||||
|
description = "Define the global function nvf_lint which is used by nvf to lint.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -683,15 +683,48 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
git_placement = mkOption {
|
git_placement = mkOption {
|
||||||
type = enum ["before" "after" "signcolumn"];
|
type = enum ["before" "after" "signcolumn" "right_align"];
|
||||||
description = "Place where the git icons will be rendered. `signcolumn` requires `view.signcolumn` to be enabled.";
|
|
||||||
default = "before";
|
default = "before";
|
||||||
|
description = ''
|
||||||
|
Place where the git icons will be rendered.
|
||||||
|
`signcolumn` requires `view.signcolumn` to be enabled.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
modified_placement = mkOption {
|
modified_placement = mkOption {
|
||||||
type = enum ["before" "after" "signcolumn"];
|
type = enum ["before" "after" "signcolumn" "right_align"];
|
||||||
description = "Place where the modified icons will be rendered. `signcolumn` requires `view.signcolumn` to be enabled.";
|
|
||||||
default = "after";
|
default = "after";
|
||||||
|
description = ''
|
||||||
|
Place where the modified icons will be rendered.
|
||||||
|
`signcolumn` requires `view.signcolumn` to be enabled.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
hidden_placement = mkOption {
|
||||||
|
type = enum ["before" "after" "signcolumn" "right_align"];
|
||||||
|
default = "after";
|
||||||
|
description = ''
|
||||||
|
Place where the hidden icons will be rendered.
|
||||||
|
`signcolumn` requires `view.signcolumn` to be enabled.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
diagnostics_placement = mkOption {
|
||||||
|
type = enum ["before" "after" "signcolumn" "right_align"];
|
||||||
|
default = "after";
|
||||||
|
description = ''
|
||||||
|
Place where the diagnostics icons will be rendered.
|
||||||
|
`signcolumn` requires `view.signcolumn` to be enabled.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
bookmarks_placement = mkOption {
|
||||||
|
type = enum ["before" "after" "signcolumn" "right_align"];
|
||||||
|
default = "after";
|
||||||
|
description = ''
|
||||||
|
Place where the bookmark icons will be rendered.
|
||||||
|
`signcolumn` requires `view.signcolumn` to be enabled.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
padding = mkOption {
|
padding = mkOption {
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,9 @@
|
||||||
{
|
{lib, ...}: let
|
||||||
pkgs,
|
inherit (lib.generators) mkLuaInline;
|
||||||
lib,
|
inherit (lib.options) mkOption mkEnableOption literalMD;
|
||||||
...
|
inherit (lib.types) attrs either nullOr;
|
||||||
}: let
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.nvim.types) luaInline mkPluginSetupOption;
|
||||||
inherit (lib.types) attrs enum nullOr;
|
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
|
||||||
inherit (lib.nvim.lua) mkLuaInline;
|
|
||||||
in {
|
in {
|
||||||
options.vim.formatter.conform-nvim = {
|
options.vim.formatter.conform-nvim = {
|
||||||
enable = mkEnableOption "lightweight yet powerful formatter plugin for Neovim [conform-nvim]";
|
enable = mkEnableOption "lightweight yet powerful formatter plugin for Neovim [conform-nvim]";
|
||||||
|
|
@ -31,26 +28,46 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
format_on_save = mkOption {
|
format_on_save = mkOption {
|
||||||
type = nullOr attrs;
|
type = nullOr (either attrs luaInline);
|
||||||
default = {
|
default = mkLuaInline ''
|
||||||
lsp_format = "fallback";
|
function()
|
||||||
timeout_ms = 500;
|
if not vim.g.formatsave or vim.b.disableFormatSave then
|
||||||
};
|
return
|
||||||
|
else
|
||||||
|
return {lsp_format = "fallback", timeout_ms = 500}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
defaultText = literalMD ''
|
||||||
|
enabled by default, and respects {option}`vim.lsp.formatOnSave` and
|
||||||
|
{option}`vim.lsp.mappings.toggleFormatSave`
|
||||||
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
Table that will be passed to `conform.format()`. If this
|
Attribute set or Lua function that will be passed to
|
||||||
is set, Conform will run the formatter on save.
|
`conform.format()`. If this is set, Conform will run the formatter
|
||||||
|
on save.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
format_after_save = mkOption {
|
format_after_save = let
|
||||||
type = nullOr attrs;
|
defaultFormatAfterSaveOpts = {lsp_format = "fallback";};
|
||||||
default = {lsp_format = "fallback";};
|
in
|
||||||
description = ''
|
mkOption {
|
||||||
Table that will be passed to `conform.format()`. If this
|
type = nullOr (either attrs luaInline);
|
||||||
is set, Conform will run the formatter asynchronously after
|
default = mkLuaInline ''
|
||||||
save.
|
function()
|
||||||
'';
|
if not vim.g.formatsave or vim.b.disableFormatSave then
|
||||||
};
|
return
|
||||||
|
else
|
||||||
|
return ${toLuaObject defaultFormatAfterSaveOpts}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Table or function(luainline) that will be passed to `conform.format()`. If this
|
||||||
|
is set, Conform will run the formatter asynchronously after save.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,11 @@
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./gitsigns
|
./gitsigns
|
||||||
|
./hunk-nvim
|
||||||
./vim-fugitive
|
./vim-fugitive
|
||||||
./git-conflict
|
./git-conflict
|
||||||
./gitlinker-nvim
|
./gitlinker-nvim
|
||||||
|
./neogit
|
||||||
];
|
];
|
||||||
|
|
||||||
options.vim.git = {
|
options.vim.git = {
|
||||||
|
|
@ -13,7 +15,9 @@ in {
|
||||||
git integration suite.
|
git integration suite.
|
||||||
|
|
||||||
Enabling this option will enable the following plugins:
|
Enabling this option will enable the following plugins:
|
||||||
|
|
||||||
* gitsigns
|
* gitsigns
|
||||||
|
* hunk-nvim
|
||||||
* vim-fugitive
|
* vim-fugitive
|
||||||
* git-conflict
|
* git-conflict
|
||||||
* gitlinker-nvim
|
* gitlinker-nvim
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue