mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-13 15:41:03 +00:00
Compare commits
8 commits
dad9511e8e
...
7f0ab59a01
| Author | SHA1 | Date | |
|---|---|---|---|
|
7f0ab59a01 |
|||
|
dfd278d745 |
|||
|
7bcb35fe3c |
|||
|
1f2163d2a8 |
|||
|
b9dd1b816a |
|||
|
6e1d539712 |
|||
|
11d0292539 |
|||
|
cd9a5da852 |
53 changed files with 547 additions and 827 deletions
6
.github/dependabot.yml
vendored
6
.github/dependabot.yml
vendored
|
|
@ -1,7 +1,11 @@
|
||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: github-actions
|
- package-ecosystem: github-actions
|
||||||
open-pull-requests-limit: 15
|
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: daily
|
interval: daily
|
||||||
|
open-pull-requests-limit: 15
|
||||||
|
reviewers:
|
||||||
|
- NotAShelf
|
||||||
|
assignees:
|
||||||
|
- NotAShelf
|
||||||
|
|
|
||||||
2
.github/typos.toml
vendored
2
.github/typos.toml
vendored
|
|
@ -5,10 +5,8 @@ default.extend-ignore-words-re = [
|
||||||
"befores",
|
"befores",
|
||||||
"annote",
|
"annote",
|
||||||
"viw",
|
"viw",
|
||||||
"typ",
|
|
||||||
"edn",
|
"edn",
|
||||||
"esy",
|
"esy",
|
||||||
"BA", # somehow "BANanaD3V" is valid, but BA is not...
|
"BA", # somehow "BANanaD3V" is valid, but BA is not...
|
||||||
"Emac"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
||||||
2
.github/workflows/check.yml
vendored
2
.github/workflows/check.yml
vendored
|
|
@ -101,7 +101,7 @@ jobs:
|
||||||
run: echo "date=$(date +'%Y-%m-%d-%H%M%S')" >> ${GITHUB_OUTPUT}
|
run: echo "date=$(date +'%Y-%m-%d-%H%M%S')" >> ${GITHUB_OUTPUT}
|
||||||
|
|
||||||
- name: Upload doc artifacts
|
- name: Upload doc artifacts
|
||||||
uses: actions/upload-artifact@v5
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: "${{ matrix.package }}"
|
name: "${{ matrix.package }}"
|
||||||
path: result/share/doc/nvf
|
path: result/share/doc/nvf
|
||||||
|
|
|
||||||
6
.github/workflows/docs-preview.yml
vendored
6
.github/workflows/docs-preview.yml
vendored
|
|
@ -90,7 +90,7 @@ jobs:
|
||||||
echo "Preview can be found at ${URL}" >> "$GITHUB_STEP_SUMMARY"
|
echo "Preview can be found at ${URL}" >> "$GITHUB_STEP_SUMMARY"
|
||||||
|
|
||||||
- name: Find Comment
|
- name: Find Comment
|
||||||
uses: peter-evans/find-comment@v4
|
uses: peter-evans/find-comment@v3
|
||||||
id: fc
|
id: fc
|
||||||
with:
|
with:
|
||||||
comment-author: "github-actions[bot]"
|
comment-author: "github-actions[bot]"
|
||||||
|
|
@ -98,7 +98,7 @@ jobs:
|
||||||
body-includes: "Live preview deployed"
|
body-includes: "Live preview deployed"
|
||||||
|
|
||||||
- name: Post live preview comment
|
- name: Post live preview comment
|
||||||
uses: peter-evans/create-or-update-comment@v5
|
uses: peter-evans/create-or-update-comment@v4
|
||||||
env:
|
env:
|
||||||
COMMENT_ID: ${{ steps.fc.outputs.comment-id }}
|
COMMENT_ID: ${{ steps.fc.outputs.comment-id }}
|
||||||
URL: ${{ steps.prelude.outputs.URL }}
|
URL: ${{ steps.prelude.outputs.URL }}
|
||||||
|
|
@ -177,7 +177,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Post cleanup verification
|
- name: Post cleanup verification
|
||||||
uses: peter-evans/create-or-update-comment@v5
|
uses: peter-evans/create-or-update-comment@v4
|
||||||
with:
|
with:
|
||||||
issue-number: ${{ github.event.pull_request.number }}
|
issue-number: ${{ github.event.pull_request.number }}
|
||||||
body: |
|
body: |
|
||||||
|
|
|
||||||
91
.github/workflows/update.yml
vendored
91
.github/workflows/update.yml
vendored
|
|
@ -1,91 +0,0 @@
|
||||||
name: Weekly Dependency Updates
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
# 8 PM UTC every Friday
|
|
||||||
- cron: '0 20 * * 5'
|
|
||||||
jobs:
|
|
||||||
update-dependencies:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: "Install Nix"
|
|
||||||
uses: cachix/install-nix-action@v31.8.2
|
|
||||||
|
|
||||||
- name: Set up Git
|
|
||||||
run: |
|
|
||||||
git config user.name "GitHub Actions Bot"
|
|
||||||
git config user.email "actions@github.com"
|
|
||||||
|
|
||||||
- name: Create branch for updates
|
|
||||||
run: |
|
|
||||||
DATE=$(date +%Y-%m-%d)
|
|
||||||
BRANCH_NAME="update/dependencies-$DATE"
|
|
||||||
git checkout -b $BRANCH_NAME
|
|
||||||
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Update npins
|
|
||||||
run: nix run nixpkgs#npins update
|
|
||||||
|
|
||||||
# Only update Nixpkgs. mnw might break on update, better to track it manually to avoid
|
|
||||||
# unexpected breakage.
|
|
||||||
- name: Update nixpkgs
|
|
||||||
run: nix flake update nixpkgs
|
|
||||||
|
|
||||||
- name: Check for changes
|
|
||||||
id: check_changes
|
|
||||||
run: |
|
|
||||||
if git diff --quiet; then
|
|
||||||
echo "No changes detected"
|
|
||||||
echo "changes_detected=false" >> "$GITHUB_OUTPUT"
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo "Changes detected"
|
|
||||||
echo "changes_detected=true" >> "$GITHUB_OUTPUT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# FIXME: Worth adding additional checks for, e.g., fragile plugins
|
|
||||||
# or modules
|
|
||||||
# nix build .#checks.<system>.<check-name>
|
|
||||||
# We'll probably want to handle this with machine tests
|
|
||||||
- name: Verify changes
|
|
||||||
if: steps.check_changes.outputs.changes_detected == 'true'
|
|
||||||
run: |
|
|
||||||
# Run verification tests to ensure updates don't break anything
|
|
||||||
nix flake check
|
|
||||||
|
|
||||||
|
|
||||||
- name: Set date variable
|
|
||||||
run: echo "DATE=$(date +%Y-%m-%d)" >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
- name: Commit and push changes
|
|
||||||
if: steps.check_changes.outputs.changes_detected == 'true'
|
|
||||||
run: |
|
|
||||||
git add .
|
|
||||||
git commit -m "pins: bump all plugins (${{ env.DATE }})"
|
|
||||||
git push -u origin $BRANCH_NAME
|
|
||||||
|
|
||||||
- name: Create Pull Request
|
|
||||||
if: steps.check_changes.outputs.changes_detected == 'true'
|
|
||||||
uses: peter-evans/create-pull-request@v7
|
|
||||||
with:
|
|
||||||
branch: ${{ env.BRANCH_NAME }}
|
|
||||||
base: main
|
|
||||||
labels: dependencies,automated pr
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
commit-message: "npins: bump all plugins (${{ env.DATE }})"
|
|
||||||
title: "Weekly Dependency Updates: ${{ env.DATE }}"
|
|
||||||
body: |
|
|
||||||
> [!NOTE]
|
|
||||||
> This PR was automatically generated by the Weekly Dependency Updates workflow. Please wait
|
|
||||||
> for all CI steps to complete, and test any major changes personally.
|
|
||||||
|
|
||||||
Updates Performed:
|
|
||||||
|
|
||||||
- Updated dependencies using `npins update`
|
|
||||||
- Updated nixpkgs using `nix flake update nixpkgs`
|
|
||||||
|
|
||||||
If the verification steps have passed, updates should be safe to merge. For failing CI steps
|
|
||||||
submit a Pull Request targetting ${{ env.BRANCH_NAME }}
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
# Release Notes {#ch-release-notes}
|
|
||||||
|
|
||||||
This section lists the release notes for tagged version of **nvf** and the
|
|
||||||
current main current main branch
|
|
||||||
|
|
||||||
```{=include=} chapters
|
|
||||||
rl-0.1.md
|
|
||||||
rl-0.2.md
|
|
||||||
rl-0.3.md
|
|
||||||
rl-0.4.md
|
|
||||||
rl-0.5.md
|
|
||||||
rl-0.6.md
|
|
||||||
rl-0.7.md
|
|
||||||
```
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Release 0.6 {#sec-release-0-6}
|
# Release 0.6 {#sec-release-0-6}
|
||||||
|
|
||||||
Release notes for release 0.6
|
Release notes for release 0-6
|
||||||
|
|
||||||
## Breaking Changes and Migration Guide {#sec-breaking-changes-and-migration-guide}
|
## Breaking Changes and Migration Guide {#sec-breaking-changes-and-migration-guide}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,6 @@
|
||||||
align with the "hunks" themed mapping and avoid conflict with the new [neogit]
|
align with the "hunks" themed mapping and avoid conflict with the new [neogit]
|
||||||
group.
|
group.
|
||||||
|
|
||||||
- LSP keybinds and related plugin integrations are now attached in an LspAttach
|
|
||||||
autocmd event. If you were calling `default_on_attach()` in your LSP setup you
|
|
||||||
can remove them now.
|
|
||||||
|
|
||||||
## Changelog {#sec-release-0-8-changelog}
|
## Changelog {#sec-release-0-8-changelog}
|
||||||
|
|
||||||
[NotAShelf](https://github.com/notashelf):
|
[NotAShelf](https://github.com/notashelf):
|
||||||
|
|
@ -44,7 +40,6 @@
|
||||||
[colorful-menu.nvim]: https://github.com/xzbdmw/colorful-menu.nvim
|
[colorful-menu.nvim]: https://github.com/xzbdmw/colorful-menu.nvim
|
||||||
[oil.nvim]: https://github.com/stevearc/oil.nvim
|
[oil.nvim]: https://github.com/stevearc/oil.nvim
|
||||||
[hunk.nvim]: https://github.com/julienvincent/hunk.nvim
|
[hunk.nvim]: https://github.com/julienvincent/hunk.nvim
|
||||||
[undotree]: https://github.com/mbbill/undotree
|
|
||||||
|
|
||||||
- Add [typst-preview.nvim] under
|
- Add [typst-preview.nvim] under
|
||||||
`languages.typst.extensions.typst-preview-nvim`.
|
`languages.typst.extensions.typst-preview-nvim`.
|
||||||
|
|
@ -117,9 +112,6 @@
|
||||||
- Add [hunk.nvim], Neovim plugin & tool for splitting diffs in Neovim. Available
|
- Add [hunk.nvim], Neovim plugin & tool for splitting diffs in Neovim. Available
|
||||||
as `vim.git.hunk-nvim`
|
as `vim.git.hunk-nvim`
|
||||||
|
|
||||||
- Move `crates.nvim` into `languages.rust.extensions and support` `setupOpts`
|
|
||||||
for the plugin. Deprecates the top level "crates" option in `languages.rust`.
|
|
||||||
|
|
||||||
[sjcobb2022](https://github.com/sjcobb2022):
|
[sjcobb2022](https://github.com/sjcobb2022):
|
||||||
|
|
||||||
- Migrate all current lsp configurations to `vim.lsp.server` and remove internal
|
- Migrate all current lsp configurations to `vim.lsp.server` and remove internal
|
||||||
|
|
@ -144,8 +136,6 @@
|
||||||
- Moved code setting `additionalRuntimePaths` and `enableLuaLoader` out of
|
- Moved code setting `additionalRuntimePaths` and `enableLuaLoader` out of
|
||||||
`luaConfigPre`'s default to prevent being overridden
|
`luaConfigPre`'s default to prevent being overridden
|
||||||
- Use conform over custom autocmds for LSP format on save
|
- Use conform over custom autocmds for LSP format on save
|
||||||
- Move LSP keybinds and other related plugin integrations into an LspAttach
|
|
||||||
event.
|
|
||||||
|
|
||||||
[diniamo](https://github.com/diniamo):
|
[diniamo](https://github.com/diniamo):
|
||||||
|
|
||||||
|
|
@ -300,13 +290,10 @@
|
||||||
- Fix [blink.cmp] breaking when built-in sources were modified.
|
- Fix [blink.cmp] breaking when built-in sources were modified.
|
||||||
- Fix [conform.nvim] not allowing disabling formatting on and after save. Use
|
- Fix [conform.nvim] not allowing disabling formatting on and after save. Use
|
||||||
`null` value to disable them if conform is enabled.
|
`null` value to disable them if conform is enabled.
|
||||||
- Add [markdown-oxide](https://github.com/Feel-ix-343/markdown-oxide) option to
|
|
||||||
markdown language module.
|
|
||||||
- Fix Helm-YAML language module integration. YAML diagnostics will now remain in
|
- Fix Helm-YAML language module integration. YAML diagnostics will now remain in
|
||||||
`helmfile`s when both are enabled.
|
`helmfile`s when both are enabled.
|
||||||
- Fix YAML language module not activating LSP keybinds if the Helm language
|
- Fix YAML language module not activating LSP keybinds if the Helm language
|
||||||
module was also enabled.
|
module was also enabled.
|
||||||
- Fix `json` language module (default) language server not activating.
|
|
||||||
|
|
||||||
[TheColorman](https://github.com/TheColorman):
|
[TheColorman](https://github.com/TheColorman):
|
||||||
|
|
||||||
|
|
@ -506,7 +493,6 @@
|
||||||
|
|
||||||
- fix broken `neorg` grammars
|
- fix broken `neorg` grammars
|
||||||
- remove obsolete warning in the `otter` module
|
- remove obsolete warning in the `otter` module
|
||||||
- add mainProgram attribute to vala language server wrapper
|
|
||||||
|
|
||||||
[JManch](https://github.com/JManch):
|
[JManch](https://github.com/JManch):
|
||||||
|
|
||||||
|
|
@ -571,23 +557,8 @@
|
||||||
- Add [nvim-highlight-colors] plugin in `vim.ui.nvim-highlight-colors` with
|
- Add [nvim-highlight-colors] plugin in `vim.ui.nvim-highlight-colors` with
|
||||||
`enable` and `setupOpts`
|
`enable` and `setupOpts`
|
||||||
|
|
||||||
- Fix [blink.cmp] keymap preset types to allow alternate cmdline, terminal, etc
|
[simon-wg](https://github.com/simon-wg):
|
||||||
modes to `inherit` the default mode keymaps. This is an option as per the
|
|
||||||
[blink.cmp] docs and is now supported in nvf.
|
|
||||||
|
|
||||||
[PartyWumpus](https://github.com/PartyWumpus):
|
|
||||||
|
|
||||||
[typst-concealer]: https://github.com/PartyWumpus/typst-concealer
|
|
||||||
|
|
||||||
- Add inline typst concealing support under `vim.languages.typst` using
|
|
||||||
[typst-concealer]. [simon-wg](https://github.com/simon-wg):
|
|
||||||
|
|
||||||
- Update `python` language module to use correct lsp binary.
|
- Update `python` language module to use correct lsp binary.
|
||||||
- Fix `python` pyright and basedpyright language servers not using default on
|
- Fix `python` pyright and basedpyright language servers not using default on
|
||||||
attach behavior.
|
attach behavior.
|
||||||
|
|
||||||
[critical](https://github.com/critical):
|
|
||||||
|
|
||||||
[mellow.nvim]: https://github.com/mellow-theme/mellow.nvim
|
|
||||||
|
|
||||||
- Add [mellow.nvim] plugin for vim and lualine theme support
|
|
||||||
|
|
|
||||||
65
flake.lock
generated
65
flake.lock
generated
|
|
@ -16,21 +16,6 @@
|
||||||
"url": "https://git.lix.systems/lix-project/flake-compat.git"
|
"url": "https://git.lix.systems/lix-project/flake-compat.git"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-compat_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1747046372,
|
|
||||||
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
|
|
@ -38,11 +23,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1760948891,
|
"lastModified": 1759362264,
|
||||||
"narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=",
|
"narHash": "sha256-wfG0S7pltlYyZTM+qqlhJ7GMw2fTF4mLKCIVhLii/4M=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04",
|
"rev": "758cf7296bee11f1706a574c77d072b8a7baa881",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -66,48 +51,13 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ndg": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": "flake-compat_2",
|
|
||||||
"nixpkgs": "nixpkgs"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1760777965,
|
|
||||||
"narHash": "sha256-PHmDh1GxoBixpgtRCrBCvXJee/tCb6T57MLbwKfIURg=",
|
|
||||||
"owner": "feel-co",
|
|
||||||
"repo": "ndg",
|
|
||||||
"rev": "30b955582f0cd869a86007f491252bbffde48f8b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "feel-co",
|
|
||||||
"repo": "ndg",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1761880412,
|
"lastModified": 1760596604,
|
||||||
"narHash": "sha256-QoJjGd4NstnyOG4mm4KXF+weBzA2AH/7gn1Pmpfcb0A=",
|
"narHash": "sha256-J/i5K6AAz/y5dBePHQOuzC7MbhyTOKsd/GLezSbEFiM=",
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "8913c168d1c56dc49a7718685968f38752171c3b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1756696532,
|
|
||||||
"narHash": "sha256-6FWagzm0b7I/IGigOv9pr6LL7NQ86mextfE8g8Q6HBg=",
|
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a7fc11be66bdfb5cdde611ee5ce381c183da8386",
|
"rev": "3cbe716e2346710d6e1f7c559363d14e11c32a43",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -122,8 +72,7 @@
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"mnw": "mnw",
|
"mnw": "mnw",
|
||||||
"ndg": "ndg",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs": "nixpkgs_2",
|
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
self',
|
self',
|
||||||
|
inputs',
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
devShells = {
|
devShells = {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
# - the addition of the function `entryBefore` indicating a "wanted
|
# - the addition of the function `entryBefore` indicating a "wanted
|
||||||
# by" relationship.
|
# by" relationship.
|
||||||
{lib}: let
|
{lib}: let
|
||||||
inherit (builtins) isAttrs attrValues attrNames elem all head tail length toJSON isString removeAttrs;
|
inherit (builtins) isAttrs attrValues attrNames elem all head tail length toJSON isString;
|
||||||
inherit (lib.attrsets) filterAttrs mapAttrs;
|
inherit (lib.attrsets) filterAttrs mapAttrs;
|
||||||
inherit (lib.lists) toposort;
|
inherit (lib.lists) toposort;
|
||||||
inherit (lib.nvim.dag) empty isEntry entryBetween entryAfter entriesBetween entryAnywhere topoSort;
|
inherit (lib.nvim.dag) empty isEntry entryBetween entryAfter entriesBetween entryAnywhere topoSort;
|
||||||
|
|
@ -169,11 +169,10 @@ in {
|
||||||
else value)
|
else value)
|
||||||
dag;
|
dag;
|
||||||
sortedDag = topoSort finalDag;
|
sortedDag = topoSort finalDag;
|
||||||
loopDetail = map (loops: removeAttrs loops ["data"]) sortedDag.loops;
|
|
||||||
result =
|
result =
|
||||||
if sortedDag ? result
|
if sortedDag ? result
|
||||||
then mapResult sortedDag.result
|
then mapResult sortedDag.result
|
||||||
else abort ("Dependency cycle in ${name}: " + toJSON loopDetail);
|
else abort ("Dependency cycle in ${name}: " + toJSON sortedDag);
|
||||||
in
|
in
|
||||||
result;
|
result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
134
lib/lua.nix
134
lib/lua.nix
|
|
@ -1,52 +1,92 @@
|
||||||
# Helpers for converting values to lua
|
# Helpers for converting values to lua
|
||||||
{lib}: let
|
{lib}: let
|
||||||
|
inherit (builtins) hasAttr head throw typeOf isList isAttrs isBool isInt isString isPath isFloat toJSON;
|
||||||
|
inherit (lib.attrsets) mapAttrsToList filterAttrs;
|
||||||
|
inherit (lib.strings) concatStringsSep concatMapStringsSep stringToCharacters;
|
||||||
|
inherit (lib.trivial) boolToString warn;
|
||||||
|
in rec {
|
||||||
|
# Convert a null value to lua's nil
|
||||||
|
nullString = value:
|
||||||
|
if value == null
|
||||||
|
then "nil"
|
||||||
|
else "'${value}'";
|
||||||
|
|
||||||
|
# convert an expression to lua
|
||||||
|
expToLua = exp:
|
||||||
|
if isList exp
|
||||||
|
then listToLuaTable exp # if list, convert to lua table
|
||||||
|
else if isAttrs exp
|
||||||
|
then attrsetToLuaTable exp # if attrs, convert to table
|
||||||
|
else if isBool exp
|
||||||
|
then boolToString exp # if bool, convert to string
|
||||||
|
else if isInt exp
|
||||||
|
then toString exp # if int, convert to string
|
||||||
|
else if exp == null
|
||||||
|
then "nil"
|
||||||
|
else (toJSON exp); # otherwise jsonify the value and print as is
|
||||||
|
|
||||||
|
# convert list to a lua table
|
||||||
|
listToLuaTable = list:
|
||||||
|
"{ " + (concatStringsSep ", " (map expToLua list)) + " }";
|
||||||
|
|
||||||
|
# convert attrset to a lua table
|
||||||
|
attrsetToLuaTable = attrset:
|
||||||
|
"{ "
|
||||||
|
+ (
|
||||||
|
concatStringsSep ", "
|
||||||
|
(
|
||||||
|
mapAttrsToList (
|
||||||
|
name: value:
|
||||||
|
name
|
||||||
|
+ " = "
|
||||||
|
+ (expToLua value)
|
||||||
|
)
|
||||||
|
attrset
|
||||||
|
)
|
||||||
|
)
|
||||||
|
+ " }";
|
||||||
|
# Convert a list of lua expressions to a lua table. The difference to listToLuaTable is that the elements here are expected to be lua expressions already, whereas listToLuaTable converts from nix types to lua first
|
||||||
|
luaTable = items: ''{${concatStringsSep "," items}}'';
|
||||||
|
|
||||||
isLuaInline = object: (object._type or null) == "lua-inline";
|
isLuaInline = object: (object._type or null) == "lua-inline";
|
||||||
|
|
||||||
toLuaObject = args:
|
toLuaObject = args:
|
||||||
{
|
if isAttrs args
|
||||||
int = toString args;
|
then
|
||||||
float = toString args;
|
if isLuaInline args
|
||||||
|
then args.expr
|
||||||
# escapes \ and quotes
|
else if hasAttr "__empty" args
|
||||||
string = builtins.toJSON args;
|
then
|
||||||
path = builtins.toJSON args;
|
warn ''
|
||||||
|
Using `__empty` to define an empty lua table is deprecated. Use an empty attrset instead.
|
||||||
bool = lib.boolToString args;
|
'' "{ }"
|
||||||
null = "nil";
|
else
|
||||||
|
"{"
|
||||||
list = "{${lib.concatMapStringsSep ",\n" toLuaObject args}}";
|
+ (concatStringsSep ","
|
||||||
|
(mapAttrsToList
|
||||||
set =
|
(n: v:
|
||||||
if lib.isDerivation args
|
if head (stringToCharacters n) == "@"
|
||||||
then ''"${args}"''
|
then toLuaObject v
|
||||||
else if isLuaInline args
|
else "[${toLuaObject n}] = " + (toLuaObject v))
|
||||||
then args.expr
|
(filterAttrs
|
||||||
else "{${
|
(_: v: v != null)
|
||||||
lib.pipe args [
|
args)))
|
||||||
(lib.filterAttrs (_: v: v != null))
|
+ "}"
|
||||||
(builtins.mapAttrs (
|
else if isList args
|
||||||
n: v:
|
then "{" + concatMapStringsSep "," toLuaObject args + "}"
|
||||||
if lib.hasPrefix "@" n
|
else if isString args
|
||||||
then toLuaObject v
|
then
|
||||||
else "[${toLuaObject n}] = ${toLuaObject v}"
|
# This should be enough!
|
||||||
))
|
toJSON args
|
||||||
builtins.attrValues
|
else if isPath args
|
||||||
(lib.concatStringsSep ",\n")
|
then toJSON (toString args)
|
||||||
]
|
else if isBool args
|
||||||
}}";
|
then "${boolToString args}"
|
||||||
}
|
else if isFloat args
|
||||||
.${
|
then "${toString args}"
|
||||||
builtins.typeOf args
|
else if isInt args
|
||||||
}
|
then "${toString args}"
|
||||||
or (builtins.throw "Could not convert object of type `${builtins.typeOf args}` to lua object");
|
else if (args == null)
|
||||||
in
|
then "nil"
|
||||||
{
|
else throw "could not convert object of type `${typeOf args}` to lua object";
|
||||||
inherit isLuaInline toLuaObject;
|
}
|
||||||
luaTable = x: (toLuaObject (map lib.mkLuaInline x));
|
|
||||||
}
|
|
||||||
// lib.genAttrs [
|
|
||||||
"nullString"
|
|
||||||
"expToLua"
|
|
||||||
"listToLuaTable"
|
|
||||||
"attrsetToLuaTable"
|
|
||||||
] (name: lib.warn "${name} is deprecated use toLuaObject instead" toLuaObject)
|
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,13 @@
|
||||||
inherit (lib.strings) isString stringLength match;
|
inherit (lib.strings) isString stringLength match;
|
||||||
inherit (lib.types) listOf mkOptionType coercedTo;
|
inherit (lib.types) listOf mkOptionType coercedTo;
|
||||||
in {
|
in {
|
||||||
mergelessListOf = elemType:
|
mergelessListOf = elemType: let
|
||||||
mkOptionType {
|
super = listOf elemType;
|
||||||
|
in
|
||||||
|
super
|
||||||
|
// {
|
||||||
name = "mergelessListOf";
|
name = "mergelessListOf";
|
||||||
description = "mergeless list of ${elemType.description or "values"}";
|
description = "mergeless ${super.description}";
|
||||||
inherit (lib.types.listOf elemType) check;
|
|
||||||
merge = mergeEqualOption;
|
merge = mergeEqualOption;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,13 +62,7 @@ in rec {
|
||||||
inherit (elemType) getSubModules;
|
inherit (elemType) getSubModules;
|
||||||
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name>"]);
|
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name>"]);
|
||||||
substSubModules = m: dagOf (elemType.substSubModules m);
|
substSubModules = m: dagOf (elemType.substSubModules m);
|
||||||
functor = {
|
functor = (defaultFunctor name) // {wrapped = elemType;};
|
||||||
name = name;
|
|
||||||
type = dagOf;
|
|
||||||
wrapped = elemType;
|
|
||||||
payload = elemType;
|
|
||||||
binOp = a: b: a;
|
|
||||||
};
|
|
||||||
nestedTypes.elemType = elemType;
|
nestedTypes.elemType = elemType;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -259,16 +259,6 @@ in {
|
||||||
|
|
||||||
(mkRenamedLspServer "zig")
|
(mkRenamedLspServer "zig")
|
||||||
(mkRemovedLspPackage "zig")
|
(mkRemovedLspPackage "zig")
|
||||||
|
|
||||||
# 2025-10-22
|
|
||||||
(mkRenamedOptionModule ["vim" "languages" "rust" "crates" "enable"] ["vim" "languages" "rust" "extensions" "crates-nvim" "enable"])
|
|
||||||
(mkRemovedOptionModule ["vim" "languages" "rust" "crates" "codeActions"] ''
|
|
||||||
'vim.languages.rust.crates' option has been moved to 'vim.languages.rust.extensions.crates-nvim' in full and the
|
|
||||||
codeActions option has been removed. To set up code actions again, you may use the the new 'setupOpts' option
|
|
||||||
located under 'vim.languages.rust.extensions.crates-nvim'. Refer to crates.nvim documentation for setup steps:
|
|
||||||
|
|
||||||
<https://github.com/Saecki/crates.nvim/wiki/Documentation-v0.7.1#in-process-language-server>
|
|
||||||
'')
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# Migrated via batchRenameOptions. Further batch renames must be below this line.
|
# Migrated via batchRenameOptions. Further batch renames must be below this line.
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
inherit (lib.types) nullOr submodule listOf str bool;
|
inherit (lib.types) nullOr submodule listOf str bool;
|
||||||
inherit (lib.nvim.types) luaInline;
|
inherit (lib.nvim.types) luaInline;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
inherit (lib.nvim.dag) entryAfter entryBetween;
|
inherit (lib.nvim.dag) entryAfter;
|
||||||
|
|
||||||
autocommandType = submodule {
|
autocommandType = submodule {
|
||||||
options = {
|
options = {
|
||||||
|
|
@ -144,7 +144,7 @@ in {
|
||||||
enabledAutogroups = filter (au: au.enable) cfg.augroups;
|
enabledAutogroups = filter (au: au.enable) cfg.augroups;
|
||||||
in {
|
in {
|
||||||
luaConfigRC = {
|
luaConfigRC = {
|
||||||
augroups = entryBetween ["autocmds"] ["pluginConfigs"] (optionalString (enabledAutogroups != []) ''
|
augroups = entryAfter ["pluginConfigs"] (optionalString (enabledAutogroups != []) ''
|
||||||
local nvf_autogroups = {}
|
local nvf_autogroups = {}
|
||||||
for _, group in ipairs(${toLuaObject enabledAutogroups}) do
|
for _, group in ipairs(${toLuaObject enabledAutogroups}) do
|
||||||
if group.name then
|
if group.name then
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ in {
|
||||||
{
|
{
|
||||||
vim.lsp.servers."*" = {
|
vim.lsp.servers."*" = {
|
||||||
capabilities = mkDefault (mkLuaInline "capabilities");
|
capabilities = mkDefault (mkLuaInline "capabilities");
|
||||||
|
on_attach = mkDefault (mkLuaInline "default_on_attach");
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
inherit (lib.strings) concatLines concatStringsSep optionalString;
|
inherit (lib.strings) concatLines concatStringsSep optionalString;
|
||||||
inherit (lib.attrsets) mapAttrsToList;
|
inherit (lib.attrsets) mapAttrsToList;
|
||||||
inherit (lib.types) listOf str attrsOf;
|
inherit (lib.types) listOf str attrsOf;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) listToLuaTable;
|
||||||
inherit (lib.nvim.dag) entryAfter;
|
inherit (lib.nvim.dag) entryAfter;
|
||||||
|
|
||||||
cfg = config.vim.spellcheck;
|
cfg = config.vim.spellcheck;
|
||||||
|
|
@ -152,7 +152,7 @@ in {
|
||||||
vim.api.nvim_create_augroup("nvf_autocmds", {clear = false})
|
vim.api.nvim_create_augroup("nvf_autocmds", {clear = false})
|
||||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||||
group = "nvf_autocmds",
|
group = "nvf_autocmds",
|
||||||
pattern = ${toLuaObject cfg.ignoredFiletypes},
|
pattern = ${listToLuaTable cfg.ignoredFiletypes},
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.opt_local.spell = false
|
vim.opt_local.spell = false
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
inherit (builtins) filter;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.nvim.dag) entryBefore;
|
inherit (lib.nvim.dag) entryBefore;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
options,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
|
@ -11,7 +10,8 @@
|
||||||
|
|
||||||
cfg = config.vim.assistant.chatgpt;
|
cfg = config.vim.assistant.chatgpt;
|
||||||
|
|
||||||
mappingDefinitions = options.vim.assistant.chatgpt.mappings;
|
self = import ./chatgpt.nix {inherit lib;};
|
||||||
|
mappingDefinitions = self.options.vim.assistant.chatgpt.mappings;
|
||||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||||
maps = mkMerge [
|
maps = mkMerge [
|
||||||
(mkSetBinding mappings.editWithInstructions "<cmd>ChatGPTEditWithInstruction<CR>")
|
(mkSetBinding mappings.editWithInstructions "<cmd>ChatGPTEditWithInstruction<CR>")
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ in {
|
||||||
accept = mkOption {
|
accept = mkOption {
|
||||||
type = nullOr str;
|
type = nullOr str;
|
||||||
default = "<M-l>";
|
default = "<M-l>";
|
||||||
description = "Accept suggestion";
|
description = "Accept suggetion";
|
||||||
};
|
};
|
||||||
|
|
||||||
acceptWord = mkOption {
|
acceptWord = mkOption {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
freeformType = attrsOf (listOf (either str luaInline));
|
freeformType = attrsOf (listOf (either str luaInline));
|
||||||
options = {
|
options = {
|
||||||
preset = mkOption {
|
preset = mkOption {
|
||||||
type = enum ["inherit" "default" "none" "super-tab" "enter" "cmdline"];
|
type = enum ["default" "none" "super-tab" "enter" "cmdline"];
|
||||||
default = "none";
|
default = "none";
|
||||||
description = "keymap presets";
|
description = "keymap presets";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
options,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
|
@ -11,7 +10,8 @@
|
||||||
|
|
||||||
cfg = config.vim.git.git-conflict;
|
cfg = config.vim.git.git-conflict;
|
||||||
|
|
||||||
gcMappingDefinitions = options.vim.git.git-conflict.mappings;
|
self = import ./git-conflict.nix {inherit lib config;};
|
||||||
|
gcMappingDefinitions = self.options.vim.git.git-conflict.mappings;
|
||||||
|
|
||||||
gcMappings = addDescriptionsToMappings cfg.mappings gcMappingDefinitions;
|
gcMappings = addDescriptionsToMappings cfg.mappings gcMappingDefinitions;
|
||||||
in {
|
in {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
options,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) toJSON;
|
inherit (builtins) toJSON;
|
||||||
|
|
@ -13,7 +12,8 @@
|
||||||
|
|
||||||
cfg = config.vim.git.gitsigns;
|
cfg = config.vim.git.gitsigns;
|
||||||
|
|
||||||
gsMappingDefinitions = options.vim.git.gitsigns.mappings;
|
self = import ./gitsigns.nix {inherit lib config;};
|
||||||
|
gsMappingDefinitions = self.options.vim.git.gitsigns.mappings;
|
||||||
|
|
||||||
gsMappings = addDescriptionsToMappings cfg.mappings gsMappingDefinitions;
|
gsMappings = addDescriptionsToMappings cfg.mappings gsMappingDefinitions;
|
||||||
in {
|
in {
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@
|
||||||
workspace_required = true;
|
workspace_required = true;
|
||||||
on_attach = mkLuaInline ''
|
on_attach = mkLuaInline ''
|
||||||
function(client, bufnr)
|
function(client, bufnr)
|
||||||
|
default_on_attach(client, bufnr)
|
||||||
|
|
||||||
local function switch_source_header(bufnr)
|
local function switch_source_header(bufnr)
|
||||||
local method_name = "textDocument/switchSourceHeader"
|
local method_name = "textDocument/switchSourceHeader"
|
||||||
local params = vim.lsp.util.make_text_document_params(bufnr)
|
local params = vim.lsp.util.make_text_document_params(bufnr)
|
||||||
|
|
@ -75,6 +77,8 @@
|
||||||
};
|
};
|
||||||
on_attach = mkLuaInline ''
|
on_attach = mkLuaInline ''
|
||||||
function(client, bufnr)
|
function(client, bufnr)
|
||||||
|
default_on_attach(client, bufnr)
|
||||||
|
|
||||||
local function switch_source_header(bufnr)
|
local function switch_source_header(bufnr)
|
||||||
local method_name = "textDocument/switchSourceHeader"
|
local method_name = "textDocument/switchSourceHeader"
|
||||||
local client = vim.lsp.get_clients({ bufnr = bufnr, name = "clangd", })[1]
|
local client = vim.lsp.get_clients({ bufnr = bufnr, name = "clangd", })[1]
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,10 @@
|
||||||
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.types) enum listOf package;
|
inherit (lib.lists) isList;
|
||||||
|
inherit (lib.types) enum either listOf package str;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||||
|
|
||||||
cfg = config.vim.languages.clojure;
|
cfg = config.vim.languages.clojure;
|
||||||
|
|
|
||||||
|
|
@ -63,11 +63,12 @@
|
||||||
};
|
};
|
||||||
on_attach = mkLuaInline ''
|
on_attach = mkLuaInline ''
|
||||||
function(client, bufnr)
|
function(client, bufnr)
|
||||||
local oe = require("omnisharp_extended")
|
default_on_attach(client, bufnr)
|
||||||
${mkLspBinding "goToDefinition" "oe.lsp_definition"}
|
local oe = require("omnisharp_extended")
|
||||||
${mkLspBinding "goToType" "oe.lsp_type_definition"}
|
${mkLspBinding "goToDefinition" "oe.lsp_definition"}
|
||||||
${mkLspBinding "listReferences" "oe.lsp_references"}
|
${mkLspBinding "goToType" "oe.lsp_type_definition"}
|
||||||
${mkLspBinding "listImplementations" "oe.lsp_implementation"}
|
${mkLspBinding "listReferences" "oe.lsp_references"}
|
||||||
|
${mkLspBinding "listImplementations" "oe.lsp_implementation"}
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
settings = {
|
settings = {
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,7 @@ in {
|
||||||
},
|
},
|
||||||
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
on_attach = default_on_attach;
|
||||||
},
|
},
|
||||||
${optionalString cfg.dap.enable ''
|
${optionalString cfg.dap.enable ''
|
||||||
debugger = {
|
debugger = {
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,13 @@
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
inherit (lib.nvim.dag) entryAfter;
|
inherit (lib.nvim.dag) entryAfter entryBefore;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.meta) getExe';
|
inherit (lib.meta) getExe';
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
|
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||||
inherit (pkgs) haskellPackages;
|
inherit (pkgs) haskellPackages;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
cfg = config.vim.languages.haskell;
|
cfg = config.vim.languages.haskell;
|
||||||
|
|
||||||
|
|
@ -32,6 +34,7 @@
|
||||||
''
|
''
|
||||||
function(client, bufnr)
|
function(client, bufnr)
|
||||||
local ht = require("haskell-tools")
|
local ht = require("haskell-tools")
|
||||||
|
default_on_attach(client, bufnr, ht)
|
||||||
local opts = { noremap = true, silent = true, buffer = bufnr }
|
local opts = { noremap = true, silent = true, buffer = bufnr }
|
||||||
vim.keymap.set('n', '<localleader>cl', vim.lsp.codelens.run, opts)
|
vim.keymap.set('n', '<localleader>cl', vim.lsp.codelens.run, opts)
|
||||||
vim.keymap.set('n', '<localleader>hs', ht.hoogle.hoogle_signature, opts)
|
vim.keymap.set('n', '<localleader>hs', ht.hoogle.hoogle_signature, opts)
|
||||||
|
|
@ -119,7 +122,7 @@ in {
|
||||||
dap = {
|
dap = {
|
||||||
cmd = ${
|
cmd = ${
|
||||||
if isList cfg.dap.package
|
if isList cfg.dap.package
|
||||||
then toLuaObject cfg.dap.package
|
then expToLua cfg.dap.package
|
||||||
else ''{"${cfg.dap.package}/bin/haskell-debug-adapter"}''
|
else ''{"${cfg.dap.package}/bin/haskell-debug-adapter"}''
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
defaultServers = ["jsonls"];
|
defaultServers = ["jsonls"];
|
||||||
servers = {
|
servers = {
|
||||||
jsonls = {
|
jsonls = {
|
||||||
cmd = [(getExe' pkgs.vscode-langservers-extracted "vscode-json-language-server") "--stdio"];
|
cmd = [(getExe' pkgs.vscode-langservers-extracted "vscode-json-languageserver") "--stdio"];
|
||||||
filetypes = ["json" "jsonc"];
|
filetypes = ["json" "jsonc"];
|
||||||
init_options = {provideFormatter = true;};
|
init_options = {provideFormatter = true;};
|
||||||
root_markers = [".git"];
|
root_markers = [".git"];
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,6 @@
|
||||||
filetypes = ["markdown" "markdown.mdx"];
|
filetypes = ["markdown" "markdown.mdx"];
|
||||||
root_markers = [".marksman.toml" ".git"];
|
root_markers = [".marksman.toml" ".git"];
|
||||||
};
|
};
|
||||||
|
|
||||||
markdown-oxide = {
|
|
||||||
enable = true;
|
|
||||||
cmd = [(getExe pkgs.markdown-oxide)];
|
|
||||||
filetypes = ["markdown"];
|
|
||||||
root_markers = [".git" ".obsidian" ".moxide.toml"];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultFormat = "deno_fmt";
|
defaultFormat = "deno_fmt";
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@
|
||||||
};
|
};
|
||||||
on_attach = mkLuaInline ''
|
on_attach = mkLuaInline ''
|
||||||
function(client, bufnr)
|
function(client, bufnr)
|
||||||
|
default_on_attach(client, bufnr);
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function()
|
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function()
|
||||||
local params = {
|
local params = {
|
||||||
command = 'pyright.organizeimports',
|
command = 'pyright.organizeimports',
|
||||||
|
|
@ -88,6 +89,7 @@
|
||||||
};
|
};
|
||||||
on_attach = mkLuaInline ''
|
on_attach = mkLuaInline ''
|
||||||
function(client, bufnr)
|
function(client, bufnr)
|
||||||
|
default_on_attach(client, bufnr);
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function()
|
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function()
|
||||||
local params = {
|
local params = {
|
||||||
command = 'basedpyright.organizeimports',
|
command = 'basedpyright.organizeimports',
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,16 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.options) mkOption mkEnableOption literalMD;
|
inherit (lib.options) mkOption mkEnableOption literalMD;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
|
inherit (lib.trivial) boolToString;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.attrsets) attrNames;
|
|
||||||
inherit (lib.types) bool package str listOf either enum;
|
inherit (lib.types) bool package str listOf either enum;
|
||||||
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
inherit (lib.nvim.lua) expToLua toLuaObject;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.nvim.dag) entryAfter entryAnywhere;
|
inherit (lib.nvim.dag) entryAfter entryAnywhere;
|
||||||
|
|
||||||
cfg = config.vim.languages.rust;
|
cfg = config.vim.languages.rust;
|
||||||
|
|
@ -32,6 +33,15 @@ in {
|
||||||
package = mkGrammarOption pkgs "rust";
|
package = mkGrammarOption pkgs "rust";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
crates = {
|
||||||
|
enable = mkEnableOption "crates-nvim, tools for managing dependencies";
|
||||||
|
codeActions = mkOption {
|
||||||
|
description = "Enable code actions through null-ls";
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Rust LSP support (rust-analyzer with extra tools)" // {default = config.vim.lsp.enable;};
|
enable = mkEnableOption "Rust LSP support (rust-analyzer with extra tools)" // {default = config.vim.lsp.enable;};
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
|
|
@ -93,32 +103,25 @@ in {
|
||||||
default = pkgs.lldb;
|
default = pkgs.lldb;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
extensions = {
|
|
||||||
crates-nvim = {
|
|
||||||
enable = mkEnableOption "crates.io dependency management [crates-nvim]";
|
|
||||||
|
|
||||||
setupOpts = mkPluginSetupOption "crates-nvim" {
|
|
||||||
completion.cmp.enable = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = config.vim.autocomplete.nvim-cmp.enable;
|
|
||||||
defaultText = "{option}`config.vim.autocomplete.nvim-cmp.enable`";
|
|
||||||
description = ''
|
|
||||||
Whether to add crates.nvim as a source for completion plugins. The following
|
|
||||||
plugins are supported by crates.nvim:
|
|
||||||
|
|
||||||
* nvim-cmp
|
|
||||||
* coq.nvim
|
|
||||||
|
|
||||||
However nvf only supports auto-setup for nvim-cmp.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.crates.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = ["crates-nvim"];
|
||||||
|
lsp.null-ls.enable = mkIf cfg.crates.codeActions true;
|
||||||
|
autocomplete.nvim-cmp.sources = {crates = "[Crates]";};
|
||||||
|
pluginRC.rust-crates = entryAnywhere ''
|
||||||
|
require('crates').setup {
|
||||||
|
null_ls = {
|
||||||
|
enabled = ${boolToString cfg.crates.codeActions},
|
||||||
|
name = "crates.nvim",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
||||||
(mkIf cfg.treesitter.enable {
|
(mkIf cfg.treesitter.enable {
|
||||||
vim.treesitter.enable = true;
|
vim.treesitter.enable = true;
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
|
|
@ -137,6 +140,7 @@ in {
|
||||||
(mkIf (cfg.lsp.enable || cfg.dap.enable) {
|
(mkIf (cfg.lsp.enable || cfg.dap.enable) {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = ["rustaceanvim"];
|
startPlugins = ["rustaceanvim"];
|
||||||
|
|
||||||
pluginRC.rustaceanvim = entryAfter ["lsp-setup"] ''
|
pluginRC.rustaceanvim = entryAfter ["lsp-setup"] ''
|
||||||
vim.g.rustaceanvim = {
|
vim.g.rustaceanvim = {
|
||||||
${optionalString cfg.lsp.enable ''
|
${optionalString cfg.lsp.enable ''
|
||||||
|
|
@ -195,28 +199,5 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.extensions.crates-nvim.enable {
|
|
||||||
vim = let
|
|
||||||
withCompletion = cfg.extensions.crates-nvim.setupOpts.completion.cmp.enable;
|
|
||||||
in
|
|
||||||
mkMerge [
|
|
||||||
{
|
|
||||||
startPlugins = ["crates-nvim"];
|
|
||||||
pluginRC.rust-crates = entryAnywhere ''
|
|
||||||
require("crates").setup(${toLuaObject cfg.extensions.crates-nvim.setupOpts})
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
|
|
||||||
# FIXME: this will not be necessary once crates.nvim creates a new release that
|
|
||||||
# ships improvements to the in-progress LSP module. If updating > 0.7.1, remember
|
|
||||||
# to update this section.
|
|
||||||
# See:
|
|
||||||
# <https://github.com/saecki/crates.nvim/wiki/Documentation-unstable#auto-completion>
|
|
||||||
(mkIf withCompletion {
|
|
||||||
autocomplete.nvim-cmp.sources = {crates = "[Crates]";};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
})
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,8 @@
|
||||||
};
|
};
|
||||||
on_attach = mkLuaInline ''
|
on_attach = mkLuaInline ''
|
||||||
function(client, bufnr)
|
function(client, bufnr)
|
||||||
|
default_on_attach(client, bufnr);
|
||||||
|
|
||||||
-- ts_ls provides `source.*` code actions that apply to the whole file. These only appear in
|
-- ts_ls provides `source.*` code actions that apply to the whole file. These only appear in
|
||||||
-- `vim.lsp.buf.code_action()` if specified in `context.only`.
|
-- `vim.lsp.buf.code_action()` if specified in `context.only`.
|
||||||
vim.api.nvim_buf_create_user_command(0, 'LspTypescriptSourceAction', function()
|
vim.api.nvim_buf_create_user_command(0, 'LspTypescriptSourceAction', function()
|
||||||
|
|
@ -104,6 +106,7 @@
|
||||||
};
|
};
|
||||||
on_attach = mkLuaInline ''
|
on_attach = mkLuaInline ''
|
||||||
function(client, bufnr)
|
function(client, bufnr)
|
||||||
|
default_on_attach(client, bufnr)
|
||||||
vim.api.nvim_buf_create_user_command(0, 'LspDenolsCache', function()
|
vim.api.nvim_buf_create_user_command(0, 'LspDenolsCache', function()
|
||||||
client:exec_cmd({
|
client:exec_cmd({
|
||||||
command = 'deno.cache',
|
command = 'deno.cache',
|
||||||
|
|
|
||||||
|
|
@ -4,16 +4,15 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.types) nullOr enum attrsOf listOf package str bool int;
|
inherit (lib.types) nullOr enum attrsOf listOf package str;
|
||||||
inherit (lib.attrsets) attrNames;
|
inherit (lib.attrsets) attrNames;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption singleOrListOf;
|
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption singleOrListOf;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||||
inherit (lib.nvim.binds) mkKeymap mkMappingOption;
|
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
|
|
||||||
cfg = config.vim.languages.typst;
|
cfg = config.vim.languages.typst;
|
||||||
|
|
@ -92,8 +91,11 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultFormat = "typstyle";
|
defaultFormat = "typstfmt";
|
||||||
formats = {
|
formats = {
|
||||||
|
typstfmt = {
|
||||||
|
package = pkgs.typstfmt;
|
||||||
|
};
|
||||||
# https://github.com/Enter-tainer/typstyle
|
# https://github.com/Enter-tainer/typstyle
|
||||||
typstyle = {
|
typstyle = {
|
||||||
package = pkgs.typstyle;
|
package = pkgs.typstyle;
|
||||||
|
|
@ -176,57 +178,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
typst-concealer = {
|
|
||||||
enable = mkEnableOption ''
|
|
||||||
[typst-concealer]: https://github.com/PartyWumpus/typst-concealer
|
|
||||||
|
|
||||||
Inline typst preview for Neovim via [typst-concealer]
|
|
||||||
'';
|
|
||||||
|
|
||||||
mappings = {
|
|
||||||
toggleConcealing = mkMappingOption "Enable typst-concealer in buffer" "<leader>TT";
|
|
||||||
};
|
|
||||||
|
|
||||||
setupOpts = mkPluginSetupOption "typst-concealer" {
|
|
||||||
do_diagnostics = mkOption {
|
|
||||||
type = nullOr bool;
|
|
||||||
default = !cfg.lsp.enable;
|
|
||||||
description = "Should typst-concealer provide diagnostics on error?";
|
|
||||||
};
|
|
||||||
color = mkOption {
|
|
||||||
type = nullOr str;
|
|
||||||
default = null;
|
|
||||||
example = "rgb(\"#f012be\")";
|
|
||||||
description = "What color should typst-concealer render text/stroke with? (only applies when styling_type is 'colorscheme')";
|
|
||||||
};
|
|
||||||
enabled_by_default = mkOption {
|
|
||||||
type = nullOr bool;
|
|
||||||
default = null;
|
|
||||||
description = "Should typst-concealer conceal newly opened buffers by default?";
|
|
||||||
};
|
|
||||||
styling_type = mkOption {
|
|
||||||
type = nullOr (enum ["simple" "none" "colorscheme"]);
|
|
||||||
default = null;
|
|
||||||
description = "What kind of styling should typst-concealer apply to your typst?";
|
|
||||||
};
|
|
||||||
ppi = mkOption {
|
|
||||||
type = nullOr int;
|
|
||||||
default = null;
|
|
||||||
description = "What PPI should typst render at. Plugin default is 300, typst's normal default is 144.";
|
|
||||||
};
|
|
||||||
typst_location = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = getExe pkgs.typst;
|
|
||||||
description = "Where should typst-concealer look for your typst binary?";
|
|
||||||
example = ''lib.getExe pkgs.typst'';
|
|
||||||
};
|
|
||||||
conceal_in_normal = mkOption {
|
|
||||||
type = nullOr bool;
|
|
||||||
default = null;
|
|
||||||
description = "Should typst-concealer still conceal when the normal mode cursor goes over a line.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
|
@ -261,18 +212,5 @@ in {
|
||||||
require("typst-preview").setup(${toLuaObject cfg.extensions.typst-preview-nvim.setupOpts})
|
require("typst-preview").setup(${toLuaObject cfg.extensions.typst-preview-nvim.setupOpts})
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.extensions.typst-concealer.enable {
|
|
||||||
vim.lazy.plugins.typst-concealer = {
|
|
||||||
event = "BufRead *.typ";
|
|
||||||
package = "typst-concealer";
|
|
||||||
setupModule = "typst-concealer";
|
|
||||||
setupOpts = cfg.extensions.typst-concealer.setupOpts;
|
|
||||||
|
|
||||||
keys = [
|
|
||||||
(mkKeymap "n" cfg.extensions.typst-concealer.mappings.toggleConcealing "<cmd>lua require('typst-concealer').toggle_buf()<CR>" {desc = "Toggle typst-concealer in buffer";})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
})
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@
|
||||||
(getExe (pkgs.symlinkJoin {
|
(getExe (pkgs.symlinkJoin {
|
||||||
name = "vala-language-server-wrapper";
|
name = "vala-language-server-wrapper";
|
||||||
paths = [pkgs.vala-language-server];
|
paths = [pkgs.vala-language-server];
|
||||||
meta.mainProgram = "vala-language-server-wrapper";
|
|
||||||
buildInputs = [pkgs.makeBinaryWrapper];
|
buildInputs = [pkgs.makeBinaryWrapper];
|
||||||
postBuild = ''
|
postBuild = ''
|
||||||
wrapProgram $out/bin/vala-language-server \
|
wrapProgram $out/bin/vala-language-server \
|
||||||
|
|
|
||||||
|
|
@ -15,18 +15,18 @@
|
||||||
|
|
||||||
cfg = config.vim.languages.yaml;
|
cfg = config.vim.languages.yaml;
|
||||||
|
|
||||||
on_attach =
|
on_attach = mkLuaInline (
|
||||||
if config.vim.languages.helm.lsp.enable && config.vim.languages.helm.enable
|
if config.vim.languages.helm.lsp.enable && config.vim.languages.helm.enable
|
||||||
then
|
then ''
|
||||||
mkLuaInline ''
|
function(client, bufnr)
|
||||||
function(client, bufnr)
|
default_on_attach()
|
||||||
local filetype = vim.bo[bufnr].filetype
|
local filetype = vim.bo[bufnr].filetype
|
||||||
if filetype == "helm" then
|
if filetype == "helm" then
|
||||||
client.stop()
|
client.stop()
|
||||||
end
|
|
||||||
end
|
end
|
||||||
''
|
end''
|
||||||
else null;
|
else "default_on_attach"
|
||||||
|
);
|
||||||
|
|
||||||
defaultServers = ["yaml-language-server"];
|
defaultServers = ["yaml-language-server"];
|
||||||
servers = {
|
servers = {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
options,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
|
|
@ -10,21 +10,20 @@
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.trivial) boolToString;
|
inherit (lib.trivial) boolToString;
|
||||||
inherit (lib.nvim.binds) addDescriptionsToMappings;
|
inherit (lib.nvim.binds) addDescriptionsToMappings;
|
||||||
inherit (lib.nvim.dag) entryBefore;
|
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
|
||||||
|
|
||||||
cfg = config.vim.lsp;
|
cfg = config.vim.lsp;
|
||||||
usingNvimCmp = config.vim.autocomplete.nvim-cmp.enable;
|
usingNvimCmp = config.vim.autocomplete.nvim-cmp.enable;
|
||||||
usingBlinkCmp = config.vim.autocomplete.blink-cmp.enable;
|
usingBlinkCmp = config.vim.autocomplete.blink-cmp.enable;
|
||||||
|
self = import ./module.nix {inherit config lib pkgs;};
|
||||||
conformCfg = config.vim.formatter.conform-nvim;
|
conformCfg = config.vim.formatter.conform-nvim;
|
||||||
conformFormatOnSave = conformCfg.enable && conformCfg.setupOpts.format_on_save != null;
|
conformFormatOnSave = conformCfg.enable && conformCfg.setupOpts.format_on_save != null;
|
||||||
|
|
||||||
augroup = "nvf_lsp";
|
augroup = "nvf_lsp";
|
||||||
mappingDefinitions = options.vim.lsp.mappings;
|
mappingDefinitions = self.options.vim.lsp.mappings;
|
||||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||||
mkBinding = binding: action:
|
mkBinding = binding: action:
|
||||||
if binding.value != null
|
if binding.value != null
|
||||||
then "vim.keymap.set('n', ${toLuaObject binding.value}, ${action}, {buffer=bufnr, noremap=true, silent=true, desc=${toLuaObject binding.description}})"
|
then "vim.keymap.set('n', '${binding.value}', ${action}, {buffer=bufnr, noremap=true, silent=true, desc='${binding.description}'})"
|
||||||
else "";
|
else "";
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
@ -36,26 +35,20 @@ in {
|
||||||
|
|
||||||
augroups = [{name = augroup;}];
|
augroups = [{name = augroup;}];
|
||||||
autocmds =
|
autocmds =
|
||||||
[
|
(optional cfg.inlayHints.enable {
|
||||||
{
|
group = augroup;
|
||||||
group = augroup;
|
event = ["LspAttach"];
|
||||||
event = ["LspAttach"];
|
desc = "LSP on-attach enable inlay hints autocmd";
|
||||||
desc = "LSP on-attach add keybinds, enable inlay hints, and other plugin integrations";
|
callback = mkLuaInline ''
|
||||||
callback = mkLuaInline ''
|
function(event)
|
||||||
function(event)
|
local bufnr = event.buf
|
||||||
local bufnr = event.buf
|
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
|
||||||
default_on_attach(client, bufnr)
|
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr }), { bufnr = bufnr })
|
||||||
|
|
||||||
${optionalString cfg.inlayHints.enable ''
|
|
||||||
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
|
|
||||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr }), { bufnr = bufnr })
|
|
||||||
end
|
|
||||||
''}
|
|
||||||
end
|
end
|
||||||
'';
|
end
|
||||||
}
|
'';
|
||||||
]
|
})
|
||||||
++ (optional (!conformFormatOnSave) {
|
++ (optional (!conformFormatOnSave) {
|
||||||
group = augroup;
|
group = augroup;
|
||||||
event = ["BufWritePre"];
|
event = ["BufWritePre"];
|
||||||
|
|
@ -94,7 +87,7 @@ in {
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
|
|
||||||
pluginRC.lsp-setup = entryBefore ["autocmds"] ''
|
pluginRC.lsp-setup = ''
|
||||||
vim.g.formatsave = ${boolToString cfg.formatOnSave};
|
vim.g.formatsave = ${boolToString cfg.formatOnSave};
|
||||||
|
|
||||||
local attach_keymaps = function(client, bufnr)
|
local attach_keymaps = function(client, bufnr)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
options,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
|
@ -10,8 +9,9 @@
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
cfg = config.vim.lsp.nvim-docs-view;
|
cfg = config.vim.lsp.nvim-docs-view;
|
||||||
|
self = import ./nvim-docs-view.nix {inherit lib;};
|
||||||
|
|
||||||
mappingDefinitions = options.vim.lsp.nvim-docs-view.mappings;
|
mappingDefinitions = self.options.vim.lsp.nvim-docs-view.mappings;
|
||||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
options,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
|
@ -11,7 +10,8 @@
|
||||||
|
|
||||||
cfg = config.vim.lsp;
|
cfg = config.vim.lsp;
|
||||||
|
|
||||||
mappingDefinitions = options.vim.lsp.otter-nvim.mappings;
|
self = import ./otter.nix {inherit lib;};
|
||||||
|
mappingDefinitions = self.options.vim.lsp.otter-nvim.mappings;
|
||||||
mappings = addDescriptionsToMappings cfg.otter-nvim.mappings mappingDefinitions;
|
mappings = addDescriptionsToMappings cfg.otter-nvim.mappings mappingDefinitions;
|
||||||
in {
|
in {
|
||||||
config = mkIf (cfg.enable && cfg.otter-nvim.enable) {
|
config = mkIf (cfg.enable && cfg.otter-nvim.enable) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
options,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
|
@ -10,7 +9,9 @@
|
||||||
|
|
||||||
cfg = config.vim.minimap.codewindow;
|
cfg = config.vim.minimap.codewindow;
|
||||||
|
|
||||||
mappingDefinitions = options.vim.minimap.codewindow.mappings;
|
self = import ./codewindow.nix {inherit lib;};
|
||||||
|
|
||||||
|
mappingDefinitions = self.options.vim.minimap.codewindow.mappings;
|
||||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
|
pkgs,
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
options,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkMerge mkIf;
|
inherit (lib.modules) mkMerge mkIf;
|
||||||
|
|
@ -9,7 +9,8 @@
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
cfg = config.vim.notes.todo-comments;
|
cfg = config.vim.notes.todo-comments;
|
||||||
inherit (options.vim.notes.todo-comments) mappings;
|
self = import ./todo-comments.nix {inherit pkgs lib;};
|
||||||
|
inherit (self.options.vim.notes.todo-comments) mappings;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
|
|
|
||||||
|
|
@ -5,5 +5,4 @@
|
||||||
"oxocarbon"
|
"oxocarbon"
|
||||||
"gruvbox"
|
"gruvbox"
|
||||||
"nord"
|
"nord"
|
||||||
"mellow"
|
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
options,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
|
@ -10,8 +9,8 @@
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
cfg = config.vim.tabline.nvimBufferline;
|
cfg = config.vim.tabline.nvimBufferline;
|
||||||
|
self = import ./nvim-bufferline.nix {inherit config lib;};
|
||||||
inherit (options.vim.tabline.nvimBufferline) mappings;
|
inherit (self.options.vim.tabline.nvimBufferline) mappings;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ in {
|
||||||
then
|
then
|
||||||
mkLuaInline ''
|
mkLuaInline ''
|
||||||
(function()
|
(function()
|
||||||
local integration = require("catppuccin.special.bufferline")
|
local integration = require("catppuccin.groups.integrations.bufferline")
|
||||||
return (integration.get_theme or integration.get)()
|
return (integration.get_theme or integration.get)()
|
||||||
end)()
|
end)()
|
||||||
''
|
''
|
||||||
|
|
@ -40,7 +40,7 @@ in {
|
||||||
defaultText = literalMD ''
|
defaultText = literalMD ''
|
||||||
```lua
|
```lua
|
||||||
(function()
|
(function()
|
||||||
local integration = require("catppuccin.special.bufferline")
|
local integration = require("catppuccin.groups.integrations.bufferline")
|
||||||
return (integration.get_theme or integration.get)()
|
return (integration.get_theme or integration.get)()
|
||||||
end)()
|
end)()
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -46,18 +46,6 @@ in {
|
||||||
}: ''
|
}: ''
|
||||||
require('tokyonight').setup {
|
require('tokyonight').setup {
|
||||||
transparent = ${boolToString transparent};
|
transparent = ${boolToString transparent};
|
||||||
styles = {
|
|
||||||
sidebars = ${
|
|
||||||
if transparent
|
|
||||||
then ''"transparent"''
|
|
||||||
else ''"dark"''
|
|
||||||
},
|
|
||||||
floats = ${
|
|
||||||
if transparent
|
|
||||||
then ''"transparent"''
|
|
||||||
else ''"dark"''
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
vim.cmd[[colorscheme tokyonight-${style}]]
|
vim.cmd[[colorscheme tokyonight-${style}]]
|
||||||
'';
|
'';
|
||||||
|
|
@ -315,13 +303,4 @@ in {
|
||||||
|
|
||||||
styles = ["hard" "medium" "soft"];
|
styles = ["hard" "medium" "soft"];
|
||||||
};
|
};
|
||||||
|
|
||||||
mellow = {
|
|
||||||
setup = {transparent ? false, ...}: ''
|
|
||||||
-- Mellow configuration
|
|
||||||
vim.g.mellow_transparent = ${boolToString transparent}
|
|
||||||
|
|
||||||
vim.cmd.colorscheme("mellow")
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
options,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
|
@ -12,7 +12,8 @@
|
||||||
|
|
||||||
cfg = config.vim.treesitter;
|
cfg = config.vim.treesitter;
|
||||||
|
|
||||||
mappingDefinitions = options.vim.treesitter.mappings;
|
self = import ./treesitter.nix {inherit pkgs lib;};
|
||||||
|
mappingDefinitions = self.options.vim.treesitter.mappings;
|
||||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
options,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
|
@ -10,7 +9,9 @@
|
||||||
|
|
||||||
cfg = config.vim.gestures.gesture-nvim;
|
cfg = config.vim.gestures.gesture-nvim;
|
||||||
|
|
||||||
mappingDefinitions = options.vim.gestures.gesture-nvim.mappings;
|
self = import ./gesture-nvim.nix {inherit lib;};
|
||||||
|
|
||||||
|
mappingDefinitions = self.options.vim.gestures.gesture-nvim.mappings;
|
||||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ in {
|
||||||
"flash-nvim" = {
|
"flash-nvim" = {
|
||||||
package = "flash-nvim";
|
package = "flash-nvim";
|
||||||
setupModule = "flash";
|
setupModule = "flash";
|
||||||
inherit (cfg) setupOpts;
|
setupOpts = cfg.setupOpts;
|
||||||
|
|
||||||
lazy = true;
|
lazy = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
options,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
|
|
@ -10,7 +9,9 @@
|
||||||
|
|
||||||
cfg = config.vim.utility.motion.hop;
|
cfg = config.vim.utility.motion.hop;
|
||||||
|
|
||||||
mappingDefinitions = options.vim.utility.motion.hop.mappings;
|
self = import ./hop.nix {inherit lib;};
|
||||||
|
|
||||||
|
mappingDefinitions = self.options.vim.utility.motion.hop.mappings;
|
||||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
options,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
|
@ -10,7 +9,10 @@
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
cfg = config.vim.utility.preview.glow;
|
cfg = config.vim.utility.preview.glow;
|
||||||
inherit (options.vim.utility.preview.glow) mappings;
|
self = import ./glow.nix {
|
||||||
|
inherit lib config pkgs;
|
||||||
|
};
|
||||||
|
inherit (self.options.vim.utility.preview.glow) mappings;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim.startPlugins = ["glow-nvim"];
|
vim.startPlugins = ["glow-nvim"];
|
||||||
|
|
|
||||||
|
|
@ -130,9 +130,6 @@
|
||||||
# In systems where we only have a package and no module, this can be used
|
# In systems where we only have a package and no module, this can be used
|
||||||
# to access the built init.lua
|
# to access the built init.lua
|
||||||
initLua = dummyInit;
|
initLua = dummyInit;
|
||||||
|
|
||||||
mnwConfig = neovim-wrapped.passthru.config;
|
|
||||||
mnwConfigDir = neovim-wrapped.passthru.configDir;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
meta =
|
meta =
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue