Merge pull request #570 from LilleAila/add-rainbow-delimiters

visuals/rainbow-delimiters: init
This commit is contained in:
raf 2025-01-19 22:07:44 +03:00 committed by Ching Pei Yang
commit 62bc9764f1
No known key found for this signature in database
GPG key ID: B3841364253DC4C8
33 changed files with 786 additions and 119 deletions

View file

@ -14,7 +14,7 @@ indent_style = space
indent_size = 2 indent_size = 2
trim_trailing_whitespace = false trim_trailing_whitespace = false
[*.{js,nix,yml,yaml}] [*.{js,json,nix,yml,yaml}]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
tab_width = 2 tab_width = 2

View file

@ -7,14 +7,17 @@ or dependency in this section.
If your pull request aims to fix an open issue or a please bug, please also link the relevant issue If your pull request aims to fix an open issue or a please bug, please also link the relevant issue
below this line. You may attach an issue to your pull request with `Fixes #<issue number>` outside below this line. You may attach an issue to your pull request with `Fixes #<issue number>` outside
this comment, and it will be closed when your pull request is merged. this comment, and it will be closed when your pull request is merged.
A developer package template is provided in flake/develop.nix. If working on a module, you may use
it to test your changes with minimal dependency changes.
--> -->
## Sanity Checking ## Sanity Checking
<!-- <!--
Please check all that apply. As before, this section is not a hard requirement but checklists with more checked Please check all that apply. As before, this section is not a hard requirement but checklists with more checked
items are likely to be merged faster. You may save some time in maintainer review by performing self-reviews here items are likely to be merged faster. You may save some time in maintainer reviews by performing self-reviews
before submitting your pull request. here before submitting your pull request.
If your pull request includes any change or unexpected behaviour not covered below, please do make sure to include If your pull request includes any change or unexpected behaviour not covered below, please do make sure to include
it above in your description. it above in your description.
@ -22,9 +25,11 @@ it above in your description.
[editorconfig]: https://editorconfig.org [editorconfig]: https://editorconfig.org
[changelog]: https://github.com/NotAShelf/nvf/tree/main/docs/release-notes [changelog]: https://github.com/NotAShelf/nvf/tree/main/docs/release-notes
[hacking nvf]: https://notashelf.github.io/nvf/index.xhtml#sec-guidelines
- [ ] I have updated the [changelog] as per my changes - [ ] I have updated the [changelog] as per my changes
- [ ] I have tested, and self-reviewed my code - [ ] I have tested, and self-reviewed my code
- [ ] My changes fit guidelines found in [hacking nvf]
- Style and consistency - Style and consistency
- [ ] I ran **Alejandra** to format my code (`nix fmt`) - [ ] I ran **Alejandra** to format my code (`nix fmt`)
- [ ] My code conforms to the [editorconfig] configuration of the project - [ ] My code conforms to the [editorconfig] configuration of the project
@ -34,9 +39,10 @@ it above in your description.
- [ ] I have added a section in the manual - [ ] I have added a section in the manual
- [ ] _(For breaking changes)_ I have included a migration guide - [ ] _(For breaking changes)_ I have included a migration guide
- Package(s) built: - Package(s) built:
- [ ] `.#nix` (default package) - [ ] `.#nix` _(default package)_
- [ ] `.#maximal` - [ ] `.#maximal`
- [ ] `.#docs-html` (manual, must build) - [ ] `.#docs-html` _(manual, must build)_
- [ ] `.#docs-linkcheck` _(optional, please build if adding links)_
- Tested on platform(s) - Tested on platform(s)
- [ ] `x86_64-linux` - [ ] `x86_64-linux`
- [ ] `aarch64-linux` - [ ] `aarch64-linux`
@ -46,7 +52,8 @@ it above in your description.
<!-- <!--
If your changes touch upon a portion of the codebase that you do not understand well, please make sure to consult If your changes touch upon a portion of the codebase that you do not understand well, please make sure to consult
the maintainers on your changes. In most cases, making an issue before creating your PR will help you avoid duplicate the maintainers on your changes. In most cases, making an issue before creating your PR will help you avoid duplicate
efforts in the long run. efforts in the long run. `git blame` might help you find out who is the "author" or the "maintainer" of a current
module by showing who worked on it the most.
--> -->
--- ---

72
.github/README.md vendored
View file

