diff --git a/docs-preview-591/index.xhtml b/docs-preview-591/index.xhtml index 451c1e67..85b61706 100644 --- a/docs-preview-591/index.xhtml +++ b/docs-preview-591/index.xhtml @@ -33,7 +33,7 @@
Table of Contents
Table of Contents
Table of Contents
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.
@@ -43,7 +43,7 @@ reporting them over at the pull requests tab.Table of Contents
Thanks to the portability of Nix, you can try out nvf without actually +
Table of Contents
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 - 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
@@ -80,7 +80,7 @@ downloading a whole bunch of language servers and associated tools.
Table of Contents
It is possible to install nvf without depending on NixOS or Home-Manager as the +module installation section.
Table of Contents
Table of Contents
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.
{
@@ -224,7 +224,7 @@ the default theme enabled. You may use other options inside Module Installation
Table of Contents
The below chapters will describe installing nvf as NixOS and Home-Manager
+
Table of Contents
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.
Table of Contents
The NixOS module allows us to customize the different vim options from inside
the NixOS configuration without having to call for the wrapper yourself. It is
@@ -359,7 +359,7 @@ installation sections of the manual. You may find all available options in the
As of v0.5, you may now specify the Neovim package that will be wrapped with +
Table of Contents
As of v0.5, you may now specify the Neovim package that will be wrapped with
your configuration. This is done with the vim.package option.
{inputs, pkgs, ...}: {
# using the neovim-nightly overlay
vim.package = inputs.neovim-overlay.packages.${pkgs.system}.neovim;
@@ -371,7 +371,7 @@ the neovim package, similar to neovim-unwrapped in
vim.package = pkgs.neovim-unwrapped;
}
-Table of Contents
nvf, by default, exposes a wide variety of plugins as module options for +
Table of Contents
nvf, by default, exposes a wide variety of plugins as module options for your convenience and bundles necessary dependencies into nvf’s runtime. In case a plugin is not available in nvf, you may consider making a pull request to nvf to include it as a module or you may add it to your @@ -661,21 +661,107 @@ direct DAG, but is converted to, and resolved as one internally
Table of Contents
There may be instances where the your Nix configuration evaluates to invalid +
Table of Contents
Table of Contents
We recognize that you might not always want to configure your setup purely in +Nix, sometimes doing things in Lua is simply the “superior” option. In such a +case you might want to configure your Neovim instance using Lua, and nothing but +Lua. It is also possible to mix Lua and Nix configurations.
Pure Lua or hybrid Lua/Nix configurations can be achieved in two different ways.
+Purely, by modifying Neovim’s runtime directory or impurely by placing Lua
+configuration in a directory found in $HOME. For your convenience, this
+section will document both methods as they can be used.
As of 0.6, nvf allows you to modify Neovim’s runtime path to suit your needs.
+One of the ways the new runtime option is to add a configuration located
+relative to your flake.nix, which must be version controlled in pure flakes
+manner.
{
+ # Let us assume we are in the repository root, i.e., the same directory as the
+ # flake.nix. For the sake of the argument, we will assume that the Neovim lua
+ # configuration is in a nvim/ directory relative to flake.nix.
+ vim = {
+ additionalRuntimeDirectories = [
+ # This will be added to Neovim's runtime paths. Conceptually, this behaves
+ # very similarly to ~/.config/nvim but you may not place a top-level
+ # init.lua to be able to require it directly.
+ ./nvim
+ ];
+ };
+}
+This will add the nvim directory, or rather, the store path that will be
+realised after your flake gets copied to the Nix store, to Neovim’s runtime
+directory. You may now create a lua/myconfig directory within this nvim
+directory, and call it with vim.luaConfigRC.
{pkgs, ...}: {
+ vim = {
+ additionalRuntimeDirectories = [
+ # You can list more than one file here.
+ ./nvim-custom-1
+
+ # To make sure list items are ordered, use lib.mkBefore or lib.mkAfter
+ # Simply placing list items in a given order will **not** ensure that
+ # this list will be deterministic.
+ ./nvim-custom-2
+ ];
+
+ startPlugins = [pkgs.vimPlugins.gitsigns];
+
+ # Neovim supports in-line syntax highlighting for multi-line strings.
+ # Simply place the filetype in a /* comment */ before the line.
+ luaConfigRC.myconfig = /* lua */ ''
+ -- Call the Lua module from ./nvim/lua/myconfig
+ require("myconfig")
+
+ -- Any additional Lua configuration that you might want *after* your own
+ -- configuration. For example, a plugin setup call.
+ require('gitsigns').setup({})
+ '';
+ };
+}
+
+As of Neovim 0.9, $NVIM_APPNAME is a variable expected by Neovim to
+decide on the configuration directory. nvf sets this variable as "nvf",
+meaning ~/.config/nvf will be regarded as the configuration directory by
+Neovim, similar to how ~/.config/nvim behaves in regular installations. This
+allows some degree of Lua configuration, backed by our low-level wrapper
+mnw. Creating a lua/ directory located in
+$NVIM_APPNAME (“nvf” by default) and placing your configuration in, e.g.,
+~/.config/nvf/lua/myconfig will allow you to require it as a part of the Lua
+module system through nvf’s module system.
Let’s assume your ~/.config/nvf/lua/myconfig/init.lua consists of the
+following:
-- init.lua
+vim.keymap.set("n", " ", "<Nop>", { silent = true, remap = false })
+vim.g.mapleader = " "
+The following Nix configuration via vim.luaConfigRC will allow loading
+this
{
+ # The attribute name "myconfig-dir" here is arbitrary. It is required to be
+ # a *named* attribute by the DAG system, but the name is entirely up to you.
+ vim.luaConfigRC.myconfig-dir = ''
+ require("myconfig")
+
+ -- Any additional Lua
+ '';
+}
+After you load your custom configuration, you may use an init.lua located in
+your custom configuration directory to configure Neovim exactly as you would
+without a wrapper like nvf. If you want to place your require call in a
+specific position (i.e., before or after options you set in nvf) the
+DAG system will let you place your configuration in a location of your
+choosing.
Table of Contents
There may be instances where the your Nix configuration evaluates to invalid Lua, or times when you will be asked to provide your built Lua configuration for easier debugging by nvf maintainers. nvf provides two helpful utilities out of the box.
nvf-print-config and nvf-print-config-path will be bundled with nvf as lightweight utilities to help you view or share your built configuration when necessary.
To view your configuration with syntax highlighting, you may use the bat pager.
nvf-print-config | bat --language=lua
-Alternatively, cat or less may also be used.
Alternatively, cat or less may also be used.
neovimConfig It is also possible to access the configuration for the wrapped package. The
+built Neovim package will contain a neovimConfig attribute in its
+passthru.
The manpages provided by nvf contains an offline version of the option search
normally available at https://notashelf.github.io/nvf/options.html. You may
use the man 5 nvf command to view option documentation from the comfort of
your terminal.
Note that this is only available for NixOS and Home-Manager module installations.
Table of Contents
nvf is designed for the developer as much as it is designed for the end-user. We +
Table of Contents
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 diff --git a/docs-preview-591/options.html b/docs-preview-591/options.html index 7635681a..f61d2364 100644 --- a/docs-preview-591/options.html +++ b/docs-preview-591/options.html @@ -4,7 +4,7 @@
-Below are the module options provided by nvf, in no particular order. Most +
Below are the module options provided by nvf, in no particular order. Most options will include useful comments, warnings or setup tips on how a module -option is meant to be used as well as examples in complex cases.
An offline version of this page is bundled with nvf as a part of the manpages
+which you can access with man 5 nvf. Please us know if you believe any of the
+options below are missing useful examples.
Table of Contents
Release notes for release 0.7
vim.configRC removed In v0.7 we are removing vim.configRC in favor of making vim.luaConfigRC the
+
Table of Contents
Release notes for release 0.7
vim.configRC removed In v0.7 we are removing vim.configRC in favor of making vim.luaConfigRC the
top-level DAG, and thereby making the entire configuration Lua based. This
change introduces a few breaking changes:
vim.configRC has been removed, which means that you have to convert all of
your custom vimscript-based configuration to Lua. As for how to do that, you
@@ -373,7 +373,7 @@ Svelte. Enable them via
-
Appendix B. Neovim Flake Configuration Options
+ Appendix B. nvf Configuration Options
Home