mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-18 08:08:40 +00:00
Compare commits
No commits in common. "b6486a2abab5ccf2ff2141caa34df48552a8c317" and "6bdc52cd772e8708db8e32d3533ce4674943ccef" have entirely different histories.
b6486a2aba
...
6bdc52cd77
176 changed files with 1831 additions and 4154 deletions
6
.github/CODEOWNERS
vendored
6
.github/CODEOWNERS
vendored
|
|
@ -1,5 +1 @@
|
||||||
# Codeowners should be used to distinguish the maintainers of the project
|
* @NotAShelf
|
||||||
# and not contributors of specific modules to nvf. While adding a new module
|
|
||||||
# please consider adding yourself to 'meta.maintainers' in the module instead
|
|
||||||
# of CODEOWNERS here.
|
|
||||||
* @NotAShelf @horriblename @Soliprem
|
|
||||||
|
|
|
||||||
25
.github/README.md
vendored
25
.github/README.md
vendored
|
|
@ -200,9 +200,8 @@ fix.
|
||||||
**Q**: What platforms are supported?
|
**Q**: What platforms are supported?
|
||||||
|
|
||||||
**A**: nvf actively supports **Linux and Darwin** platforms using standalone
|
**A**: nvf actively supports **Linux and Darwin** platforms using standalone
|
||||||
Nix, NixOS or Home-Manager. It has been reported that **Android** is also
|
Nix, NixOS or Home-Manager. Please take a look at the [nvf manual] for available
|
||||||
supported through the Home-Manager module, or using standalone package. Please
|
installation instructions.
|
||||||
take a look at the [nvf manual] for available installation instructions.
|
|
||||||
|
|
||||||
**Q**: Can you add _X_?
|
**Q**: Can you add _X_?
|
||||||
|
|
||||||
|
|
@ -247,15 +246,14 @@ Neovim's behaviour with Nix.
|
||||||
|
|
||||||
### Co-Maintainers
|
### Co-Maintainers
|
||||||
|
|
||||||
Alongside [myself](https://github.com/notashelf), nvf is developed by those
|
Alongside myself, nvf is developed by those talented folk:
|
||||||
talented folk. nvf would not be what it is today without their invaluable
|
|
||||||
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
|
- [**@Diniamo**](https://github.com/Diniamo)
|
||||||
missing features and excellent work on new language modules.
|
([Liberapay](https://en.liberapay.com/diniamo/)) - For actively submitting
|
||||||
|
pull requests, issues and assistance with maintenance of nvf.
|
||||||
|
|
||||||
Please do remember to extend your thanks (financially or otherwise) if this
|
Please do remember to extend your thanks (financially or otherwise) if this
|
||||||
project has been helpful to you.
|
project has been helpful to you.
|
||||||
|
|
@ -272,14 +270,14 @@ heart-felt thanks to
|
||||||
- [**@FlafyDev**](https://github.com/FlafyDev) - For getting Home-Manager module
|
- [**@FlafyDev**](https://github.com/FlafyDev) - For getting Home-Manager module
|
||||||
to work and Nix assistance.
|
to work and Nix assistance.
|
||||||
- [**@n3oney**](https://github.com/n3oney) - For making custom keybinds finally
|
- [**@n3oney**](https://github.com/n3oney) - For making custom keybinds finally
|
||||||
possible, great ideas and module additions.
|
possible, and other module additions.
|
||||||
- [**@Yavko**](https://github.com/Yavko) - For the amazing **nvf** logo
|
- [**@Yavko**](https://github.com/Yavko) - For the amazing **nvf** logo
|
||||||
- [**@FrothyMarrow**](https://github.com/FrothyMarrow) - For seeing mistakes
|
- [**@FrothyMarrow**](https://github.com/FrothyMarrow) - For seeing mistakes
|
||||||
that I could not and contributing good ideas & code.
|
that I could not.
|
||||||
- [**@Gerg-l**](https://github.com/gerg-l) 🐸 - For the modern Neovim wrapper,
|
- [**@Gerg-l**](https://github.com/gerg-l) 🐸 - For the modern Neovim wrapper,
|
||||||
[mnw], and occasional improvements to the codebase.
|
[mnw], and occasional code improvements.
|
||||||
- [**@Diniamo**](https://github.com/Diniamo) - For actively submitting pull
|
- [**@Soliprem**](https://github.com/soliprem) - Rigorously implementing missing
|
||||||
requests, issues and assistance with co-maintenance of nvf.
|
features and excellent work on new language modules.
|
||||||
|
|
||||||
and everyone who has submitted issues or pull requests!
|
and everyone who has submitted issues or pull requests!
|
||||||
|
|
||||||
|
|
@ -303,6 +301,7 @@ including:
|
||||||
|
|
||||||
I am grateful for their previous work and inspiration, and I wholeheartedly
|
I am grateful for their previous work and inspiration, and I wholeheartedly
|
||||||
recommend checking their work out.
|
recommend checking their work out.
|
||||||
|
<br/>
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
|
||||||
55
.github/labels.yml
vendored
55
.github/labels.yml
vendored
|
|
@ -1,55 +0,0 @@
|
||||||
# This file is used by .github/workflows/labels.yml
|
|
||||||
"topic: plugins":
|
|
||||||
- any:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file:
|
|
||||||
- modules/plugins/**/*
|
|
||||||
|
|
||||||
"topic: modules":
|
|
||||||
- any:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file:
|
|
||||||
- modules/**/*
|
|
||||||
|
|
||||||
"topic: dependencies":
|
|
||||||
- any:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file:
|
|
||||||
- npins
|
|
||||||
- flake.lock
|
|
||||||
|
|
||||||
"topic: CI":
|
|
||||||
- any:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file:
|
|
||||||
- .github/workflows/*.yml
|
|
||||||
- .github/typos.toml
|
|
||||||
- .github/dependabot.yml
|
|
||||||
|
|
||||||
"topic: meta":
|
|
||||||
- any:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file:
|
|
||||||
- .github/CODEOWNERS
|
|
||||||
- LICENSE
|
|
||||||
- .github/README.md
|
|
||||||
- .github/funding.yml
|
|
||||||
- .github/assets
|
|
||||||
- .github/*_TEMPLATE
|
|
||||||
- .gitignore
|
|
||||||
- .editorconfig
|
|
||||||
- release.json
|
|
||||||
|
|
||||||
"topic: documentation":
|
|
||||||
- any:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file:
|
|
||||||
- docs/**/*
|
|
||||||
- .github/CONTRIBUTING.md
|
|
||||||
- .github/README.md
|
|
||||||
"topic: packaging":
|
|
||||||
- any:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file:
|
|
||||||
- flake.nix
|
|
||||||
- flake/packages.nix
|
|
||||||
33
.github/workflows/backport.yml
vendored
33
.github/workflows/backport.yml
vendored
|
|
@ -1,33 +0,0 @@
|
||||||
name: Backport PR on Label
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types:
|
|
||||||
- labeled
|
|
||||||
|
|
||||||
# Permissions needed for the korthout/backport-action to create branches and PRs
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
backport:
|
|
||||||
name: Create Backport PR
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: |
|
|
||||||
github.event.pull_request.merged == true && startsWith(github.event.label.name, 'backport-')
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
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+)?)$'
|
|
||||||
2
.github/workflows/cachix.yml
vendored
2
.github/workflows/cachix.yml
vendored
|
|
@ -36,7 +36,7 @@ jobs:
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
|
||||||
- uses: cachix/cachix-action@v16
|
- uses: cachix/cachix-action@v15
|
||||||
with:
|
with:
|
||||||
authToken: ${{ secrets.CACHIX_TOKEN }}
|
authToken: ${{ secrets.CACHIX_TOKEN }}
|
||||||
extraPullNames: nix-community
|
extraPullNames: nix-community
|
||||||
|
|
|
||||||
56
.github/workflows/check-docs.yml
vendored
Normal file
56
.github/workflows/check-docs.yml
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
name: "Validate flake & check documentation"
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- docs/**
|
||||||
|
jobs:
|
||||||
|
flake-docs-check:
|
||||||
|
name: Validate Flake Documentation
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
package:
|
||||||
|
- docs
|
||||||
|
- docs-html
|
||||||
|
- docs-manpages
|
||||||
|
- docs-json
|
||||||
|
steps:
|
||||||
|
- name: Install Nix
|
||||||
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set default git branch (to reduce log spam)
|
||||||
|
run: git config --global init.defaultBranch main
|
||||||
|
|
||||||
|
- name: Build documentation packages
|
||||||
|
run: nix build .#${{ matrix.package }} --print-build-logs
|
||||||
|
|
||||||
|
- name: Get current date
|
||||||
|
id: get-date
|
||||||
|
# output format: 2023-12-22-120000
|
||||||
|
run: echo "date=$(date +'%Y-%m-%d-%H%M%S')" >> ${GITHUB_OUTPUT}
|
||||||
|
|
||||||
|
- name: Upload doc artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: "${{ matrix.package }}"
|
||||||
|
path: result/share/doc/nvf
|
||||||
|
|
||||||
|
flake-docs-linkcheck:
|
||||||
|
name: Validate hyperlinks in documentation sources
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install Nix
|
||||||
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build documentation packages
|
||||||
|
run: nix build .#docs-linkcheck -Lv
|
||||||
129
.github/workflows/check.yml
vendored
129
.github/workflows/check.yml
vendored
|
|
@ -1,6 +1,4 @@
|
||||||
name: "Treewide Checks"
|
name: "Validate flake & check formatting"
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
@ -8,13 +6,13 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
|
- .github/**
|
||||||
- assets/**
|
- assets/**
|
||||||
|
- .gitignore
|
||||||
jobs:
|
jobs:
|
||||||
nix-flake-check:
|
nix-flake-check:
|
||||||
name: "Validate flake"
|
name: Validate Flake
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
@ -26,9 +24,8 @@ jobs:
|
||||||
run: nix flake check
|
run: nix flake check
|
||||||
|
|
||||||
format-with-alejandra:
|
format-with-alejandra:
|
||||||
name: "Check formatting"
|
name: Formatting via Alejandra
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
@ -36,118 +33,4 @@ jobs:
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
|
||||||
- name: Check formatting via Alejandra
|
- run: nix run nixpkgs#alejandra -- -c .
|
||||||
run: nix run nixpkgs#alejandra -- --check . --exclude npins
|
|
||||||
|
|
||||||
check-typos:
|
|
||||||
name: "Check source tree for typos"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Check for typos
|
|
||||||
uses: crate-ci/typos@master
|
|
||||||
with:
|
|
||||||
config: .github/typos.toml
|
|
||||||
|
|
||||||
- if: ${{ failure() }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "::error:: Current codebase contains typos that were caught by the CI!"
|
|
||||||
echo "If those typos were intentional, please add them to the ignored regexes in .github/typos.toml"
|
|
||||||
echo "[skip ci] label may be added to the PR title if this is a one-time issue and is safe to ignore"
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
flake-docs-check:
|
|
||||||
name: "Validate documentation builds"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
package:
|
|
||||||
- docs
|
|
||||||
- docs-html
|
|
||||||
- docs-manpages
|
|
||||||
- docs-json
|
|
||||||
steps:
|
|
||||||
- name: Install Nix
|
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set default git branch (to reduce log spam)
|
|
||||||
run: git config --global init.defaultBranch main
|
|
||||||
|
|
||||||
- name: Build documentation packages
|
|
||||||
run: nix build .#${{ matrix.package }} --print-build-logs
|
|
||||||
|
|
||||||
- name: Get current date
|
|
||||||
id: get-date
|
|
||||||
# output format: 2023-12-22-120000
|
|
||||||
run: echo "date=$(date +'%Y-%m-%d-%H%M%S')" >> ${GITHUB_OUTPUT}
|
|
||||||
|
|
||||||
- name: Upload doc artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: "${{ matrix.package }}"
|
|
||||||
path: result/share/doc/nvf
|
|
||||||
|
|
||||||
flake-docs-linkcheck:
|
|
||||||
name: "Validate hyperlinks in documentation sources"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
|
||||||
steps:
|
|
||||||
- name: Install Nix
|
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Build linkcheck package
|
|
||||||
run: nix build .#docs-linkcheck -Lv
|
|
||||||
|
|
||||||
check-editorconfig:
|
|
||||||
name: "Validate Editorconfig conformance"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 2 # slows down checkout, but we need to compare against the previous commit on push events
|
|
||||||
|
|
||||||
- name: Get list of changed files from PR
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
|
||||||
gh api repos/${{ github.repository }}/pulls/${{ github.event.number }}/files --paginate \
|
|
||||||
| jq -r '.[] | select(.status != "removed") | .filename' \
|
|
||||||
> "$HOME/changed_files"
|
|
||||||
else
|
|
||||||
git diff --name-only HEAD^ > "$HOME/changed_files"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Print list of changed files
|
|
||||||
run: |
|
|
||||||
cat "$HOME/changed_files"
|
|
||||||
|
|
||||||
- name: Install Nix
|
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
|
||||||
|
|
||||||
- name: Checking Editorconfig conformance
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
< "$HOME/changed_files" nix-shell -p editorconfig-checker --run 'xargs -r editorconfig-checker -disable-indent-size'
|
|
||||||
|
|
||||||
- if: ${{ failure() }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "::error:: Current formatting does not fit convention provided by .editorconfig located in the project root."
|
|
||||||
echo "Please make sure your editor properly integrates editorconfig, Neovim does so by default."
|
|
||||||
echo "See https://editorconfig.org/#download on how to integrate Editorconfig to your editor."
|
|
||||||
exit 1
|
|
||||||
|
|
|
||||||
8
.github/workflows/cleanup.yml
vendored
8
.github/workflows/cleanup.yml
vendored
|
|
@ -1,13 +1,9 @@
|
||||||
name: Delete Stale Branches
|
name: Cleanup
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 4 1 * *" # 4AM on 1st of every month
|
- cron: "0 4 1 * *" # 4AM on 1st of every month
|
||||||
- cron: "0 4 15 * *" # 4AM on the 15th of every month
|
- cron: "0 4 15 * *" # 4AM on the 15th of every month
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
branches:
|
branches:
|
||||||
name: Cleanup old branches
|
name: Cleanup old branches
|
||||||
|
|
@ -17,7 +13,7 @@ jobs:
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- 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.10
|
||||||
with:
|
with:
|
||||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
date: "1 months ago"
|
date: "1 months ago"
|
||||||
|
|
|
||||||
4
.github/workflows/docs-preview.yml
vendored
4
.github/workflows/docs-preview.yml
vendored
|
|
@ -9,7 +9,7 @@ on:
|
||||||
- "modules/**"
|
- "modules/**"
|
||||||
- "docs/**"
|
- "docs/**"
|
||||||
|
|
||||||
# Defining permissions here passes it to all jobs.
|
# Defining permissions here passes it to all workflows.
|
||||||
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
|
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
@ -34,7 +34,7 @@ jobs:
|
||||||
run: git config --global init.defaultBranch main
|
run: git config --global init.defaultBranch main
|
||||||
|
|
||||||
- name: Build documentation packages
|
- name: Build documentation packages
|
||||||
run: nix build .#docs-html --print-build-logs || exit 1
|
run: nix build .#docs-html --print-build-logs
|
||||||
|
|
||||||
- name: Deploy to GitHub Pages preview
|
- name: Deploy to GitHub Pages preview
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
46
.github/workflows/editorconfig.yml
vendored
Normal file
46
.github/workflows/editorconfig.yml
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
name: "Check validity of .editorconfig"
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-editorconfig:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
||||||
|
steps:
|
||||||
|
- name: Get list of changed files from PR
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
gh api \
|
||||||
|
repos/notashelf/nvf/pulls/${{github.event.number}}/files --paginate \
|
||||||
|
| jq '.[] | select(.status != "removed") | .filename' \
|
||||||
|
> "$HOME/changed_files"
|
||||||
|
|
||||||
|
- name: Print list of changed files
|
||||||
|
run: |
|
||||||
|
cat "$HOME/changed_files"
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
||||||
|
|
||||||
|
- name: Install Nix
|
||||||
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
|
||||||
|
- name: Checking EditorConfig
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cat "$HOME/changed_files" | nix-shell -p editorconfig-checker.out --run 'xargs -r editorconfig-checker -disable-indentation -exclude flake.lock --verbose'
|
||||||
|
echo -n "Check status: $?"
|
||||||
|
|
||||||
|
- name: Fail Gracefully
|
||||||
|
if: ${{ failure() }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "::error:: Current formatting does not fit convention provided by .editorconfig located in the project root."
|
||||||
|
echo "Please make sure your editor properly integrates editorconfig. See https://editorconfig.org/#download for more."
|
||||||
|
exit 1
|
||||||
21
.github/workflows/labeler.yml
vendored
21
.github/workflows/labeler.yml
vendored
|
|
@ -1,21 +0,0 @@
|
||||||
name: "Label PR"
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types: [edited, opened, synchronize, reopened]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
labels:
|
|
||||||
name: "Label PR"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
|
||||||
steps:
|
|
||||||
- uses: actions/labeler@v5
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
configuration-path: .github/labels.yml
|
|
||||||
sync-labels: true
|
|
||||||
30
.github/workflows/typos.yml
vendored
Normal file
30
.github/workflows/typos.yml
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
name: "Check for typos in the source tree"
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-typos:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Check for typos
|
||||||
|
uses: crate-ci/typos@master
|
||||||
|
with:
|
||||||
|
config: .github/typos.toml
|
||||||
|
|
||||||
|
- name: Fail Gracefully
|
||||||
|
if: ${{ failure() }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "::error:: Current codebase contains typos that were caught by the CI!"
|
||||||
|
echo "If those typos were intentional, please add them to the ignored regexes in .github/typos.toml"
|
||||||
|
echo "[skip ci] label may be used if this is a one-time issue"
|
||||||
|
exit 1
|
||||||
|
|
@ -18,17 +18,14 @@ 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 = !isMaximal; # conflicts with blink in maximal
|
lspSignature.enable = true;
|
||||||
otter-nvim.enable = isMaximal;
|
otter-nvim.enable = isMaximal;
|
||||||
|
lsplines.enable = isMaximal;
|
||||||
nvim-docs-view.enable = isMaximal;
|
nvim-docs-view.enable = isMaximal;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -42,7 +39,8 @@ 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 = {
|
||||||
enableFormat = true; #
|
enableLSP = true;
|
||||||
|
enableFormat = true;
|
||||||
enableTreesitter = true;
|
enableTreesitter = true;
|
||||||
enableExtraDiagnostics = true;
|
enableExtraDiagnostics = true;
|
||||||
|
|
||||||
|
|
@ -84,7 +82,6 @@ isMaximal: {
|
||||||
elixir.enable = false;
|
elixir.enable = false;
|
||||||
haskell.enable = false;
|
haskell.enable = false;
|
||||||
ruby.enable = false;
|
ruby.enable = false;
|
||||||
fsharp.enable = false;
|
|
||||||
|
|
||||||
tailwind.enable = false;
|
tailwind.enable = false;
|
||||||
svelte.enable = false;
|
svelte.enable = false;
|
||||||
|
|
@ -127,15 +124,7 @@ isMaximal: {
|
||||||
|
|
||||||
autopairs.nvim-autopairs.enable = true;
|
autopairs.nvim-autopairs.enable = true;
|
||||||
|
|
||||||
# nvf provides various autocomplete options. The tried and tested nvim-cmp
|
autocomplete.nvim-cmp.enable = true;
|
||||||
# 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 = {
|
||||||
|
|
@ -153,7 +142,6 @@ isMaximal: {
|
||||||
binds = {
|
binds = {
|
||||||
whichKey.enable = true;
|
whichKey.enable = true;
|
||||||
cheatsheet.enable = true;
|
cheatsheet.enable = true;
|
||||||
hardtime-nvim.enable = isMaximal;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
telescope.enable = true;
|
telescope.enable = true;
|
||||||
|
|
@ -246,7 +234,6 @@ isMaximal: {
|
||||||
enable = false;
|
enable = false;
|
||||||
cmp.enable = isMaximal;
|
cmp.enable = isMaximal;
|
||||||
};
|
};
|
||||||
codecompanion-nvim.enable = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
session = {
|
session = {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
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;
|
||||||
|
|
@ -96,6 +95,8 @@
|
||||||
inherit (nvimModuleDocs) optionsJSON;
|
inherit (nvimModuleDocs) optionsJSON;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
inherit (inputs) nmd;
|
||||||
|
|
||||||
# TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream
|
# TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream
|
||||||
# `nixosOptionsDoc` is more customizable.
|
# `nixosOptionsDoc` is more customizable.
|
||||||
options.json =
|
options.json =
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,5 @@
|
||||||
# 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](/options.html)
|
|
||||||
|
|
||||||
```{=include=} chapters
|
```{=include=} chapters
|
||||||
configuring/custom-package.md
|
configuring/custom-package.md
|
||||||
configuring/custom-plugins.md
|
configuring/custom-plugins.md
|
||||||
|
|
@ -17,5 +7,4 @@ 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
|
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -1,119 +0,0 @@
|
||||||
# Autocommands and Autogroups {#ch-autocmds-augroups}
|
|
||||||
|
|
||||||
This module allows you to declaratively configure Neovim autocommands and
|
|
||||||
autogroups within your Nix configuration.
|
|
||||||
|
|
||||||
## Autogroups (`vim.augroups`) {#sec-vim-augroups}
|
|
||||||
|
|
||||||
Autogroups (`augroup`) organize related autocommands. This allows them to be
|
|
||||||
managed collectively, such as clearing them all at once to prevent duplicates.
|
|
||||||
Each entry in the list is a submodule with the following options:
|
|
||||||
|
|
||||||
| Option | Type | Default | Description | Example |
|
|
||||||
| :------- | :----- | :------ | :--------------------------------------------------------------------------------------------------- | :---------------- |
|
|
||||||
| `enable` | `bool` | `true` | Enables or disables this autogroup definition. | `true` |
|
|
||||||
| `name` | `str` | _None_ | **Required.** The unique name for the autogroup. | `"MyFormatGroup"` |
|
|
||||||
| `clear` | `bool` | `true` | Clears any existing autocommands within this group before adding new ones defined in `vim.autocmds`. | `true` |
|
|
||||||
|
|
||||||
**Example:**
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
vim.augroups = [
|
|
||||||
{
|
|
||||||
name = "MyCustomAuGroup";
|
|
||||||
clear = true; # Clear previous autocommands in this group on reload
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "Formatting";
|
|
||||||
# clear defaults to true
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Autocommands (`vim.autocmds`) {#sec-vim-autocmds}
|
|
||||||
|
|
||||||
Autocommands (`autocmd`) trigger actions based on events happening within Neovim
|
|
||||||
(e.g., saving a file, entering a buffer). Each entry in the list is a submodule
|
|
||||||
with the following options:
|
|
||||||
|
|
||||||
| Option | Type | Default | Description | Example |
|
|
||||||
| :--------- | :-------------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------- |
|
|
||||||
| `enable` | `bool` | `true` | Enables or disables this autocommand definition. | `true` |
|
|
||||||
| `event` | `nullOr (listOf str)` | `null` | **Required.** List of Neovim events that trigger this autocommand (e.g., `BufWritePre`, `FileType`). | `[ "BufWritePre" ]` |
|
|
||||||
| `pattern` | `nullOr (listOf str)` | `null` | List of file patterns (globs) to match against (e.g., `*.py`, `*`). If `null`, matches all files for the given event. | `[ "*.lua", "*.nix" ]` |
|
|
||||||
| `callback` | `nullOr luaInline` | `null` | A Lua function to execute when the event triggers. Use `lib.nvim.types.luaInline` or `lib.options.literalExpression "mkLuaInline '''...'''"`. **Cannot be used with `command`.** | `lib.nvim.types.luaInline "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.nvim.types.luaInline ''
|
|
||||||
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 [](#opt-vim.package) option.
|
your configuration. This is done with the `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.stdenv.system}.neovim;
|
vim.package = inputs.neovim-overlay.packages.${pkgs.system}.neovim;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,22 @@
|
||||||
# Custom Plugins {#ch-custom-plugins}
|
# Custom Plugins {#ch-custom-plugins}
|
||||||
|
|
||||||
**nvf** exposes a very wide variety of plugins by default, which are consumed by
|
**nvf**, by default, exposes a wide variety of plugins as module options for
|
||||||
module options. This is done for your convenience, and to bundle all necessary
|
your convenience and bundles necessary dependencies into **nvf**'s runtime. In
|
||||||
dependencies into **nvf**'s runtime with full control of versioning, testing and
|
case a plugin is not available in **nvf**, you may consider making a pull
|
||||||
dependencies. In the case a plugin you need is _not_ available, you may consider
|
request to **nvf** to include it as a module or you may add it to your
|
||||||
making a pull request to add the package you're looking for, or you may add it
|
configuration locally.
|
||||||
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}
|
||||||
|
|
||||||
Per **nvf**'s design choices, there are several ways of adding custom plugins to
|
There are multiple ways of adding custom plugins to your **nvf** configuration.
|
||||||
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.
|
|
||||||
|
|
||||||
:::{.info}
|
You can use custom plugins, before they are implemented in the flake. To add a
|
||||||
|
plugin to the runtime, you need to add it to the [](#opt-vim.startPlugins) list
|
||||||
|
in your configuration.
|
||||||
|
|
||||||
To add a plugin to your runtime, you will need to add it to
|
Adding a plugin to `startPlugins` will not allow you to configure the plugin
|
||||||
[](#opt-vim.startPlugins) list in your configuration. This is akin to cloning a
|
that you have added, but **nvf** provides multiple way of configuring any custom
|
||||||
plugin to `~/.config/nvim`, but they are only ever placed in the Nix store and
|
plugins that you might have added to your configuration.
|
||||||
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,20 +1,13 @@
|
||||||
# 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., for example, if the plugin requires a setup table. In that case, you
|
be enough. In that case, you can write custom lua config using either
|
||||||
can write custom Lua configuration using one of
|
`config.vim.lazy.plugins.*.setupOpts` `config.vim.extraPlugins.*.setup` or
|
||||||
|
`config.vim.luaConfigRC`.
|
||||||
|
|
||||||
- `config.vim.lazy.plugins.*.setupOpts`
|
The first option uses an extended version of `lz.n`'s PluginSpec. `setupModule`
|
||||||
- `config.vim.extraPlugins.*.setup`
|
and `setupOpt` can be used if the plugin uses a `require('module').setup(...)`
|
||||||
- `config.vim.luaConfigRC`.
|
pattern. Otherwise, the `before` and `after` hooks should do what you need.
|
||||||
|
|
||||||
## 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
|
||||||
{
|
{
|
||||||
|
|
@ -32,61 +25,50 @@ hooks should do what you need.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Standard API {#ch-vim-extra-plugins}
|
The second option uses an attribute set, which maps DAG section names to a
|
||||||
|
|
||||||
`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
|
||||||
{pkgs, ...}: {
|
config.vim.extraPlugins = with pkgs.vimPlugins; {
|
||||||
config.vim.extraPlugins = {
|
aerial = {
|
||||||
aerial = {
|
package = aerial-nvim;
|
||||||
package = pkgs.vimPlugins.aerial-nvim;
|
setup = "require('aerial').setup {}";
|
||||||
setup = "require('aerial').setup {}";
|
};
|
||||||
};
|
|
||||||
|
|
||||||
harpoon = {
|
harpoon = {
|
||||||
package = pkgs.vimPlugins.harpoon;
|
package = harpoon;
|
||||||
setup = "require('harpoon').setup {}";
|
setup = "require('harpoon').setup {}";
|
||||||
after = ["aerial"]; # place harpoon configuration after aerial
|
after = ["aerial"]; # place harpoon configuration after aerial
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Setup using luaConfigRC {#setup-using-luaconfigrc}
|
The third option also uses an attribute set, but this one is resolved as a DAG
|
||||||
|
|
||||||
`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 a section called "aquarium" in the 'init.lua' with the
|
# this will create an "aquarium" section in your init.lua with the contents of your custom config
|
||||||
# contents of your custom configuration. By default 'entryAnywhere' is implied
|
# which will be *appended* to the rest of your configuration, inside your init.vim
|
||||||
# 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
|
||||||
configuration snippets precisely using the [DAG system]. DAGs
|
snippets of configuration via the DAG system. It will allow specifying positions
|
||||||
are a very powerful mechanism that allows specifying positions
|
of individual sections of configuration as needed. nvf provides helper functions
|
||||||
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] in the nvf manual
|
Please refer to the [DAG section](/index.xhtml#ch-dag-entries) 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,8 +1,7 @@
|
||||||
# Lazy Method {#sec-lazy-method}
|
# Lazy Method {#sec-lazy-method}
|
||||||
|
|
||||||
As of version **0.7**, an API is exposed to allow configuring lazy-loaded
|
As of version **0.7**, we exposed an API for configuring lazy-loaded plugins via
|
||||||
plugins via `lz.n` and `lzn-auto-require`. Below is a comprehensive example of
|
`lz.n` and `lzn-auto-require`.
|
||||||
how it may be loaded to lazy-load an arbitrary plugin.
|
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
|
|
@ -39,24 +38,3 @@ how it may be loaded to lazy-load an arbitrary plugin.
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## LazyFile event {#sec-lazyfile-event}
|
|
||||||
|
|
||||||
**nvf** re-implements `LazyFile` as a familiar user event to load a plugin when
|
|
||||||
a file is opened:
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
config.vim.lazy.plugins = {
|
|
||||||
"aerial.nvim" = {
|
|
||||||
package = pkgs.vimPlugins.aerial-nvim;
|
|
||||||
event = [{event = "User"; pattern = "LazyFile";}];
|
|
||||||
# ...
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
You can consider the `LazyFile` event as an alias to the combination of
|
|
||||||
`"BufReadPost"`, `"BufNewFile"` and `"BufWritePre"`, i.e., a list containing all
|
|
||||||
three of those events: `["BufReadPost" "BufNewFile" "BufWritePre"]`
|
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,26 @@
|
||||||
# Legacy Method {#sec-legacy-method}
|
# Legacy Method {#sec-legacy-method}
|
||||||
|
|
||||||
Prior to version **0.5**, the method of adding new plugins was adding the plugin
|
Prior to version v0.5, the method of adding new plugins was adding the plugin
|
||||||
package to [](#opt-vim.startPlugins) and adding its configuration as a DAG under
|
package to `vim.startPlugins` and add its configuration as a DAG under one of
|
||||||
one of `vim.configRC` or [](#opt-vim.luaConfigRC). While `configRC` has been
|
`vim.configRC` or `vim.luaConfigRC`. Users who have not yet updated to 0.5, or
|
||||||
deprecated, users who have not yet updated to 0.5 or those who prefer a more
|
prefer a more hands-on approach may use the old method where the load order of
|
||||||
hands-on approach may choose to use the old method where the load order of the
|
the plugins is determined by DAGs.
|
||||||
plugins is explicitly determined by DAGs without internal abstractions.
|
|
||||||
|
|
||||||
## Adding New Plugins {#sec-adding-new-plugins}
|
## Adding plugins {#sec-adding-plugins}
|
||||||
|
|
||||||
To add a plugin not available in **nvf** as a module to your configuration using
|
To add a plugin not available in nvf as a module to your configuration, you may
|
||||||
the legacy method, you must add it to [](#opt-vim.startPlugins) in order to make
|
add it to [](#opt-vim.startPlugins) in order to make it available to Neovim at
|
||||||
it available to Neovim at runtime.
|
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];
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Once the package is available in Neovim's runtime, you may use the `luaConfigRC`
|
And to configure the added plugin, you can use the `luaConfigRC` option to
|
||||||
option to provide configuration as a DAG using the **nvf** extended library in
|
provide configuration as a DAG using the **nvf** extended library.
|
||||||
order to configure the added plugin,
|
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{inputs, ...}: let
|
{inputs, ...}: let
|
||||||
|
|
@ -34,8 +29,6 @@ order to configure the added plugin,
|
||||||
# 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,15 +1,14 @@
|
||||||
# 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 that
|
As of version **0.5**, we have a more extensive API for configuring plugins,
|
||||||
should be preferred over the legacy method. This API is available as
|
under `vim.extraPlugins`. Instead of using DAGs exposed by the library, you may
|
||||||
[](#opt-vim.extraPlugins). Instead of using DAGs exposed by the library
|
use the extra plugin module as follows:
|
||||||
_directly_, you may use the extra plugin module as follows:
|
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{pkgs, ...}: {
|
{
|
||||||
config.vim.extraPlugins = {
|
config.vim.extraPlugins = with pkgs.vimPlugins; {
|
||||||
aerial = {
|
aerial = {
|
||||||
package = pkgs.vimPlugins.aerial-nvim;
|
package = aerial-nvim;
|
||||||
setup = ''
|
setup = ''
|
||||||
require('aerial').setup {
|
require('aerial').setup {
|
||||||
-- some lua configuration here
|
-- some lua configuration here
|
||||||
|
|
@ -18,12 +17,10 @@ _directly_, you may use the extra plugin module as follows:
|
||||||
};
|
};
|
||||||
|
|
||||||
harpoon = {
|
harpoon = {
|
||||||
package = pkgs.vimPlugins.harpoon;
|
package = 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.
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ formatting to diagnostics. The following languages have sections under the
|
||||||
- Go: [vim.languages.go.enable](#opt-vim.languages.go.enable)
|
- Go: [vim.languages.go.enable](#opt-vim.languages.go.enable)
|
||||||
- Lua: [vim.languages.lua.enable](#opt-vim.languages.lua.enable)
|
- Lua: [vim.languages.lua.enable](#opt-vim.languages.lua.enable)
|
||||||
- PHP: [vim.languages.php.enable](#opt-vim.languages.php.enable)
|
- PHP: [vim.languages.php.enable](#opt-vim.languages.php.enable)
|
||||||
- F#: [vim.languages.fsharp.enable](#opt-vim.languages.fsharp.enable)
|
|
||||||
|
|
||||||
Adding support for more languages, and improving support for existing ones are
|
Adding support for more languages, and improving support for existing ones are
|
||||||
great places where you can contribute with a PR.
|
great places where you can contribute with a PR.
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,17 @@
|
||||||
# LSP Custom Packages/Command {#sec-languages-custom-lsp-packages}
|
# LSP Custom Packages/Command {#sec-languages-custom-lsp-packages}
|
||||||
|
|
||||||
One of the strengths of **nvf** is convenient aliases to quickly configure LSP
|
In any of the `opt.languages.<language>.lsp.package` options you can provide
|
||||||
servers through the Nix module system. By default the LSP packages for relevant
|
your own LSP package, or provide the command to launch the language server, as a
|
||||||
language modules will be pulled into the closure. If this is not desirable, you
|
list of strings. You can use this to skip automatic installation of a language
|
||||||
may provide **a custom LSP package** (e.g., a Bash script that calls a command)
|
server, and instead use the one found in your `$PATH` during runtime, for
|
||||||
or **a list of strings** to be interpreted as the command to launch the language
|
example:
|
||||||
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
|
||||||
# This expects 'jdt-language-server' to be in your PATH or in
|
# or in `vim.extraPackages`
|
||||||
# '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"];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
10
docs/manual/default-configs.md
Normal file
10
docs/manual/default-configs.md
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
# 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
|
||||||
|
```
|
||||||
11
docs/manual/default-configs/maximal.md
Normal file
11
docs/manual/default-configs/maximal.md
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Maximal {#sec-default-maximal}
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ nix shell github:notashelf/nvf#maximal test.nix
|
||||||
|
```
|
||||||
|
|
||||||
|
It is the same fully configured Neovim as with the [Nix](#sec-default-nix)
|
||||||
|
configuration, but with every supported language enabled.
|
||||||
|
|
||||||
|
::: {.note} Running the maximal config will download _a lot_ of packages as it
|
||||||
|
is downloading language servers, formatters, and more. :::
|
||||||
9
docs/manual/default-configs/nix.md
Normal file
9
docs/manual/default-configs/nix.md
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
# Nix {#sec-default-nix}
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ nix run github:notashelf/nvf#nix test.nix
|
||||||
|
```
|
||||||
|
|
||||||
|
Enables all the of Neovim plugins, with language support for specifically Nix.
|
||||||
|
This lets you see what a fully configured neovim setup looks like without
|
||||||
|
downloading a whole bunch of language servers and associated tools.
|
||||||
|
|
@ -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
|
||||||
treesitter.enable = true;
|
tree-sitter.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.
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ try-it-out.md
|
||||||
```
|
```
|
||||||
|
|
||||||
```{=include=} parts
|
```{=include=} parts
|
||||||
|
default-configs.md
|
||||||
installation.md
|
installation.md
|
||||||
configuring.md
|
configuring.md
|
||||||
tips.md
|
tips.md
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ options will include useful comments, warnings or setup tips on how a module
|
||||||
option is meant to be used as well as examples in complex cases.
|
option is meant to be used as well as examples in complex cases.
|
||||||
|
|
||||||
An offline version of this page is bundled with nvf as a part of the manpages
|
An offline version of this page is bundled with nvf as a part of the manpages
|
||||||
which you can access with `man 5 nvf`. Please let us know if you believe any of
|
which you can access with `man 5 nvf`. Please us know if you believe any of the
|
||||||
the options below are missing useful examples.
|
options below are missing useful examples.
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
In the manual, individual options may be referenced in Hyperlinks as follows:
|
In the manual, individual options may be referenced in Hyperlinks as follows:
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,7 @@
|
||||||
# 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
|
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -1,131 +0,0 @@
|
||||||
# Adding Plugins From Different Sources {#sec-plugin-sources}
|
|
||||||
|
|
||||||
**nvf** attempts to avoid depending on Nixpkgs for Neovim plugins. For the most
|
|
||||||
part, this is accomplished by defining each plugin's source and building them
|
|
||||||
from source.
|
|
||||||
|
|
||||||
[npins]: https://github.com/andir/npins
|
|
||||||
|
|
||||||
To define plugin sources, we use [npins] and pin each plugin source using
|
|
||||||
builtin fetchers. You are not bound by this restriction. In your own
|
|
||||||
configuration, any kind of fetcher or plugin source is fine.
|
|
||||||
|
|
||||||
## Nixpkgs & Friends {#ch-plugins-from-nixpkgs}
|
|
||||||
|
|
||||||
`vim.startPlugins` and `vim.optPlugins` options take either a **string**, in
|
|
||||||
which case a plugin from nvf's internal plugins registry will be used, or a
|
|
||||||
**package**. If your plugin does not require any setup, or ordering for it s
|
|
||||||
configuration, then it is possible to add it to `vim.startPlugins` to load it on
|
|
||||||
startup.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{pkgs, ...}: {
|
|
||||||
# Aerial does require some setup. In the case you pass a plugin that *does*
|
|
||||||
# require manual setup, then you must also call the setup function.
|
|
||||||
vim.startPlugins = [pkgs.vimPlugins.aerial-nvim];
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
[`vim.extraPlugins`]: 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"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
@ -26,12 +26,7 @@ $ nix run github:notashelf/nvf#nix
|
||||||
$ nix run github:notashelf/nvf#maximal
|
$ nix run github:notashelf/nvf#maximal
|
||||||
```
|
```
|
||||||
|
|
||||||
### Available Configurations {#sec-available-configs}
|
### Available Configs {#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}
|
||||||
|
|
||||||
|
|
@ -39,32 +34,15 @@ The below configurations are provided for demonstration purposes, and are
|
||||||
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.
|
||||||
|
|
||||||
```bash
|
::: {.tip}
|
||||||
$ nix run github:notashelf/nvf#maximal -- test.nix
|
|
||||||
```
|
|
||||||
|
|
||||||
It uses the same configuration template with the [Nix](#sec-configs-nix)
|
You are _strongly_ recommended to use the binary cache if you would like to try
|
||||||
configuration, but supports many more languages, and enables more utility,
|
the Maximal configuration.
|
||||||
companion or fun plugins.
|
|
||||||
|
|
||||||
::: {.warning}
|
|
||||||
|
|
||||||
Running the maximal config will download _a lot_ of packages as it is
|
|
||||||
downloading language servers, formatters, and more.
|
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,9 @@ 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 `enableLSP` [](#opt-vim.languages.enableTreesitter), etc. will
|
- The options [](#opt-vim.languages.enableLSP),
|
||||||
enable the respective section for all languages that have been enabled.
|
[](#opt-vim.languages.enableTreesitter), etc. will enable the respective
|
||||||
|
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`
|
||||||
|
|
||||||
[poz](https://poz.pet):
|
[jacekpoz](https://jacekpoz.pl):
|
||||||
|
|
||||||
- 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.
|
||||||
|
|
||||||
[poz](https://poz.pet):
|
[jacekpoz](https://jacekpoz.pl):
|
||||||
|
|
||||||
- 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
|
||||||
|
|
||||||
[poz](https://poz.pet):
|
[jacekpoz](https://jacekpoz.pl):
|
||||||
|
|
||||||
[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
|
||||||
|
|
|
||||||
|
|
@ -2,31 +2,17 @@
|
||||||
|
|
||||||
## Breaking changes
|
## Breaking changes
|
||||||
|
|
||||||
[Lspsaga documentation]: https://nvimdev.github.io/lspsaga/
|
|
||||||
|
|
||||||
- `git-conflict` keybinds are now prefixed with `<leader>` to avoid conflicting
|
- `git-conflict` keybinds are now prefixed with `<leader>` to avoid conflicting
|
||||||
with builtins.
|
with builtins.
|
||||||
|
|
||||||
- `alpha` is now configured with nix, default config removed.
|
- `alpha` is now configured with nix, default config removed.
|
||||||
|
|
||||||
- Lspsaga module no longer ships default keybindings. The keybind format has
|
|
||||||
been changed by upstream, and old keybindings do not have equivalents under
|
|
||||||
the new API they provide. Please manually set your keybinds according to
|
|
||||||
[Lspsaga documentation] following the new API.
|
|
||||||
|
|
||||||
- none-ls has been updated to the latest version. If you have been using raw Lua
|
|
||||||
configuration to _manually_ configure it, some of the formats may become
|
|
||||||
unavailable as they have been refactored out of the main none-ls repository
|
|
||||||
upstream.
|
|
||||||
|
|
||||||
[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
|
||||||
[render-markdown.nvim]: https://github.com/MeanderingProgrammer/render-markdown.nvim
|
[render-markdown.nvim]: https://github.com/MeanderingProgrammer/render-markdown.nvim
|
||||||
[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
|
|
||||||
[oil.nvim]: https://github.com/stevearc/oil.nvim
|
|
||||||
|
|
||||||
- Add [typst-preview.nvim] under
|
- Add [typst-preview.nvim] under
|
||||||
`languages.typst.extensions.typst-preview-nvim`.
|
`languages.typst.extensions.typst-preview-nvim`.
|
||||||
|
|
@ -76,21 +62,6 @@
|
||||||
|
|
||||||
- Add [yazi.nvim] as a companion plugin for Yazi, the terminal file manager.
|
- Add [yazi.nvim] as a companion plugin for Yazi, the terminal file manager.
|
||||||
|
|
||||||
- Add [snacks.nvim] under `vim.utility.snacks-nvim` as a general-purpose utility
|
|
||||||
plugin.
|
|
||||||
|
|
||||||
- Move LSPSaga to `setupOpts` format, allowing freeform configuration in
|
|
||||||
`vim.lsp.lspsaga.setupOpts`.
|
|
||||||
|
|
||||||
- Lazyload Lspsaga and remove default keybindings for it.
|
|
||||||
|
|
||||||
- Add [oil.nvim] as an alternative file explorer. It will be available under
|
|
||||||
`vim.utility.oil-nvim`.
|
|
||||||
|
|
||||||
- Add `vim.diagnostics` to interact with Neovim's diagnostics module. Available
|
|
||||||
options for `vim.diagnostic.config()` can now be customized through the
|
|
||||||
[](#opt-vim.diagnostics.config) in nvf.
|
|
||||||
|
|
||||||
[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
|
||||||
|
|
@ -101,15 +72,7 @@
|
||||||
|
|
||||||
[blink.cmp]: https://github.com/saghen/blink.cmp
|
[blink.cmp]: https://github.com/saghen/blink.cmp
|
||||||
|
|
||||||
- Add [aerial.nvim].
|
|
||||||
- Add [nvim-ufo].
|
|
||||||
- Add [blink.cmp] support.
|
- Add [blink.cmp] support.
|
||||||
- Add `LazyFile` user event.
|
|
||||||
- Migrate language modules from none-ls to conform/nvim-lint
|
|
||||||
- Add tsx support in conform and lint
|
|
||||||
- Moved code setting `additionalRuntimePaths` and `enableLuaLoader` out of
|
|
||||||
`luaConfigPre`'s default to prevent being overridden
|
|
||||||
- Use conform over custom autocmds for LSP format on save
|
|
||||||
|
|
||||||
[diniamo](https://github.com/diniamo):
|
[diniamo](https://github.com/diniamo):
|
||||||
|
|
||||||
|
|
@ -118,6 +81,14 @@
|
||||||
- Disable the built-in format-on-save feature of zls. Use `vim.lsp.formatOnSave`
|
- Disable the built-in format-on-save feature of zls. Use `vim.lsp.formatOnSave`
|
||||||
instead.
|
instead.
|
||||||
|
|
||||||
|
[horriblename](https://github.com/horriblename):
|
||||||
|
|
||||||
|
[aerial.nvim]: (https://github.com/stevearc/aerial.nvim)
|
||||||
|
[nvim-ufo]: (https://github.com/kevinhwang91/nvim-ufo)
|
||||||
|
|
||||||
|
- Add [aerial.nvim].
|
||||||
|
- Add [nvim-ufo].
|
||||||
|
|
||||||
[LilleAila](https://github.com/LilleAila):
|
[LilleAila](https://github.com/LilleAila):
|
||||||
|
|
||||||
- Remove `vim.notes.obsidian.setupOpts.dir`, which was set by default. Fixes
|
- Remove `vim.notes.obsidian.setupOpts.dir`, which was set by default. Fixes
|
||||||
|
|
@ -188,21 +159,16 @@
|
||||||
[thamenato](https://github.com/thamenato):
|
[thamenato](https://github.com/thamenato):
|
||||||
|
|
||||||
[ruff]: (https://github.com/astral-sh/ruff)
|
[ruff]: (https://github.com/astral-sh/ruff)
|
||||||
[cue]: (https://cuelang.org/)
|
|
||||||
|
|
||||||
- Add [ruff] as a formatter option in `vim.languages.python.format.type`.
|
- Add [ruff] as a formatter option in `vim.languages.python.format.type`.
|
||||||
- Add [cue] support under `vim.languages.cue`.
|
|
||||||
|
|
||||||
[ARCIII](https://github.com/ArmandoCIII):
|
[ARCIII](https://github.com/ArmandoCIII):
|
||||||
|
|
||||||
[leetcode.nvim]: https://github.com/kawre/leetcode.nvim
|
[leetcode.nvim]: https://github.com/kawre/leetcode.nvim
|
||||||
[codecompanion-nvim]: https://github.com/olimorris/codecompanion.nvim
|
|
||||||
|
|
||||||
- Add `vim.languages.zig.dap` support through pkgs.lldb dap adapter. Code
|
- Add `vim.languages.zig.dap` support through pkgs.lldb dap adapter. Code
|
||||||
Inspiration from `vim.languages.clang.dap` implementation.
|
Inspiration from `vim.languages.clang.dap` implementation.
|
||||||
- Add [leetcode.nvim] plugin under `vim.utility.leetcode-nvim`.
|
- Add [leetcode.nvim] plugin under `vim.utility.leetcode-nvim`.
|
||||||
- Add [codecompanion.nvim] plugin under `vim.assistant.codecompanion-nvim`.
|
|
||||||
- Fix [codecompanion-nvim] plugin: nvim-cmp error and setupOpts defaults.
|
|
||||||
|
|
||||||
[nezia1](https://github.com/nezia1):
|
[nezia1](https://github.com/nezia1):
|
||||||
|
|
||||||
|
|
@ -248,9 +214,8 @@
|
||||||
|
|
||||||
[alfarel](https://github.com/alfarelcynthesis):
|
[alfarel](https://github.com/alfarelcynthesis):
|
||||||
|
|
||||||
[conform.nvim]: https://github.com/stevearc/conform.nvim
|
|
||||||
|
|
||||||
- Add missing `yazi.nvim` dependency (`snacks.nvim`).
|
- Add missing `yazi.nvim` dependency (`snacks.nvim`).
|
||||||
|
|
||||||
- Add [mkdir.nvim](https://github.com/jghauser/mkdir.nvim) plugin for automatic
|
- Add [mkdir.nvim](https://github.com/jghauser/mkdir.nvim) plugin for automatic
|
||||||
creation of parent directories when editing a nested file.
|
creation of parent directories when editing a nested file.
|
||||||
- Add [nix-develop.nvim](https://github.com/figsoda/nix-develop.nvim) plugin for
|
- Add [nix-develop.nvim](https://github.com/figsoda/nix-develop.nvim) plugin for
|
||||||
|
|
@ -261,9 +226,6 @@
|
||||||
- Add [blink.cmp] option to add
|
- Add [blink.cmp] option to add
|
||||||
[friendly-snippets](https://github.com/rafamadriz/friendly-snippets) so
|
[friendly-snippets](https://github.com/rafamadriz/friendly-snippets) so
|
||||||
blink.cmp can source snippets from it.
|
blink.cmp can source snippets from it.
|
||||||
- Fix [blink.cmp] breaking when built-in sources were modified.
|
|
||||||
- Fix [conform.nvim] not allowing disabling formatting on and after save. Use
|
|
||||||
`null` value to disable them if conform is enabled.
|
|
||||||
|
|
||||||
[TheColorman](https://github.com/TheColorman):
|
[TheColorman](https://github.com/TheColorman):
|
||||||
|
|
||||||
|
|
@ -280,98 +242,3 @@
|
||||||
|
|
||||||
- `alpha` is now configured with nix.
|
- `alpha` is now configured with nix.
|
||||||
- Add `markview-nvim` markdown renderer.
|
- Add `markview-nvim` markdown renderer.
|
||||||
|
|
||||||
[viicslen](https://github.com/viicslen):
|
|
||||||
|
|
||||||
- Add `intelephense` language server support under
|
|
||||||
`vim.languages.php.lsp.server`
|
|
||||||
|
|
||||||
[Butzist](https://github.com/butzist):
|
|
||||||
|
|
||||||
- Add Helm chart support under `vim.languages.helm`.
|
|
||||||
|
|
||||||
[rice-cracker-dev](https://github.com/rice-cracker-dev):
|
|
||||||
|
|
||||||
- `eslint_d` now checks for configuration files to load.
|
|
||||||
- Fix an error where `eslint_d` fails to load.
|
|
||||||
- Add required files support for linters under
|
|
||||||
`vim.diagnostics.nvim-lint.linters.*.required_files`.
|
|
||||||
- Add global function `nvf_lint` under
|
|
||||||
`vim.diagnostics.nvim-lint.lint_function`.
|
|
||||||
|
|
||||||
[Sc3l3t0n](https://github.com/Sc3l3t0n):
|
|
||||||
|
|
||||||
- Add F# support under `vim.languages.fsharp`.
|
|
||||||
|
|
||||||
[venkyr77](https://github.com/venkyr77):
|
|
||||||
|
|
||||||
- Add lint (luacheck) and formatting (stylua) support for Lua.
|
|
||||||
- Add lint (markdownlint-cli2) support for Markdown.
|
|
||||||
- Add catppuccin integration for Bufferline, Lspsaga.
|
|
||||||
- Add `neo-tree`, `snacks.explorer` integrations to `bufferline`.
|
|
||||||
- Add more applicable filetypes to illuminate denylist.
|
|
||||||
- Disable mini.indentscope for applicable filetypes.
|
|
||||||
- Fix fzf-lua having a hard dependency on fzf.
|
|
||||||
- Enable inlay hints support - `config.vim.lsp.inlayHints`.
|
|
||||||
- Add `neo-tree`, `snacks.picker` extensions to `lualine`.
|
|
||||||
- Add support for `vim.lsp.formatOnSave` and
|
|
||||||
`vim.lsp.mappings.toggleFormatOnSave`
|
|
||||||
|
|
||||||
[tebuevd](https://github.com/tebuevd):
|
|
||||||
|
|
||||||
- Fix `pickers` configuration for `telescope` by nesting it under `setupOpts`
|
|
||||||
- Fix `find_command` configuration for `telescope` by nesting it under
|
|
||||||
`setupOpts.pickers.find_files`
|
|
||||||
- Update default `telescope.setupOpts.pickers.find_files.find_command` to only
|
|
||||||
include files (and therefore exclude directories from results)
|
|
||||||
|
|
||||||
[ckoehler](https://github.com/ckoehler):
|
|
||||||
|
|
||||||
[flash.nvim]: https://github.com/folke/flash.nvim
|
|
||||||
[gitlinker.nvim]: https://github.com/linrongbin16/gitlinker.nvim
|
|
||||||
|
|
||||||
- Fix oil config referencing snacks
|
|
||||||
- Add [flash.nvim] plugin to `vim.utility.motion.flash-nvim`
|
|
||||||
- Fix default telescope ignore list entry for '.git/' to properly match
|
|
||||||
- Add [gitlinker.nvim] plugin to `vim.git.gitlinker-nvim`
|
|
||||||
|
|
||||||
[rrvsh](https://github.com/rrvsh):
|
|
||||||
|
|
||||||
- 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):
|
|
||||||
|
|
||||||
- Fix [render-markdown.nvim] file_types option type to list, to accept merging.
|
|
||||||
|
|
||||||
[poz](https://poz.pet):
|
|
||||||
|
|
||||||
- Fix gitsigns null-ls issue.
|
|
||||||
|
|
||||||
[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`).
|
|
||||||
|
|
|
||||||
62
flake.lock
generated
62
flake.lock
generated
|
|
@ -5,11 +5,11 @@
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1743550720,
|
"lastModified": 1738453229,
|
||||||
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
|
"narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
|
"rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -38,11 +38,11 @@
|
||||||
},
|
},
|
||||||
"mnw": {
|
"mnw": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1746338991,
|
"lastModified": 1738852285,
|
||||||
"narHash": "sha256-GbyoHjf14LOxZQc+0NFblI4xf/uwGrYo3W8lwE4HcwI=",
|
"narHash": "sha256-8Y1uyE6gGHxdU0Vcx2CMg/dAmDSxJw19aAl3TKbbo54=",
|
||||||
"owner": "Gerg-L",
|
"owner": "Gerg-L",
|
||||||
"repo": "mnw",
|
"repo": "mnw",
|
||||||
"rev": "c65407ee9387ef75985dad3e30f58c822c766ec1",
|
"rev": "6ae73dc9cb72cea17bcc2e3d4670825f483e80e8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -62,11 +62,11 @@
|
||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741118843,
|
"lastModified": 1732053863,
|
||||||
"narHash": "sha256-ggXU3RHv6NgWw+vc+HO4/9n0GPufhTIUjVuLci8Za8c=",
|
"narHash": "sha256-DCIVdlb81Fct2uwzbtnawLBC/U03U2hqx8trqTJB7WA=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "nil",
|
"repo": "nil",
|
||||||
"rev": "577d160da311cc7f5042038456a0713e9863d09e",
|
"rev": "2e24c9834e3bb5aa2a3701d3713b43a6fb106362",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -77,11 +77,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1746152631,
|
"lastModified": 1740303746,
|
||||||
"narHash": "sha256-zBuvmL6+CUsk2J8GINpyy8Hs1Zp4PP6iBWSmZ4SCQ/s=",
|
"narHash": "sha256-XcdiWLEhjJkMxDLKQJ0CCivmYYCvA5MDxu9pMybM5kM=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "032bc6539bd5f14e9d0c51bd79cfe9a055b094c3",
|
"rev": "2d068ae5c6516b2d04562de50a58c682540de9bf",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -93,17 +93,30 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
"nixpkgs-lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1743296961,
|
"lastModified": 1738452942,
|
||||||
"narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=",
|
"narHash": "sha256-vJzFZGaCpnmo7I6i416HaBLpC+hvcURh/BQwROcGIp8=",
|
||||||
"owner": "nix-community",
|
"type": "tarball",
|
||||||
"repo": "nixpkgs.lib",
|
"url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz"
|
||||||
"rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa",
|
|
||||||
"type": "github"
|
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"type": "tarball",
|
||||||
"repo": "nixpkgs.lib",
|
"url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz"
|
||||||
"type": "github"
|
}
|
||||||
|
},
|
||||||
|
"nmd": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1705050560,
|
||||||
|
"narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=",
|
||||||
|
"owner": "~rycee",
|
||||||
|
"repo": "nmd",
|
||||||
|
"rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3",
|
||||||
|
"type": "sourcehut"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "~rycee",
|
||||||
|
"repo": "nmd",
|
||||||
|
"type": "sourcehut"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
|
|
@ -113,6 +126,7 @@
|
||||||
"mnw": "mnw",
|
"mnw": "mnw",
|
||||||
"nil": "nil",
|
"nil": "nil",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
|
"nmd": "nmd",
|
||||||
"systems": "systems_2"
|
"systems": "systems_2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -124,11 +138,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741055476,
|
"lastModified": 1731983527,
|
||||||
"narHash": "sha256-52vwEV0oS2lCnx3c/alOFGglujZTLmObit7K8VblnS8=",
|
"narHash": "sha256-JECaBgC0pQ91Hq3W4unH6K9to8s2Zl2sPNu7bLOv4ek=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "aefb7017d710f150970299685e8d8b549d653649",
|
"rev": "71287228d96e9568e1e70c6bbfa3f992d145947b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,10 @@
|
||||||
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
|
||||||
];
|
];
|
||||||
|
|
@ -83,6 +86,12 @@
|
||||||
# Alternate neovim-wrapper
|
# Alternate neovim-wrapper
|
||||||
mnw.url = "github:Gerg-L/mnw";
|
mnw.url = "github:Gerg-L/mnw";
|
||||||
|
|
||||||
|
# For generating documentation website
|
||||||
|
nmd = {
|
||||||
|
url = "sourcehut:~rycee/nmd";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
# Language servers (use master instead of nixpkgs)
|
# Language servers (use master instead of nixpkgs)
|
||||||
nil = {
|
nil = {
|
||||||
url = "github:oxalica/nil";
|
url = "github:oxalica/nil";
|
||||||
|
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
{
|
|
||||||
rustPlatform,
|
|
||||||
fetchFromGitHub,
|
|
||||||
writeShellScriptBin,
|
|
||||||
}:
|
|
||||||
rustPlatform.buildRustPackage (finalAttrs: {
|
|
||||||
pname = "blink-cmp";
|
|
||||||
version = "1.2.0";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "Saghen";
|
|
||||||
repo = "blink.cmp";
|
|
||||||
tag = "v${finalAttrs.version}";
|
|
||||||
hash = "sha256-bKe8SSg1HPWE7b4iRQJwiOVCrvvgttuHCOIa4U/38AY=";
|
|
||||||
};
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
cp -r {lua,plugin} "$out"
|
|
||||||
mkdir -p "$out/target"
|
|
||||||
mv "$out/lib" "$out/target/release"
|
|
||||||
'';
|
|
||||||
|
|
||||||
cargoHash = "sha256-IDoDugtNWQovfSstbVMkKHLBXKa06lxRWmywu4zyS3M=";
|
|
||||||
useFetchCargoVendor = true;
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
(writeShellScriptBin "git" "exit 1")
|
|
||||||
];
|
|
||||||
|
|
||||||
env.RUSTC_BOOTSTRAP = true;
|
|
||||||
})
|
|
||||||
|
|
@ -3,14 +3,13 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
self',
|
self',
|
||||||
inputs',
|
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
devShells = {
|
devShells = {
|
||||||
default = self'.devShells.lsp;
|
default = self'.devShells.lsp;
|
||||||
nvim-nix = pkgs.mkShellNoCC {packages = [config.packages.nix];};
|
nvim-nix = pkgs.mkShellNoCC {packages = [config.packages.nix];};
|
||||||
lsp = pkgs.mkShellNoCC {
|
lsp = pkgs.mkShellNoCC {
|
||||||
packages = with pkgs; [inputs'.nil.packages.default statix deadnix alejandra npins];
|
packages = with pkgs; [nil statix deadnix alejandra npins];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
35
flake/legacyPackages.nix
Normal file
35
flake/legacyPackages.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
38
flake/legacyPackages/blink-cmp.nix
Normal file
38
flake/legacyPackages/blink-cmp.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
rustPlatform,
|
||||||
|
hostPlatform,
|
||||||
|
vimUtils,
|
||||||
|
git,
|
||||||
|
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;
|
||||||
|
|
||||||
|
nativeBuildInputs = [git];
|
||||||
|
cargoLock = {
|
||||||
|
lockFile = "${src}/Cargo.lock";
|
||||||
|
allowBuiltinFetchGit = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
libExt =
|
||||||
|
if hostPlatform.isDarwin
|
||||||
|
then "dylib"
|
||||||
|
else "so";
|
||||||
|
in
|
||||||
|
vimUtils.buildVimPlugin {
|
||||||
|
pname = "blink-cmp";
|
||||||
|
inherit version src;
|
||||||
|
|
||||||
|
# blink references a repro.lua which is placed outside the lua/ directory
|
||||||
|
doCheck = false;
|
||||||
|
preInstall = ''
|
||||||
|
mkdir -p target/release
|
||||||
|
ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy.${libExt} target/release/libblink_cmp_fuzzy.${libExt}
|
||||||
|
'';
|
||||||
|
}
|
||||||
19
flake/overlays.nix
Normal file
19
flake/overlays.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
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,4 +1,4 @@
|
||||||
{inputs, ...} @ args: {
|
{inputs, ...}: {
|
||||||
perSystem = {
|
perSystem = {
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
|
@ -6,15 +6,8 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
docs = import ../docs {inherit pkgs inputs lib;};
|
docs = import ../docs {inherit pkgs inputs lib;};
|
||||||
buildPkg = maximal:
|
|
||||||
(args.config.flake.lib.nvim.neovimConfiguration {
|
|
||||||
inherit pkgs;
|
|
||||||
modules = [(import ../configuration.nix maximal)];
|
|
||||||
}).neovim;
|
|
||||||
in {
|
in {
|
||||||
packages = {
|
packages = {
|
||||||
blink-cmp = pkgs.callPackage ./blink {};
|
|
||||||
|
|
||||||
inherit (docs.manual) htmlOpenTool;
|
inherit (docs.manual) htmlOpenTool;
|
||||||
# Documentation
|
# Documentation
|
||||||
docs = docs.manual.html;
|
docs = docs.manual.html;
|
||||||
|
|
@ -68,9 +61,9 @@
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Exposed neovim configurations
|
# Exposed neovim configurations
|
||||||
nix = buildPkg false;
|
nix = config.legacyPackages.neovim-nix;
|
||||||
maximal = buildPkg true;
|
maximal = config.legacyPackages.neovim-maximal;
|
||||||
default = config.packages.nix;
|
default = config.legacyPackages.neovim-nix;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,22 +26,12 @@
|
||||||
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 self;};
|
types = import ./types {inherit lib;};
|
||||||
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,11 +1,10 @@
|
||||||
|
# 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) listOf bool str submodule attrsOf anything either nullOr;
|
inherit (lib.types) bool;
|
||||||
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,
|
||||||
|
|
@ -33,48 +32,4 @@ 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.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
{
|
{lib}: let
|
||||||
lib,
|
|
||||||
self,
|
|
||||||
}: let
|
|
||||||
typesDag = import ./dag.nix {inherit lib;};
|
typesDag = import ./dag.nix {inherit lib;};
|
||||||
typesPlugin = import ./plugins.nix {inherit lib self;};
|
typesPlugin = import ./plugins.nix {inherit lib;};
|
||||||
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,7 +1,4 @@
|
||||||
{
|
{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;
|
||||||
|
|
@ -15,7 +12,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 = ["blink-cmp"] ++ attrNames self.pins;
|
pluginInputNames = attrNames (lib.importJSON ../../npins/sources.json).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 (
|
||||||
|
|
|
||||||
|
|
@ -104,13 +104,6 @@ in {
|
||||||
their behaviour was abstract, and confusing. Please use 'vim.options' or 'vim.luaConfigRC'
|
their behaviour was abstract, and confusing. Please use 'vim.options' or 'vim.luaConfigRC'
|
||||||
to replicate previous behaviour.
|
to replicate previous behaviour.
|
||||||
'')
|
'')
|
||||||
|
|
||||||
# 2025-04-04
|
|
||||||
(mkRemovedOptionModule ["vim" "lsp" "lsplines"] ''
|
|
||||||
lsplines module has been removed from nvf, as its functionality is now built into Neovim
|
|
||||||
under the diagnostics module. Please consider using one of 'vim.diagnostics.config' or
|
|
||||||
'vim.luaConfigRC' to configure LSP lines for Neovim through its own diagnostics API.
|
|
||||||
'')
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# Migrated via batchRenameOptions. Further batch renames must be below this line.
|
# Migrated via batchRenameOptions. Further batch renames must be below this line.
|
||||||
|
|
|
||||||
|
|
@ -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,7 +31,7 @@
|
||||||
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 {
|
||||||
|
|
@ -44,16 +44,13 @@
|
||||||
end
|
end
|
||||||
''''
|
''''
|
||||||
'';
|
'';
|
||||||
description = "Lua function to be called when the event(s) are triggered.";
|
description = "The file pattern(s) that determine when the autocommand applies.";
|
||||||
};
|
};
|
||||||
|
|
||||||
command = mkOption {
|
command = mkOption {
|
||||||
type = nullOr str;
|
type = nullOr str;
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = "Vim command string instead of a Lua function.";
|
||||||
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 {
|
||||||
|
|
@ -73,7 +70,7 @@
|
||||||
once = mkOption {
|
once = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "Whether to run the autocommand only once.";
|
description = "Whether autocommand run only once.";
|
||||||
};
|
};
|
||||||
|
|
||||||
nested = mkOption {
|
nested = mkOption {
|
||||||
|
|
@ -90,7 +87,7 @@
|
||||||
mkEnableOption ""
|
mkEnableOption ""
|
||||||
// {
|
// {
|
||||||
default = true;
|
default = true;
|
||||||
description = "Whether to enable this autocommand group.";
|
description = "Whether to enable this autogroup";
|
||||||
};
|
};
|
||||||
|
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
|
|
@ -121,8 +118,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 and a boolean indicating whether to clear
|
Each autogroup consists of a name, a boolean indicating whether to clear
|
||||||
existing autocommands.
|
existing autocommands, and a list of associated autocommands.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -132,8 +129,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, a callback or Vim
|
Each entry defines an autocommand, specifying events, patterns, optional
|
||||||
command, an optional group, a description, and execution settings.
|
callbacks, commands, groups, and execution settings.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,7 @@
|
||||||
./autocmds.nix
|
./autocmds.nix
|
||||||
./basic.nix
|
./basic.nix
|
||||||
./debug.nix
|
./debug.nix
|
||||||
./diagnostics.nix
|
|
||||||
./highlight.nix
|
./highlight.nix
|
||||||
./lsp.nix
|
|
||||||
./spellcheck.nix
|
./spellcheck.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,109 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
|
||||||
inherit (lib.types) attrsOf anything oneOf bool submodule;
|
|
||||||
inherit (lib.nvim.dag) entryAfter;
|
|
||||||
inherit (lib.nvim.types) luaInline;
|
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
|
||||||
|
|
||||||
cfg = config.vim.diagnostics;
|
|
||||||
|
|
||||||
# Takes a boolean, a table, or a Lua list ({key = value}). We
|
|
||||||
# would like to allow all of those types, while clearly expressing
|
|
||||||
# them in the option's type. As such, this type is what it is.
|
|
||||||
diagnosticType = oneOf [(attrsOf anything) bool luaInline];
|
|
||||||
diagnosticsSubmodule = submodule {
|
|
||||||
# The table might need to be extended, so let's allow that case
|
|
||||||
# with a freeform type of what is supported by diagnostics opts.
|
|
||||||
freeformType = attrsOf diagnosticType;
|
|
||||||
options = {
|
|
||||||
underline = mkOption {
|
|
||||||
type = diagnosticType;
|
|
||||||
default = true;
|
|
||||||
description = "Use underline for diagnostics.";
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual_text = mkOption {
|
|
||||||
type = diagnosticType;
|
|
||||||
default = false;
|
|
||||||
example = literalExpression ''
|
|
||||||
{
|
|
||||||
format = lib.generators.mkLuaInline '''
|
|
||||||
function(diagnostic)
|
|
||||||
return string.format("%s (%s)", diagnostic.message, diagnostic.source)
|
|
||||||
end
|
|
||||||
''';
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
description = ''
|
|
||||||
Use virtual text for diagnostics. If multiple diagnostics are set for a namespace,
|
|
||||||
one prefix per diagnostic + the last diagnostic message are shown.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual_lines = mkOption {
|
|
||||||
type = diagnosticType;
|
|
||||||
default = false;
|
|
||||||
description = ''
|
|
||||||
Use virtual lines for diagnostics.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
signs = mkOption {
|
|
||||||
type = diagnosticType;
|
|
||||||
default = false;
|
|
||||||
example = {
|
|
||||||
signs.text = {
|
|
||||||
"vim.diagnostic.severity.ERROR" = " ";
|
|
||||||
"vim.diagnostic.severity.WARN" = " ";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
description = ''
|
|
||||||
Use signs for diagnostics. See {command}`:help diagnostic-signs`.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
update_in_insert = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = ''
|
|
||||||
Update diagnostics in Insert mode. If `false`, diagnostics will
|
|
||||||
be updated on InsertLeave ({command}`:help InsertLeave`).
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
options.vim = {
|
|
||||||
diagnostics = {
|
|
||||||
enable = mkEnableOption "diagostics module for Neovim";
|
|
||||||
config = mkOption {
|
|
||||||
type = diagnosticsSubmodule;
|
|
||||||
default = {};
|
|
||||||
description = ''
|
|
||||||
Values that will be passed to `vim.diagnostic.config` after being converted
|
|
||||||
to a Lua table. Possible values for each key can be found in the help text
|
|
||||||
for `vim.diagnostics.Opts`. You may find more about the diagnostics API of
|
|
||||||
Neovim in {command}`:help diagnostic-api`.
|
|
||||||
|
|
||||||
:::{.note}
|
|
||||||
This option is freeform. You may set values that are not present in nvf
|
|
||||||
documentation, but those values will not be fully type checked. Please
|
|
||||||
refer to the help text for `vim.diagnostic.Opts` for appropriate values.
|
|
||||||
:::
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config.vim = mkIf cfg.enable {
|
|
||||||
luaConfigRC.diagnostics = entryAfter ["basic"] ''
|
|
||||||
vim.diagnostic.config(${toLuaObject cfg.config})
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -5,14 +5,15 @@
|
||||||
}: 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) concatLines;
|
inherit (lib.strings) hasPrefix 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 str;
|
type = nullOr hexColor;
|
||||||
default = null;
|
default = null;
|
||||||
example = "#ebdbb2";
|
example = "#ebdbb2";
|
||||||
description = ''
|
description = ''
|
||||||
|
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (builtins) filter;
|
|
||||||
inherit (lib.modules) mkIf mkMerge mkDefault;
|
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
|
||||||
inherit (lib.types) attrsOf;
|
|
||||||
inherit (lib.strings) concatLines;
|
|
||||||
inherit (lib.attrsets) mapAttrsToList attrNames filterAttrs;
|
|
||||||
inherit (lib.generators) mkLuaInline;
|
|
||||||
inherit (lib.nvim.languages) lspOptions;
|
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
|
||||||
|
|
||||||
cfg = config.vim.lsp;
|
|
||||||
|
|
||||||
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))})
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -30,16 +30,7 @@
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = [
|
startPlugins = ["chatgpt-nvim"];
|
||||||
"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})
|
||||||
|
|
|
||||||
|
|
@ -1,301 +0,0 @@
|
||||||
{lib, ...}: let
|
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
|
||||||
inherit (lib.types) int str enum nullOr attrs;
|
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
|
||||||
in {
|
|
||||||
options.vim.assistant = {
|
|
||||||
codecompanion-nvim = {
|
|
||||||
enable = mkEnableOption "complementary neovim plugin for codecompanion.nvim";
|
|
||||||
|
|
||||||
setupOpts = mkPluginSetupOption "codecompanion-nvim" {
|
|
||||||
opts = {
|
|
||||||
send_code =
|
|
||||||
mkEnableOption ""
|
|
||||||
// {
|
|
||||||
default = true;
|
|
||||||
description = ''
|
|
||||||
Whether to enable code being sent to the LLM.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
log_level = mkOption {
|
|
||||||
type = enum ["DEBUG" "INFO" "ERROR" "TRACE"];
|
|
||||||
default = "ERROR";
|
|
||||||
description = "Change the level of logging.";
|
|
||||||
};
|
|
||||||
|
|
||||||
language = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = "English";
|
|
||||||
description = "Specify which language an LLM should respond in.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
display = {
|
|
||||||
diff = {
|
|
||||||
enabled =
|
|
||||||
mkEnableOption ""
|
|
||||||
// {
|
|
||||||
default = true;
|
|
||||||
description = ''
|
|
||||||
Whether to enable a diff view
|
|
||||||
to see the changes made by the LLM.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
close_chat_at = mkOption {
|
|
||||||
type = int;
|
|
||||||
default = 240;
|
|
||||||
description = ''
|
|
||||||
Close an open chat buffer if the
|
|
||||||
total columns of your display are less than...
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
layout = mkOption {
|
|
||||||
type = enum ["vertical" "horizontal"];
|
|
||||||
default = "vertical";
|
|
||||||
description = "Type of split for default provider.";
|
|
||||||
};
|
|
||||||
|
|
||||||
provider = mkOption {
|
|
||||||
type = enum ["default" "mini_diff"];
|
|
||||||
default = "default";
|
|
||||||
description = "The preferred kind of provider.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
inline = {
|
|
||||||
layout = mkOption {
|
|
||||||
type = enum ["vertical" "horizontal" "buffer"];
|
|
||||||
default = "vertical";
|
|
||||||
description = "Customize how output is created in new buffer.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
chat = {
|
|
||||||
auto_scroll =
|
|
||||||
mkEnableOption ""
|
|
||||||
// {
|
|
||||||
default = true;
|
|
||||||
description = "Whether to enable automatic page scrolling.";
|
|
||||||
};
|
|
||||||
|
|
||||||
show_settings = mkEnableOption ''
|
|
||||||
LLM settings to appear at the top of the chat buffer.
|
|
||||||
'';
|
|
||||||
|
|
||||||
start_in_insert_mode = mkEnableOption ''
|
|
||||||
opening the chat buffer in insert mode.
|
|
||||||
'';
|
|
||||||
|
|
||||||
show_header_separator = mkEnableOption ''
|
|
||||||
header separators in the chat buffer.
|
|
||||||
|
|
||||||
Set this to false if you're using an
|
|
||||||
external markdown formatting plugin.
|
|
||||||
'';
|
|
||||||
|
|
||||||
show_references =
|
|
||||||
mkEnableOption ""
|
|
||||||
// {
|
|
||||||
default = true;
|
|
||||||
description = ''
|
|
||||||
Whether to enable references in the chat buffer.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
show_token_count =
|
|
||||||
mkEnableOption ""
|
|
||||||
// {
|
|
||||||
default = true;
|
|
||||||
description = ''
|
|
||||||
Whether to enable the token count for each response.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
intro_message = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = "Welcome to CodeCompanion ✨! Press ? for options.";
|
|
||||||
description = "Message to appear in chat buffer.";
|
|
||||||
};
|
|
||||||
|
|
||||||
separator = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = "─";
|
|
||||||
description = ''
|
|
||||||
The separator between the
|
|
||||||
different messages in the chat buffer.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
icons = {
|
|
||||||
pinned_buffer = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = " ";
|
|
||||||
description = "The icon to represent a pinned buffer.";
|
|
||||||
};
|
|
||||||
|
|
||||||
watched_buffer = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = "👀 ";
|
|
||||||
description = "The icon to represent a watched buffer.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
action_palette = {
|
|
||||||
width = mkOption {
|
|
||||||
type = int;
|
|
||||||
default = 95;
|
|
||||||
description = "Width of the action palette.";
|
|
||||||
};
|
|
||||||
|
|
||||||
height = mkOption {
|
|
||||||
type = int;
|
|
||||||
default = 10;
|
|
||||||
description = "Height of the action palette.";
|
|
||||||
};
|
|
||||||
|
|
||||||
prompt = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = "Prompt ";
|
|
||||||
description = "Prompt used for interactive LLM calls.";
|
|
||||||
};
|
|
||||||
|
|
||||||
provider = mkOption {
|
|
||||||
type = enum ["default" "telescope" "mini_pick"];
|
|
||||||
default = "default";
|
|
||||||
description = "Provider used for the action palette.";
|
|
||||||
};
|
|
||||||
|
|
||||||
opts = {
|
|
||||||
show_default_actions =
|
|
||||||
mkEnableOption ""
|
|
||||||
// {
|
|
||||||
default = true;
|
|
||||||
description = ''
|
|
||||||
Whether to enable showing default
|
|
||||||
actions in the action palette.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
show_default_prompt_library =
|
|
||||||
mkEnableOption ""
|
|
||||||
// {
|
|
||||||
default = true;
|
|
||||||
description = ''
|
|
||||||
Whether to enable showing default
|
|
||||||
prompt library in the action palette.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
adapters = mkOption {
|
|
||||||
type = nullOr luaInline;
|
|
||||||
default = null;
|
|
||||||
description = "An adapter is what connects Neovim to an LLM.";
|
|
||||||
};
|
|
||||||
|
|
||||||
strategies = {
|
|
||||||
chat = {
|
|
||||||
adapter = mkOption {
|
|
||||||
type = nullOr str;
|
|
||||||
default = null;
|
|
||||||
description = "Adapter used for the chat strategy.";
|
|
||||||
};
|
|
||||||
|
|
||||||
keymaps = mkOption {
|
|
||||||
type = nullOr attrs;
|
|
||||||
default = null;
|
|
||||||
description = "Define or override the default keymaps.";
|
|
||||||
};
|
|
||||||
|
|
||||||
variables = mkOption {
|
|
||||||
type = nullOr luaInline;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
Define your own variables
|
|
||||||
to share specific content.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
slash_commands = mkOption {
|
|
||||||
type = nullOr luaInline;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
Slash Commands (invoked with /) let you dynamically
|
|
||||||
insert context into the chat buffer,
|
|
||||||
such as file contents or date/time.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
tools = mkOption {
|
|
||||||
type = nullOr attrs;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
Configure tools to perform specific
|
|
||||||
tasks when invoked by an LLM.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
roles = mkOption {
|
|
||||||
type = nullOr luaInline;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
The chat buffer places user and LLM responses under a H2 header.
|
|
||||||
These can be customized in the configuration.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
inline = {
|
|
||||||
adapter = mkOption {
|
|
||||||
type = nullOr str;
|
|
||||||
default = null;
|
|
||||||
description = "Adapter used for the inline strategy.";
|
|
||||||
};
|
|
||||||
|
|
||||||
variables = mkOption {
|
|
||||||
type = nullOr luaInline;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
Define your own variables
|
|
||||||
to share specific content.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
keymaps = {
|
|
||||||
accept_change = {
|
|
||||||
n = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = "ga";
|
|
||||||
description = "Accept the suggested change.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
reject_change = {
|
|
||||||
n = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = "gr";
|
|
||||||
description = "Reject the suggested change.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
prompt_library = mkOption {
|
|
||||||
type = nullOr attrs;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
A prompt library is a collection of prompts
|
|
||||||
that can be used in the action palette.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
|
|
||||||
cfg = config.vim.assistant.codecompanion-nvim;
|
|
||||||
in {
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
vim = {
|
|
||||||
startPlugins = [
|
|
||||||
"plenary-nvim"
|
|
||||||
];
|
|
||||||
|
|
||||||
lazy.plugins = {
|
|
||||||
codecompanion-nvim = {
|
|
||||||
package = "codecompanion-nvim";
|
|
||||||
setupModule = "codecompanion";
|
|
||||||
inherit (cfg) setupOpts;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
treesitter.enable = true;
|
|
||||||
|
|
||||||
autocomplete.nvim-cmp = {
|
|
||||||
sources = {codecompanion-nvim = "[codecompanion]";};
|
|
||||||
sourcePlugins = ["codecompanion-nvim"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./config.nix
|
|
||||||
./codecompanion-nvim.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -37,12 +37,6 @@ in {
|
||||||
inherit (cfg) setupOpts;
|
inherit (cfg) setupOpts;
|
||||||
after = mkIf cfg.cmp.enable "require('copilot_cmp').setup()";
|
after = mkIf cfg.cmp.enable "require('copilot_cmp').setup()";
|
||||||
|
|
||||||
event = [
|
|
||||||
{
|
|
||||||
event = "User";
|
|
||||||
pattern = "LazyFile";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
cmd = ["Copilot" "CopilotAuth" "CopilotDetach" "CopilotPanel" "CopilotStop"];
|
cmd = ["Copilot" "CopilotAuth" "CopilotDetach" "CopilotPanel" "CopilotStop"];
|
||||||
keys = [
|
keys = [
|
||||||
(mkLuaKeymap ["n"] cfg.mappings.panel.accept (wrapPanelBinding ''require("copilot.panel").accept'' cfg.mappings.panel.accept) "[copilot] Accept suggestion" {})
|
(mkLuaKeymap ["n"] cfg.mappings.panel.accept (wrapPanelBinding ''require("copilot.panel").accept'' cfg.mappings.panel.accept) "[copilot] Accept suggestion" {})
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,5 @@
|
||||||
imports = [
|
imports = [
|
||||||
./chatgpt
|
./chatgpt
|
||||||
./copilot
|
./copilot
|
||||||
./codecompanion
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +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) listOf str either attrsOf submodule enum anything int nullOr;
|
||||||
inherit (lib.generators) mkLuaInline;
|
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;
|
||||||
|
|
@ -21,9 +21,8 @@
|
||||||
freeformType = anything;
|
freeformType = anything;
|
||||||
options = {
|
options = {
|
||||||
module = mkOption {
|
module = mkOption {
|
||||||
type = nullOr str;
|
type = str;
|
||||||
default = null;
|
description = "module of the provider";
|
||||||
description = "Provider module.";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -41,7 +40,20 @@ in {
|
||||||
providers = mkOption {
|
providers = mkOption {
|
||||||
type = attrsOf providerType;
|
type = attrsOf providerType;
|
||||||
default = {};
|
default = {};
|
||||||
description = "Settings for completion providers.";
|
description = "Settings for completion providers";
|
||||||
|
};
|
||||||
|
|
||||||
|
transform_items = mkOption {
|
||||||
|
type = nullOr luaInline;
|
||||||
|
default = mkLuaInline "function(_, items) return items end";
|
||||||
|
defaultText = ''
|
||||||
|
Our default does nothing. If you want blink.cmp's default, which
|
||||||
|
lowers the score for snippets, set this option to null.
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Function to use when transforming the items before they're returned
|
||||||
|
for all providers.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -51,12 +63,6 @@ in {
|
||||||
default = [];
|
default = [];
|
||||||
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.";
|
||||||
};
|
};
|
||||||
|
|
||||||
keymap = mkOption {
|
|
||||||
type = keymapType;
|
|
||||||
default = {};
|
|
||||||
description = "blink.cmp cmdline keymap";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
completion = {
|
completion = {
|
||||||
|
|
@ -68,16 +74,6 @@ in {
|
||||||
description = "Delay before auto show triggers";
|
description = "Delay before auto show triggers";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
menu.auto_show = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = ''
|
|
||||||
Manages the appearance of the completion menu. You may prevent the menu
|
|
||||||
from automatically showing by this option to `false` and manually showing
|
|
||||||
it with the show keymap command.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
keymap = mkOption {
|
keymap = mkOption {
|
||||||
|
|
@ -107,25 +103,7 @@ in {
|
||||||
fuzzy = {
|
fuzzy = {
|
||||||
prebuilt_binaries = {
|
prebuilt_binaries = {
|
||||||
download = mkBool false ''
|
download = mkBool false ''
|
||||||
Auto-downloads prebuilt binaries.
|
Auto-downloads prebuilt binaries. Do not enable, it doesn't work on nix
|
||||||
|
|
||||||
::: .{warning}
|
|
||||||
Do not enable this option, as it does **not work** on Nix!
|
|
||||||
:::
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
implementation = mkOption {
|
|
||||||
type = enum ["lua" "prefer_rust" "rust" "prefer_rust_with_warning"];
|
|
||||||
default = "prefer_rust";
|
|
||||||
description = ''
|
|
||||||
fuzzy matcher implementation for Blink.
|
|
||||||
|
|
||||||
* `"lua"`: slower, Lua native fuzzy matcher implementation
|
|
||||||
* `"rust": use the SIMD fuzzy matcher, 'frizbee'
|
|
||||||
* `"prefer_rust"`: use the rust implementation, but fall back to lua
|
|
||||||
* `"prefer_rust_with_warning"`: use the rust implementation, and fall back to lua
|
|
||||||
if it is not available after emitting a warning.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -144,14 +122,12 @@ in {
|
||||||
sourcePlugins = let
|
sourcePlugins = let
|
||||||
sourcePluginType = submodule {
|
sourcePluginType = submodule {
|
||||||
options = {
|
options = {
|
||||||
enable = mkEnableOption "this source";
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = pluginType;
|
type = pluginType;
|
||||||
description = ''
|
description = ''
|
||||||
`blink-cmp` source plugin package.
|
`blink-cmp` source plugin package.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
module = mkOption {
|
module = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
description = ''
|
description = ''
|
||||||
|
|
@ -160,6 +136,7 @@ in {
|
||||||
Should be present in the source's documentation.
|
Should be present in the source's documentation.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
enable = mkEnableOption "this source";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.attrsets) attrValues filterAttrs mapAttrsToList;
|
inherit (lib.attrsets) attrValues filterAttrs;
|
||||||
inherit (lib.lists) map optional elem;
|
inherit (lib.lists) map optional;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
inherit (builtins) concatStringsSep typeOf tryEval attrNames mapAttrs;
|
inherit (builtins) concatStringsSep typeOf tryEval attrNames mapAttrs;
|
||||||
|
|
||||||
|
|
@ -24,22 +24,7 @@
|
||||||
|
|
||||||
enabledBlinkSources = filterAttrs (_source: definition: definition.enable) cfg.sourcePlugins;
|
enabledBlinkSources = filterAttrs (_source: definition: definition.enable) cfg.sourcePlugins;
|
||||||
blinkSourcePlugins = map (definition: definition.package) (attrValues enabledBlinkSources);
|
blinkSourcePlugins = map (definition: definition.package) (attrValues enabledBlinkSources);
|
||||||
|
|
||||||
blinkBuiltins = [
|
|
||||||
"path"
|
|
||||||
"lsp"
|
|
||||||
"snippets"
|
|
||||||
"buffer"
|
|
||||||
"omni"
|
|
||||||
];
|
|
||||||
in {
|
in {
|
||||||
assertions =
|
|
||||||
mapAttrsToList (provider: definition: {
|
|
||||||
assertion = elem provider blinkBuiltins || definition.module != null;
|
|
||||||
message = "`config.vim.autocomplete.blink-cmp.setupOpts.sources.providers.${provider}.module` is `null`: non-builtin providers must set `module`.";
|
|
||||||
})
|
|
||||||
cfg.setupOpts.sources.providers;
|
|
||||||
|
|
||||||
vim = mkIf cfg.enable {
|
vim = mkIf cfg.enable {
|
||||||
startPlugins = ["blink-compat"] ++ blinkSourcePlugins ++ (optional cfg.friendly-snippets.enable "friendly-snippets");
|
startPlugins = ["blink-compat"] ++ blinkSourcePlugins ++ (optional cfg.friendly-snippets.enable "friendly-snippets");
|
||||||
lazy.plugins = {
|
lazy.plugins = {
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,12 @@ in {
|
||||||
enableSharedCmpSources = true;
|
enableSharedCmpSources = true;
|
||||||
|
|
||||||
nvim-cmp = {
|
nvim-cmp = {
|
||||||
|
sources = {
|
||||||
|
nvim-cmp = null;
|
||||||
|
buffer = "[Buffer]";
|
||||||
|
path = "[Path]";
|
||||||
|
};
|
||||||
|
|
||||||
sourcePlugins = ["cmp-buffer" "cmp-path"];
|
sourcePlugins = ["cmp-buffer" "cmp-path"];
|
||||||
|
|
||||||
setupOpts = {
|
setupOpts = {
|
||||||
|
|
|
||||||
|
|
@ -98,16 +98,14 @@ in {
|
||||||
|
|
||||||
sources = mkOption {
|
sources = mkOption {
|
||||||
type = attrsOf (nullOr str);
|
type = attrsOf (nullOr str);
|
||||||
default = {
|
default = {};
|
||||||
nvim-cmp = null;
|
|
||||||
buffer = "[Buffer]";
|
|
||||||
path = "[Path]";
|
|
||||||
};
|
|
||||||
example = {
|
|
||||||
nvim-cmp = null;
|
|
||||||
buffer = "[Buffer]";
|
|
||||||
};
|
|
||||||
description = "The list of sources used by nvim-cmp";
|
description = "The list of sources used by nvim-cmp";
|
||||||
|
example = literalExpression ''
|
||||||
|
{
|
||||||
|
nvim-cmp = null;
|
||||||
|
buffer = "[Buffer]";
|
||||||
|
}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
sourcePlugins = mkOption {
|
sourcePlugins = mkOption {
|
||||||
|
|
|
||||||
|
|
@ -3,50 +3,18 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.generators) mkLuaInline;
|
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
cfg = config.vim.diagnostics.nvim-lint;
|
cfg = config.vim.diagnostics.nvim-lint;
|
||||||
in {
|
in {
|
||||||
config = mkMerge [
|
config = mkIf cfg.enable {
|
||||||
(mkIf cfg.enable {
|
vim = {
|
||||||
vim = {
|
startPlugins = ["nvim-lint"];
|
||||||
startPlugins = ["nvim-lint"];
|
pluginRC.nvim-lint = entryAnywhere ''
|
||||||
pluginRC.nvim-lint = entryAnywhere ''
|
require("lint").setup(${toLuaObject cfg.setupOpts})
|
||||||
require("lint").linters_by_ft = ${toLuaObject cfg.linters_by_ft}
|
'';
|
||||||
|
};
|
||||||
local linters = require("lint").linters
|
};
|
||||||
local nvf_linters = ${toLuaObject cfg.linters}
|
|
||||||
for linter, config in pairs(nvf_linters) do
|
|
||||||
if linters[linter] == nil then
|
|
||||||
linters[linter] = config
|
|
||||||
else
|
|
||||||
for key, val in pairs(config) do
|
|
||||||
linters[linter][key] = val
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
nvf_lint = ${toLuaObject cfg.lint_function}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
})
|
|
||||||
(mkIf (cfg.enable && cfg.lint_after_save) {
|
|
||||||
vim = {
|
|
||||||
augroups = [{name = "nvf_nvim_lint";}];
|
|
||||||
autocmds = [
|
|
||||||
{
|
|
||||||
event = ["BufWritePost"];
|
|
||||||
callback = mkLuaInline ''
|
|
||||||
function(args)
|
|
||||||
nvf_lint(args.buf)
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,187 +1,27 @@
|
||||||
{lib, ...}: let
|
{lib, ...}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
inherit (lib.types) nullOr attrsOf listOf str either submodule bool enum;
|
inherit (lib.types) attrsOf listOf str;
|
||||||
inherit (lib.nvim.types) luaInline;
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
inherit (lib.generators) mkLuaInline;
|
|
||||||
|
|
||||||
linterType = submodule {
|
|
||||||
options = {
|
|
||||||
name = mkOption {
|
|
||||||
type = nullOr str;
|
|
||||||
default = null;
|
|
||||||
description = "Name of the linter";
|
|
||||||
};
|
|
||||||
|
|
||||||
cmd = mkOption {
|
|
||||||
type = nullOr str;
|
|
||||||
default = null;
|
|
||||||
description = "Command of the linter";
|
|
||||||
};
|
|
||||||
|
|
||||||
args = mkOption {
|
|
||||||
type = nullOr (listOf (either str luaInline));
|
|
||||||
default = null;
|
|
||||||
description = "Arguments to pass";
|
|
||||||
};
|
|
||||||
|
|
||||||
stdin = mkOption {
|
|
||||||
type = nullOr bool;
|
|
||||||
default = null;
|
|
||||||
description = "Send content via stdin.";
|
|
||||||
};
|
|
||||||
|
|
||||||
append_fname = mkOption {
|
|
||||||
type = nullOr bool;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
Automatically add the current file name to the commands arguments. Only
|
|
||||||
has an effect if stdin is false
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
stream = mkOption {
|
|
||||||
type = nullOr (enum ["stdout" "stderr" "both"]);
|
|
||||||
default = null;
|
|
||||||
description = "Result stream";
|
|
||||||
};
|
|
||||||
|
|
||||||
ignore_exitcode = mkOption {
|
|
||||||
type = nullOr bool;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
Declares if exit code != 1 should be ignored or result in a warning.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
env = mkOption {
|
|
||||||
type = nullOr (attrsOf str);
|
|
||||||
default = null;
|
|
||||||
description = "Environment variables to use";
|
|
||||||
};
|
|
||||||
|
|
||||||
cwd = mkOption {
|
|
||||||
type = nullOr str;
|
|
||||||
default = null;
|
|
||||||
description = "Working directory of the linter";
|
|
||||||
};
|
|
||||||
|
|
||||||
parser = mkOption {
|
|
||||||
type = nullOr luaInline;
|
|
||||||
default = null;
|
|
||||||
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 {
|
||||||
options.vim.diagnostics.nvim-lint = {
|
options.vim.diagnostics.nvim-lint = {
|
||||||
enable = mkEnableOption "asynchronous linter plugin for Neovim [nvim-lint]";
|
enable = mkEnableOption "asynchronous linter plugin for Neovim [nvim-lint]";
|
||||||
|
setupOpts = mkPluginSetupOption "nvim-lint" {
|
||||||
|
linters_by_ft = mkOption {
|
||||||
|
type = attrsOf (listOf str);
|
||||||
|
default = {};
|
||||||
|
example = {
|
||||||
|
text = ["vale"];
|
||||||
|
markdown = ["vale"];
|
||||||
|
};
|
||||||
|
|
||||||
# nvim-lint does not have a setup table.
|
description = ''
|
||||||
linters_by_ft = mkOption {
|
Map of filetype to formatters. This option takes a set of
|
||||||
type = attrsOf (listOf str);
|
`key = value` format where the `value` will be converted
|
||||||
default = {};
|
to its Lua equivalent. You are responsible for passing the
|
||||||
example = {
|
correct Nix data types to generate a correct Lua value that
|
||||||
text = ["vale"];
|
conform is able to accept.
|
||||||
markdown = ["vale"];
|
'';
|
||||||
};
|
};
|
||||||
description = ''
|
|
||||||
Map of filetype to formatters. This option takes a set of `key = value`
|
|
||||||
format where the `value` will be converted to its Lua equivalent
|
|
||||||
through `toLuaObject. You are responsible for passing the correct Nix
|
|
||||||
data types to generate a correct Lua value that conform is able to
|
|
||||||
accept.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
linters = mkOption {
|
|
||||||
type = attrsOf linterType;
|
|
||||||
default = {};
|
|
||||||
example = ''
|
|
||||||
{
|
|
||||||
phpcs = {
|
|
||||||
args = ["-q" "--report-json" "-"];
|
|
||||||
|
|
||||||
# this will replace the builtin's env table if it exists
|
|
||||||
env = {
|
|
||||||
ENV_VAR = "something";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
description = ''
|
|
||||||
Linter configurations. Builtin linters will be updated and not
|
|
||||||
replaced, but note that this is not a deep extend operation, i.e. if
|
|
||||||
you define an `env` option, it will replace the entire `env` table
|
|
||||||
provided by the builtin (if it exists).
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
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,48 +683,15 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
git_placement = mkOption {
|
git_placement = mkOption {
|
||||||
type = enum ["before" "after" "signcolumn" "right_align"];
|
type = enum ["before" "after" "signcolumn"];
|
||||||
|
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" "right_align"];
|
type = enum ["before" "after" "signcolumn"];
|
||||||
|
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,9 +1,12 @@
|
||||||
{lib, ...}: let
|
{
|
||||||
inherit (lib.generators) mkLuaInline;
|
pkgs,
|
||||||
inherit (lib.options) mkOption mkEnableOption literalMD;
|
lib,
|
||||||
inherit (lib.types) attrs either nullOr;
|
...
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
}: let
|
||||||
inherit (lib.nvim.types) luaInline mkPluginSetupOption;
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
|
inherit (lib.types) attrs enum;
|
||||||
|
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]";
|
||||||
|
|
@ -28,46 +31,26 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
format_on_save = mkOption {
|
format_on_save = mkOption {
|
||||||
type = nullOr (either attrs luaInline);
|
type = attrs;
|
||||||
default = mkLuaInline ''
|
default = {
|
||||||
function()
|
lsp_format = "fallback";
|
||||||
if not vim.g.formatsave or vim.b.disableFormatSave then
|
timeout_ms = 500;
|
||||||
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 = ''
|
||||||
Attribute set or Lua function that will be passed to
|
Table that will be passed to `conform.format()`. If this
|
||||||
`conform.format()`. If this is set, Conform will run the formatter
|
is set, Conform will run the formatter on save.
|
||||||
on save.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
format_after_save = let
|
format_after_save = mkOption {
|
||||||
defaultFormatAfterSaveOpts = {lsp_format = "fallback";};
|
type = attrs;
|
||||||
in
|
default = {lsp_format = "fallback";};
|
||||||
mkOption {
|
description = ''
|
||||||
type = nullOr (either attrs luaInline);
|
Table that will be passed to `conform.format()`. If this
|
||||||
default = mkLuaInline ''
|
is set, Conform will run the formatter asynchronously after
|
||||||
function()
|
save.
|
||||||
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.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ in {
|
||||||
./gitsigns
|
./gitsigns
|
||||||
./vim-fugitive
|
./vim-fugitive
|
||||||
./git-conflict
|
./git-conflict
|
||||||
./gitlinker-nvim
|
|
||||||
];
|
];
|
||||||
|
|
||||||
options.vim.git = {
|
options.vim.git = {
|
||||||
|
|
@ -16,7 +15,6 @@ in {
|
||||||
* gitsigns
|
* gitsigns
|
||||||
* vim-fugitive
|
* vim-fugitive
|
||||||
* git-conflict
|
* git-conflict
|
||||||
* gitlinker-nvim
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
|
|
||||||
cfg = config.vim.git.gitlinker-nvim;
|
|
||||||
in {
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
vim = {
|
|
||||||
lazy.plugins = {
|
|
||||||
"gitlinker-nvim" = {
|
|
||||||
package = "gitlinker-nvim";
|
|
||||||
setupModule = "gitlinker";
|
|
||||||
inherit (cfg) setupOpts;
|
|
||||||
cmd = ["GitLink"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./config.nix
|
|
||||||
./gitlinker-nvim.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.options) mkEnableOption;
|
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
|
||||||
in {
|
|
||||||
options.vim.git.gitlinker-nvim = {
|
|
||||||
enable = mkEnableOption "gitlinker-nvim" // {default = config.vim.git.enable;};
|
|
||||||
setupOpts = mkPluginSetupOption "gitlinker-nvim" {};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) toJSON;
|
inherit (builtins) toJSON;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.generators) mkLuaInline;
|
|
||||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetExprBinding mkSetLuaBinding pushDownDefault;
|
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetExprBinding mkSetLuaBinding pushDownDefault;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
@ -33,7 +32,6 @@ in {
|
||||||
return '<Ignore>'
|
return '<Ignore>'
|
||||||
end
|
end
|
||||||
'')
|
'')
|
||||||
|
|
||||||
(mkSetExprBinding gsMappings.previousHunk ''
|
(mkSetExprBinding gsMappings.previousHunk ''
|
||||||
function()
|
function()
|
||||||
if vim.wo.diff then return ${toJSON gsMappings.previousHunk.value} end
|
if vim.wo.diff then return ${toJSON gsMappings.previousHunk.value} end
|
||||||
|
|
@ -79,14 +77,13 @@ in {
|
||||||
}
|
}
|
||||||
|
|
||||||
(mkIf cfg.codeActions.enable {
|
(mkIf cfg.codeActions.enable {
|
||||||
vim.lsp.null-ls = {
|
vim.lsp.null-ls.enable = true;
|
||||||
enable = true;
|
vim.lsp.null-ls.sources.gitsigns-ca = ''
|
||||||
setupOpts.sources = [
|
table.insert(
|
||||||
(mkLuaInline ''
|
ls_sources,
|
||||||
require("null-ls").builtins.code_actions.gitsigns
|
null_ls.builtins.code_actions.gitsigns
|
||||||
'')
|
)
|
||||||
];
|
'';
|
||||||
};
|
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Assembly LSP support (asm-lsp)" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "Assembly LSP support (asm-lsp)" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = package;
|
type = package;
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.types) enum either listOf package str;
|
inherit (lib.types) enum either listOf package str;
|
||||||
inherit (lib.generators) mkLuaInline;
|
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
|
inherit (lib.nvim.languages) diagnosticsToLua;
|
||||||
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
||||||
|
|
||||||
cfg = config.vim.languages.astro;
|
cfg = config.vim.languages.astro;
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
package = pkgs.astro-language-server;
|
package = pkgs.astro-language-server;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
lspconfig.astro.setup {
|
lspconfig.astro.setup {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities;
|
||||||
on_attach = attach_keymaps,
|
on_attach = attach_keymaps,
|
||||||
cmd = ${
|
cmd = ${
|
||||||
if isList cfg.lsp.package
|
if isList cfg.lsp.package
|
||||||
|
|
@ -39,35 +39,42 @@
|
||||||
formats = {
|
formats = {
|
||||||
prettier = {
|
prettier = {
|
||||||
package = pkgs.nodePackages.prettier;
|
package = pkgs.nodePackages.prettier;
|
||||||
};
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
prettierd = {
|
ls_sources,
|
||||||
package = pkgs.prettierd;
|
null_ls.builtins.formatting.prettier.with({
|
||||||
|
command = "${cfg.format.package}/bin/prettier",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
biome = {
|
biome = {
|
||||||
package = pkgs.biome;
|
package = pkgs.biome;
|
||||||
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.biome.with({
|
||||||
|
command = "${cfg.format.package}/bin/biome",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: specify packages
|
# TODO: specify packages
|
||||||
defaultDiagnosticsProvider = ["eslint_d"];
|
defaultDiagnosticsProvider = ["eslint_d"];
|
||||||
diagnosticsProviders = {
|
diagnosticsProviders = {
|
||||||
eslint_d = let
|
eslint_d = {
|
||||||
pkg = pkgs.eslint_d;
|
package = pkgs.eslint_d;
|
||||||
in {
|
nullConfig = pkg: ''
|
||||||
package = pkg;
|
table.insert(
|
||||||
config = {
|
ls_sources,
|
||||||
cmd = getExe pkg;
|
null_ls.builtins.diagnostics.eslint_d.with({
|
||||||
required_files = [
|
command = "${getExe pkg}",
|
||||||
"eslint.config.js"
|
})
|
||||||
"eslint.config.mjs"
|
)
|
||||||
".eslintrc"
|
'';
|
||||||
".eslintrc.json"
|
|
||||||
".eslintrc.js"
|
|
||||||
".eslintrc.yml"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|
@ -81,19 +88,19 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Astro LSP support" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "Astro LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
|
description = "Astro LSP server to use";
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
default = defaultServer;
|
default = defaultServer;
|
||||||
description = "Astro LSP server to use";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
|
description = "Astro LSP server package, or the command to run as a list of strings";
|
||||||
|
example = ''[lib.getExe pkgs.astro-language-server "--minify" "--stdio"]'';
|
||||||
type = either package (listOf str);
|
type = either package (listOf str);
|
||||||
default = servers.${cfg.lsp.server}.package;
|
default = servers.${cfg.lsp.server}.package;
|
||||||
example = ''[lib.getExe pkgs.astro-language-server "--minify" "--stdio"]'';
|
|
||||||
description = "Astro LSP server package, or the command to run as a list of strings";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -136,22 +143,16 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
(mkIf cfg.format.enable {
|
||||||
vim.formatter.conform-nvim = {
|
vim.lsp.null-ls.enable = true;
|
||||||
enable = true;
|
vim.lsp.null-ls.sources.astro-format = formats.${cfg.format.type}.nullConfig;
|
||||||
setupOpts.formatters_by_ft.astro = [cfg.format.type];
|
|
||||||
setupOpts.formatters.${cfg.format.type} = {
|
|
||||||
command = getExe cfg.format.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.extraDiagnostics.enable {
|
(mkIf cfg.extraDiagnostics.enable {
|
||||||
vim.diagnostics.nvim-lint = {
|
vim.lsp.null-ls.enable = true;
|
||||||
enable = true;
|
vim.lsp.null-ls.sources = diagnosticsToLua {
|
||||||
linters_by_ft.astro = cfg.extraDiagnostics.types;
|
lang = "astro";
|
||||||
linters =
|
config = cfg.extraDiagnostics.types;
|
||||||
mkMerge (map (name: {${name} = diagnosticsProviders.${name}.config;})
|
inherit diagnosticsProviders;
|
||||||
cfg.extraDiagnostics.types);
|
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,10 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
inherit (lib.meta) getExe;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.types) enum either package listOf str bool;
|
inherit (lib.types) enum either package listOf str bool;
|
||||||
|
inherit (lib.nvim.languages) diagnosticsToLua;
|
||||||
inherit (lib.nvim.types) diagnostics mkGrammarOption;
|
inherit (lib.nvim.types) diagnostics mkGrammarOption;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
|
|
||||||
|
|
@ -37,6 +37,14 @@
|
||||||
formats = {
|
formats = {
|
||||||
shfmt = {
|
shfmt = {
|
||||||
package = pkgs.shfmt;
|
package = pkgs.shfmt;
|
||||||
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.shfmt.with({
|
||||||
|
command = "${pkgs.shfmt}/bin/shfmt",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -44,6 +52,15 @@
|
||||||
diagnosticsProviders = {
|
diagnosticsProviders = {
|
||||||
shellcheck = {
|
shellcheck = {
|
||||||
package = pkgs.shellcheck;
|
package = pkgs.shellcheck;
|
||||||
|
nullConfig = pkg: ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.diagnostics.shellcheck.with({
|
||||||
|
command = "${pkg}/bin/shellcheck",
|
||||||
|
diagnostics_format = "#{m} [#{c}]"
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|
@ -56,7 +73,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Enable Bash LSP support" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "Enable Bash LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Bash LSP server to use";
|
description = "Bash LSP server to use";
|
||||||
|
|
@ -113,23 +130,16 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
(mkIf cfg.format.enable {
|
||||||
vim.formatter.conform-nvim = {
|
vim.lsp.null-ls.enable = true;
|
||||||
enable = true;
|
vim.lsp.null-ls.sources.bash-format = formats.${cfg.format.type}.nullConfig;
|
||||||
setupOpts.formatters_by_ft.sh = [cfg.format.type];
|
|
||||||
setupOpts.formatters.${cfg.format.type} = {
|
|
||||||
command = getExe cfg.format.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.extraDiagnostics.enable {
|
(mkIf cfg.extraDiagnostics.enable {
|
||||||
vim.diagnostics.nvim-lint = {
|
vim.lsp.null-ls.enable = true;
|
||||||
enable = true;
|
vim.lsp.null-ls.sources = diagnosticsToLua {
|
||||||
linters_by_ft.sh = cfg.extraDiagnostics.types;
|
lang = "bash";
|
||||||
linters = mkMerge (map (name: {
|
config = cfg.extraDiagnostics.types;
|
||||||
${name}.cmd = getExe diagnosticsProviders.${name}.package;
|
inherit diagnosticsProviders;
|
||||||
})
|
|
||||||
cfg.extraDiagnostics.types);
|
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "clang LSP support" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "clang LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "The clang LSP server to use";
|
description = "The clang LSP server to use";
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "C# LSP support" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "C# LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "C# LSP server to use";
|
description = "C# LSP server to use";
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.meta) getExe;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.types) enum either listOf package str;
|
inherit (lib.types) enum either listOf package str;
|
||||||
|
|
@ -43,6 +42,14 @@
|
||||||
formats = {
|
formats = {
|
||||||
prettier = {
|
prettier = {
|
||||||
package = pkgs.nodePackages.prettier;
|
package = pkgs.nodePackages.prettier;
|
||||||
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.prettier.with({
|
||||||
|
command = "${cfg.format.package}/bin/prettier",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
prettierd = {
|
prettierd = {
|
||||||
|
|
@ -80,7 +87,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "CSS LSP support" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "CSS LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "CSS LSP server to use";
|
description = "CSS LSP server to use";
|
||||||
|
|
@ -125,13 +132,8 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
(mkIf cfg.format.enable {
|
||||||
vim.formatter.conform-nvim = {
|
vim.lsp.null-ls.enable = true;
|
||||||
enable = true;
|
vim.lsp.null-ls.sources.css-format = formats.${cfg.format.type}.nullConfig;
|
||||||
setupOpts.formatters_by_ft.css = [cfg.format.type];
|
|
||||||
setupOpts.formatters.${cfg.format.type} = {
|
|
||||||
command = getExe cfg.format.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.types) package;
|
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
|
||||||
|
|
||||||
cfg = config.vim.languages.cue;
|
|
||||||
in {
|
|
||||||
options.vim.languages.cue = {
|
|
||||||
enable = mkEnableOption "CUE language support";
|
|
||||||
|
|
||||||
treesitter = {
|
|
||||||
enable = mkEnableOption "CUE treesitter" // {default = config.vim.languages.enableTreesitter;};
|
|
||||||
|
|
||||||
package = mkGrammarOption pkgs "cue";
|
|
||||||
};
|
|
||||||
|
|
||||||
lsp = {
|
|
||||||
enable = mkEnableOption "CUE LSP support" // {default = config.vim.lsp.enable;};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
type = package;
|
|
||||||
default = pkgs.cue;
|
|
||||||
description = "cue lsp implementation";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
|
||||||
(mkIf cfg.treesitter.enable {
|
|
||||||
vim.treesitter.enable = true;
|
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
|
||||||
vim.lsp.lspconfig.enable = true;
|
|
||||||
vim.lsp.lspconfig.sources.cue-lsp = ''
|
|
||||||
lspconfig.cue.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = default_on_attach,
|
|
||||||
cmd = {"${cfg.lsp.package}/bin/cue", "lsp"},
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
inherit (lib.nvim.dag) entryAfter;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
cfg = config.vim.languages.dart;
|
cfg = config.vim.languages.dart;
|
||||||
ftcfg = cfg.flutter-tools;
|
ftcfg = cfg.flutter-tools;
|
||||||
|
|
@ -77,29 +77,20 @@ in {
|
||||||
flutter-tools = {
|
flutter-tools = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = config.vim.lsp.enable;
|
default = config.vim.languages.enableLSP;
|
||||||
description = "Enable flutter-tools for flutter support";
|
description = "Enable flutter-tools for flutter support";
|
||||||
};
|
};
|
||||||
|
|
||||||
flutterPackage = mkOption {
|
|
||||||
type = nullOr package;
|
|
||||||
default = pkgs.flutter;
|
|
||||||
description = "Flutter package, or null to detect the flutter path at runtime instead.";
|
|
||||||
};
|
|
||||||
|
|
||||||
enableNoResolvePatch = mkOption {
|
enableNoResolvePatch = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = false;
|
default = true;
|
||||||
description = ''
|
description = ''
|
||||||
Whether to patch flutter-tools so that it doesn't resolve
|
Whether to patch flutter-tools so that it doesn't resolve
|
||||||
symlinks when detecting flutter path.
|
symlinks when detecting flutter path.
|
||||||
|
|
||||||
::: {.note}
|
This is required if you want to use a flutter package built with nix.
|
||||||
This is required if `flutterPackage` is set to null and the flutter
|
If you are using a flutter SDK installed from a different source
|
||||||
package in your `PATH` was built with Nix. If you are using a flutter
|
and encounter the error "`dart` missing from PATH", disable this option.
|
||||||
SDK installed from a different source and encounter the error "`dart`
|
|
||||||
missing from `PATH`", leave this option disabled.
|
|
||||||
:::
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -131,30 +122,25 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config.vim = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
(mkIf cfg.treesitter.enable {
|
(mkIf cfg.treesitter.enable {
|
||||||
treesitter.enable = true;
|
vim.treesitter.enable = true;
|
||||||
treesitter.grammars = [cfg.treesitter.package];
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
(mkIf cfg.lsp.enable {
|
||||||
lsp.lspconfig.enable = true;
|
vim.lsp.lspconfig.enable = true;
|
||||||
lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig;
|
vim.lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf ftcfg.enable {
|
(mkIf ftcfg.enable {
|
||||||
startPlugins = [
|
vim.startPlugins =
|
||||||
(
|
if ftcfg.enableNoResolvePatch
|
||||||
if ftcfg.enableNoResolvePatch
|
then ["flutter-tools-patched"]
|
||||||
then "flutter-tools-patched"
|
else ["flutter-tools-nvim"];
|
||||||
else "flutter-tools-nvim"
|
|
||||||
)
|
|
||||||
"plenary-nvim"
|
|
||||||
];
|
|
||||||
|
|
||||||
pluginRC.flutter-tools = entryAfter ["lsp-setup"] ''
|
vim.pluginRC.flutter-tools = entryAnywhere ''
|
||||||
require('flutter-tools').setup {
|
require('flutter-tools').setup {
|
||||||
${optionalString (ftcfg.flutterPackage != null) "flutter_path = \"${ftcfg.flutterPackage}/bin/flutter\","}
|
|
||||||
lsp = {
|
lsp = {
|
||||||
color = { -- show the derived colours for dart variables
|
color = { -- show the derived colours for dart variables
|
||||||
enabled = ${boolToString ftcfg.color.enable}, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10
|
enabled = ${boolToString ftcfg.color.enable}, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10
|
||||||
|
|
@ -166,6 +152,7 @@ in {
|
||||||
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = default_on_attach;
|
on_attach = default_on_attach;
|
||||||
|
flags = lsp_flags,
|
||||||
},
|
},
|
||||||
${optionalString cfg.dap.enable ''
|
${optionalString cfg.dap.enable ''
|
||||||
debugger = {
|
debugger = {
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,17 @@
|
||||||
{lib, ...}: let
|
{lib, ...}: let
|
||||||
inherit (lib.modules) mkRenamedOptionModule;
|
|
||||||
inherit (lib.nvim.languages) mkEnable;
|
inherit (lib.nvim.languages) mkEnable;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./asm.nix
|
./asm.nix
|
||||||
./astro.nix
|
./astro.nix
|
||||||
./bash.nix
|
./bash.nix
|
||||||
./cue.nix
|
|
||||||
./dart.nix
|
./dart.nix
|
||||||
./clang.nix
|
./clang.nix
|
||||||
./css.nix
|
./css.nix
|
||||||
./elixir.nix
|
./elixir.nix
|
||||||
./fsharp.nix
|
|
||||||
./gleam.nix
|
./gleam.nix
|
||||||
./go.nix
|
./go.nix
|
||||||
./hcl.nix
|
./hcl.nix
|
||||||
./helm.nix
|
|
||||||
./kotlin.nix
|
./kotlin.nix
|
||||||
./html.nix
|
./html.nix
|
||||||
./haskell.nix
|
./haskell.nix
|
||||||
|
|
@ -45,13 +41,10 @@ in {
|
||||||
./wgsl.nix
|
./wgsl.nix
|
||||||
./yaml.nix
|
./yaml.nix
|
||||||
./ruby.nix
|
./ruby.nix
|
||||||
|
|
||||||
# This is now a hard deprecation.
|
|
||||||
(mkRenamedOptionModule ["vim" "languages" "enableLSP"] ["vim" "lsp" "enable"])
|
|
||||||
];
|
];
|
||||||
|
|
||||||
options.vim.languages = {
|
options.vim.languages = {
|
||||||
# Those are still managed by plugins, and should be enabled here.
|
enableLSP = mkEnable "LSP";
|
||||||
enableDAP = mkEnable "Debug Adapter";
|
enableDAP = mkEnable "Debug Adapter";
|
||||||
enableTreesitter = mkEnable "Treesitter";
|
enableTreesitter = mkEnable "Treesitter";
|
||||||
enableFormat = mkEnable "Formatting";
|
enableFormat = mkEnable "Formatting";
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,14 @@
|
||||||
formats = {
|
formats = {
|
||||||
mix = {
|
mix = {
|
||||||
package = pkgs.elixir;
|
package = pkgs.elixir;
|
||||||
config = {
|
nullConfig = ''
|
||||||
command = "${cfg.format.package}/bin/mix";
|
table.insert(
|
||||||
};
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.mix.with({
|
||||||
|
command = "${cfg.format.package}/bin/mix",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|
@ -53,7 +58,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Elixir LSP support" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "Elixir LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Elixir LSP server to use";
|
description = "Elixir LSP server to use";
|
||||||
|
|
@ -102,12 +107,8 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
(mkIf cfg.format.enable {
|
||||||
vim.formatter.conform-nvim = {
|
vim.lsp.null-ls.enable = true;
|
||||||
enable = true;
|
vim.lsp.null-ls.sources.elixir-format = formats.${cfg.format.type}.nullConfig;
|
||||||
setupOpts.formatters_by_ft.elixir = [cfg.format.type];
|
|
||||||
setupOpts.formatters.${cfg.format.type} =
|
|
||||||
formats.${cfg.format.type}.config;
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.elixir-tools.enable {
|
(mkIf cfg.elixir-tools.enable {
|
||||||
|
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (builtins) attrNames;
|
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
|
||||||
inherit (lib.types) either listOf package str enum;
|
|
||||||
inherit (lib.meta) getExe;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.lists) isList;
|
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
|
||||||
inherit (lib.nvim.lua) expToLua;
|
|
||||||
|
|
||||||
defaultServer = "fsautocomplete";
|
|
||||||
servers = {
|
|
||||||
fsautocomplete = {
|
|
||||||
package = pkgs.fsautocomplete;
|
|
||||||
internalFormatter = false;
|
|
||||||
lspConfig = ''
|
|
||||||
lspconfig.fsautocomplete.setup {
|
|
||||||
capabilities = capabilities;
|
|
||||||
on_attach = default_on_attach;
|
|
||||||
cmd = ${
|
|
||||||
if isList cfg.lsp.package
|
|
||||||
then expToLua cfg.lsp.package
|
|
||||||
else "{'${cfg.lsp.package}/bin/fsautocomplete'}"
|
|
||||||
},
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
defaultFormat = "fantomas";
|
|
||||||
formats = {
|
|
||||||
fantomas = {
|
|
||||||
package = pkgs.fantomas;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
cfg = config.vim.languages.fsharp;
|
|
||||||
in {
|
|
||||||
options = {
|
|
||||||
vim.languages.fsharp = {
|
|
||||||
enable = mkEnableOption "F# language support";
|
|
||||||
|
|
||||||
treesitter = {
|
|
||||||
enable = mkEnableOption "F# treesitter" // {default = config.vim.languages.enableTreesitter;};
|
|
||||||
package = mkGrammarOption pkgs "fsharp";
|
|
||||||
};
|
|
||||||
|
|
||||||
lsp = {
|
|
||||||
enable = mkEnableOption "F# LSP support" // {default = config.vim.lsp.enable;};
|
|
||||||
server = mkOption {
|
|
||||||
type = enum (attrNames servers);
|
|
||||||
default = defaultServer;
|
|
||||||
description = "F# LSP server to use";
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
type = either package (listOf str);
|
|
||||||
default = servers.${cfg.lsp.server}.package;
|
|
||||||
example = ''[lib.getExe pkgs.fsautocomplete "--state-directory" "~/.cache/fsautocomplete"]'';
|
|
||||||
description = "F# LSP server package, or the command to run as a list of strings";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
format = {
|
|
||||||
enable = mkEnableOption "F# formatting" // {default = config.vim.languages.enableFormat;};
|
|
||||||
|
|
||||||
type = mkOption {
|
|
||||||
type = enum (attrNames formats);
|
|
||||||
default = defaultFormat;
|
|
||||||
description = "F# formatter to use";
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
type = package;
|
|
||||||
default = formats.${cfg.format.type}.package;
|
|
||||||
description = "F# formatter package";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
|
||||||
(mkIf cfg.treesitter.enable {
|
|
||||||
vim.treesitter.enable = true;
|
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
|
||||||
vim.lsp.lspconfig.enable = true;
|
|
||||||
vim.lsp.lspconfig.sources.fsharp-lsp = servers.${cfg.lsp.server}.lspConfig;
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
|
||||||
vim.formatter.conform-nvim = {
|
|
||||||
enable = true;
|
|
||||||
setupOpts.formatters_by_ft.fsharp = [cfg.format.type];
|
|
||||||
setupOpts.formatters.${cfg.format.type} = {
|
|
||||||
command = getExe cfg.format.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
@ -41,7 +41,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Gleam LSP support" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "Gleam LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.options) mkEnableOption mkOption literalMD;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
|
|
@ -38,15 +38,36 @@
|
||||||
formats = {
|
formats = {
|
||||||
gofmt = {
|
gofmt = {
|
||||||
package = pkgs.go;
|
package = pkgs.go;
|
||||||
config.command = "${cfg.format.package}/bin/gofmt";
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.gofmt.with({
|
||||||
|
command = "${cfg.format.package}/bin/gofmt",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
gofumpt = {
|
gofumpt = {
|
||||||
package = pkgs.gofumpt;
|
package = pkgs.gofumpt;
|
||||||
config.command = getExe cfg.format.package;
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.gofumpt.with({
|
||||||
|
command = "${cfg.format.package}/bin/gofumpt",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
golines = {
|
golines = {
|
||||||
package = pkgs.golines;
|
package = pkgs.golines;
|
||||||
config.command = "${cfg.format.package}/bin/golines";
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.golines.with({
|
||||||
|
command = "${cfg.format.package}/bin/golines",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -67,7 +88,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Go LSP support" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "Go LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Go LSP server to use";
|
description = "Go LSP server to use";
|
||||||
|
|
@ -84,14 +105,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
format = {
|
format = {
|
||||||
enable =
|
enable = mkEnableOption "Go formatting" // {default = config.vim.languages.enableFormat;};
|
||||||
mkEnableOption "Go formatting"
|
|
||||||
// {
|
|
||||||
default = !cfg.lsp.enable && config.vim.languages.enableFormat;
|
|
||||||
defaultText = literalMD ''
|
|
||||||
disabled if Go LSP is enabled, otherwise follows {option}`vim.languages.enableFormat`
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
type = mkOption {
|
type = mkOption {
|
||||||
description = "Go formatter to use";
|
description = "Go formatter to use";
|
||||||
|
|
@ -139,11 +153,8 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
(mkIf cfg.format.enable {
|
||||||
vim.formatter.conform-nvim = {
|
vim.lsp.null-ls.enable = true;
|
||||||
enable = true;
|
vim.lsp.null-ls.sources.go-format = formats.${cfg.format.type}.nullConfig;
|
||||||
setupOpts.formatters_by_ft.go = [cfg.format.type];
|
|
||||||
setupOpts.formatters.${cfg.format.type} = formats.${cfg.format.type}.config;
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.dap.enable {
|
(mkIf cfg.dap.enable {
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "LSP support for Haskell" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "LSP support for Haskell" // {default = config.vim.languages.enableLSP;};
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "Haskell LSP package or command to run the Haskell LSP";
|
description = "Haskell LSP package or command to run the Haskell LSP";
|
||||||
example = ''[ (lib.getExe pkgs.haskellPackages.haskell-language-server) "--debug" ]'';
|
example = ''[ (lib.getExe pkgs.haskellPackages.haskell-language-server) "--debug" ]'';
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.meta) getExe;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.types) package bool enum;
|
inherit (lib.types) package bool enum;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
|
|
@ -31,6 +30,14 @@
|
||||||
formats = {
|
formats = {
|
||||||
hclfmt = {
|
hclfmt = {
|
||||||
package = pkgs.hclfmt;
|
package = pkgs.hclfmt;
|
||||||
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.hclfmt.with({
|
||||||
|
command = "${lib.getExe cfg.format.package}",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|
@ -43,7 +50,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "HCL LSP support (terraform-ls)" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "HCL LSP support (terraform-ls)" // {default = config.vim.languages.enableLSP;};
|
||||||
# TODO: (maybe, is it better?) it would be cooler to use vscode-extensions.hashicorp.hcl probably, shouldn't be too hard
|
# TODO: (maybe, is it better?) it would be cooler to use vscode-extensions.hashicorp.hcl probably, shouldn't be too hard
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = package;
|
type = package;
|
||||||
|
|
@ -103,13 +110,8 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
(mkIf cfg.format.enable {
|
||||||
vim.formatter.conform-nvim = {
|
vim.lsp.null-ls.enable = true;
|
||||||
enable = true;
|
vim.lsp.null-ls.sources.hcl-format = formats.${cfg.format.type}.nullConfig;
|
||||||
setupOpts.formatters_by_ft.hcl = [cfg.format.type];
|
|
||||||
setupOpts.formatters.${cfg.format.type} = {
|
|
||||||
command = getExe cfg.format.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (builtins) attrNames;
|
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.lists) isList;
|
|
||||||
inherit (lib.types) enum either listOf package str;
|
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
|
||||||
inherit (lib.nvim.lua) expToLua;
|
|
||||||
|
|
||||||
cfg = config.vim.languages.helm;
|
|
||||||
yamlCfg = config.vim.languages.yaml;
|
|
||||||
|
|
||||||
helmCmd =
|
|
||||||
if isList cfg.lsp.package
|
|
||||||
then cfg.lsp.package
|
|
||||||
else ["${cfg.lsp.package}/bin/helm_ls" "serve"];
|
|
||||||
yamlCmd =
|
|
||||||
if isList yamlCfg.lsp.package
|
|
||||||
then builtins.elemAt yamlCfg.lsp.package 0
|
|
||||||
else "${yamlCfg.lsp.package}/bin/yaml-language-server";
|
|
||||||
|
|
||||||
defaultServer = "helm-ls";
|
|
||||||
servers = {
|
|
||||||
helm-ls = {
|
|
||||||
package = pkgs.helm-ls;
|
|
||||||
lspConfig = ''
|
|
||||||
lspconfig.helm_ls.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = default_on_attach,
|
|
||||||
cmd = ${expToLua helmCmd},
|
|
||||||
settings = {
|
|
||||||
['helm-ls'] = {
|
|
||||||
yamlls = {
|
|
||||||
path = "${yamlCmd}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
options.vim.languages.helm = {
|
|
||||||
enable = mkEnableOption "Helm language support";
|
|
||||||
|
|
||||||
treesitter = {
|
|
||||||
enable = mkEnableOption "Helm treesitter" // {default = config.vim.languages.enableTreesitter;};
|
|
||||||
package = mkGrammarOption pkgs "helm";
|
|
||||||
};
|
|
||||||
|
|
||||||
lsp = {
|
|
||||||
enable = mkEnableOption "Helm LSP support" // {default = config.vim.lsp.enable;};
|
|
||||||
|
|
||||||
server = mkOption {
|
|
||||||
description = "Helm LSP server to use";
|
|
||||||
type = enum (attrNames servers);
|
|
||||||
default = defaultServer;
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
description = "Helm LSP server package";
|
|
||||||
type = either package (listOf str);
|
|
||||||
default = servers.${cfg.lsp.server}.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
|
||||||
(mkIf cfg.treesitter.enable {
|
|
||||||
vim.treesitter.enable = true;
|
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
|
||||||
vim.lsp.lspconfig.enable = true;
|
|
||||||
vim.lsp.lspconfig.sources.helm-lsp = servers.${cfg.lsp.server}.lspConfig;
|
|
||||||
})
|
|
||||||
|
|
||||||
{
|
|
||||||
# Enables filetype detection
|
|
||||||
vim.startPlugins = [pkgs.vimPlugins.vim-helm];
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
@ -23,7 +23,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Java LSP support (java-language-server)" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "Java LSP support (java-language-server)" // {default = config.vim.languages.enableLSP;};
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "java language server package, or the command to run as a list of strings";
|
description = "java language server package, or the command to run as a list of strings";
|
||||||
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ in {
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = config.vim.lsp.enable;
|
default = config.vim.languages.enableLSP;
|
||||||
description = ''
|
description = ''
|
||||||
Whether to enable Julia LSP support.
|
Whether to enable Julia LSP support.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
|
inherit (lib.nvim.languages) diagnosticsToLua;
|
||||||
inherit (lib.types) either package listOf str;
|
inherit (lib.types) either package listOf str;
|
||||||
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
|
|
@ -18,6 +19,14 @@
|
||||||
diagnosticsProviders = {
|
diagnosticsProviders = {
|
||||||
ktlint = {
|
ktlint = {
|
||||||
package = pkgs.ktlint;
|
package = pkgs.ktlint;
|
||||||
|
nullConfig = pkg: ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.diagnostics.ktlint.with({
|
||||||
|
command = "${getExe pkg}",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|
@ -30,7 +39,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Kotlin LSP support" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "Kotlin LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "kotlin_language_server package with Kotlin runtime";
|
description = "kotlin_language_server package with Kotlin runtime";
|
||||||
|
|
@ -67,13 +76,11 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.extraDiagnostics.enable {
|
(mkIf cfg.extraDiagnostics.enable {
|
||||||
vim.diagnostics.nvim-lint = {
|
vim.lsp.null-ls.enable = true;
|
||||||
enable = true;
|
vim.lsp.null-ls.sources = diagnosticsToLua {
|
||||||
linters_by_ft.kotlin = cfg.extraDiagnostics.types;
|
lang = "kotlin";
|
||||||
linters = mkMerge (map (name: {
|
config = cfg.extraDiagnostics.types;
|
||||||
${name}.cmd = getExe diagnosticsProviders.${name}.package;
|
inherit diagnosticsProviders;
|
||||||
})
|
|
||||||
cfg.extraDiagnostics.types);
|
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,30 +4,16 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.types) bool either enum listOf package str;
|
inherit (lib.types) either listOf package str;
|
||||||
inherit (lib.nvim.types) diagnostics mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.nvim.dag) entryBefore;
|
inherit (lib.nvim.dag) entryBefore;
|
||||||
|
|
||||||
cfg = config.vim.languages.lua;
|
cfg = config.vim.languages.lua;
|
||||||
defaultFormat = "stylua";
|
|
||||||
formats = {
|
|
||||||
stylua = {
|
|
||||||
package = pkgs.stylua;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
defaultDiagnosticsProvider = ["luacheck"];
|
|
||||||
diagnosticsProviders = {
|
|
||||||
luacheck = {
|
|
||||||
package = pkgs.luajitPackages.luacheck;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
(lib.mkRemovedOptionModule ["vim" "languages" "lua" "lsp" "neodev"] ''
|
(lib.mkRemovedOptionModule ["vim" "languages" "lua" "lsp" "neodev"] ''
|
||||||
|
|
@ -43,7 +29,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Lua LSP support via LuaLS" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "Lua LSP support via LuaLS" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "LuaLS package, or the command to run as a list of strings";
|
description = "LuaLS package, or the command to run as a list of strings";
|
||||||
|
|
@ -53,34 +39,6 @@ in {
|
||||||
|
|
||||||
lazydev.enable = mkEnableOption "lazydev.nvim integration, useful for neovim plugin developers";
|
lazydev.enable = mkEnableOption "lazydev.nvim integration, useful for neovim plugin developers";
|
||||||
};
|
};
|
||||||
|
|
||||||
format = {
|
|
||||||
enable = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = config.vim.languages.enableFormat;
|
|
||||||
description = "Enable Lua formatting";
|
|
||||||
};
|
|
||||||
type = mkOption {
|
|
||||||
type = enum (attrNames formats);
|
|
||||||
default = defaultFormat;
|
|
||||||
description = "Lua formatter to use";
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
type = package;
|
|
||||||
default = formats.${cfg.format.type}.package;
|
|
||||||
description = "Lua formatter package";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
extraDiagnostics = {
|
|
||||||
enable = mkEnableOption "extra Lua diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
|
|
||||||
types = diagnostics {
|
|
||||||
langDesc = "Lua";
|
|
||||||
inherit diagnosticsProviders;
|
|
||||||
inherit defaultDiagnosticsProvider;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkMerge [
|
config = mkMerge [
|
||||||
|
|
@ -116,27 +74,6 @@ in {
|
||||||
})
|
})
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
|
||||||
vim.formatter.conform-nvim = {
|
|
||||||
enable = true;
|
|
||||||
setupOpts.formatters_by_ft.lua = [cfg.format.type];
|
|
||||||
setupOpts.formatters.${cfg.format.type} = {
|
|
||||||
command = getExe cfg.format.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.extraDiagnostics.enable {
|
|
||||||
vim.diagnostics.nvim-lint = {
|
|
||||||
enable = true;
|
|
||||||
linters_by_ft.lua = cfg.extraDiagnostics.types;
|
|
||||||
linters = mkMerge (map (name: {
|
|
||||||
${name}.cmd = getExe diagnosticsProviders.${name}.package;
|
|
||||||
})
|
|
||||||
cfg.extraDiagnostics.types);
|
|
||||||
};
|
|
||||||
})
|
|
||||||
]))
|
]))
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,12 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.meta) getExe;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList concatLists;
|
||||||
inherit (lib.types) bool enum either package listOf str nullOr;
|
inherit (lib.types) bool enum either package listOf str;
|
||||||
inherit (lib.nvim.lua) expToLua toLuaObject;
|
inherit (lib.nvim.lua) expToLua toLuaObject;
|
||||||
inherit (lib.nvim.types) diagnostics mkGrammarOption mkPluginSetupOption;
|
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
cfg = config.vim.languages.markdown;
|
cfg = config.vim.languages.markdown;
|
||||||
|
|
@ -33,23 +32,31 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultFormat = "deno_fmt";
|
defaultFormat = "denofmt";
|
||||||
formats = {
|
formats = {
|
||||||
# for backwards compatibility
|
|
||||||
denofmt = {
|
denofmt = {
|
||||||
package = pkgs.deno;
|
package = pkgs.deno;
|
||||||
};
|
nullConfig = ''
|
||||||
deno_fmt = {
|
table.insert(
|
||||||
package = pkgs.deno;
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.deno_fmt.with({
|
||||||
|
filetypes = ${expToLua (concatLists [cfg.format.extraFiletypes ["markdown"]])},
|
||||||
|
command = "${cfg.format.package}/bin/deno",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
prettierd = {
|
prettierd = {
|
||||||
package = pkgs.prettierd;
|
package = pkgs.prettierd;
|
||||||
};
|
nullConfig = ''
|
||||||
};
|
table.insert(
|
||||||
defaultDiagnosticsProvider = ["markdownlint-cli2"];
|
ls_sources,
|
||||||
diagnosticsProviders = {
|
null_ls.builtins.formatting.prettierd.with({
|
||||||
markdownlint-cli2 = {
|
filetypes = ${expToLua (concatLists [cfg.format.extraFiletypes ["markdown"]])},
|
||||||
package = pkgs.markdownlint-cli2;
|
command = "${cfg.format.package}/bin/prettierd",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|
@ -67,7 +74,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Enable Markdown LSP support" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "Enable Markdown LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
|
|
@ -89,7 +96,7 @@ in {
|
||||||
type = mkOption {
|
type = mkOption {
|
||||||
type = enum (attrNames formats);
|
type = enum (attrNames formats);
|
||||||
default = defaultFormat;
|
default = defaultFormat;
|
||||||
description = "Markdown formatter to use. `denofmt` is deprecated and currently aliased to deno_fmt.";
|
description = "Markdown formatter to use";
|
||||||
};
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
|
|
@ -114,19 +121,15 @@ in {
|
||||||
[render-markdown.nvim]: https://github.com/MeanderingProgrammer/render-markdown.nvim
|
[render-markdown.nvim]: https://github.com/MeanderingProgrammer/render-markdown.nvim
|
||||||
|
|
||||||
Inline Markdown rendering with [render-markdown.nvim]
|
Inline Markdown rendering with [render-markdown.nvim]
|
||||||
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
setupOpts = mkPluginSetupOption "render-markdown" {
|
setupOpts = mkPluginSetupOption "render-markdown" {
|
||||||
file_types = lib.mkOption {
|
auto_override_publish_diagnostics = mkOption {
|
||||||
type = nullOr (listOf str);
|
description = "Automatically override the publish_diagnostics handler";
|
||||||
default = null;
|
type = bool;
|
||||||
description = ''
|
default = true;
|
||||||
List of buffer filetypes to enable this plugin in.
|
|
||||||
|
|
||||||
This will cause the plugin to attach to new buffers who
|
|
||||||
have any of these filetypes.
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -143,15 +146,6 @@ in {
|
||||||
setupOpts = mkPluginSetupOption "markview-nvim" {};
|
setupOpts = mkPluginSetupOption "markview-nvim" {};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
extraDiagnostics = {
|
|
||||||
enable = mkEnableOption "extra Markdown diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
|
|
||||||
types = diagnostics {
|
|
||||||
langDesc = "Markdown";
|
|
||||||
inherit diagnosticsProviders;
|
|
||||||
inherit defaultDiagnosticsProvider;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
|
@ -166,17 +160,8 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
(mkIf cfg.format.enable {
|
||||||
vim.formatter.conform-nvim = {
|
vim.lsp.null-ls.enable = true;
|
||||||
enable = true;
|
vim.lsp.null-ls.sources.markdown-format = formats.${cfg.format.type}.nullConfig;
|
||||||
setupOpts.formatters_by_ft.markdown = [cfg.format.type];
|
|
||||||
setupOpts.formatters.${
|
|
||||||
if cfg.format.type == "denofmt"
|
|
||||||
then "deno_fmt"
|
|
||||||
else cfg.format.type
|
|
||||||
} = {
|
|
||||||
command = getExe cfg.format.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
|
|
||||||
# Extensions
|
# Extensions
|
||||||
|
|
@ -193,16 +178,5 @@ in {
|
||||||
require("markview").setup(${toLuaObject cfg.extensions.markview-nvim.setupOpts})
|
require("markview").setup(${toLuaObject cfg.extensions.markview-nvim.setupOpts})
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.extraDiagnostics.enable {
|
|
||||||
vim.diagnostics.nvim-lint = {
|
|
||||||
enable = true;
|
|
||||||
linters_by_ft.markdown = cfg.extraDiagnostics.types;
|
|
||||||
linters = mkMerge (map (name: {
|
|
||||||
${name}.cmd = getExe diagnosticsProviders.${name}.package;
|
|
||||||
})
|
|
||||||
cfg.extraDiagnostics.types);
|
|
||||||
};
|
|
||||||
})
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.meta) getExe;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.types) enum either listOf package str;
|
inherit (lib.types) enum either listOf package str;
|
||||||
|
|
@ -39,9 +38,14 @@
|
||||||
formats = {
|
formats = {
|
||||||
nimpretty = {
|
nimpretty = {
|
||||||
package = pkgs.nim;
|
package = pkgs.nim;
|
||||||
config = {
|
nullConfig = ''
|
||||||
command = "${cfg.format.package}/bin/nimpretty";
|
table.insert(
|
||||||
};
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.nimpretty.with({
|
||||||
|
command = "${pkgs.nim}/bin/nimpretty",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|
@ -54,7 +58,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Nim LSP support" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "Nim LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Nim LSP server to use";
|
description = "Nim LSP server to use";
|
||||||
type = str;
|
type = str;
|
||||||
|
|
@ -106,11 +110,8 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
(mkIf cfg.format.enable {
|
||||||
vim.formatter.conform-nvim = {
|
vim.lsp.null-ls.enable = true;
|
||||||
enable = true;
|
vim.lsp.null-ls.sources.nim-format = formats.${cfg.format.type}.nullConfig;
|
||||||
setupOpts.formatters_by_ft.nim = [cfg.format.type];
|
|
||||||
setupOpts.formatters.${cfg.format.type} = formats.${cfg.format.type}.config;
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,10 @@
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
inputs,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib) concatStringsSep;
|
inherit (lib) concatStringsSep;
|
||||||
inherit (lib.meta) getExe;
|
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
|
|
@ -15,6 +13,7 @@
|
||||||
inherit (lib.types) anything attrsOf enum either listOf nullOr package str;
|
inherit (lib.types) anything attrsOf enum either listOf nullOr package str;
|
||||||
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
||||||
inherit (lib.nvim.lua) expToLua toLuaObject;
|
inherit (lib.nvim.lua) expToLua toLuaObject;
|
||||||
|
inherit (lib.nvim.languages) diagnosticsToLua;
|
||||||
|
|
||||||
cfg = config.vim.languages.nix;
|
cfg = config.vim.languages.nix;
|
||||||
|
|
||||||
|
|
@ -28,7 +27,7 @@
|
||||||
else ''{"${package}/bin/${defaultCmd}"}'';
|
else ''{"${package}/bin/${defaultCmd}"}'';
|
||||||
servers = {
|
servers = {
|
||||||
nil = {
|
nil = {
|
||||||
package = inputs.nil.packages.${pkgs.stdenv.system}.nil;
|
package = pkgs.nil;
|
||||||
internalFormatter = true;
|
internalFormatter = true;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
lspconfig.nil_ls.setup{
|
lspconfig.nil_ls.setup{
|
||||||
|
|
@ -101,10 +100,26 @@
|
||||||
formats = {
|
formats = {
|
||||||
alejandra = {
|
alejandra = {
|
||||||
package = pkgs.alejandra;
|
package = pkgs.alejandra;
|
||||||
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.alejandra.with({
|
||||||
|
command = "${cfg.format.package}/bin/alejandra"
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
nixfmt = {
|
nixfmt = {
|
||||||
package = pkgs.nixfmt-rfc-style;
|
package = pkgs.nixfmt-rfc-style;
|
||||||
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.nixfmt.with({
|
||||||
|
command = "${cfg.format.package}/bin/nixfmt"
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -144,7 +159,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Nix LSP support" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "Nix LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Nix LSP server to use";
|
description = "Nix LSP server to use";
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
|
|
@ -222,24 +237,17 @@ in {
|
||||||
vim.lsp.lspconfig.sources.nix-lsp = servers.${cfg.lsp.server}.lspConfig;
|
vim.lsp.lspconfig.sources.nix-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf (cfg.format.enable && (!cfg.lsp.enable || !servers.${cfg.lsp.server}.internalFormatter)) {
|
(mkIf (cfg.format.enable && !servers.${cfg.lsp.server}.internalFormatter) {
|
||||||
vim.formatter.conform-nvim = {
|
vim.lsp.null-ls.enable = true;
|
||||||
enable = true;
|
vim.lsp.null-ls.sources.nix-format = formats.${cfg.format.type}.nullConfig;
|
||||||
setupOpts.formatters_by_ft.nix = [cfg.format.type];
|
|
||||||
setupOpts.formatters.${cfg.format.type} = {
|
|
||||||
command = getExe cfg.format.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.extraDiagnostics.enable {
|
(mkIf cfg.extraDiagnostics.enable {
|
||||||
vim.diagnostics.nvim-lint = {
|
vim.lsp.null-ls.enable = true;
|
||||||
enable = true;
|
vim.lsp.null-ls.sources = diagnosticsToLua {
|
||||||
linters_by_ft.nix = cfg.extraDiagnostics.types;
|
lang = "nix";
|
||||||
linters = mkMerge (map (name: {
|
config = cfg.extraDiagnostics.types;
|
||||||
${name}.cmd = getExe diagnosticsProviders.${name}.package;
|
inherit diagnosticsProviders;
|
||||||
})
|
|
||||||
cfg.extraDiagnostics.types);
|
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Nu LSP support" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "Nu LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
default = defaultServer;
|
default = defaultServer;
|
||||||
|
|
|
||||||
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