@ -50,6 +50,7 @@
[Contribute]: #contributing [Contribute]: #contributing
[FAQ]: #frequently-asked-questions [FAQ]: #frequently-asked-questions
[Credits]: #credits [Credits]: #credits
[License]: #license
**[<kbd><br>Features <br></kbd>][Features]** **[<kbd><br>Features <br></kbd>][Features]**
**[<kbd><br>Get Started<br></kbd>][Get Started]** **[<kbd><br>Get Started<br></kbd>][Get Started]**
@ -67,6 +68,10 @@
[standalone]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-installation [standalone]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-installation
[NixOS module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-nixos [NixOS module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-nixos
[Home-Manager module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-hm [Home-Manager module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-hm
[release notes]: https://notashelf.github.io/nvf/release-notes.html
[discussions tab]: https://github.com/notashelf/nvf/discussions
[FAQ section]: #frequently-asked-questions
[DAG]: https://en.wikipedia.org/wiki/Directed_acyclic_graph
- **Simple**: One language to rule them all! Use Nix to configure everything, - **Simple**: One language to rule them all! Use Nix to configure everything,
with optional Lua support for robust configurability! with optional Lua support for robust configurability!
@ -79,11 +84,31 @@
customizable through the Nix module system. customizable through the Nix module system.
- Not comfortable with a full-nix config or want to bring your Lua config? You - Not comfortable with a full-nix config or want to bring your Lua config? You
can do just that, no unnecessary restrictions. can do just that, no unnecessary restrictions.
- Lazyloading? We got it! Lazyload both internal and external plugins at will. - Lazyloading 💤? We got it! Lazyload both internal and external plugins at
will.
- nvf allows _ordering configuration bits_ using [DAG] (_Directed acyclic
graph_)s. It has never been easier to construct an editor configuration
deterministically!
- nvf exposes everything you need to avoid a vendor lock-in. Which means you
can add new modules, plugins and so on without relying on us adding a module
for them! Though, of course, feel free to request them.
- Use plugins from anywhere. Inputs, npins, nixpkgs... You name it.
- Add your own modules, with ease. It's all built-in!
- **Well-documented**: Documentation is priority. You will _never_ face - **Well-documented**: Documentation is priority. You will _never_ face
undocumented, obscure behaviour. undocumented, obscure behaviour.
- Changes, breaking or otherwise, will be communicated in the [release notes]
- Refer to the [FAQ section] for answers to common questions.
- Your question not there? Head to the to the [discussions tab]!
- **Idiomatic**: nvf does things ✨ _the right way_ ✨ - the codebase is, and - **Idiomatic**: nvf does things ✨ _the right way_ ✨ - the codebase is, and
will, remain maintainable for myself and any contributors. will, remain maintainable for myself and any contributors.
- **Community-Led**: we would like nvf to be fully capable of accomplishing what
you really want it to do. If you have a use case that is not made possible by
nvf, please open an issue (or a pull request!)
- Your feedback is more than welcome! Feedback is what _drives_ nvf forward.
If you have anything to say, or ask, please let us know.
- Pull requests are _always_ welcome. If you think the project can benefit
from something you did locally, but are not quite sure how to upstream,
please feel free to contact us! We'll help you get it done.
## Get Started ## Get Started
@ -173,36 +198,49 @@ fix.
[list of open pull requests]: https://github.com/NotAShelf/nvf/pulls [list of open pull requests]: https://github.com/NotAShelf/nvf/pulls
**Q**: What platforms are supported? **Q**: What platforms are supported?
<br/> **A**: nvf actively supports **Linux and Darwin** platforms using
standalone Nix, NixOS or Home-Manager. Please take a look at the [nvf manual] **A**: nvf actively supports **Linux and Darwin** platforms using standalone
for available installation instructions. Nix, NixOS or Home-Manager. Please take a look at the [nvf manual] for available
installation instructions.
**Q**: Can you add _X_? **Q**: Can you add _X_?
<br/> **A**: Maybe! It is not one of our goals to support each and every Neovim
**A**: Maybe! It is not one of our goals to support each and every Neovim
plugin, however, I am always open to new modules and plugin setup additions to plugin, however, I am always open to new modules and plugin setup additions to
**nvf**. Use the appropriate [issue template] and I will consider a module **nvf**. Use the appropriate [issue template] and I will consider a module
addition. As mentioned before, pull requests to add new features are also addition. As mentioned before, pull requests to add new features are also
welcome. welcome.
**Q**: A plugin I need is not available in **nvf**. What to do? **Q**: A plugin I need is not available in **nvf**. What to do?
<br/> **A**: **nvf** exposes several APIs for you to be able to add your own
plugin configurations! Please see the documentation on how you may do this. **A**: **nvf** exposes several APIs for you to be able to add your own plugin
configurations! Please see the documentation on how you may do this.
**Q**: Main branch is awfully silent, is the project dead? **Q**: Main branch is awfully silent, is the project dead?
<br/> **A**: No! Sometimes we branch out (e.g. `v0.6`) to avoid breaking
userspace and work in a separate branch until we make sure the new additions are **A**: No! Sometimes we branch out (e.g. `v0.6`) to avoid breaking userspace and
implemented in the most comfortable way possible for the end user. If you have work in a separate branch until we make sure the new additions are implemented
not noticed any activity on the main branch, consider taking a look at the in the most comfortable way possible for the end user. If you have not noticed
any activity on the main branch, consider taking a look at the
[list of branches] or the [list of open pull requests]. You may also consider [list of branches] or the [list of open pull requests]. You may also consider
_testing_ those release branches to get access to new features ahead of time and _testing_ those release branches to get access to new features ahead of time and
better prepare to breaking changes. better prepare to breaking changes.
**Q**: Will you support non-flake installations? **Q**: Will you support non-flake installations?
<br/> **A**: Quite possibly. **nvf** started as "neovim-flake", which does mean
it is and will remain flakes-first but we might consider non-flakes **A**: Quite possibly. **nvf** started as "neovim-flake", which does mean it is
compatibility. Though keep in mind that **nvf** under non-flake environments and will remain flakes-first but we might consider non-flakes compatibility.
would lose customizability of plugin inputs, which is one of our primary Though keep in mind that **nvf** under non-flake environments would lose
features. customizability of plugin inputs, which is one of our primary features.
**Q**: I prefer working with Lua, can I use nvf as a plugin manager while I use
an imperative path (e.g., `~/.config/nvim`) for my Neovim configuration instead
of a configuration generated from Nix?
**A**: Yes! Add `"~/.config.nvim"` to `vim.additionalRuntimePaths = [ ... ]` and
any plugins you want to load to `vim.startPlugins`. This will load your
configuration from `~/.config/nvim`. You may still use `vim.*` to modify
Neovim's behaviour with Nix.
## Credits ## Credits
@ -245,7 +283,7 @@ and everyone who has submitted issues or pull requests!
### Inspiration ### Inspiration
This configuration borrows from and is based on a few other configurations, This configuration borrows from, and is based on a few other configurations,
including: including:
- [@jordanisaacs's](https://github.com/jordanisaacs) - [@jordanisaacs's](https://github.com/jordanisaacs)

View file

@ -1,6 +1,7 @@
# This is the sample configuration for nvf, aiming to give you a feel of the default options # This is the sample configuration for nvf, aiming to give you a feel of the default options
# while certain plugins are enabled. While it may act as one, this is not an overview of nvf's # while certain plugins are enabled. While it may partially act as one, this is *not* quite
# module options. To find a complete overview of nvf's options and examples, visit the manual. # an overview of nvf's module options. To find a complete and curated list of nvf module
# options, examples, instruction tutorials and more; please visit the online manual.
# https://notashelf.github.io/nvf/options.html # https://notashelf.github.io/nvf/options.html
isMaximal: { isMaximal: {
config.vim = { config.vim = {
@ -175,6 +176,7 @@ isMaximal: {
icon-picker.enable = isMaximal; icon-picker.enable = isMaximal;
surround.enable = isMaximal; surround.enable = isMaximal;
diffview-nvim.enable = true; diffview-nvim.enable = true;
yanky-nvim.enable = false;
motion = { motion = {
hop.enable = true; hop.enable = true;
leap.enable = true; leap.enable = true;

View file

@ -1,13 +1,16 @@
.TH "nvf" "5" "01/01/1980" "nvf" .TH "nvf" "5" "January 1, 1980" "nvf"
.\" disable hyphenation .\" disable hyphenation
.nh .nh
.\" disable justification (adjust text to left margin only) .\" disable justification (adjust text to left margin only)
.ad l .ad l
.\" enable line breaks after slashes .\" enable line breaks after slashes
.cflags 4 / .cflags 4 /
.SH "NAME" .SH "NAME"
nvf configuration specification nvf \- Configuration specification for the nvf.
.SH "OPTIONS"
.PP .SH "DESCRIPTION"
You can use the following options to configure nvf: The nvf configuration specification provides a declarative structure for configuring Neovim using Nix with few
.PP lines of Nix. This document outlines the available options and their usage to create modular, reusable, and
reproducible configurations using nvf's module system options. For tips, tricks and possible quirks with available
plugins please visit https://notashelf.github.io/nvf/

View file

@ -1,5 +1,5 @@
.Dd January 1, 1980 .Dd January 1, 1980
.Dt nvf 1 .Dt NVF 1
.Os nvf .Os nvf
.\" disable hyphenation .\" disable hyphenation
.nh .nh
@ -7,27 +7,46 @@
.ad l .ad l
.\" enable line breaks after slashes .\" enable line breaks after slashes
.cflags 4 / .cflags 4 /
.Sh NAME .Sh NAME
.Nm nvf .Nm nvf
.Nd A highly modular, extensible and distro-agnostic Neovim configuration framework for Nix/NixOS. .Nd A modular, extensible, and distro-agnostic Neovim configuration framework for Nix/NixOS.
.
.Sh DESCRIPTION
.Nm nvf
is a highly modular, configurable, extensible, and easy-to-use Neovim configuration in Nix.
Designed for flexibility and ease of use, nvf allows you to easily configure your fully featured
Neovim instance with a few lines of Nix.
.Sh COMMANDS
The following commands are bundled with nvf to allow easier debugging of your configuration.
.Bl -tag -width Ds
.It Nm nvf-print-config
Outputs the full configuration of the current `nvf` setup. This command is useful for debugging
or inspecting the applied configuration.
.Pp
.It Nm nvf-print-config-path
Prints the file path to the configuration file currently in use. This command is helpful for locating
the source configuration file for troubleshooting or easily sharing it via online paste utilities.
.El
.Sh BUGS .Sh BUGS
.Pp .Pp
Please report any bugs that you might encounter on the Please report any bugs on the project issue tracker:
\m[blue]\fBproject issue tracker\fR\m[]\&. .Lk https://github.com/notashelf/nvf/issues
.Sh SEE ALSO .Sh SEE ALSO
.Pp .Pp
\fBnvf\fR(5) .Fn nvf 5
.Sh AUTHOR .Sh AUTHOR
.Pp .Pp
\fBnvf contributors\fR .Fn nvf contributors
.RS 4 .RS 4
Author. Primary contributors and maintainers of the project.
.RE .RE
.Sh COPYRIGHT .Sh COPYRIGHT
.br .Pp
Copyright \(co 2023\(en2024 nvf contributors Copyright (c) 20232025 nvf contributors.
.br

View file

@ -102,7 +102,7 @@ in
--script script/anchor-use.js \ --script script/anchor-use.js \
--script script/anchor-min.js \ --script script/anchor-min.js \
--script script/search.js \ --script script/search.js \
--toc-depth 2 \ --toc-depth 1 \
--section-toc-depth 1 \ --section-toc-depth 1 \
manual.md \ manual.md \
"$dest/index.xhtml" "$dest/index.xhtml"

View file

@ -1,9 +1,13 @@
# Neovim Flake Configuration Options {#ch-options} # nvf Configuration Options {#ch-options}
Below are the module options provided by nvf, in no particular order. Most Below are the module options provided by nvf, in no particular order. Most
options will include useful comments, warnings or setup tips on how a module 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
which you can access with `man 5 nvf`. Please us know if you believe any of the
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:
[](#opt-vim.*) If changing the prefix here, do keep in mind the #opt- suffix will have [](#opt-vim.*) If changing the prefix here, do keep in mind the #opt- suffix will have

View file

@ -1,6 +1,7 @@
# Helpful Tips {#ch-helpful-tips} # Helpful Tips {#ch-helpful-tips}
```{=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
``` ```

View file

@ -17,3 +17,9 @@ nvf-print-config | bat --language=lua
``` ```
Alternatively, `cat` or `less` may also be used. Alternatively, `cat` or `less` may also be used.
## Accessing `neovimConfig` {#sec-accessing-config}
It is also possible to access the configuration for the wrapped package. The
_built_ Neovim package will contain a `neovimConfig` attribute in its
`passthru`.

View file

@ -0,0 +1,117 @@
# Pure Lua Configuration {#sec-pure-lua-config}
We recognize that you might not always want to configure your setup purely in
Nix, sometimes doing things in Lua is simply the "superior" option. In such a
case you might want to configure your Neovim instance using Lua, and nothing but
Lua. It is also possible to mix Lua and Nix configurations.
Pure Lua or hybrid Lua/Nix configurations can be achieved in two different ways.
_Purely_, by modifying Neovim's runtime directory or _impurely_ by placing Lua
configuration in a directory found in `$HOME`. For your convenience, this
section will document both methods as they can be used.
## Pure Runtime Directory {#sec-pure-nvf-runtime}
As of 0.6, nvf allows you to modify Neovim's runtime path to suit your needs.
One of the ways the new runtime option is to add a configuration **located
relative to your `flake.nix`**, which must be version controlled in pure flakes
manner.
```nix
{
# Let us assume we are in the repository root, i.e., the same directory as the
# flake.nix. For the sake of the argument, we will assume that the Neovim lua
# configuration is in a nvim/ directory relative to flake.nix.
vim = {
additionalRuntimeDirectories = [
# This will be added to Neovim's runtime paths. Conceptually, this behaves
# very similarly to ~/.config/nvim but you may not place a top-level
# init.lua to be able to require it directly.
./nvim
];
};
}
```
This will add the `nvim` directory, or rather, the _store path_ that will be
realised after your flake gets copied to the Nix store, to Neovim's runtime
directory. You may now create a `lua/myconfig` directory within this nvim
directory, and call it with [](#opt-vim.luaConfigRC).
```nix
{pkgs, ...}: {
vim = {
additionalRuntimeDirectories = [
# You can list more than one file here.
./nvim-custom-1
# To make sure list items are ordered, use lib.mkBefore or lib.mkAfter
# Simply placing list items in a given order will **not** ensure that
# this list will be deterministic.
./nvim-custom-2
];
startPlugins = [pkgs.vimPlugins.gitsigns];
# Neovim supports in-line syntax highlighting for multi-line strings.
# Simply place the filetype in a /* comment */ before the line.
luaConfigRC.myconfig = /* lua */ ''
-- Call the Lua module from ./nvim/lua/myconfig
require("myconfig")
-- Any additional Lua configuration that you might want *after* your own
-- configuration. For example, a plugin setup call.
require('gitsigns').setup({})
'';
};
}
```
## Impure Absolute Directory {#sec-impure-absolute-dir}
[Neovim 0.9]: https://github.com/neovim/neovim/pull/22128
As of [Neovim 0.9], {var}`$NVIM_APPNAME` is a variable expected by Neovim to
decide on the configuration directory. nvf sets this variable as `"nvf"`,
meaning `~/.config/nvf` will be regarded as _the_ configuration directory by
Neovim, similar to how `~/.config/nvim` behaves in regular installations. This
allows some degree of Lua configuration, backed by our low-level wrapper
[mnw](https://github.com/Gerg-L/mnw). Creating a `lua/` directory located in
`$NVIM_APPNAME` ("nvf" by default) and placing your configuration in, e.g.,
`~/.config/nvf/lua/myconfig` will allow you to `require` it as a part of the Lua
module system through nvf's module system.
Let's assume your `~/.config/nvf/lua/myconfig/init.lua` consists of the
following:
```lua
-- init.lua
vim.keymap.set("n", " ", "<Nop>", { silent = true, remap = false })
vim.g.mapleader = " "
```
The following Nix configuration via [](#opt-vim.luaConfigRC) will allow loading
this
```nix
{
# The attribute name "myconfig-dir" here is arbitrary. It is required to be
# a *named* attribute by the DAG system, but the name is entirely up to you.
vim.luaConfigRC.myconfig-dir = ''
require("myconfig")
-- Any additional Lua
'';
}
```
[DAG system]: https://notashelf.github.io/nvf/index.xhtml#ch-using-dags
After you load your custom configuration, you may use an `init.lua` located in
your custom configuration directory to configure Neovim exactly as you would
without a wrapper like nvf. If you want to place your `require` call in a
specific position (i.e., before or after options you set in nvf) the
[DAG system] will let you place your configuration in a location of your
choosing.
[top-level DAG system]: https://notashelf.github.io/nvf/index.xhtml#ch-vim-luaconfigrc

View file

@ -4,6 +4,7 @@
[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
- Add [typst-preview.nvim] under - Add [typst-preview.nvim] under
`languages.typst.extensions.typst-preview-nvim`. `languages.typst.extensions.typst-preview-nvim`.
@ -31,6 +32,15 @@
your Editorconfig configuration, or use an autocommand to set indentation your Editorconfig configuration, or use an autocommand to set indentation
values for buffers with the Nix filetype. values for buffers with the Nix filetype.
- Add [](#opt-vim.lsp.lightbulb.autocmd.enable) for manually managing the
previously managed lightbulb autocommand.
- A warning will occur if [](#opt-vim.lsp.lightbulb.autocmd.enable) and
`vim.lsp.lightbulb.setupOpts.autocmd.enabled` are both set at the same time.
Pick only one.
- Add [yanky.nvim] to available plugins, under `vim.utility.yanky-nvim`.
[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
@ -59,7 +69,8 @@
- Add `vim.snippets.luasnip.setupOpts`, which was previously missing. - Add `vim.snippets.luasnip.setupOpts`, which was previously missing.
- Add `"prettierd"` as a formatter option in - Add `"prettierd"` as a formatter option in
`vim.languages.markdown.format.type`. `vim.languages.markdown.format.type`.
- Add the following plugins from [mini.nvim](https://github.com/echasnovski/mini.nvim) - Add the following plugins from
[mini.nvim](https://github.com/echasnovski/mini.nvim)
- `mini.ai` - `mini.ai`
- `mini.align` - `mini.align`
- `mini.animate` - `mini.animate`
@ -102,6 +113,9 @@
- `mini.trailspace` - `mini.trailspace`
- `mini.visits` - `mini.visits`
- Add [fzf-lua](https://github.com/ibhagwan/fzf-lua) in `vim.fzf-lua` - Add [fzf-lua](https://github.com/ibhagwan/fzf-lua) in `vim.fzf-lua`
- Add [rainbow-delimiters](https://github.com/HiPhish/rainbow-delimiters.nvim)
in `vim.visuals.rainbow-delimiters`
- Add options to define highlights under [](#opt-vim.highlight)
[kaktu5](https://github.com/kaktu5): [kaktu5](https://github.com/kaktu5):
@ -120,3 +134,8 @@
[ruff]: (https://github.com/astral-sh/ruff) [ruff]: (https://github.com/astral-sh/ruff)
- Add [ruff] as a formatter option in `vim.languages.python.format.type`. - Add [ruff] as a formatter option in `vim.languages.python.format.type`.
[ARCIII](https://github.com/ArmandoCIII):
- Add `vim.languages.zig.dap` support through pkgs.lldb dap adapter. Code
Inspiration from `vim.languages.clang.dap` implementation.

56
flake.lock generated
View file

@ -77,11 +77,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1735523292, "lastModified": 1737370608,
"narHash": "sha256-opBsbR/nrGxiiF6XzlVluiHYb6yN/hEwv+lBWTy9xoM=", "narHash": "sha256-hFA6SmioeqvGW/XvZa9bxniAeulksCOcj3kokdNT/YE=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6d97d419e5a9b36e6293887a89a078cf85f5a61b", "rev": "300081d0cc72df578b02d914df941b8ec62240e6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1836,15 +1836,15 @@
"plugin-nvim-colorizer-lua": { "plugin-nvim-colorizer-lua": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1735384185, "lastModified": 1738229011,
"narHash": "sha256-quqs3666vQc/4ticc/Z5BHzGxV6UUVE9jVGT07MEMQQ=", "narHash": "sha256-IEgZnIUeNXRKZ4eV1+KknluyKZj68HBWe1EW+LueuGA=",
"owner": "NvChad", "owner": "catgoose",
"repo": "nvim-colorizer.lua", "repo": "nvim-colorizer.lua",
"rev": "8a65c448122fc8fac9c67b2e857b6e830a4afd0b", "rev": "9b5fe0450bfb2521c6cea29391e5ec571f129136",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NvChad", "owner": "catgoose",
"repo": "nvim-colorizer.lua", "repo": "nvim-colorizer.lua",
"type": "github" "type": "github"
} }
@ -2361,6 +2361,22 @@
"type": "github" "type": "github"
} }
}, },
"plugin-rainbow-delimiters": {
"flake": false,
"locked": {
"lastModified": 1736686348,
"narHash": "sha256-zWHXYs3XdnoszqOFY3hA2L5mNn1a44OAeKv3lL3EMEw=",
"owner": "HiPhish",
"repo": "rainbow-delimiters.nvim",
"rev": "85b80abaa09cbbc039e3095b2f515b3cf8cadd11",
"type": "github"
},
"original": {
"owner": "HiPhish",
"repo": "rainbow-delimiters.nvim",
"type": "github"
}
},
"plugin-registers": { "plugin-registers": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -2444,11 +2460,11 @@
"plugin-rustaceanvim": { "plugin-rustaceanvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1735431742, "lastModified": 1738187731,
"narHash": "sha256-ucZXGbxHtbSKf5n11lL3vb6rD2BxJacIDOgcx32PLzA=", "narHash": "sha256-Z4aCPO4MR0Q2ZojT6YBGSa8fb7u5Nd+4Z/rekqhXqDY=",
"owner": "mrcjkb", "owner": "mrcjkb",
"repo": "rustaceanvim", "repo": "rustaceanvim",
"rev": "51c097ebfb65d83baa71f48000b1e5c0a8dcc4fb", "rev": "4a2f2d2cc04f5b0aa0981f98bb7d002c898318ad",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -2745,6 +2761,22 @@
"type": "github" "type": "github"
} }
}, },
"plugin-yanky-nvim": {
"flake": false,
"locked": {
"lastModified": 1737126873,
"narHash": "sha256-Gt8kb6sZoNIM2SDWUPyAF5Tw99qMZl+ltUCfyMXgJsU=",
"owner": "gbprod",
"repo": "yanky.nvim",
"rev": "d2696b30e389dced94d5acab728f524a25f308d2",
"type": "github"
},
"original": {
"owner": "gbprod",
"repo": "yanky.nvim",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
@ -2893,6 +2925,7 @@
"plugin-precognition-nvim": "plugin-precognition-nvim", "plugin-precognition-nvim": "plugin-precognition-nvim",
"plugin-project-nvim": "plugin-project-nvim", "plugin-project-nvim": "plugin-project-nvim",
"plugin-promise-async": "plugin-promise-async", "plugin-promise-async": "plugin-promise-async",
"plugin-rainbow-delimiters": "plugin-rainbow-delimiters",
"plugin-registers": "plugin-registers", "plugin-registers": "plugin-registers",
"plugin-render-markdown-nvim": "plugin-render-markdown-nvim", "plugin-render-markdown-nvim": "plugin-render-markdown-nvim",
"plugin-rose-pine": "plugin-rose-pine", "plugin-rose-pine": "plugin-rose-pine",
@ -2917,6 +2950,7 @@
"plugin-vim-repeat": "plugin-vim-repeat", "plugin-vim-repeat": "plugin-vim-repeat",
"plugin-vim-startify": "plugin-vim-startify", "plugin-vim-startify": "plugin-vim-startify",
"plugin-which-key": "plugin-which-key", "plugin-which-key": "plugin-which-key",
"plugin-yanky-nvim": "plugin-yanky-nvim",
"systems": "systems_2" "systems": "systems_2"
} }
}, },

View file

@ -17,6 +17,8 @@
# «https://github.com/nix-systems/nix-systems» # «https://github.com/nix-systems/nix-systems»
systems = import inputs.systems; systems = import inputs.systems;
imports = [ imports = [
./flake/templates
./flake/apps.nix ./flake/apps.nix
./flake/legacyPackages.nix ./flake/legacyPackages.nix
./flake/overlays.nix ./flake/overlays.nix
@ -502,6 +504,11 @@
flake = false; flake = false;
}; };
plugin-rainbow-delimiters = {
url = "github:HiPhish/rainbow-delimiters.nvim";
flake = false;
};
# Minimap # Minimap
plugin-minimap-vim = { plugin-minimap-vim = {
url = "github:wfxr/minimap.vim"; url = "github:wfxr/minimap.vim";
@ -585,6 +592,11 @@
flake = false; flake = false;
}; };
plugin-yanky-nvim = {
url = "github:gbprod/yanky.nvim";
flake = false;
};
# Note-taking # Note-taking
plugin-obsidian-nvim = { plugin-obsidian-nvim = {
url = "github:epwalsh/obsidian.nvim"; url = "github:epwalsh/obsidian.nvim";
@ -635,7 +647,7 @@
}; };
plugin-nvim-colorizer-lua = { plugin-nvim-colorizer-lua = {
url = "github:NvChad/nvim-colorizer.lua"; url = "github:catgoose/nvim-colorizer.lua";
flake = false; flake = false;
}; };

View file

@ -19,9 +19,11 @@
in in
pkgs.testers.lycheeLinkCheck { pkgs.testers.lycheeLinkCheck {
inherit site; inherit site;
remap = { remap = {
"https://notashelf.github.io/nvf/" = site; "https://notashelf.github.io/nvf/" = site;
}; };
extraConfig = { extraConfig = {
exclude = []; exclude = [];
include_mail = true; include_mail = true;
@ -29,43 +31,39 @@
}; };
}; };
# Build and open the built manual in your system browser # Helper utility for building the HTML manual and opening it in the
docs-html-wrapped = pkgs.writeScriptBin "docs-html-wrapped" '' # browser with $BROWSER or using xdg-open as a fallback tool.
#!${pkgs.stdenv.shell} # Adapted from Home-Manager, available under the MIT license.
# use xdg-open to open the docs in the browser docs-html-wrapped = let
${pkgs.xdg-utils}/bin/xdg-open ${docs.manual.html} xdg-open = lib.getExe' pkgs.xdg-utils "xdg-open";
''; docs-html = docs.manual.html + /share/doc/nvf;
in
pkgs.writeShellScriptBin "docs-html-wrapped" ''
set -euo pipefail
if [[ ! -v BROWSER || -z $BROWSER ]]; then
for candidate in xdg-open open w3m; do
BROWSER="$(type -P $candidate || true)"
if [[ -x $BROWSER ]]; then
break;
fi
done
fi
if [[ ! -v BROWSER || -z $BROWSER ]]; then
echo "$0: unable to start a web browser; please set \$BROWSER"
echo "$0: Trying xdg-open as a fallback"
${xdg-open} ${docs-html}/index.xhtml
else
echo "\$BROWSER is set. Attempting to open manual"
exec "$BROWSER" "${docs-html}/index.xhtml"
fi
'';
# Exposed neovim configurations # Exposed neovim configurations
nix = config.legacyPackages.neovim-nix; nix = config.legacyPackages.neovim-nix;
maximal = config.legacyPackages.neovim-maximal; maximal = config.legacyPackages.neovim-maximal;
default = config.legacyPackages.neovim-nix; default = config.legacyPackages.neovim-nix;
# Published docker images
docker-nix = let
inherit (pkgs) bash gitFull buildEnv;
inherit (config.legacyPackages) neovim-nix;
in
pkgs.dockerTools.buildImage {
name = "nvf";
tag = "latest";
copyToRoot = buildEnv {
name = "neovim-root";
pathsToLink = ["/bin"];
paths = [
neovim-nix
gitFull
bash
];
};
config = {
Cmd = ["${neovim-nix}/bin/nvim"];
WorkingDir = "/home/neovim/demo";
Volumes = {"/home/neovim/demo" = {};};
};
};
}; };
}; };
} }

View file

@ -0,0 +1,17 @@
{
flake.templates = {
standalone = {
path = ./standalone;
description = "Standalone flake template for nvf";
welcomeText = ''
Template flake.nix has been created in flake.nix!
Note that this is a very basic example to bootstrap nvf for you. Please edit your
configuration as described in the nvf manual before using this template. The
configured packages will be ran with 'nix run .' or 'nix run .#neovimConfigured'
Happy editing!
'';
};
};
}

View file

@ -0,0 +1,64 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nvf.url = "github:notashelf/nvf";
};
outputs = {
self,
nixpkgs,
...
} @ inputs: let
# An abstraction over systems to easily provide the same package
# for multiple systems. This is preferable to abstraction libraries.
forEachSystem = nixpkgs.lib.genAttrs ["x86_64-linux"];
in {
packages = forEachSystem (system: let
pkgs = inputs.nixpkgs.legacyPackages.${system};
# A module to be evaluated via lib.evalModules inside nvf's module system.
# All options supported by nvf will go under config.vim to create the final
# wrapped package. You may also add some new *options* under options.* to
# expand the module system.
configModule = {
# You may browse available options for nvf on the online manual. Please see
# <https://notashelf.github.io/nvf/options.html>
config.vim = {
theme.enable = true;
# Language support and automatic configuration of companion plugins.
# Note that enabling, e.g., languages.<lang>.diagnostics will automatically
# enable top-level options such as enableLSP or enableExtraDiagnostics as
# they are needed.
languages = {
enableLSP = true;
enableFormat = true;
enableTreesitter = true;
enableExtraDiagnostics = true;
# Nix language and diagnostics.
nix.enable = true;
};
};
};
# Evaluate any and all modules to create the wrapped Neovim package.
neovimConfigured = inputs.nvf.lib.neovimConfiguration {
inherit pkgs;
modules = [
# Configuration module to be imported. You may define multiple modules
# or even import them from other files (e.g., ./modules/lsp.nix) to
# better modularize your configuration.
configModule
];
};
in {
# Packages to be exposed under packages.<system>. Those can accessed
# directly from package outputs in other flakes if this flake is added
# as an input. You may run those packages with 'nix run .#<package>'
default = self.packages.${system}.neovim;
neovimConfigured = neovimConfigured.neovim;
});
};
}

View file

@ -24,7 +24,7 @@ in {
entryAfter, and entryBefore to a topologically sorted list of entryAfter, and entryBefore to a topologically sorted list of
entries. entries.
Internally this function uses the `toposort` function in Internally this function uses the `topoSort` function in
`<nixpkgs/lib/lists.nix>` and its value is accordingly. `<nixpkgs/lib/lists.nix>` and its value is accordingly.
Specifically, the result on success is Specifically, the result on success is
@ -136,16 +136,26 @@ in {
entriesAfter = tag: entriesBetween tag []; entriesAfter = tag: entriesBetween tag [];
entriesBefore = tag: before: entriesBetween tag before []; entriesBefore = tag: before: entriesBetween tag before [];
# mkLuarcSection and mkVimrcSection take a section DAG # mkLuarcSection takes a section DAG, containing 'name' and 'data' fields
# and return a string containing a comment to identify # then returns a string containing a comment to identify the section, and
# the data contained within the section.
# the section, and the data contained within the section # the section, and the data contained within the section
# #
# all operations are done without any modifications # All operations are done without any modifications to the inputted section
# to the inputted section data # data, but if a non-string is passed to name or data, then it will try to
mkLuarcSection = section: '' # coerce it into a string, which may fail. Setting data to "" or null will
-- SECTION: ${section.name} # return an empty string.
${section.data} #
''; # section.data should never be null, though taking 'null' as a value that
# can "clear" the DAG might come in handy for filtering sections more easily.
# Or perhaps simply unsetting them from an user perspective.
mkLuarcSection = section:
if section.data == "" || section.data == null
then ""
else ''
-- SECTION: ${section.name}
${section.data}
'';
resolveDag = { resolveDag = {
name, name,

View file

@ -2,6 +2,7 @@
imports = [ imports = [
./basic.nix ./basic.nix
./debug.nix ./debug.nix
./highlight.nix
./spellcheck.nix ./spellcheck.nix
]; ];
} }

View file

@ -0,0 +1,119 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkOption;
inherit (lib.types) nullOr attrsOf listOf submodule bool ints str enum;
inherit (lib.strings) hasPrefix concatLines;
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.nvim.dag) entryBetween;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.types) hexColor;
mkColorOption = target:
mkOption {
type = nullOr hexColor;
default = null;
example = "#ebdbb2";
description = ''
The ${target} color to use. Written as color name or hex "#RRGGBB".
'';
};
mkBoolOption = name:
mkOption {
type = nullOr bool;
default = null;
example = false;
description = "Whether to enable ${name}";
};
cfg = config.vim.highlight;
in {
options.vim.highlight = mkOption {
type = attrsOf (submodule {
# See :h nvim_set_hl
options = {
bg = mkColorOption "background";
fg = mkColorOption "foreground";
sp = mkColorOption "special";
blend = mkOption {
type = nullOr (ints.between 0 100);
default = null;
description = "Blend as an integer between 0 and 100";
};
bold = mkBoolOption "bold";
standout = mkBoolOption "standout";
underline = mkBoolOption "underline";
undercurl = mkBoolOption "undercurl";
underdouble = mkBoolOption "underdouble";
underdotted = mkBoolOption "underdotted";
underdashed = mkBoolOption "underdashed";
strikethrough = mkBoolOption "strikethrough";
italic = mkBoolOption "italic";
reverse = mkBoolOption "reverse";
nocombine = mkBoolOption "nocombine";
link = mkOption {
type = nullOr str;
default = null;
description = "The name of another highlight group to link to";
};
default = mkOption {
type = nullOr bool;
default = null;
description = "Don't override existing definition";
};
ctermfg = mkOption {
type = nullOr str;
default = null;
description = "The cterm foreground color to use";
};
ctermbg = mkOption {
type = nullOr str;
default = null;
description = "The cterm background color to use";
};
cterm = mkOption {
type = nullOr (listOf (enum [
"bold"
"underline"
"undercurl"
"underdouble"
"underdotted"
"underdashed"
"strikethrough"
"reverse"
"inverse"
"italic"
"standout"
"altfont"
"nocombine"
"NONE"
]));
default = null;
description = "The cterm arguments to use. See ':h highlight-args'";
};
force = mkBoolOption "force update";
};
});
default = {};
example = {
SignColumn = {
bg = "#282828";
};
};
description = "Custom highlights to apply";
};
config = {
vim.luaConfigRC.highlight = let
highlights =
mapAttrsToList (
name: value: ''vim.api.nvim_set_hl(0, ${toLuaObject name}, ${toLuaObject value})''
)
cfg;
in
entryBetween ["lazyConfigs" "pluginConfigs" "extraPluginConfigs"] ["theme"] (concatLines highlights);
};
}

View file

@ -82,7 +82,7 @@
ls_sources, ls_sources,
null_ls.builtins.formatting.prettier.with({ null_ls.builtins.formatting.prettier.with({
command = "${cfg.format.package}/bin/prettier", command = "${cfg.format.package}/bin/prettier",
filetypes = { "typescript" }, filetypes = { "typescript", "javascript" },
}) })
) )
''; '';

View file

@ -8,10 +8,12 @@
inherit (lib.options) mkEnableOption mkOption; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge mkDefault; inherit (lib.modules) mkIf mkMerge mkDefault;
inherit (lib.lists) isList; inherit (lib.lists) isList;
inherit (lib.types) either listOf package str enum; inherit (lib.types) bool either listOf package str enum;
inherit (lib.nvim.lua) expToLua; inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.types) mkGrammarOption; inherit (lib.nvim.types) mkGrammarOption;
cfg = config.vim.languages.zig;
defaultServer = "zls"; defaultServer = "zls";
servers = { servers = {
zls = { zls = {
@ -31,7 +33,35 @@
}; };
}; };
cfg = config.vim.languages.zig; # TODO: dap.adapter.lldb is duplicated when enabling the
# vim.languages.clang.dap module. This does not cause
# breakage... but could be cleaner.
defaultDebugger = "lldb-vscode";
debuggers = {
lldb-vscode = {
package = pkgs.lldb;
dapConfig = ''
dap.adapters.lldb = {
type = 'executable',
command = '${cfg.dap.package}/bin/lldb-dap',
name = 'lldb'
}
dap.configurations.zig = {
{
name = 'Launch',
type = 'lldb',
request = 'launch',
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = "''${workspaceFolder}",
stopOnEntry = false,
args = {},
},
}
'';
};
};
in { in {
options.vim.languages.zig = { options.vim.languages.zig = {
enable = mkEnableOption "Zig language support"; enable = mkEnableOption "Zig language support";
@ -56,6 +86,26 @@ in {
default = pkgs.zls; default = pkgs.zls;
}; };
}; };
dap = {
enable = mkOption {
type = bool;
default = config.vim.languages.enableDAP;
description = "Enable Zig Debug Adapter";
};
debugger = mkOption {
type = enum (attrNames debuggers);
default = defaultDebugger;
description = "Zig debugger to use";
};
package = mkOption {
type = package;
default = debuggers.${cfg.dap.debugger}.package;
description = "Zig debugger package.";
};
};
}; };
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
@ -77,5 +127,12 @@ in {
globals.zig_fmt_autosave = mkDefault 0; globals.zig_fmt_autosave = mkDefault 0;
}; };
}) })
(mkIf cfg.dap.enable {
vim = {
debugger.nvim-dap.enable = true;
debugger.nvim-dap.sources.zig-debugger = debuggers.${cfg.dap.debugger}.dapConfig;
};
})
]); ]);
} }

View file

@ -4,6 +4,7 @@
... ...
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.strings) optionalString;
inherit (lib.nvim.dag) entryAnywhere; inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject; inherit (lib.nvim.lua) toLuaObject;
@ -12,13 +13,29 @@ in {
config = mkIf (cfg.enable && cfg.lightbulb.enable) { config = mkIf (cfg.enable && cfg.lightbulb.enable) {
vim = { vim = {
startPlugins = ["nvim-lightbulb"]; startPlugins = ["nvim-lightbulb"];
pluginRC.lightbulb = entryAnywhere '' pluginRC.lightbulb = entryAnywhere ''
vim.api.nvim_command('autocmd CursorHold,CursorHoldI * lua require\'nvim-lightbulb\'.update_lightbulb()') local nvim_lightbulb = require("nvim-lightbulb")
nvim_lightbulb.setup(${toLuaObject cfg.lightbulb.setupOpts})
-- Enable trouble diagnostics viewer ${optionalString cfg.lightbulb.autocmd.enable ''
require'nvim-lightbulb'.setup(${toLuaObject cfg.lightbulb.setupOpts}) vim.api.nvim_create_autocmd(${toLuaObject cfg.lightbulb.autocmd.events}, {
pattern = ${toLuaObject cfg.lightbulb.autocmd.pattern},
callback = function()
nvim_lightbulb.update_lightbulb()
end,
})
''}
''; '';
}; };
warnings = [
# This could have been an assertion, but the chances of collision is very low and asserting here
# might be too dramatic. Let's only warn the user, *in case* this occurs and is not intended. No
# error will be thrown if 'lightbulb.setupOpts.autocmd.enable' has not been set by the user.
(mkIf (cfg.lightbulb.autocmd.enable -> (cfg.lightbulb.setupOpts.autocmd.enabled or false)) ''
Both 'vim.lsp.lightbulb.autocmd.enable' and 'vim.lsp.lightbulb.setupOpts.autocmd.enable' are set
simultaneously. This might have performance implications due to frequent updates. Please set only
one option to handle nvim-lightbulb autocmd.
'')
];
}; };
} }

View file

@ -1,11 +1,29 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.options) mkEnableOption; inherit (lib.options) mkOption mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption; inherit (lib.types) listOf str either;
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
in { in {
options.vim.lsp = { options.vim.lsp = {
lightbulb = { lightbulb = {
enable = mkEnableOption "Lightbulb for code actions. Requires an emoji font"; enable = mkEnableOption "Lightbulb for code actions. Requires an emoji font";
setupOpts = mkPluginSetupOption "nvim-lightbulb" {}; setupOpts = mkPluginSetupOption "nvim-lightbulb" {};
autocmd = {
enable = mkEnableOption "updating lightbulb glyph automatically" // {default = true;};
events = mkOption {
type = listOf str;
default = ["CursorHold" "CursorHoldI"];
description = "Events on which to update nvim-lightbulb glyphs";
};
pattern = mkOption {
type = either str luaInline;
default = "*";
description = ''
File patterns or buffer names to match, determining which files or buffers trigger
glyph updates.
'';
};
};
}; };
}; };
} }

View file

@ -1,19 +1,19 @@
{ {
imports = [ imports = [
./outline
./binds ./binds
./ccc ./ccc
./diffview
./fzf-lua
./gestures ./gestures
./motion
./new-file-template
./telescope
./icon-picker ./icon-picker
./images ./images
./telescope ./motion
./diffview ./new-file-template
./wakatime ./outline
./surround
./preview ./preview
./fzf-lua ./surround
./telescope
./wakatime
./yanky-nvim
]; ];
} }

View file

@ -0,0 +1,32 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.lists) optionals concatLists;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.utility.yanky-nvim;
usingSqlite = cfg.setupOpts.ring.storage == "sqlite";
in {
config = mkIf cfg.enable {
vim = {
# TODO: this could probably be lazyloaded. I'm not yet sure which event is
# ideal, so it's loaded normally for now.
startPlugins = concatLists [
["yanky-nvim"]
# If using the sqlite backend, sqlite-lua must be loaded
# alongside yanky.
(optionals usingSqlite [pkgs.vimPlugins.sqlite-lua])
];
pluginRC.yanky-nvim = entryAnywhere ''
require("yanky").setup(${toLuaObject cfg.setupOpts});
'';
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./config.nix
./yanky-nvim.nix
];
}

View file

@ -0,0 +1,28 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) enum;
in {
options.vim.utility.yanky-nvim = {
enable = mkEnableOption ''
improved Yank and Put functionalities for Neovim [yanky-nvim]
'';
setupOpts = {
ring.storage = mkOption {
type = enum ["shada" "sqlite" "memory"];
default = "shada";
example = "sqlite";
description = ''
storage mode for ring values.
- shada: this will save pesistantly using Neovim ShaDa feature.
This means that history will be persisted between each session of Neovim.
- memory: each Neovim instance will have his own history and it will be
lost between sessions.
- sqlite: more reliable than `shada`, requires `sqlite.lua` as a dependency.
nvf will add this dependency to `PATH` automatically.
'';
};
};
};
}

View file

@ -15,6 +15,7 @@ in {
./nvim-cursorline ./nvim-cursorline
./nvim-scrollbar ./nvim-scrollbar
./nvim-web-devicons ./nvim-web-devicons
./rainbow-delimiters
./tiny-devicons-auto-colors ./tiny-devicons-auto-colors
]; ];
} }

View file

@ -0,0 +1,18 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.visuals.rainbow-delimiters;
in {
vim = mkIf cfg.enable {
startPlugins = ["rainbow-delimiters"];
pluginRC.rainbow-delimiters = entryAnywhere ''
vim.g.rainbow_delimiters = ${toLuaObject cfg.setupOpts}
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./rainbow-delimiters.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.visuals.rainbow-delimiters = {
enable = mkEnableOption "rainbow-delimiters";
setupOpts = mkPluginSetupOption "rainbow-delimiters" {};
};
}

View file

@ -1,4 +1,4 @@
{ {
"release": "v0.8", "release": "v0.8",
"isReleaseBranch": false "isReleaseBranch": false
} }