mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 21:30:51 +00:00
Compare commits
39 commits
9b111d1fe4
...
8f1b38ee81
Author | SHA1 | Date | |
---|---|---|---|
8f1b38ee81 | |||
c0d40cb75b | |||
499d5c2679 | |||
8a98147d5b | |||
e89f074c09 | |||
969ab14046 | |||
af07e1084a | |||
84613262f0 | |||
ffbcebbb4e | |||
38f534f6d8 | |||
bd66a784db | |||
b5ea366433 | |||
550cc787c5 | |||
119a902ddb | |||
71b1aa850c | |||
5745ff6bcd | |||
711de1179c | |||
a8874e8855 | |||
f402e870eb | |||
b2dadb217a | |||
d3d5bbec92 | |||
3af7e4416e | |||
a42a4a4fb6 | |||
7a0e7739c5 | |||
|
715408d2bd | ||
|
1604c7423f | ||
|
dfdad4c2ce | ||
43e3663b2b | |||
|
b302e151e1 | ||
0ba3ccdab8 | |||
|
1bd0ae5f7e | ||
57067e85ed | |||
1b16c6b19f | |||
a6bb6e1b3e | |||
b3f51048db | |||
|
8997e62b3b | ||
82c2d4bdd0 | |||
1badee81db | |||
383924d225 |
74 changed files with 1681 additions and 1851 deletions
72
.github/README.md
vendored
72
.github/README.md
vendored
|
@ -48,7 +48,7 @@
|
|||
[Documentation]: #documentation
|
||||
[Help]: #help
|
||||
[Contribute]: #contributing
|
||||
[FAQ]: #faq
|
||||
[FAQ]: #frequently-asked-questions
|
||||
[Credits]: #credits
|
||||
|
||||
**[<kbd><br> Features <br></kbd>][Features]**
|
||||
|
@ -56,7 +56,7 @@
|
|||
**[<kbd><br> Documentation <br></kbd>][Documentation]**
|
||||
**[<kbd><br> Help <br></kbd>][Help]**
|
||||
**[<kbd><br> Contribute <br></kbd>][Contribute]**
|
||||
**[<kbd><br> FAQ <br></kbd>][Faq]** **[<kbd><br> Credits <br></kbd>][Credits]**
|
||||
**[<kbd><br> FAQ <br></kbd>][FAQ]** **[<kbd><br> Credits <br></kbd>][Credits]**
|
||||
|
||||
</p></div>
|
||||
|
||||
|
@ -64,12 +64,21 @@
|
|||
|
||||
## Features
|
||||
|
||||
[standalone]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-installation
|
||||
[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
|
||||
|
||||
- **Simple**: One language to rule them all! Use Nix to configure everything,
|
||||
with additional Lua Support
|
||||
- **Reproducible**: Your configuration will behave the same _anywhere_. No
|
||||
surprises, promise!
|
||||
- **Portable**: nvf depends _solely_ on your Nix store, and nothing else. No
|
||||
more global binaries! Works on all platforms, without hassle.
|
||||
- Options to install [standalone], [NixOS module] or [Home-Manager module].
|
||||
- **Customizable**: There are _almost no defaults_ to annoy you. nvf is fully
|
||||
customizable through the Nix module system.
|
||||
- Not comfortable with a full-nix config or want to bring your Lua config? You
|
||||
can do just that, no unnecessary restrictions.
|
||||
- **Well-documented**: Documentation is priority. You will _never_ face
|
||||
undocumented, obscure behaviour.
|
||||
- **Idiomatic**: nvf does things ✨ _the right way_ ✨ - the codebase is, and
|
||||
|
@ -120,7 +129,9 @@ instructions.
|
|||
|
||||
## Documentation
|
||||
|
||||
The _recommended_ way of installing **nvf** is using either the NixOS or the
|
||||
### Installation
|
||||
|
||||
The _recommended_ way of installing nvf is using either the NixOS or the
|
||||
Home-Manager module, though it is completely possible and no less supported to
|
||||
install **nvf** as a standalone package, or a flake output.
|
||||
|
||||
|
@ -138,11 +149,13 @@ Please create an issue on the [issue tracker] if you find the documentation
|
|||
lacking or confusing. Any improvements to the documentation through pull
|
||||
requests are also welcome, and appreciated.
|
||||
|
||||
## Help
|
||||
## Getting Help
|
||||
|
||||
You can create an issue on the [issue tracker] to ask questions or report bugs.
|
||||
I am not yet on spaces like matrix or IRC, so please use the issue tracker for
|
||||
now.
|
||||
If you are confused, stuck or would like to ask a simple question; you may
|
||||
create an issue on the [issue tracker] to ask questions or report bugs.
|
||||
|
||||
We are not not yet on spaces like matrix or IRC, so please use the issue tracker
|
||||
for now.
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@ -152,7 +165,7 @@ submitting a pull request. You can also create an issue on the [issue tracker]
|
|||
before submitting a pull request if you would like to discuss a feature or bug
|
||||
fix.
|
||||
|
||||
## FAQ
|
||||
## Frequently Asked Questions
|
||||
|
||||
[appropriate issue template]: https://github.com/NotAShelf/nvf/issues/new/choose
|
||||
[list of branches]: https://github.com/NotAShelf/nvf/branches
|
||||
|
@ -160,13 +173,15 @@ fix.
|
|||
|
||||
**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
|
||||
Nix, NixOS or Home-Manager. Please take a look at the [nvf manual] for available
|
||||
installation instructions.
|
||||
|
||||
**Q**: Can you add _X_?
|
||||
<br/> **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
|
||||
**nvf**. Use the [appropriate issue template] and I will consider a module
|
||||
addition. As mentioned before, PRs adding new features are also welcome.
|
||||
addition. As mentioned before, pull requests to add new features are also
|
||||
welcome.
|
||||
|
||||
**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
|
||||
|
@ -185,22 +200,26 @@ better prepare to breaking changes.
|
|||
|
||||
### Contributors
|
||||
|
||||
Special, heart-felt thanks to
|
||||
[mnw]: https://github.com/gerg-l/mnw
|
||||
|
||||
- [@fufexan](https://github.com/fufexan) - For the transition to flake-parts
|
||||
- [@FlafyDev](https://github.com/FlafyDev) - For getting the home-manager to
|
||||
work
|
||||
nvf would not be what it is today without the awesome people below. Special,
|
||||
heart-felt thanks to
|
||||
|
||||
- [@fufexan](https://github.com/fufexan) - For the transition to flake-parts and
|
||||
invaluable Nix assistance.
|
||||
- [@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
|
||||
possible, and other module additions.
|
||||
- [@horriblename](https://github.com/horriblename) - For actively implementing
|
||||
planned features and quality of life updates
|
||||
planned features and quality of life updates.
|
||||
- [@Yavko](https://github.com/Yavko) - For the amazing **nvf** logo
|
||||
- [@FrothyMarrow](https://github.com/FrothyMarrow) - For seeing mistakes that I
|
||||
could not
|
||||
- [@Diniamo](https://github.com/Diniamo) - For actively submitting PRs, pull
|
||||
requests and overall assistence
|
||||
- [@Gerg-l](https://github.com/gerg-l) - For the modern Neovim wrapper, mnw and
|
||||
occasional code improvements
|
||||
could not.
|
||||
- [@Diniamo](https://github.com/Diniamo) - For actively submitting pull
|
||||
requests, issues and assistance with maintenance of nvf.
|
||||
- [@Gerg-l](https://github.com/gerg-l) - For the modern Neovim wrapper, [mnw],
|
||||
and occasional code improvements.
|
||||
|
||||
and everyone who has submitted issues or pull requests!
|
||||
|
||||
|
@ -214,7 +233,7 @@ including:
|
|||
is originally based on.
|
||||
- [@sioodmy's](https://github.com/sioodmy)
|
||||
[dotfiles](https://github.com/sioodmy/dotfiles) that inspired the design
|
||||
choices.
|
||||
choices for UI and plugin defaults.
|
||||
- [@wiltaylor's](https://github.com/wiltaylor)
|
||||
[neovim-flake](https://github.com/wiltaylor/neovim-flake) for plugin and
|
||||
design ideas.
|
||||
|
@ -229,10 +248,11 @@ recommend checking their work out.
|
|||
## License
|
||||
|
||||
Following the license of the
|
||||
[original neovim-flake](https://github.com/jordanisaacs/neovim-flake), **nvf**
|
||||
has been made available under the [**MIT License**](LICENSE). However, all
|
||||
assets and documentation are published under the
|
||||
[**CC BY License**](https://github.com/NotAShelf/nvf/blob/main/.github/assets/LICENSE).
|
||||
[original neovim-flake](https://github.com/jordanisaacs/neovim-flake), nvf has
|
||||
been made available under the [**MIT License**](LICENSE). However, all assets
|
||||
and documentation are published under the
|
||||
[**CC BY License**](https://github.com/NotAShelf/nvf/blob/main/.github/assets/LICENSE)
|
||||
under explicit permission by the artist.
|
||||
|
||||
<h6 align="center">Yes, this includes the logo work too. Stop taking artwork that is not yours!</h6>
|
||||
|
||||
|
|
|
@ -46,6 +46,8 @@ isMaximal: {
|
|||
|
||||
nix.enable = true;
|
||||
|
||||
# Assembly is not common, and the asm LSP is a major hit-or-miss
|
||||
assembly.enable = false;
|
||||
markdown.enable = isMaximal;
|
||||
html.enable = isMaximal;
|
||||
css.enable = isMaximal;
|
||||
|
@ -77,20 +79,17 @@ isMaximal: {
|
|||
};
|
||||
|
||||
visuals = {
|
||||
enable = true;
|
||||
nvimWebDevicons.enable = true;
|
||||
scrollBar.enable = isMaximal;
|
||||
smoothScroll.enable = true;
|
||||
cellularAutomaton.enable = false;
|
||||
nvim-scrollbar.enable = isMaximal;
|
||||
nvim-web-devicons.enable = true;
|
||||
nvim-cursorline.enable = true;
|
||||
cinnamon-nvim.enable = true;
|
||||
fidget-nvim.enable = true;
|
||||
|
||||
highlight-undo.enable = true;
|
||||
indent-blankline.enable = true;
|
||||
|
||||
indentBlankline.enable = true;
|
||||
|
||||
cursorline = {
|
||||
enable = true;
|
||||
lineTimeout = 0;
|
||||
};
|
||||
# Fun
|
||||
cellular-automaton.enable = false;
|
||||
};
|
||||
|
||||
statusline = {
|
||||
|
@ -164,6 +163,7 @@ isMaximal: {
|
|||
motion = {
|
||||
hop.enable = true;
|
||||
leap.enable = true;
|
||||
precognition.enable = isMaximal;
|
||||
};
|
||||
|
||||
images = {
|
||||
|
|
|
@ -1,63 +1,112 @@
|
|||
{
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
fetchzip,
|
||||
runCommandLocal,
|
||||
# build inputs
|
||||
nixos-render-docs,
|
||||
documentation-highlighter,
|
||||
dart-sass,
|
||||
path,
|
||||
# nrd configuration
|
||||
release,
|
||||
optionsJSON,
|
||||
}:
|
||||
stdenvNoCC.mkDerivation {
|
||||
name = "nvf-manual";
|
||||
src = builtins.path {
|
||||
path = lib.sourceFilesBySuffices ./manual [".md"];
|
||||
name = "nvf-manual";
|
||||
} @ args: let
|
||||
manual-release = args.release or "unstable";
|
||||
|
||||
scss-reset = fetchzip {
|
||||
url = "https://github.com/Frontend-Layers/scss-reset/archive/refs/tags/1.4.2.zip";
|
||||
hash = "sha256-cif5Sx8Ca5vxdw/mNAgpulLH15TwmzyJFNM7JURpoaE=";
|
||||
};
|
||||
|
||||
compileStylesheet = runCommandLocal "compile-nvf-stylesheet" {} ''
|
||||
mkdir -p $out
|
||||
|
||||
tmpfile=$(mktemp -d)
|
||||
trap "rm -r $tmpfile" EXIT
|
||||
|
||||
ln -s "${scss-reset}/build" "$tmpfile/scss-reset"
|
||||
|
||||
${dart-sass}/bin/sass --load-path "$tmpfile" \
|
||||
${./static/style.scss} "$out/style.css"
|
||||
|
||||
echo "Generated styles"
|
||||
'';
|
||||
in
|
||||
stdenvNoCC.mkDerivation {
|
||||
name = "nvf-manual";
|
||||
src = builtins.path {
|
||||
name = "nvf-manual-${manual-release}";
|
||||
path = lib.sourceFilesBySuffices ./manual [".md" ".md.in"];
|
||||
};
|
||||
|
||||
strictDependencies = true;
|
||||
nativeBuildInputs = [nixos-render-docs];
|
||||
|
||||
postPatch = ''
|
||||
ln -s ${optionsJSON}/share/doc/nixos/options.json ./config-options.json
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
dest="$out/share/doc/nvf"
|
||||
mkdir -p "$(dirname "$dest")"
|
||||
mkdir -p $dest/{highlightjs,media}
|
||||
mkdir -p $dest/{highlightjs,script}
|
||||
|
||||
# Copy highlight scripts to /highlights in document root.
|
||||
cp -vt $dest/highlightjs \
|
||||
${documentation-highlighter}/highlight.pack.js \
|
||||
${documentation-highlighter}/LICENSE \
|
||||
${documentation-highlighter}/mono-blue.css \
|
||||
${documentation-highlighter}/loader.js
|
||||
|
||||
# Copy anchor scripts to the script directory in document root.
|
||||
cp -vt "$dest"/script \
|
||||
${./static/script}/anchor-min.js \
|
||||
${./static/script}/anchor-use.js
|
||||
|
||||
substituteInPlace ./options.md \
|
||||
--subst-var-by \
|
||||
OPTIONS_JSON \
|
||||
${optionsJSON}/share/doc/nixos/options.json
|
||||
--subst-var-by OPTIONS_JSON ./config-options.json
|
||||
|
||||
substituteInPlace ./manual.md \
|
||||
--subst-var-by \
|
||||
NVF_VERSION \
|
||||
${release}
|
||||
--subst-var-by NVF_VERSION ${manual-release}
|
||||
|
||||
# copy stylesheet
|
||||
cp ${./static/style.css} "$dest/style.css"
|
||||
substituteInPlace ./hacking/additional-plugins.md \
|
||||
--subst-var-by NVF_REPO "https://github.com/notashelf/nvf/blob/${manual-release}"
|
||||
|
||||
# copy release notes
|
||||
# Move compiled stylesheet
|
||||
cp -vt $dest \
|
||||
${compileStylesheet}/style.css
|
||||
|
||||
# Move release notes
|
||||
cp -vr ${./release-notes} release-notes
|
||||
|
||||
# generate manual from
|
||||
# Generate final manual from a set of parameters. Explanation of the CLI flags are
|
||||
# as follows:
|
||||
#
|
||||
# 1. --manpage-urls will allow you to use manual pages as they are defined in
|
||||
# the nixpkgs documentation.
|
||||
# 2. --revision is the project revision as it is defined in 'release.json' in the
|
||||
# repository root
|
||||
# 3. --script will inject a given Javascript file into the resulting pages inside
|
||||
# the <script> tag.
|
||||
# 4. --toc-depth will determine the depth of the initial Table of Contents while
|
||||
# --section-toc-depth will determine the depth of per-section Table of Contents
|
||||
# sections.
|
||||
nixos-render-docs manual html \
|
||||
--manpage-urls ${path + "/doc/manpage-urls.json"} \
|
||||
--revision ${lib.trivial.revisionWithDefault release} \
|
||||
--stylesheet style.css \
|
||||
--script highlightjs/highlight.pack.js \
|
||||
--script highlightjs/loader.js \
|
||||
--revision ${lib.trivial.revisionWithDefault manual-release} \
|
||||
--stylesheet "$dest"/style.css \
|
||||
--script ./highlightjs/highlight.pack.js \
|
||||
--script ./highlightjs/loader.js \
|
||||
--script script/anchor-use.js \
|
||||
--script script/anchor-min.js \
|
||||
--toc-depth 2 \
|
||||
--section-toc-depth 1 \
|
||||
manual.md \
|
||||
"$dest/index.xhtml"
|
||||
|
||||
# Hydra support. Probably not necessary.
|
||||
mkdir -p $out/nix-support/
|
||||
echo "doc manual $dest index.html" >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
# Configuring {#sec-configuring-plugins}
|
||||
|
||||
Just making the plugin to your Neovim configuration available might not always be enough. In that
|
||||
case, you can write custom lua config using either `config.vim.lazy.plugins.*.setupOpts`
|
||||
`config.vim.extraPlugins.*.setup` or `config.vim.luaConfigRC`.
|
||||
Just making the plugin to your Neovim configuration available might not always
|
||||
be enough. In that case, you can write custom lua config using either
|
||||
`config.vim.lazy.plugins.*.setupOpts` `config.vim.extraPlugins.*.setup` or
|
||||
`config.vim.luaConfigRC`.
|
||||
|
||||
The first option uses an extended version of `lz.n`'s PluginSpec. `setupModule` and `setupOpt` can
|
||||
be used if the plugin uses a `require('module').setup(...)` pattern. Otherwise, the `before` and
|
||||
`after` hooks should do what you need.
|
||||
The first option uses an extended version of `lz.n`'s PluginSpec. `setupModule`
|
||||
and `setupOpt` can be used if the plugin uses a `require('module').setup(...)`
|
||||
pattern. Otherwise, the `before` and `after` hooks should do what you need.
|
||||
|
||||
```nix
|
||||
{
|
||||
|
@ -24,10 +25,11 @@ be used if the plugin uses a `require('module').setup(...)` pattern. Otherwise,
|
|||
}
|
||||
```
|
||||
|
||||
The second option uses an attribute set, which maps DAG section names to a custom type, which has
|
||||
the fields `package`, `after`, `setup`. They allow you to set the package of the plugin, the
|
||||
sections its setup code should be after (note that the `extraPlugins` option has its own DAG
|
||||
scope), and the its setup code respectively. For example:
|
||||
The second option uses an attribute set, which maps DAG section names to a
|
||||
custom type, which has the fields `package`, `after`, `setup`. They allow you to
|
||||
set the package of the plugin, the sections its setup code should be after (note
|
||||
that the `extraPlugins` option has its own DAG scope), and the its setup code
|
||||
respectively. For example:
|
||||
|
||||
```nix
|
||||
config.vim.extraPlugins = with pkgs.vimPlugins; {
|
||||
|
@ -56,13 +58,17 @@ For example:
|
|||
}
|
||||
```
|
||||
|
||||
:::{.note}
|
||||
If your configuration needs to be put in a specific place in the config, you
|
||||
can use functions from `inputs.nvf.lib.nvim.dag` to order it. Refer to
|
||||
https://github.com/nix-community/home-manager/blob/master/modules/lib/dag.nix
|
||||
<!-- deno-fmt-ignore-start -->
|
||||
|
||||
::: {.note}
|
||||
One of the greatest strengths of nvf is the ability to order
|
||||
snippets of configuration via the DAG system. It will allow specifying positions
|
||||
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
|
||||
to find out more about the DAG system.
|
||||
:::
|
||||
|
||||
If you successfully made your plugin work, please feel free to create a PR to
|
||||
add it to **nvf** or open an issue with your findings so that we can make it
|
||||
available for everyone easily.
|
||||
<!-- deno-fmt-ignore-end -->
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Legacy Method {#sec-legacy-method}
|
||||
|
||||
Prior to version 0.5, the method of adding new plugins was adding the plugin
|
||||
Prior to version v0.5, the method of adding new plugins was adding the plugin
|
||||
package to `vim.startPlugins` and add its configuration as a DAG under one of
|
||||
`vim.configRC` or `vim.luaConfigRC`. Users who have not yet updated to 0.5, or
|
||||
prefer a more hands-on approach may use the old method where the load order of
|
||||
|
@ -8,13 +8,14 @@ the plugins is determined by DAGs.
|
|||
|
||||
## Adding plugins {#sec-adding-plugins}
|
||||
|
||||
To add a plugin to **nvf**'s runtime, you may add it
|
||||
To add a plugin not available in nvf as a module to your configuration, you may
|
||||
add it to [](#opt-vim.startPlugins) in order to make it available to Neovim at
|
||||
runtime.
|
||||
|
||||
```nix
|
||||
{pkgs, ...}: {
|
||||
# add a package from nixpkgs to startPlugins
|
||||
vim.startPlugins = [
|
||||
pkgs.vimPlugins.aerial-nvim ];
|
||||
# Add a Neovim plugin from Nixpkgs to the runtime.
|
||||
vim.startPlugins = [pkgs.vimPlugins.aerial-nvim];
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -23,7 +24,9 @@ provide configuration as a DAG using the **nvf** extended library.
|
|||
|
||||
```nix
|
||||
{inputs, ...}: let
|
||||
# assuming you have an input called nvf pointing at the nvf repository
|
||||
# This assumes you have an input called 'nvf' in your flake inputs
|
||||
# and 'inputs' in your specialArgs. In the case you have passed 'nvf'
|
||||
# to specialArgs, the 'inputs' prefix may be omitted.
|
||||
inherit (inputs.nvf.lib.nvim.dag) entryAnywhere;
|
||||
in {
|
||||
vim.luaConfigRC.aerial-nvim= entryAnywhere ''
|
||||
|
|
|
@ -1,16 +1,25 @@
|
|||
# Hacking nvf {#ch-hacking}
|
||||
|
||||
**nvf** is designed for developers as much as it is for the end user. I would like any potential contributor
|
||||
to be able to propagate their desired changes into the repository without the extra effort. As such, below are guides
|
||||
(and guidelines) to streamline the contribution process and ensure that your valuable input seamlessly integrates
|
||||
into **nvf**'s development without leaving question marks in your head.
|
||||
[open issues]: https://github.com/notashelf/nvf/issues
|
||||
[new issue]: https://github.com/notashelf/nvf/issues/new
|
||||
|
||||
This section is mainly directed towards those who wish to contribute code into **nvf**. If you wish to instead
|
||||
report a bug or discuss a potential feature implementation, first look among the
|
||||
already [open issues](https://github.com/notashelf/nvf/issues) and if no matching issue exists you may open
|
||||
a [new issue](https://github.com/notashelf/nvf/issues/new) and describe your problem/request. While creating an
|
||||
issue, please try to include as much information as you can, ideally also include relevant context in which an issue
|
||||
occurs or a feature should be implemented.
|
||||
nvf is designed for the developer as much as it is designed for the end-user. We
|
||||
would like for any contributor to be able to propagate their changes, or add new
|
||||
features to the project with minimum possible friction. As such, below are the
|
||||
guides and guidelines written to streamline the contribution process and to
|
||||
ensure that your valuable input integrates into nvf's development as seamlessly
|
||||
as possible without leaving any question marks in your head.
|
||||
|
||||
This section is directed mainly towards those who wish to contribute code into
|
||||
the project. If you instead wish to report a bug, or discuss a potential new
|
||||
feature implementation (which you do not wish to implement yourself) first look
|
||||
among the already [open issues] and if no matching issue exists you may open a
|
||||
[new issue] and describe your problem/request.
|
||||
|
||||
While creating an issue, please try to include as much information as you can,
|
||||
ideally also include relevant context in which an issue occurs or a feature
|
||||
should be implemented. If you wish to make a contribution, but feel stuck -
|
||||
please do not be afraid to submit a pull request, we will help you get it in.
|
||||
|
||||
```{=include=} sections
|
||||
hacking/getting-started.md
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Adding Plugins {#sec-additional-plugins}
|
||||
|
||||
To add a new Neovim plugin, first add the source url in the inputs section of `flake.nix`
|
||||
with the prefix `plugin-`
|
||||
To add a new Neovim plugin, first add the source url in the inputs section of
|
||||
`flake.nix` with the prefix `plugin-`
|
||||
|
||||
```nix
|
||||
|
||||
{
|
||||
inputs = {
|
||||
# ...
|
||||
|
@ -17,13 +16,18 @@ with the prefix `plugin-`
|
|||
}
|
||||
```
|
||||
|
||||
Prepending `plugin-` to the name of the input will allow nvf to automatically
|
||||
discover inputs that are marked as plugins, and make them available in
|
||||
`vim.startPlugins` or other areas that require a very specific plugin type as it
|
||||
is defined in `@NVF_REPO@/lib/types/plugins.nix`
|
||||
|
||||
The addition of the `plugin-` prefix will allow **nvf** to autodiscover the
|
||||
input from the flake inputs automatically, allowing you to refer to it in areas
|
||||
that require a very specific plugin type as defined in `lib/types/plugins.nix`
|
||||
|
||||
You can now reference this plugin using its string name, the plugin will be
|
||||
built with the name and source URL from the flake input, allowing you to
|
||||
refer to it as a **string**.
|
||||
built with the name and source URL from the flake input, allowing you to refer
|
||||
to it as a **string**.
|
||||
|
||||
```nix
|
||||
config.vim.startPlugins = ["neodev-nvim"];
|
||||
|
@ -33,11 +37,11 @@ config.vim.startPlugins = ["neodev-nvim"];
|
|||
|
||||
Most plugins is initialized with a call to `require('plugin').setup({...})`.
|
||||
|
||||
We use a special function that lets you easily add support for such setup options in a modular way:
|
||||
`mkPluginSetupOption`.
|
||||
We use a special function that lets you easily add support for such setup
|
||||
options in a modular way: `mkPluginSetupOption`.
|
||||
|
||||
Once you have added the source of the plugin as shown above, you can define the setup options like
|
||||
this:
|
||||
Once you have added the source of the plugin as shown above, you can define the
|
||||
setup options like this:
|
||||
|
||||
```nix
|
||||
# in modules/.../your-plugin/your-plugin.nix
|
||||
|
@ -86,7 +90,8 @@ require('plugin-name').setup({
|
|||
})
|
||||
```
|
||||
|
||||
Now users can set any of the pre-defined option field, and can also add their own fields!
|
||||
Now users can set any of the pre-defined option field, and can also add their
|
||||
own fields!
|
||||
|
||||
```nix
|
||||
# in user's config
|
||||
|
@ -110,8 +115,8 @@ As you've seen above, `toLuaObject` is used to convert our nix attrSet
|
|||
1. nix `null` converts to lua `nil`
|
||||
2. number and strings convert to their lua counterparts
|
||||
3. nix attrSet/list convert into lua tables
|
||||
4. you can write raw lua code using `lib.generators.mkLuaInline`. This
|
||||
function is part of nixpkgs.
|
||||
4. you can write raw lua code using `lib.generators.mkLuaInline`. This function
|
||||
is part of nixpkgs.
|
||||
|
||||
Example:
|
||||
|
||||
|
@ -127,8 +132,8 @@ vim.your-plugin.setupOpts = {
|
|||
|
||||
## Lazy plugins {#sec-lazy-plugins}
|
||||
|
||||
If the plugin can be lazy-loaded, `vim.lazy.plugins` should be used to add it. Lazy
|
||||
plugins are managed by `lz.n`.
|
||||
If the plugin can be lazy-loaded, `vim.lazy.plugins` should be used to add it.
|
||||
Lazy plugins are managed by `lz.n`.
|
||||
|
||||
```nix
|
||||
# in modules/.../your-plugin/config.nix
|
||||
|
@ -163,6 +168,7 @@ in {
|
|||
```
|
||||
|
||||
This results in the following lua code:
|
||||
|
||||
```lua
|
||||
require('lz.n').load({
|
||||
{
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
# Installing nvf {#ch-installation}
|
||||
|
||||
[module installation section]: #ch-module-installation
|
||||
|
||||
There are multiple ways of installing nvf on your system. You may either choose
|
||||
the standalone installation method, which does not depend on a module system and may
|
||||
be done on any system that has the Nix package manager or the appropriate modules
|
||||
for NixOS and home-manager as described in the [module installation section](#ch-module-installation)
|
||||
the standalone installation method, which does not depend on a module system and
|
||||
may be done on any system that has the Nix package manager or the appropriate
|
||||
modules for NixOS and home-manager as described in the
|
||||
[module installation section].
|
||||
|
||||
```{=include=} chapters
|
||||
installation/custom-configuration.md
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
# Standalone Installation {#ch-standalone-installation}
|
||||
|
||||
It is possible to install **nvf** without depending on NixOS or home-manager as the parent
|
||||
module system, using the `neovimConfiguration` function exposed by **nvf** extended library.
|
||||
It takes in the configuration as a module, and returns an attribute set as a result.
|
||||
It is possible to install nvf without depending on NixOS or Home-Manager as the
|
||||
parent module system, using the `neovimConfiguration` function exposed in the
|
||||
extended library. This function will take `modules` and `extraSpecialArgs` as
|
||||
arguments, and return the following schema as a result.
|
||||
|
||||
```nix
|
||||
{
|
||||
|
@ -13,6 +14,55 @@ It takes in the configuration as a module, and returns an attribute set as a res
|
|||
}
|
||||
```
|
||||
|
||||
An example flake that exposes your custom Neovim configuration might look like
|
||||
|
||||
```nix
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nvf.url = "github:notashelf/nvf";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
...
|
||||
} @ inputs: {
|
||||
packages."x86_64-linux" = let
|
||||
neovimConfigured = (inputs.nvf.lib.neovimConfiguration {
|
||||
inherit (nixpkgs.legacyPackages."x86_64-linux") pkgs;
|
||||
modules = [{
|
||||
config.vim = {
|
||||
# Enable custom theming options
|
||||
theme.enable = true;
|
||||
|
||||
# Enable Treesitter
|
||||
tree-sitter.enable = true;
|
||||
|
||||
# Other options will go here. Refer to the config
|
||||
# reference in Appendix B of the nvf manual.
|
||||
# ...
|
||||
};
|
||||
}];
|
||||
});
|
||||
in {
|
||||
# Set the default package to the wrapped instance of Neovim.
|
||||
# This will allow running your Neovim configuration with
|
||||
# `nix run` and in addition, sharing your configuration with
|
||||
# other users in case your repository is public.
|
||||
default = neovimConfigured.neovim;
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
<!-- TODO: mention the built-in flake template here when it is added -->
|
||||
|
||||
The above setup will allow to set up nvf as a standalone flake, which you can
|
||||
build independently from your system configuration while also possibly sharing
|
||||
it with others. The next two chapters will detail specific usage of such a setup
|
||||
for a package output in the context of NixOS or Home-Manager installation.
|
||||
|
||||
```{=include=} chapters
|
||||
standalone/nixos.md
|
||||
standalone/home-manager.md
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
# Module Installation {#ch-module-installation}
|
||||
|
||||
The below chapters will describe installing nvf as NixOS and Home-Manager
|
||||
modules. Note that those methods are mutually exclusive, and will likely cause
|
||||
path collisions if used simultaneously.
|
||||
|
||||
```{=include=} chapters
|
||||
modules/nixos.md
|
||||
modules/home-manager.md
|
||||
|
|
|
@ -77,7 +77,9 @@ configure **nvf**.
|
|||
```
|
||||
|
||||
::: {.note}
|
||||
|
||||
**nvf** exposes a lot of options, most of which are not referenced in the
|
||||
installation sections of the manual. You may find all avaliable options
|
||||
in the [appendix](https://notashelf.github.io/nvf/options)
|
||||
installation sections of the manual. You may find all available options in the
|
||||
[appendix](https://notashelf.github.io/nvf/options)
|
||||
|
||||
:::
|
||||
|
|
|
@ -76,7 +76,9 @@ configure **nvf**.
|
|||
```
|
||||
|
||||
::: {.note}
|
||||
|
||||
**nvf** exposes a lot of options, most of which are not referenced in the
|
||||
installation sections of the manual. You may find all avaliable options
|
||||
in the [appendix](https://notashelf.github.io/nvf/options)
|
||||
installation sections of the manual. You may find all available options in the
|
||||
[appendix](https://notashelf.github.io/nvf/options)
|
||||
|
||||
:::
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
# Standalone Installation on Home-Manager {#ch-standalone-hm}
|
||||
|
||||
Your built Neoevim configuration can be exposed as a flake output to make it
|
||||
Your built Neovim configuration can be exposed as a flake output to make it
|
||||
easier to share across machines, repositories and so on. Or it can be added to
|
||||
your system packages to make it available across your system.
|
||||
|
||||
The following is an example installation of `nvf` as a standalone package with
|
||||
the default theme enabled. You may use other options inside `config.vim` in
|
||||
`configModule`, but this example will not cover that.
|
||||
`configModule`, but this example will not cover that extensively.
|
||||
|
||||
```nix
|
||||
{
|
||||
|
@ -30,23 +30,22 @@ the default theme enabled. You may use other options inside `config.vim` in
|
|||
};
|
||||
|
||||
customNeovim = nvf.lib.neovimConfiguration {
|
||||
modules = [configModule];
|
||||
inherit pkgs;
|
||||
modules = [configModule];
|
||||
};
|
||||
in {
|
||||
# this will make the package available as a flake input
|
||||
# This will make the package available as a flake output under 'packages'
|
||||
packages.${system}.my-neovim = customNeovim.neovim;
|
||||
|
||||
# this is an example home-manager configuration
|
||||
# using the built neovim package
|
||||
# Example Home-Manager configuration using the configured Neovim package
|
||||
homeConfigurations = {
|
||||
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration {
|
||||
# ...
|
||||
modules = [
|
||||
./home.nix
|
||||
|
||||
# this will make wrapped neovim available in your system packages
|
||||
{environment.systemPackages = [customNeovim.neovim];}
|
||||
# This will make Neovim available to users using the Home-Manager
|
||||
# configuration. To make the package available to all users, prefer
|
||||
# environment.systemPackages in your NixOS configuration.
|
||||
{home.packages = [customNeovim.neovim];}
|
||||
];
|
||||
# ...
|
||||
};
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
# Standalone Installation on NixOS {#ch-standalone-nixos}
|
||||
|
||||
Your built Neoevim configuration can be exposed as a flake output to make it
|
||||
Your built Neovim configuration can be exposed as a flake output to make it
|
||||
easier to share across machines, repositories and so on. Or it can be added to
|
||||
your system packages to make it available across your system.
|
||||
|
||||
The following is an example installation of `nvf` as a standalone package with
|
||||
the default theme enabled. You may use other options inside `config.vim` in
|
||||
`configModule`, but this example will not cover that.
|
||||
`configModule`, but this example will not cover that extensively.
|
||||
|
||||
```nix
|
||||
{
|
||||
|
@ -30,21 +30,19 @@ the default theme enabled. You may use other options inside `config.vim` in
|
|||
};
|
||||
|
||||
customNeovim = nvf.lib.neovimConfiguration {
|
||||
modules = [configModule];
|
||||
inherit pkgs;
|
||||
modules = [configModule];
|
||||
};
|
||||
in {
|
||||
# this will make the package available as a flake input
|
||||
# This will make the package available as a flake output under 'packages'
|
||||
packages.${system}.my-neovim = customNeovim.neovim;
|
||||
|
||||
# this is an example nixosConfiguration using the built neovim package
|
||||
# Example nixosConfiguration using the configured Neovim package
|
||||
nixosConfigurations = {
|
||||
yourHostName = nixpkgs.lib.nixosSystem {
|
||||
# ...
|
||||
modules = [
|
||||
./configuration.nix # or whatever your configuration is
|
||||
|
||||
# this will make wrapped neovim available in your system packages
|
||||
# This will make wrapped neovim available in your system packages
|
||||
{environment.systemPackages = [customNeovim.neovim];}
|
||||
];
|
||||
# ...
|
||||
|
|
|
@ -17,8 +17,8 @@ configuring.md
|
|||
hacking.md
|
||||
```
|
||||
|
||||
```{=include=} appendix html:into-file=//plugins.html
|
||||
plugins.md
|
||||
```{=include=} appendix html:into-file=//quirks.html
|
||||
quirks.md
|
||||
```
|
||||
|
||||
```{=include=} appendix html:into-file=//options.html
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
# Neovim Flake Configuration Options {#ch-options}
|
||||
|
||||
Below are the options provided by nvf provided in no particular order.
|
||||
They may include useful comments and warnings, or examples on how a module option
|
||||
is meant to be used.
|
||||
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
|
||||
option is meant to be used as well as examples in complex cases.
|
||||
|
||||
<!--
|
||||
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
|
||||
to be changed everywhere.
|
||||
-->
|
||||
|
||||
```{=include=} options
|
||||
id-prefix: opt-
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
# Plugin specific quirks {#ch-plugins}
|
||||
|
||||
At times, certain plugins refuse to play nicely. Be it as a result of generating
|
||||
lua from Nix, or the state of packaging. This page shall list any plugins that
|
||||
are known to misbehave, and potential workarounds.
|
||||
|
||||
```{=include=} chapters
|
||||
plugins/nodejs.md
|
||||
```
|
||||
<!--
|
||||
If adding a new section, uncomment this part and add your page to
|
||||
plugins/<page>.md
|
||||
```{=include=} chapters
|
||||
plugins/page.md
|
||||
```
|
||||
-->
|
|
@ -1,7 +1,20 @@
|
|||
# Preface {#ch-preface}
|
||||
|
||||
If you noticed a bug caused by **nvf** then please consider reporting it over
|
||||
[the issue tracker](https://github.com/notashelf/nvf/issues).
|
||||
## What is nvf {#sec-what-is-it}
|
||||
|
||||
Bugfixes, feature additions and upstreamed changes from your local configurations
|
||||
are always welcome in the [the pull requests tab](https://github.com/notashelf/nvf/pulls).
|
||||
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.
|
||||
|
||||
## Bugs & Suggestions {#sec-bugs-suggestions}
|
||||
|
||||
[issue tracker]: https://github.com/notashelf/nvf/issues
|
||||
[discussions tab]: https://github.com/notashelf/nvf/discussions
|
||||
[pull requests tab]: https://github.com/notashelf/nvf/pulls
|
||||
|
||||
If you notice any issues with nvf, or this documentation, then please consider
|
||||
reporting them over at the [issue tracker]. Issues tab, in addition to the
|
||||
[discussions tab] is a good place as any to request new features.
|
||||
|
||||
You may also consider submitting bugfixes, feature additions and upstreamed
|
||||
changes that you think are critical over at the [pull requests tab].
|
||||
|
|
13
docs/manual/quirks.md
Normal file
13
docs/manual/quirks.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Known Issues and Quirks {#ch-known-issues-quirks}
|
||||
|
||||
At times, certain plugins and modules may refuse to play nicely with your setup,
|
||||
be it a result of generating Lua from Nix, or the state of packaging. This page,
|
||||
in turn, will list any known modules or plugins that are known to misbehave, and
|
||||
possible workarounds that you may apply.
|
||||
|
||||
<!-- If adding a new known quirk, please create a new page in quirks/ and include
|
||||
the name of the file here.-->
|
||||
|
||||
```{=include=} chapters
|
||||
quirks/nodejs.md
|
||||
```
|
|
@ -1,16 +1,22 @@
|
|||
# NodeJS {#ch-plugins-nodejs}
|
||||
# NodeJS {#ch-quirks-nodejs}
|
||||
|
||||
## eslint-plugin-prettier {#sec-eslint-plugin-prettier}
|
||||
|
||||
When working with NodeJS, everything works as expected, but some projects have settings that can fool nvf.
|
||||
When working with NodeJS, everything works as expected, but some projects have
|
||||
settings that can fool nvf.
|
||||
|
||||
If [this plugin](https://github.com/prettier/eslint-plugin-prettier) or similar is included, you might get a situation where your eslint configuration diagnoses your formatting according to its own config (usually `.eslintrc.js`).
|
||||
If [this plugin](https://github.com/prettier/eslint-plugin-prettier) or similar
|
||||
is included, you might get a situation where your eslint configuration diagnoses
|
||||
your formatting according to its own config (usually `.eslintrc.js`).
|
||||
|
||||
The issue there is your formatting is made via prettierd.
|
||||
|
||||
This results in auto-formating relying on your prettier config, while your eslint config diagnoses formatting [which it's not supposed to](https://prettier.io/docs/en/comparison.html))
|
||||
This results in auto-formating relying on your prettier config, while your
|
||||
eslint config diagnoses formatting
|
||||
[which it's not supposed to](https://prettier.io/docs/en/comparison.html))
|
||||
|
||||
In the end, you get discrepancies between what your editor does and what it wants.
|
||||
In the end, you get discrepancies between what your editor does and what it
|
||||
wants.
|
||||
|
||||
Solutions are:
|
||||
|
|
@ -1,25 +1,27 @@
|
|||
# Try it out {#ch-try-it-out}
|
||||
|
||||
Thanks to the portability of Nix, you can try out nvf without actually installing it to your machine.
|
||||
Below are the commands you may run to try out different configurations provided by this flake. As of v0.5, three
|
||||
Thanks to the portability of Nix, you can try out nvf without actually
|
||||
installing it to your machine. Below are the commands you may run to try out
|
||||
different configurations provided by this flake. As of v0.5, two specialized
|
||||
configurations are provided:
|
||||
|
||||
- Nix
|
||||
- Maximal
|
||||
- **Nix** - Nix language server + simple utility plugins
|
||||
- **Maximal** - Variable language servers + utility and decorative plugins
|
||||
|
||||
You may try out any of the provided configurations using the `nix run` command on a system where Nix is installed.
|
||||
You may try out any of the provided configurations using the `nix run` command
|
||||
on a system where Nix is installed.
|
||||
|
||||
```console
|
||||
```bash
|
||||
$ cachix use nvf # Optional: it'll save you CPU resources and time
|
||||
$ nix run github:notashelf/nvf#nix # will run the default minimal configuration
|
||||
```
|
||||
|
||||
Do keep in mind that this is **susceptible to garbage collection** meaning it will be removed from your Nix store
|
||||
once you garbage collect.
|
||||
Do keep in mind that this is **susceptible to garbage collection** meaning it
|
||||
will be removed from your Nix store once you garbage collect.
|
||||
|
||||
## Using Prebuilt Configs {#sec-using-prebuild-configs}
|
||||
## Using Prebuilt Configs {#sec-using-prebuilt-configs}
|
||||
|
||||
```console
|
||||
```bash
|
||||
$ nix run github:notashelf/nvf#nix
|
||||
$ nix run github:notashelf/nvf#maximal
|
||||
```
|
||||
|
@ -28,12 +30,19 @@ $ nix run github:notashelf/nvf#maximal
|
|||
|
||||
#### Nix {#sec-configs-nix}
|
||||
|
||||
`Nix` configuration by default provides LSP/diagnostic support for Nix alongisde a set of visual and functional plugins.
|
||||
By running `nix run .#`, which is the default package, you will build Neovim with this config.
|
||||
`Nix` configuration by default provides LSP/diagnostic support for Nix alongside
|
||||
a set of visual and functional plugins. By running `nix run .#`, which is the
|
||||
default package, you will build Neovim with this config.
|
||||
|
||||
#### Maximal {#sec-configs-maximal}
|
||||
|
||||
`Maximal` is the ultimate configuration that will enable support for more commonly used language as well as additional
|
||||
complementary plugins. Keep in mind, however, that this will pull a lot of dependencies.
|
||||
`Maximal` is the ultimate configuration that will enable support for more
|
||||
commonly used language as well as additional complementary plugins. Keep in
|
||||
mind, however, that this will pull a lot of dependencies.
|
||||
|
||||
You are _strongly_ recommended to use the binary cache if you would like to try the Maximal configuration.
|
||||
::: {.tip}
|
||||
|
||||
You are _strongly_ recommended to use the binary cache if you would like to try
|
||||
the Maximal configuration.
|
||||
|
||||
:::
|
||||
|
|
|
@ -285,6 +285,9 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
|
|||
- Add [](#opt-vim.spellcheck.extraSpellWords) to allow adding arbitrary
|
||||
spellfiles to Neovim's runtime with ease.
|
||||
|
||||
- Add combined nvf configuration (`config.vim`) into the final package's
|
||||
passthru as `passthru.neovimConfiguration` for easier debugging.
|
||||
|
||||
[ppenguin](https://github.com/ppenguin):
|
||||
|
||||
- Telescope:
|
||||
|
@ -302,6 +305,9 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
|
|||
`vim.languages.kotlin`
|
||||
- changed default keybinds for leap.nvim to avoid altering expected behavior
|
||||
- Add LSP, formatter and Treesitter support for Vala under `vim.languages.vala`
|
||||
- Add [Tinymist](https://github.com/Myriad-Dreamin/tinymist] as a formatter for
|
||||
the Typst language module.
|
||||
- Add LSP and Treesitter support for Assembly under `vim.languages.assembly`
|
||||
|
||||
[Bloxx12](https://github.com/Bloxx12)
|
||||
|
||||
|
@ -322,3 +328,7 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
|
|||
[](#opt-vim.languages.svelte.format.type) respectively.
|
||||
- Replace [nixpkgs-fmt](https://github.com/nix-community/nixpkgs-fmt) with
|
||||
[nixfmt](https://github.com/NixOS/nixfmt) (nixfmt-rfc-style).
|
||||
|
||||
[Nowaaru](https://github.com/Nowaaru):
|
||||
|
||||
- Add `precognition-nvim`.
|
||||
|
|
10
docs/static/script/anchor-min.js
vendored
Normal file
10
docs/static/script/anchor-min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
docs/static/script/anchor-use.js
vendored
Normal file
4
docs/static/script/anchor-use.js
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
document.addEventListener('DOMContentLoaded', function(event) {
|
||||
anchors.add('h1[id]:not(div.note h1, div.warning h1, div.tip h1, div.caution h1, div.important h1), h2[id]:not(div.note h2, div.warning h2, div.tip h2, div.caution h2, div.important h2), h3[id]:not(div.note h3, div.warning h3, div.tip h3, div.caution h3, div.important h3), h4[id]:not(div.note h4, div.warning h4, div.tip h4, div.caution h4, div.important h4), h5[id]:not(div.note h5, div.warning h5, div.tip h5, div.caution h5, div.important h5), h6[id]:not(div.note h6, div.warning h6, div.tip h6, div.caution h6, div.important h6)');
|
||||
});
|
||||
|
827
docs/static/style.css
vendored
827
docs/static/style.css
vendored
File diff suppressed because one or more lines are too long
4
docs/static/style.scss
vendored
4
docs/static/style.scss
vendored
|
@ -1,3 +1,5 @@
|
|||
@use "scss-reset/reset";
|
||||
|
||||
:root {
|
||||
--nmd-color0: #0a3e68;
|
||||
--nmd-color1: #268598;
|
||||
|
@ -32,8 +34,6 @@ $color-blue-700: #1d4ed8;
|
|||
$color-blue-800: #1e40af;
|
||||
$color-blue-900: #1e3a8a;
|
||||
|
||||
@use "scss-reset/reset";
|
||||
|
||||
@mixin boxed {
|
||||
background: $color-gray-50;
|
||||
margin: 2rem 16px;
|
||||
|
|
97
docs/static/tomorrow-night.min.css
vendored
97
docs/static/tomorrow-night.min.css
vendored
|
@ -4,99 +4,4 @@
|
|||
License: ~ MIT (or more permissive) [via base16-schemes-source]
|
||||
Maintainer: @highlightjs/core-team
|
||||
Version: 2021.09.0
|
||||
*/
|
||||
pre code.hljs {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
padding: 1em;
|
||||
}
|
||||
code.hljs {
|
||||
padding: 3px 5px;
|
||||
}
|
||||
.hljs {
|
||||
color: #ccc;
|
||||
background: #2d2d2d;
|
||||
}
|
||||
.hljs ::selection,
|
||||
.hljs::selection {
|
||||
background-color: #515151;
|
||||
color: #ccc;
|
||||
}
|
||||
.hljs-comment {
|
||||
color: #999;
|
||||
}
|
||||
.hljs-tag {
|
||||
color: #b4b7b4;
|
||||
}
|
||||
.hljs-operator,
|
||||
.hljs-punctuation,
|
||||
.hljs-subst {
|
||||
color: #ccc;
|
||||
}
|
||||
.hljs-operator {
|
||||
opacity: 0.7;
|
||||
}
|
||||
.hljs-bullet,
|
||||
.hljs-deletion,
|
||||
.hljs-name,
|
||||
.hljs-selector-tag,
|
||||
.hljs-template-variable,
|
||||
.hljs-variable {
|
||||
color: #f2777a;
|
||||
}
|
||||
.hljs-attr,
|
||||
.hljs-link,
|
||||
.hljs-literal,
|
||||
.hljs-number,
|
||||
.hljs-symbol,
|
||||
.hljs-variable.constant_ {
|
||||
color: #f99157;
|
||||
}
|
||||
.hljs-class .hljs-title,
|
||||
.hljs-title,
|
||||
.hljs-title.class_ {
|
||||
color: #fc6;
|
||||
}
|
||||
.hljs-strong {
|
||||
font-weight: 700;
|
||||
color: #fc6;
|
||||
}
|
||||
.hljs-addition,
|
||||
.hljs-code,
|
||||
.hljs-string,
|
||||
.hljs-title.class_.inherited__ {
|
||||
color: #9c9;
|
||||
}
|
||||
.hljs-built_in,
|
||||
.hljs-doctag,
|
||||
.hljs-keyword.hljs-atrule,
|
||||
.hljs-quote,
|
||||
.hljs-regexp {
|
||||
color: #6cc;
|
||||
}
|
||||
.hljs-attribute,
|
||||
.hljs-function .hljs-title,
|
||||
.hljs-section,
|
||||
.hljs-title.function_,
|
||||
.ruby .hljs-property {
|
||||
color: #69c;
|
||||
}
|
||||
.diff .hljs-meta,
|
||||
.hljs-keyword,
|
||||
.hljs-template-tag,
|
||||
.hljs-type {
|
||||
color: #c9c;
|
||||
}
|
||||
.hljs-emphasis {
|
||||
color: #c9c;
|
||||
font-style: italic;
|
||||
}
|
||||
.hljs-meta,
|
||||
.hljs-meta .hljs-keyword,
|
||||
.hljs-meta .hljs-string {
|
||||
color: #a3685a;
|
||||
}
|
||||
.hljs-meta .hljs-keyword,
|
||||
.hljs-meta-keyword {
|
||||
font-weight: 700;
|
||||
}
|
||||
*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#ccc;background:#2d2d2d}.hljs ::selection,.hljs::selection{background-color:#515151;color:#ccc}.hljs-comment{color:#999}.hljs-tag{color:#b4b7b4}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#ccc}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#f2777a}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f99157}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fc6}.hljs-strong{font-weight:700;color:#fc6}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#9c9}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#6cc}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#69c}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#c9c}.hljs-emphasis{color:#c9c;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a3685a}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700}
|
||||
|
|
573
flake.lock
573
flake.lock
File diff suppressed because it is too large
Load diff
27
flake.nix
27
flake.nix
|
@ -30,29 +30,25 @@
|
|||
};
|
||||
|
||||
homeManagerModules = {
|
||||
nvf = import ./flake/modules/home-manager.nix self.packages lib;
|
||||
default = self.homeManagerModules.nvf;
|
||||
neovim-flake =
|
||||
lib.warn ''
|
||||
homeManagerModules.neovim-flake has been deprecated.
|
||||
Plese use the homeManagerModules.nvf instead
|
||||
'homeManagerModules.neovim-flake' has been deprecated, and will be removed
|
||||
in a future release. Please use 'homeManagerModules.nvf' instead.
|
||||
''
|
||||
self.homeManagerModules.nvf;
|
||||
|
||||
nvf = import ./flake/modules/home-manager.nix self.packages lib;
|
||||
|
||||
default = self.homeManagerModules.nvf;
|
||||
};
|
||||
|
||||
nixosModules = {
|
||||
nvf = import ./flake/modules/nixos.nix self.packages lib;
|
||||
default = self.nixosModules.nvf;
|
||||
neovim-flake =
|
||||
lib.warn ''
|
||||
nixosModules.neovim-flake has been deprecated.
|
||||
Please use the nixosModules.nvf instead
|
||||
'nixosModules.neovim-flake' has been deprecated, and will be removed
|
||||
in a future release. Please use 'nixosModules.nvf' instead.
|
||||
''
|
||||
self.nixosModules.nvf;
|
||||
|
||||
nvf = import ./flake/modules/nixos.nix self.packages lib;
|
||||
|
||||
default = self.nixosModules.nvf;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -443,7 +439,7 @@
|
|||
flake = false;
|
||||
};
|
||||
|
||||
plugin-scrollbar-nvim = {
|
||||
plugin-nvim-scrollbar = {
|
||||
url = "github:petertriho/nvim-scrollbar";
|
||||
flake = false;
|
||||
};
|
||||
|
@ -566,6 +562,11 @@
|
|||
flake = false;
|
||||
};
|
||||
|
||||
plugin-precognition-nvim = {
|
||||
url = "github:tris203/precognition.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Note-taking
|
||||
plugin-obsidian-nvim = {
|
||||
url = "github:epwalsh/obsidian.nvim";
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
docs-html-wrapped = pkgs.writeScriptBin "docs-html-wrapped" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
# use xdg-open to open the docs in the browser
|
||||
${pkgs.xdg_utils}/bin/xdg-open ${docs.manual.html}
|
||||
${pkgs.xdg-utils}/bin/xdg-open ${docs.manual.html}
|
||||
'';
|
||||
|
||||
# Exposed neovim configurations
|
||||
|
@ -29,10 +29,10 @@
|
|||
|
||||
# Published docker images
|
||||
docker-nix = let
|
||||
inherit (pkgs) bash gitFull buildEnv dockerTools;
|
||||
inherit (pkgs) bash gitFull buildEnv;
|
||||
inherit (config.legacyPackages) neovim-nix;
|
||||
in
|
||||
dockerTools.buildImage {
|
||||
pkgs.dockerTools.buildImage {
|
||||
name = "nvf";
|
||||
tag = "latest";
|
||||
|
||||
|
|
|
@ -123,6 +123,11 @@ in {
|
|||
paths = [neovim-wrapped printConfig printConfigPath];
|
||||
postBuild = "echo Helpers added";
|
||||
|
||||
# Allow evaluating vimOptions, i.e., config.vim from the packages' passthru
|
||||
# attribute. For example, packages.x86_64-linux.neovim.passthru.neovimConfig
|
||||
# will return the configuration in full.
|
||||
passthru.neovimConfig = vimOptions;
|
||||
|
||||
meta = {
|
||||
description = "Wrapped version of Neovim with additional helper scripts";
|
||||
mainProgram = "nvim";
|
||||
|
|
|
@ -42,6 +42,20 @@ in {
|
|||
after = ''
|
||||
${optionalString luasnipEnable "local luasnip = require('luasnip')"}
|
||||
local cmp = require("cmp")
|
||||
|
||||
local kinds = require("cmp.types").lsp.CompletionItemKind
|
||||
local deprio = function(kind)
|
||||
return function(e1, e2)
|
||||
if e1:get_kind() == kind then
|
||||
return false
|
||||
end
|
||||
if e2:get_kind() == kind then
|
||||
return true
|
||||
end
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
cmp.setup(${toLuaObject cfg.setupOpts})
|
||||
|
||||
${optionalString config.vim.lazy.enable
|
||||
|
|
|
@ -29,6 +29,8 @@ in {
|
|||
sorting.comparators = mkOption {
|
||||
type = mergelessListOf (either str luaInline);
|
||||
default = [
|
||||
(mkLuaInline "deprio(kinds.Text)")
|
||||
(mkLuaInline "deprio(kinds.Snippet)")
|
||||
"offset"
|
||||
"exact"
|
||||
"score"
|
||||
|
@ -43,6 +45,12 @@ in {
|
|||
(see `:help cmp-config.sorting.comparators`),
|
||||
or a string, in which case the builtin comparator with that name will
|
||||
be used.
|
||||
|
||||
A `deprio` function and a `kinds`
|
||||
(`require("cmp.types").lsp.CompletionItemKind`) variable is provided
|
||||
above `setupOpts`. By passing a type to the funcion, the returned
|
||||
function will be a comparator that always ranks the specified kind the
|
||||
lowest.
|
||||
'';
|
||||
apply = map (
|
||||
c:
|
||||
|
|
|
@ -24,7 +24,7 @@ in {
|
|||
cmd = ["Neotree"];
|
||||
};
|
||||
|
||||
visuals.nvimWebDevicons.enable = true;
|
||||
visuals.nvim-web-devicons.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
49
modules/plugins/languages/asm.nix
Normal file
49
modules/plugins/languages/asm.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) package;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
|
||||
cfg = config.vim.languages.assembly;
|
||||
in {
|
||||
options.vim.languages.assembly = {
|
||||
enable = mkEnableOption "Assembly support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Assembly treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkGrammarOption pkgs "asm";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "Assembly LSP support (asm-lsp)" // {default = config.vim.languages.enableLSP;};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = pkgs.asm-lsp;
|
||||
description = "asm-lsp package";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
vim.lsp.lspconfig.sources.asm-lsp = ''
|
||||
lspconfig.asm_lsp.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = default_on_attach,
|
||||
cmd = {"${cfg.lsp.package}/bin/asm-lsp"},
|
||||
}
|
||||
'';
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
inherit (lib.nvim.languages) mkEnable;
|
||||
in {
|
||||
imports = [
|
||||
./asm.nix
|
||||
./bash.nix
|
||||
./dart.nix
|
||||
./clang.nix
|
||||
|
|
|
@ -14,6 +14,38 @@
|
|||
|
||||
cfg = config.vim.languages.typst;
|
||||
|
||||
defaultServer = "tinymist";
|
||||
servers = {
|
||||
typst-lsp = {
|
||||
package = pkgs.typst-lsp;
|
||||
lspConfig = ''
|
||||
lspconfig.typst_lsp.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = default_on_attach,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/typst-lsp"}''
|
||||
},
|
||||
}
|
||||
'';
|
||||
};
|
||||
tinymist = {
|
||||
package = pkgs.tinymist;
|
||||
lspConfig = ''
|
||||
lspconfig.tinymist.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = default_on_attach,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/tinymist"}''
|
||||
},
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
defaultFormat = "typstfmt";
|
||||
formats = {
|
||||
typstfmt = {
|
||||
|
@ -52,11 +84,17 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.languages.enableLSP;};
|
||||
|
||||
server = mkOption {
|
||||
description = "Typst LSP server to use";
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "typst-lsp package, or the command to run as a list of strings";
|
||||
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
||||
type = either package (listOf str);
|
||||
default = pkgs.typst-lsp;
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -82,19 +120,14 @@ in {
|
|||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources.typst-format = formats.${cfg.format.type}.nullConfig;
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
vim.lsp.lspconfig.sources.typst-lsp = ''
|
||||
lspconfig.typst_lsp.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach=default_on_attach,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/typst-lsp"}''
|
||||
},
|
||||
}
|
||||
'';
|
||||
vim.lsp.lspconfig.sources.typst-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -15,10 +15,14 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = [
|
||||
(assert config.vim.visuals.nvimWebDevicons.enable; "nvim-bufferline-lua")
|
||||
"nvim-bufferline-lua"
|
||||
"bufdelete-nvim"
|
||||
];
|
||||
|
||||
# Soft-dependency for bufferline.
|
||||
# Recommended by upstream, so enabled here.
|
||||
visuals.nvim-web-devicons.enable = true;
|
||||
|
||||
maps.normal = mkMerge [
|
||||
(mkLuaBinding cfg.mappings.closeCurrent "require(\"bufdelete\").bufdelete" mappings.closeCurrent.description)
|
||||
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
||||
|
|
|
@ -4,33 +4,20 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.binds.whichKey;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = ["which-key"];
|
||||
vim = {
|
||||
startPlugins = ["which-key"];
|
||||
|
||||
vim.pluginRC.whichkey = entryAnywhere ''
|
||||
pluginRC.whichkey = entryAnywhere ''
|
||||
local wk = require("which-key")
|
||||
wk.setup ({
|
||||
key_labels = {
|
||||
["<space>"] = "SPACE",
|
||||
["<leader>"] = "SPACE",
|
||||
["<cr>"] = "RETURN",
|
||||
["<tab>"] = "TAB",
|
||||
},
|
||||
|
||||
${optionalString config.vim.ui.borders.plugins.which-key.enable ''
|
||||
window = {
|
||||
border = ${toLuaObject config.vim.ui.borders.plugins.which-key.style},
|
||||
},
|
||||
''}
|
||||
})
|
||||
|
||||
wk.setup (${toLuaObject cfg.setupOpts})
|
||||
wk.register(${toLuaObject cfg.register})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./which-key.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,14 +1,51 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) attrsOf nullOr str;
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) attrsOf nullOr str attrs enum bool;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
options.vim.binds.whichKey = {
|
||||
enable = mkEnableOption "which-key keybind helper menu";
|
||||
|
||||
register = mkOption {
|
||||
description = "Register label for which-key keybind helper menu";
|
||||
type = attrsOf (nullOr str);
|
||||
default = {};
|
||||
description = "Register label for which-key keybind helper menu";
|
||||
};
|
||||
|
||||
setupOpts = mkPluginSetupOption "which-key" {
|
||||
preset = mkOption {
|
||||
type = enum ["classic" "modern" "helix"];
|
||||
default = "modern";
|
||||
description = "The default preset for the which-key window";
|
||||
};
|
||||
|
||||
notify = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Show a warning when issues were detected with mappings";
|
||||
};
|
||||
|
||||
replace = mkOption {
|
||||
type = attrs;
|
||||
default = {
|
||||
"<space>" = "SPACE";
|
||||
"<leader>" = "SPACE";
|
||||
"<cr>" = "RETURN";
|
||||
"<tab>" = "TAB";
|
||||
};
|
||||
description = "Functions/Lua Patterns for formatting the labels";
|
||||
};
|
||||
|
||||
win = {
|
||||
border = mkOption {
|
||||
type = str;
|
||||
default = config.vim.ui.borders.plugins.which-key.style;
|
||||
description = "Which-key window border style";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,5 +2,6 @@ _: {
|
|||
imports = [
|
||||
./hop
|
||||
./leap
|
||||
./precognition
|
||||
];
|
||||
}
|
||||
|
|
18
modules/plugins/utility/motion/precognition/config.nix
Normal file
18
modules/plugins/utility/motion/precognition/config.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
|
||||
cfg = config.vim.utility.motion.precognition;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["precognition-nvim"];
|
||||
luaConfigRC.precognition = lib.nvim.dag.entryAnywhere ''
|
||||
require('precognition').setup(${lib.nvim.lua.toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/utility/motion/precognition/default.nix
Normal file
6
modules/plugins/utility/motion/precognition/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./precognition.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
66
modules/plugins/utility/motion/precognition/precognition.nix
Normal file
66
modules/plugins/utility/motion/precognition/precognition.nix
Normal file
|
@ -0,0 +1,66 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||
inherit (lib.types) attrsOf listOf str bool int submodule;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
|
||||
mkHintType = description:
|
||||
mkOption {
|
||||
inherit description;
|
||||
default = {};
|
||||
type = attrsOf (submodule {
|
||||
options = {
|
||||
text = mkOption {
|
||||
type = str;
|
||||
description = "The easier-to-read depiction of the motion";
|
||||
};
|
||||
|
||||
prio = mkOption {
|
||||
type = int;
|
||||
default = 1;
|
||||
description = "The priority of the hint";
|
||||
example = 10;
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
in {
|
||||
options.vim.utility.motion.precognition = {
|
||||
enable = mkEnableOption "assisted motion discovery[precognition.nvim]";
|
||||
setupOpts = mkPluginSetupOption "precognition.nvim" {
|
||||
startVisible = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether to start 'precognition' automatically";
|
||||
};
|
||||
|
||||
showBlankVirtLine = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether to show a blank virtual line when no movements are shown";
|
||||
};
|
||||
|
||||
highlightColor = mkOption {
|
||||
type = attrsOf str;
|
||||
default = {link = "Comment";};
|
||||
example = literalExpression ''
|
||||
{ link = "Comment"; }
|
||||
# or
|
||||
{ foreground = "#0000FF"; background = "#000000"; };
|
||||
'';
|
||||
description = "The highlight for the virtual text";
|
||||
};
|
||||
|
||||
disabled_fts = mkOption {
|
||||
type = listOf str;
|
||||
default = ["startify"];
|
||||
example = literalExpression ''["startify"]'';
|
||||
description = "Filetypes that automatically disable 'precognition'";
|
||||
};
|
||||
|
||||
hints = mkHintType "What motions display, and at what priority";
|
||||
gutterHints = mkHintType ''
|
||||
What motions display and at what priority. Only appears in gutters
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.modules) mkRenamedOptionModule;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.nvim.types) luaInline;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
in {
|
||||
imports = [
|
||||
(mkRenamedOptionModule ["vim" "visuals" "cellularAutomaton"] ["vim" "visuals" "cellular-automaton"])
|
||||
];
|
||||
|
||||
options.vim.visuals.cellular-automaton = {
|
||||
enable = mkEnableOption "cellular-automaton to help you cope with stubborn code [cellular-automaton]";
|
||||
|
||||
mappings = {
|
||||
makeItRain = mkMappingOption "Make it rain [cellular-automaton]" "<leader>fml";
|
||||
};
|
||||
|
||||
animation = {
|
||||
register = mkEnableOption "registering configured animation(s) automatically" // {default = true;};
|
||||
setup = mkOption {
|
||||
type = luaInline;
|
||||
default = mkLuaInline ''
|
||||
local ca_config = {
|
||||
fps = 50,
|
||||
name = 'slide',
|
||||
}
|
||||
|
||||
-- init function is invoked only once at the start
|
||||
-- config.init = function (grid)
|
||||
--
|
||||
-- end
|
||||
|
||||
-- update function
|
||||
ca_config.update = function (grid)
|
||||
for i = 1, #grid do
|
||||
local prev = grid[i][#(grid[i])]
|
||||
for j = 1, #(grid[i]) do
|
||||
grid[i][j], prev = prev, grid[i][j]
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
'';
|
||||
description = ''
|
||||
Configuration used to generate an animation to be registered.
|
||||
|
||||
The final value for `ca_config` will be used to register a new
|
||||
animation using `require("cellular-automaton").register_animation(ca_config)`
|
||||
|
||||
::: {.warning}
|
||||
`ca_config` **must** eval to a valid Lua table. nvf does not and cannot
|
||||
perform any kind of validation on your Lua code, so bogus values will
|
||||
result in errors when the animation is registered.
|
||||
:::
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
39
modules/plugins/visuals/cellular-automaton/config.nix
Normal file
39
modules/plugins/visuals/cellular-automaton/config.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere entryAfter;
|
||||
inherit (lib.nvim.binds) mkBinding;
|
||||
|
||||
cfg = config.vim.visuals.cellular-automaton;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["cellular-automaton"];
|
||||
|
||||
maps.normal = mkBinding cfg.mappings.makeItRain "<cmd>CellularAutomaton make_it_rain<CR>" "Make it rain";
|
||||
|
||||
pluginRC = {
|
||||
# XXX: This has no error handling. User can set
|
||||
# `animation.setup` to a bogus value, and we would
|
||||
# have an error in our hands. I don't think there
|
||||
# is a good way to check for errors, so I'm leaving
|
||||
# it like this under the assumption that the user
|
||||
# will not mess it up for no reason.
|
||||
cellular-automaton-anim = entryAnywhere (optionalString cfg.animation.register ''
|
||||
-- Coerce user animation config into pluginRC
|
||||
${toLuaObject cfg.animation.setup}
|
||||
'');
|
||||
|
||||
cellular-automaton = entryAfter ["cellular-automaton-anim"] ''
|
||||
-- Register the animation
|
||||
require("cellular-automaton").register_animation(ca_config)
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/visuals/cellular-automaton/default.nix
Normal file
6
modules/plugins/visuals/cellular-automaton/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./cellular-automaton.nix
|
||||
];
|
||||
}
|
35
modules/plugins/visuals/cinnamon-nvim/cinnamon-nvim.nix
Normal file
35
modules/plugins/visuals/cinnamon-nvim/cinnamon-nvim.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.modules) mkRemovedOptionModule;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) submodule attrs attrsOf;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
imports = [
|
||||
(mkRemovedOptionModule ["vim" "visuals" "smoothScroll"] ''
|
||||
`vim.visuals.smoothScroll` has been removed. You may consider enabling the
|
||||
option `vim.visuals.cinnamon-nvim` to repliace previous smooth scrolling
|
||||
behaviour.
|
||||
'')
|
||||
];
|
||||
|
||||
options.vim.visuals.cinnamon-nvim = {
|
||||
enable = mkEnableOption "smooth scrolling for ANY command [cinnamon-nvim]";
|
||||
setupOpts = mkPluginSetupOption "cinnamon.nvim" {
|
||||
options = mkOption {
|
||||
type = attrs;
|
||||
default = {
|
||||
# Defaults provided for the sake of documentation only!
|
||||
# Who would've guessed setupOpts.options would be confusing?
|
||||
mode = "cursor";
|
||||
count_only = false;
|
||||
};
|
||||
description = "Scroll options";
|
||||
};
|
||||
|
||||
keymaps = {
|
||||
basic = mkEnableOption "basic animation keymaps";
|
||||
extra = mkEnableOption "extra animation keymaps";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
21
modules/plugins/visuals/cinnamon-nvim/config.nix
Normal file
21
modules/plugins/visuals/cinnamon-nvim/config.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.visuals.cinnamon-nvim;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["cinnamon-nvim"];
|
||||
|
||||
pluginRC.cursorline = entryAnywhere ''
|
||||
require("cinnamon").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/visuals/cinnamon-nvim/default.nix
Normal file
6
modules/plugins/visuals/cinnamon-nvim/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./cinnamon-nvim.nix
|
||||
];
|
||||
}
|
|
@ -1,118 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.trivial) boolToString;
|
||||
inherit (lib.nvim.binds) mkBinding;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.visuals;
|
||||
in {
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.indentBlankline.enable {
|
||||
vim.startPlugins = ["indent-blankline"];
|
||||
vim.pluginRC.indent-blankline = entryAnywhere ''
|
||||
require("ibl").setup(${toLuaObject cfg.indentBlankline.setupOpts})
|
||||
'';
|
||||
})
|
||||
|
||||
(mkIf cfg.cursorline.enable {
|
||||
vim.startPlugins = ["nvim-cursorline"];
|
||||
vim.pluginRC.cursorline = entryAnywhere ''
|
||||
require('nvim-cursorline').setup {
|
||||
cursorline = {
|
||||
timeout = ${toString cfg.cursorline.lineTimeout},
|
||||
number = ${boolToString (!cfg.cursorline.lineNumbersOnly)},
|
||||
}
|
||||
}
|
||||
'';
|
||||
})
|
||||
|
||||
(mkIf cfg.nvimWebDevicons.enable {
|
||||
vim.startPlugins = ["nvim-web-devicons"];
|
||||
})
|
||||
|
||||
(mkIf cfg.scrollBar.enable {
|
||||
vim.startPlugins = ["scrollbar-nvim"];
|
||||
vim.pluginRC.scrollBar = entryAnywhere ''
|
||||
require('scrollbar').setup{
|
||||
excluded_filetypes = {
|
||||
'prompt',
|
||||
'TelescopePrompt',
|
||||
'noice',
|
||||
'NvimTree',
|
||||
'alpha',
|
||||
'notify',
|
||||
'Navbuddy'
|
||||
},
|
||||
}
|
||||
'';
|
||||
})
|
||||
|
||||
(mkIf cfg.smoothScroll.enable {
|
||||
vim.startPlugins = ["cinnamon-nvim"];
|
||||
vim.pluginRC.smoothScroll = entryAnywhere ''
|
||||
require('cinnamon').setup()
|
||||
'';
|
||||
})
|
||||
|
||||
(mkIf cfg.cellularAutomaton.enable {
|
||||
vim.startPlugins = ["cellular-automaton"];
|
||||
|
||||
vim.maps.normal = mkBinding cfg.cellularAutomaton.mappings.makeItRain "<cmd>CellularAutomaton make_it_rain<CR>" "Make it rain";
|
||||
|
||||
vim.pluginRC.cellularAUtomaton = entryAnywhere ''
|
||||
local config = {
|
||||
fps = 50,
|
||||
name = 'slide',
|
||||
}
|
||||
|
||||
-- init function is invoked only once at the start
|
||||
-- config.init = function (grid)
|
||||
--
|
||||
-- end
|
||||
|
||||
-- update function
|
||||
config.update = function (grid)
|
||||
for i = 1, #grid do
|
||||
local prev = grid[i][#(grid[i])]
|
||||
for j = 1, #(grid[i]) do
|
||||
grid[i][j], prev = prev, grid[i][j]
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
require("cellular-automaton").register_animation(config)
|
||||
'';
|
||||
})
|
||||
|
||||
(mkIf cfg.highlight-undo.enable {
|
||||
vim.startPlugins = ["highlight-undo"];
|
||||
vim.pluginRC.highlight-undo = entryAnywhere ''
|
||||
require('highlight-undo').setup({
|
||||
duration = ${toString cfg.highlight-undo.duration},
|
||||
highlight_for_count = ${boolToString cfg.highlight-undo.highlightForCount},
|
||||
undo = {
|
||||
hlgroup = ${cfg.highlight-undo.undo.hlGroup},
|
||||
mode = 'n',
|
||||
lhs = 'u',
|
||||
map = 'undo',
|
||||
opts = {}
|
||||
},
|
||||
|
||||
redo = {
|
||||
hlgroup = ${cfg.highlight-undo.redo.hlGroup},
|
||||
mode = 'n',
|
||||
lhs = '<C-r>',
|
||||
map = 'redo',
|
||||
opts = {}
|
||||
},
|
||||
})
|
||||
'';
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -1,7 +1,19 @@
|
|||
{...}: {
|
||||
{lib, ...}: let
|
||||
inherit (lib.modules) mkRemovedOptionModule;
|
||||
in {
|
||||
imports = [
|
||||
./config.nix
|
||||
./visuals.nix
|
||||
./fidget
|
||||
(mkRemovedOptionModule ["vim" "visuals" "enable"] ''
|
||||
As top-level toggles are being deprecated, you are encouraged to handle plugin
|
||||
toggles under individual options.
|
||||
'')
|
||||
|
||||
./cellular-automaton
|
||||
./cinnamon-nvim
|
||||
./fidget-nvim
|
||||
./highlight-undo
|
||||
./indent-blankline
|
||||
./nvim-cursorline
|
||||
./nvim-scrollbar
|
||||
./nvim-web-devicons
|
||||
];
|
||||
}
|
||||
|
|
|
@ -12,8 +12,11 @@
|
|||
in {
|
||||
imports = [
|
||||
(mkRenamedOptionModule ["vim" "visuals" "fidget-nvim" "align" "bottom"] ["vim" "visuals" "fidget-nvim" "setupOpts" "notification" "window" "align"])
|
||||
(mkRemovedOptionModule ["vim" "visuals" "fidget-nvim" "align" "right"]
|
||||
"Option `vim.fidget-nvim.align.right` has been removed and does not have an equivalent replacement in rewritten fidget.nvim configuration.")
|
||||
(mkRemovedOptionModule ["vim" "visuals" "fidget-nvim" "align" "right"] ''
|
||||
Option `vim.fidget-nvim.align.right` has been removed and does not have an
|
||||
equivalent replacement in rewritten fidget.nvim configuration. Please remove
|
||||
it from your configuration.
|
||||
'')
|
||||
];
|
||||
|
||||
options.vim.visuals.fidget-nvim = {
|
21
modules/plugins/visuals/highlight-undo/config.nix
Normal file
21
modules/plugins/visuals/highlight-undo/config.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.visuals.highlight-undo;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["highlight-undo"];
|
||||
|
||||
pluginRC.highlight-undo = entryAnywhere ''
|
||||
require("highlight-undo").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/visuals/highlight-undo/default.nix
Normal file
6
modules/plugins/visuals/highlight-undo/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./highlight-undo.nix
|
||||
];
|
||||
}
|
32
modules/plugins/visuals/highlight-undo/highlight-undo.nix
Normal file
32
modules/plugins/visuals/highlight-undo/highlight-undo.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.modules) mkRemovedOptionModule;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) int;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
|
||||
checkDocsMsg = ''
|
||||
highlight-undo.nvim has deprecated previously used configuration options in
|
||||
a recent update, so previous values will no longer work as expected.
|
||||
|
||||
Please use `vim.visuals.highlight-undo.setupOpts` with upstream instructions
|
||||
'';
|
||||
in {
|
||||
imports = [
|
||||
# This gives a lot of error messages for those with default values set or modified. Could
|
||||
# there be a better way to handle his? Perhaps an assertion?
|
||||
(mkRemovedOptionModule ["vim" "visuals" "highlight-undo" "highlightForCount"] checkDocsMsg)
|
||||
(mkRemovedOptionModule ["vim" "visuals" "highlight-undo" "undo" "hlGroup"] checkDocsMsg)
|
||||
(mkRemovedOptionModule ["vim" "visuals" "highlight-undo" "redo" "hlGroup"] checkDocsMsg)
|
||||
];
|
||||
|
||||
options.vim.visuals.highlight-undo = {
|
||||
enable = mkEnableOption "highlight undo [highlight-undo]";
|
||||
setupOpts = mkPluginSetupOption "highlight-undo" {
|
||||
duration = mkOption {
|
||||
type = int;
|
||||
default = 500;
|
||||
description = "Duration of the highlight";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
21
modules/plugins/visuals/indent-blankline/config.nix
Normal file
21
modules/plugins/visuals/indent-blankline/config.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.visuals.indent-blankline;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["indent-blankline"];
|
||||
|
||||
pluginRC.indent-blankline = entryAnywhere ''
|
||||
require("ibl").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/visuals/indent-blankline/default.nix
Normal file
6
modules/plugins/visuals/indent-blankline/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./indent-blankline.nix
|
||||
];
|
||||
}
|
195
modules/plugins/visuals/indent-blankline/indent-blankline.nix
Normal file
195
modules/plugins/visuals/indent-blankline/indent-blankline.nix
Normal file
|
@ -0,0 +1,195 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkRenamedOptionModule;
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.types) int bool str nullOr either listOf attrsOf;
|
||||
|
||||
cfg = config.vim.visuals;
|
||||
in {
|
||||
imports = [
|
||||
(mkRenamedOptionModule ["vim" "visuals" "indentBlankline"] ["vim" "visuals" "indent-blankline"])
|
||||
];
|
||||
|
||||
options.vim.visuals.indent-blankline = {
|
||||
enable = mkEnableOption "indentation guides [indent-blankline]";
|
||||
setupOpts = {
|
||||
debounce = mkOption {
|
||||
type = int;
|
||||
description = "Debounce time in milliseconds";
|
||||
default = 200;
|
||||
};
|
||||
|
||||
viewport_buffer = {
|
||||
min = mkOption {
|
||||
type = int;
|
||||
description = "Number of lines above and below of what is currently
|
||||
visible in the window";
|
||||
default = 30;
|
||||
};
|
||||
|
||||
max = mkOption {
|
||||
type = int;
|
||||
description = "Number of lines above and below of what is currently
|
||||
visible in the window";
|
||||
default = 500;
|
||||
};
|
||||
};
|
||||
|
||||
indent = {
|
||||
char = mkOption {
|
||||
type = either str (listOf str);
|
||||
description = "Character(s) for indentation guide";
|
||||
default = "│";
|
||||
};
|
||||
|
||||
tab_char = mkOption {
|
||||
type = nullOr (either str (listOf str));
|
||||
description = ''
|
||||
Character(s) for tab indentation guide.
|
||||
|
||||
See `:help ibl.config.indent.tab_char`.
|
||||
'';
|
||||
default = null;
|
||||
};
|
||||
|
||||
highlight = mkOption {
|
||||
type = nullOr (either str (listOf str));
|
||||
description = ''
|
||||
The highlight group(s) applied to the indentation guide.
|
||||
|
||||
See `:help ibl.config.indent.highlight`.
|
||||
'';
|
||||
default = null;
|
||||
};
|
||||
|
||||
smart_indent_cap = mkOption {
|
||||
type = bool;
|
||||
description = "Caps the number of indentation levels based on surrounding code";
|
||||
default = true;
|
||||
};
|
||||
|
||||
priority = mkOption {
|
||||
type = int;
|
||||
description = "Virtual text priority for the indentation guide";
|
||||
default = 1;
|
||||
};
|
||||
|
||||
repeat_linebreak = mkOption {
|
||||
type = bool;
|
||||
description = "Repeat indentation guides on wrapped lines";
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
whitespace = {
|
||||
highlight = mkOption {
|
||||
type = nullOr (either str (listOf str));
|
||||
description = ''
|
||||
The highlight group(s) applied to whitespace.
|
||||
|
||||
See `:help ibl.config.whitespace.highlight`.
|
||||
'';
|
||||
default = null;
|
||||
};
|
||||
|
||||
remove_blankline_trail = mkOption {
|
||||
type = bool;
|
||||
description = "Remove trailing whitespace on blanklines";
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
scope = {
|
||||
enabled = mkOption {
|
||||
description = "Highlight current scope from treesitter";
|
||||
type = bool;
|
||||
default = config.vim.treesitter.enable;
|
||||
defaultText = literalExpression "config.vim.treesitter.enable";
|
||||
};
|
||||
|
||||
char = mkOption {
|
||||
type = either str (listOf str);
|
||||
description = "The character(s) for the scope indentation guide";
|
||||
default = cfg.indent-blankline.setupOpts.indent.char;
|
||||
defaultText = literalExpression "config.vim.visuals.indent-blankline.setupOpts.indent.char";
|
||||
};
|
||||
|
||||
show_start = mkOption {
|
||||
type = bool;
|
||||
description = "Show an underline on the first line of the scope";
|
||||
default = false;
|
||||
};
|
||||
|
||||
show_end = mkOption {
|
||||
type = bool;
|
||||
description = "Show an underline on the last line of the scope";
|
||||
default = false;
|
||||
};
|
||||
|
||||
show_exact_scope = mkOption {
|
||||
type = bool;
|
||||
description = "Show the scope underline at the exact start of the scope, even if that's to the right of the indentation guide";
|
||||
default = false;
|
||||
};
|
||||
|
||||
injected_languages = mkOption {
|
||||
type = bool;
|
||||
description = "Check for injected languages (treesitter)";
|
||||
default = config.vim.treesitter.enable;
|
||||
defaultText = literalExpression "config.vim.treesitter.enable";
|
||||
};
|
||||
|
||||
highlight = mkOption {
|
||||
type = nullOr (either str (listOf str));
|
||||
description = ''
|
||||
The highlight group(s) applied to the scope.
|
||||
|
||||
See `:help `ibl.config.scope.highlight`.
|
||||
'';
|
||||
default = null;
|
||||
};
|
||||
|
||||
priority = mkOption {
|
||||
type = int;
|
||||
description = "Virtual text priority for the scope";
|
||||
default = 1024;
|
||||
};
|
||||
|
||||
include.node_type = mkOption {
|
||||
type = attrsOf (listOf str);
|
||||
description = "Additional nodes to be used for scope checking, per language";
|
||||
default = {};
|
||||
};
|
||||
|
||||
exclude = {
|
||||
language = mkOption {
|
||||
type = listOf str;
|
||||
description = ''
|
||||
The list of treesitter languages to disable scope for.
|
||||
|
||||
`*` can be used as a wildcard for every language/node type.
|
||||
'';
|
||||
default = [];
|
||||
};
|
||||
|
||||
node_type = mkOption {
|
||||
type = attrsOf (listOf str);
|
||||
description = ''
|
||||
Nodes to ignore in scope checking, per language.
|
||||
|
||||
`*` can be used as a wildcard for every language.
|
||||
'';
|
||||
default = {
|
||||
"*" = ["source_file" "program"];
|
||||
lua = ["chunk"];
|
||||
python = ["module"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
21
modules/plugins/visuals/nvim-cursorline/config.nix
Normal file
21
modules/plugins/visuals/nvim-cursorline/config.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.visuals.nvim-cursorline;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["nvim-cursorline"];
|
||||
|
||||
pluginRC.nvim-cursorline = entryAnywhere ''
|
||||
require("nvim-cursorline").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/visuals/nvim-cursorline/default.nix
Normal file
6
modules/plugins/visuals/nvim-cursorline/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./nvim-cursorline.nix
|
||||
];
|
||||
}
|
65
modules/plugins/visuals/nvim-cursorline/nvim-cursorline.nix
Normal file
65
modules/plugins/visuals/nvim-cursorline/nvim-cursorline.nix
Normal file
|
@ -0,0 +1,65 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.modules) mkRenamedOptionModule mkRemovedOptionModule;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) int bool;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
imports = [
|
||||
(mkRenamedOptionModule ["vim" "visuals" "cursorline"] ["vim" "visuals" "nvim-cursorline"])
|
||||
(mkRenamedOptionModule ["vim" "visuals" "nvim-cursorline" "lineTimeout"] ["vim" "visuals" "nvim-cursorline" "setupOpts" "line_timeout"])
|
||||
(mkRemovedOptionModule ["vim" "visuals" "nvim-cursorline" "lineNumbersOnly"] ''
|
||||
`vim.visuals.nvim-cursorline.lineNumbersOnly` has been removed. Use `vim.visuals.nvim-cursorline.number` instead.
|
||||
'')
|
||||
];
|
||||
|
||||
options.vim.visuals.nvim-cursorline = {
|
||||
enable = mkEnableOption "cursor word and line highlighting [nvim-cursorline]";
|
||||
|
||||
# Upstream has **zero** documentation whatsoever. I'm making wild assumptions
|
||||
# on what goes into description based don the source code. I'm sorry. Not.
|
||||
setupOpts = mkPluginSetupOption "nvim-cursorline" {
|
||||
cursorline = {
|
||||
enable = mkEnableOption "cursor line highlighting";
|
||||
timeout = mkOption {
|
||||
type = int;
|
||||
default = 1000;
|
||||
description = "Cursorline timeout";
|
||||
};
|
||||
|
||||
number = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = ''
|
||||
If true, `vim.wo.cursorlineopt` will be set to "number"
|
||||
when the trigger conditions are met.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
cursorword = {
|
||||
enable = mkEnableOption "cursor word highlighting";
|
||||
timeout = mkOption {
|
||||
type = int;
|
||||
default = 1000;
|
||||
description = "Cursorword timeout";
|
||||
};
|
||||
|
||||
min_length = mkOption {
|
||||
type = int;
|
||||
default = 3;
|
||||
description = ''
|
||||
The min_length option defines the minimum number of characters
|
||||
a word must have to be highlighted as a "cursor word." Any word
|
||||
shorter than this value will be ignored and not highlighted.
|
||||
'';
|
||||
};
|
||||
|
||||
hl.underline = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether to underline matching cursorword";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
21
modules/plugins/visuals/nvim-scrollbar/config.nix
Normal file
21
modules/plugins/visuals/nvim-scrollbar/config.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.visuals.nvim-scrollbar;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["nvim-scrollbar"];
|
||||
|
||||
pluginRC.cursorline = entryAnywhere ''
|
||||
require("scrollbar").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/visuals/nvim-scrollbar/default.nix
Normal file
6
modules/plugins/visuals/nvim-scrollbar/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./scrollbar-nvim.nix
|
||||
];
|
||||
}
|
21
modules/plugins/visuals/nvim-scrollbar/scrollbar-nvim.nix
Normal file
21
modules/plugins/visuals/nvim-scrollbar/scrollbar-nvim.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.modules) mkRenamedOptionModule;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) listOf str;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
imports = [
|
||||
(mkRenamedOptionModule ["vim" "visuals" "scrollBar"] ["vim" "visuals" "nvim-scrollbar"])
|
||||
];
|
||||
|
||||
options.vim.visuals.nvim-scrollbar = {
|
||||
enable = mkEnableOption "extensible Neovim Scrollbar [nvim-scrollbar]";
|
||||
setupOpts = mkPluginSetupOption "scrollbar-nvim" {
|
||||
excluded_filetypes = mkOption {
|
||||
type = listOf str;
|
||||
default = ["prompt" "TelescopePrompt" "noice" "noice" "NvimTree" "neo-tree" "alpha" "notify" "Navbuddy"];
|
||||
description = "Filetypes to hide the scrollbar on";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
21
modules/plugins/visuals/nvim-web-devicons/config.nix
Normal file
21
modules/plugins/visuals/nvim-web-devicons/config.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.visuals.nvim-web-devicons;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["nvim-web-devicons"];
|
||||
|
||||
pluginRC.nvim-web-devicons = entryAnywhere ''
|
||||
require("nvim-web-devicons").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/visuals/nvim-web-devicons/default.nix
Normal file
6
modules/plugins/visuals/nvim-web-devicons/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./nvim-web-devicons.nix
|
||||
];
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkRenamedOptionModule;
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.types) nullOr attrsOf attrs enum;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
imports = [
|
||||
(mkRenamedOptionModule ["vim" "visuals" "nvimWebDevicons"] ["vim" "visuals" "nvim-web-devicons"])
|
||||
];
|
||||
|
||||
options.vim.visuals.nvim-web-devicons = {
|
||||
enable = mkEnableOption "Neovim dev icons [nvim-web-devicons]";
|
||||
|
||||
setupOpts = mkPluginSetupOption "nvim-web-devicons" {
|
||||
color_icons = mkEnableOption "different highlight colors per icon" // {default = true;};
|
||||
variant = mkOption {
|
||||
type = nullOr (enum ["light" "dark"]);
|
||||
default = null;
|
||||
description = "Set the light or dark variant manually, instead of relying on `background`";
|
||||
};
|
||||
|
||||
override = mkOption {
|
||||
type = attrsOf attrs;
|
||||
default = {};
|
||||
example = literalExpression ''
|
||||
{
|
||||
zsh = {
|
||||
name = "Zsh";
|
||||
icon = "";
|
||||
color = "#428850";
|
||||
cterm_color = "65";
|
||||
};
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Your personal icon overrides.
|
||||
|
||||
You can specify color or cterm_color instead of specifying
|
||||
both of them. DevIcon will be appended to `name`
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,261 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||
inherit (lib.types) int bool str nullOr either listOf attrsOf;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
|
||||
cfg = config.vim.visuals;
|
||||
in {
|
||||
options.vim.visuals = {
|
||||
enable = mkEnableOption "Visual enhancements.";
|
||||
|
||||
nvimWebDevicons.enable = mkEnableOption "dev icons. Required for certain plugins [nvim-web-devicons].";
|
||||
|
||||
scrollBar.enable = mkEnableOption "scrollbar [scrollbar.nvim]";
|
||||
|
||||
smoothScroll.enable = mkEnableOption "smooth scrolling [cinnamon-nvim]";
|
||||
|
||||
cellularAutomaton = {
|
||||
enable = mkEnableOption "cellular automaton [cellular-automaton]";
|
||||
|
||||
mappings = {
|
||||
makeItRain = mkMappingOption "Make it rain [cellular-automaton]" "<leader>fml";
|
||||
};
|
||||
};
|
||||
|
||||
cursorline = {
|
||||
enable = mkEnableOption "line hightlighting on the cursor [nvim-cursorline]";
|
||||
|
||||
lineTimeout = mkOption {
|
||||
type = int;
|
||||
description = "Time in milliseconds for cursorline to appear";
|
||||
default = 0;
|
||||
};
|
||||
|
||||
lineNumbersOnly = mkOption {
|
||||
type = bool;
|
||||
description = "Hightlight only in the presence of line numbers";
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
indentBlankline = {
|
||||
enable = mkEnableOption "indentation guides [indent-blankline]";
|
||||
|
||||
setupOpts = {
|
||||
debounce = mkOption {
|
||||
type = int;
|
||||
description = "Debounce time in milliseconds";
|
||||
default = 200;
|
||||
};
|
||||
|
||||
viewport_buffer = {
|
||||
min = mkOption {
|
||||
type = int;
|
||||
description = "Number of lines above and below of what is currently
|
||||
visible in the window";
|
||||
default = 30;
|
||||
};
|
||||
|
||||
max = mkOption {
|
||||
type = int;
|
||||
description = "Number of lines above and below of what is currently
|
||||
visible in the window";
|
||||
default = 500;
|
||||
};
|
||||
};
|
||||
|
||||
indent = {
|
||||
char = mkOption {
|
||||
type = either str (listOf str);
|
||||
description = "Character(s) for indentation guide";
|
||||
default = "│";
|
||||
};
|
||||
|
||||
tab_char = mkOption {
|
||||
type = nullOr (either str (listOf str));
|
||||
description = ''
|
||||
Character(s) for tab indentation guide.
|
||||
|
||||
See `:help ibl.config.indent.tab_char`.
|
||||
'';
|
||||
default = null;
|
||||
};
|
||||
|
||||
highlight = mkOption {
|
||||
type = nullOr (either str (listOf str));
|
||||
description = ''
|
||||
The highlight group(s) applied to the indentation guide.
|
||||
|
||||
See `:help ibl.config.indent.highlight`.
|
||||
'';
|
||||
default = null;
|
||||
};
|
||||
|
||||
smart_indent_cap = mkOption {
|
||||
type = bool;
|
||||
description = "Caps the number of indentation levels based on surrounding code";
|
||||
default = true;
|
||||
};
|
||||
|
||||
priority = mkOption {
|
||||
type = int;
|
||||
description = "Virtual text priority for the indentation guide";
|
||||
default = 1;
|
||||
};
|
||||
|
||||
repeat_linebreak = mkOption {
|
||||
type = bool;
|
||||
description = "Repeat indentation guides on wrapped lines";
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
whitespace = {
|
||||
highlight = mkOption {
|
||||
type = nullOr (either str (listOf str));
|
||||
description = ''
|
||||
The highlight group(s) applied to whitespace.
|
||||
|
||||
See `:help ibl.config.whitespace.highlight`.
|
||||
'';
|
||||
default = null;
|
||||
};
|
||||
|
||||
remove_blankline_trail = mkOption {
|
||||
type = bool;
|
||||
description = "Remove trailing whitespace on blanklines";
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
scope = {
|
||||
enabled = mkOption {
|
||||
description = "Highlight current scope from treesitter";
|
||||
type = bool;
|
||||
default = config.vim.treesitter.enable;
|
||||
defaultText = literalExpression "config.vim.treesitter.enable";
|
||||
};
|
||||
|
||||
char = mkOption {
|
||||
type = either str (listOf str);
|
||||
description = "The character(s) for the scope indentation guide";
|
||||
default = cfg.indentBlankline.setupOpts.indent.char;
|
||||
defaultText = literalExpression "config.vim.visuals.indentBlankline.setuopOpts.indent.char";
|
||||
};
|
||||
|
||||
show_start = mkOption {
|
||||
type = bool;
|
||||
description = "Show an underline on the first line of the scope";
|
||||
default = false;
|
||||
};
|
||||
|
||||
show_end = mkOption {
|
||||
type = bool;
|
||||
description = "Show an underline on the last line of the scope";
|
||||
default = false;
|
||||
};
|
||||
|
||||
show_exact_scope = mkOption {
|
||||
type = bool;
|
||||
description = "Show the scope underline at the exact start of the scope, even if that's to the right of the indentation guide";
|
||||
default = false;
|
||||
};
|
||||
|
||||
injected_languages = mkOption {
|
||||
type = bool;
|
||||
description = "Check for injected languages (treesitter)";
|
||||
default = config.vim.treesitter.enable;
|
||||
defaultText = literalExpression "config.vim.treesitter.enable";
|
||||
};
|
||||
|
||||
highlight = mkOption {
|
||||
type = nullOr (either str (listOf str));
|
||||
description = ''
|
||||
The highlight group(s) applied to the scope.
|
||||
|
||||
See `:help `ibl.config.scope.highlight`.
|
||||
'';
|
||||
default = null;
|
||||
};
|
||||
|
||||
priority = mkOption {
|
||||
type = int;
|
||||
description = "Virtual text priority for the scope";
|
||||
default = 1024;
|
||||
};
|
||||
|
||||
include.node_type = mkOption {
|
||||
type = attrsOf (listOf str);
|
||||
description = "Additional nodes to be used for scope checking, per language";
|
||||
default = {};
|
||||
};
|
||||
|
||||
exclude = {
|
||||
language = mkOption {
|
||||
type = listOf str;
|
||||
description = ''
|
||||
The list of treesitter languages to disable scope for.
|
||||
|
||||
`*` can be used as a wildcard for every language/node type.
|
||||
'';
|
||||
default = [];
|
||||
};
|
||||
|
||||
node_type = mkOption {
|
||||
type = attrsOf (listOf str);
|
||||
description = ''
|
||||
Nodes to ignore in scope checking, per language.
|
||||
|
||||
`*` can be used as a wildcard for every language.
|
||||
'';
|
||||
default = {
|
||||
"*" = ["source_file" "program"];
|
||||
lua = ["chunk"];
|
||||
python = ["module"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
highlight-undo = {
|
||||
enable = mkEnableOption "highlight undo [highlight-undo]";
|
||||
|
||||
highlightForCount = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Enable support for highlighting when a <count> is provided before the key
|
||||
If set to false it will only highlight when the mapping is not prefixed with a <count>
|
||||
'';
|
||||
};
|
||||
|
||||
duration = mkOption {
|
||||
type = int;
|
||||
description = "Duration of highlight";
|
||||
default = 500;
|
||||
};
|
||||
|
||||
undo = {
|
||||
hlGroup = mkOption {
|
||||
type = str;
|
||||
description = "Highlight group for undo";
|
||||
default = "HighlightUndo";
|
||||
};
|
||||
};
|
||||
|
||||
redo = {
|
||||
hlGroup = mkOption {
|
||||
type = str;
|
||||
description = "Highlight group for redo";
|
||||
default = "HighlightUndo";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -189,7 +189,7 @@ in {
|
|||
};
|
||||
|
||||
plugins = mkOption {
|
||||
default = [];
|
||||
default = {};
|
||||
type = attrsOf lznPluginType;
|
||||
description = ''
|
||||
Plugins to lazy load.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"release": "v0.6",
|
||||
"isReleaseBranch": true
|
||||
"release": "v0.7",
|
||||
"isReleaseBranch": false
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue