diff --git a/.editorconfig b/.editorconfig index 2f767ae8..c7fdc76d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,7 +14,7 @@ indent_style = space indent_size = 2 trim_trailing_whitespace = false -[*.{js,json,nix,yml,yaml}] +[*.{js,json,nix,yml,yaml,toml}] indent_style = space indent_size = 2 tab_width = 2 diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index de6ff5ef..2fb071ca 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1,5 @@ -* @NotAShelf +# Codeowners should be used to distinguish the maintainers of the project +# and not contributors of specific modules to nvf. While adding a new module +# please consider adding yourself to 'meta.maintainers' in the module instead +# of CODEOWNERS here. +* @NotAShelf @horriblename @Soliprem diff --git a/.github/README.md b/.github/README.md index 01395211..3fc7ffdf 100644 --- a/.github/README.md +++ b/.github/README.md @@ -200,8 +200,9 @@ fix. **Q**: What platforms are supported? **A**: nvf actively supports **Linux and Darwin** platforms using standalone -Nix, NixOS or Home-Manager. Please take a look at the [nvf manual] for available -installation instructions. +Nix, NixOS or Home-Manager. It has been reported that **Android** is also +supported through the Home-Manager module, or using standalone package. Please +take a look at the [nvf manual] for available installation instructions. **Q**: Can you add _X_? @@ -237,7 +238,7 @@ customizability of plugin inputs, which is one of our primary features. an imperative path (e.g., `~/.config/nvim`) for my Neovim configuration instead of a configuration generated from Nix? -**A**: Yes! Add `"~/.config.nvim"` to `vim.additionalRuntimePaths = [ ... ]` and +**A**: Yes! Add `"~/.config/nvim"` to `vim.additionalRuntimePaths = [ ... ]` and any plugins you want to load to `vim.startPlugins`. This will load your configuration from `~/.config/nvim`. You may still use `vim.*` to modify Neovim's behaviour with Nix. @@ -246,14 +247,15 @@ Neovim's behaviour with Nix. ### Co-Maintainers -Alongside myself, nvf is developed by those talented folk: +Alongside [myself](https://github.com/notashelf), nvf is developed by those +talented folk. nvf would not be what it is today without their invaluable +contributions. - [**@horriblename**](https://github.com/horriblename) ([Liberapay](https://liberapay.com/horriblename/))- For actively implementing planned features and quality of life updates. -- [**@Diniamo**](https://github.com/Diniamo) - ([Liberapay](https://en.liberapay.com/diniamo/)) - For actively submitting - pull requests, issues and assistance with maintenance of nvf. +- [**@Soliprem**](https://github.com/soliprem) - For rigorously implementing + missing features and excellent work on new language modules. Please do remember to extend your thanks (financially or otherwise) if this project has been helpful to you. @@ -270,14 +272,14 @@ heart-felt thanks to - [**@FlafyDev**](https://github.com/FlafyDev) - For getting Home-Manager module to work and Nix assistance. - [**@n3oney**](https://github.com/n3oney) - For making custom keybinds finally - possible, and other module additions. + possible, great ideas and module additions. - [**@Yavko**](https://github.com/Yavko) - For the amazing **nvf** logo - [**@FrothyMarrow**](https://github.com/FrothyMarrow) - For seeing mistakes - that I could not. + that I could not and contributing good ideas & code. - [**@Gerg-l**](https://github.com/gerg-l) 🐸 - For the modern Neovim wrapper, - [mnw], and occasional code improvements. -- [**@Soliprem**](https://github.com/soliprem) - Rigorously implementing missing - features and excellent work on new language modules. + [mnw], and occasional improvements to the codebase. +- [**@Diniamo**](https://github.com/Diniamo) - For actively submitting pull + requests, issues and assistance with co-maintenance of nvf. and everyone who has submitted issues or pull requests! @@ -301,7 +303,6 @@ including: I am grateful for their previous work and inspiration, and I wholeheartedly recommend checking their work out. -
## License diff --git a/.github/typos.toml b/.github/typos.toml index 2ea46a8c..2cd18dde 100644 --- a/.github/typos.toml +++ b/.github/typos.toml @@ -1,5 +1,10 @@ -default.extend-ignore-words-re = ["(?i)(noice)", "befores", "annote", "viw"] -files.extend-exclude = [ -"npins/sources.json" +files.extend-exclude = ["npins/sources.json"] +default.extend-ignore-words-re = [ + "(?i)(noice)", + "befores", + "annote", + "viw", + "BA", # somehow "BANanaD3V" is valid, but BA is not... ] + diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index cac8ee51..959a04b6 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -36,7 +36,7 @@ jobs: - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - - uses: cachix/cachix-action@v15 + - uses: cachix/cachix-action@v16 with: authToken: ${{ secrets.CACHIX_TOKEN }} extraPullNames: nix-community diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml deleted file mode 100644 index 4d133ecd..00000000 --- a/.github/workflows/check-docs.yml +++ /dev/null @@ -1,56 +0,0 @@ -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 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 7a7677eb..a349cb07 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,4 +1,6 @@ -name: "Validate flake & check formatting" +name: "Treewide Checks" +permissions: read-all + on: pull_request: workflow_dispatch: @@ -6,13 +8,13 @@ on: branches: - main paths-ignore: - - .github/** - assets/** - - .gitignore + jobs: nix-flake-check: - name: Validate Flake + name: "Validate flake" runs-on: ubuntu-latest + if: "!contains(github.event.pull_request.title, '[skip ci]')" steps: - name: Checkout uses: actions/checkout@v4 @@ -24,8 +26,9 @@ jobs: run: nix flake check format-with-alejandra: - name: Formatting via Alejandra + name: "Check formatting" runs-on: ubuntu-latest + if: "!contains(github.event.pull_request.title, '[skip ci]')" steps: - name: Checkout uses: actions/checkout@v4 @@ -33,4 +36,118 @@ jobs: - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - - run: nix run nixpkgs#alejandra -- -c . + - name: Check formatting via Alejandra + run: nix run nixpkgs#alejandra -- -c . + + 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 diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index 204dcba7..aa8fb272 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -1,9 +1,13 @@ -name: Cleanup +name: Delete Stale Branches +permissions: + contents: write + on: workflow_dispatch: schedule: - cron: "0 4 1 * *" # 4AM on 1st of every month - cron: "0 4 15 * *" # 4AM on the 15th of every month + jobs: branches: name: Cleanup old branches @@ -13,7 +17,7 @@ jobs: uses: actions/checkout@v4 - name: "Delete old branches" - uses: beatlabs/delete-old-branches-action@v0.0.10 + uses: beatlabs/delete-old-branches-action@v0.0.11 with: repo_token: "${{ secrets.GITHUB_TOKEN }}" date: "1 months ago" diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index f8f45d05..9adaf5ef 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -9,7 +9,7 @@ on: - "modules/**" - "docs/**" -# Defining permissions here passes it to all workflows. +# Defining permissions here passes it to all jobs. # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token permissions: contents: write @@ -34,7 +34,7 @@ jobs: run: git config --global init.defaultBranch main - name: Build documentation packages - run: nix build .#docs-html --print-build-logs + run: nix build .#docs-html --print-build-logs || exit 1 - name: Deploy to GitHub Pages preview run: | diff --git a/.github/workflows/editorconfig.yml b/.github/workflows/editorconfig.yml deleted file mode 100644 index 3d8ca360..00000000 --- a/.github/workflows/editorconfig.yml +++ /dev/null @@ -1,46 +0,0 @@ -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 diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml deleted file mode 100644 index d74ee5b7..00000000 --- a/.github/workflows/typos.yml +++ /dev/null @@ -1,30 +0,0 @@ -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 diff --git a/configuration.nix b/configuration.nix index 8fe4a809..3f647b3b 100644 --- a/configuration.nix +++ b/configuration.nix @@ -25,7 +25,6 @@ isMaximal: { trouble.enable = true; lspSignature.enable = true; otter-nvim.enable = isMaximal; - lsplines.enable = isMaximal; nvim-docs-view.enable = isMaximal; }; @@ -83,6 +82,7 @@ isMaximal: { elixir.enable = false; haskell.enable = false; ruby.enable = false; + fsharp.enable = false; tailwind.enable = false; svelte.enable = false; @@ -235,6 +235,7 @@ isMaximal: { enable = false; cmp.enable = isMaximal; }; + codecompanion-nvim.enable = false; }; session = { diff --git a/docs/default.nix b/docs/default.nix index 48cff563..98b29db0 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -95,8 +95,6 @@ inherit (nvimModuleDocs) optionsJSON; }; in { - inherit (inputs) nmd; - # TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream # `nixosOptionsDoc` is more customizable. options.json = diff --git a/docs/manual/configuring/custom-plugins/configuring.md b/docs/manual/configuring/custom-plugins/configuring.md index c0935f03..5106d29b 100644 --- a/docs/manual/configuring/custom-plugins/configuring.md +++ b/docs/manual/configuring/custom-plugins/configuring.md @@ -67,7 +67,7 @@ of individual sections of configuration as needed. nvf provides helper functions in the extended library, usually under `inputs.nvf.lib.nvim.dag` that you may use. -Please refer to the [DAG section](/index.xhtml#ch-dag-entries) in the nvf manual +Please refer to the [DAG section](#ch-dag-entries) in the nvf manual to find out more about the DAG system. ::: diff --git a/docs/manual/configuring/custom-plugins/lazy-method.md b/docs/manual/configuring/custom-plugins/lazy-method.md index c6fd7106..ae766535 100644 --- a/docs/manual/configuring/custom-plugins/lazy-method.md +++ b/docs/manual/configuring/custom-plugins/lazy-method.md @@ -38,3 +38,22 @@ As of version **0.7**, we exposed an API for configuring lazy-loaded plugins via }; } ``` + +## LazyFile event {#sec-lazyfile-event} + +You can use the `LazyFile` 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 `LazyFile` as an alias to +`["BufReadPost" "BufNewFile" "BufWritePre"]` diff --git a/docs/manual/configuring/languages.md b/docs/manual/configuring/languages.md index 74714365..252163fb 100644 --- a/docs/manual/configuring/languages.md +++ b/docs/manual/configuring/languages.md @@ -19,6 +19,7 @@ formatting to diagnostics. The following languages have sections under the - Go: [vim.languages.go.enable](#opt-vim.languages.go.enable) - Lua: [vim.languages.lua.enable](#opt-vim.languages.lua.enable) - PHP: [vim.languages.php.enable](#opt-vim.languages.php.enable) +- F#: [vim.languages.fsharp.enable](#opt-vim.languages.fsharp.enable) Adding support for more languages, and improving support for existing ones are great places where you can contribute with a PR. diff --git a/docs/manual/options.md b/docs/manual/options.md index 61282dfa..beab4f16 100644 --- a/docs/manual/options.md +++ b/docs/manual/options.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. 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 us know if you believe any of the -options below are missing useful examples. +which you can access with `man 5 nvf`. Please let us know if you believe any of +the options below are missing useful examples.