Skip to content

Commit

Permalink
Merge branch 'main' into add-multicursors-nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAShelf authored Feb 13, 2025
2 parents 0536421 + 63c032c commit 6d868dc
Show file tree
Hide file tree
Showing 67 changed files with 2,941 additions and 4,070 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ trim_trailing_whitespace = unset

[*.lock]
indent_size = unset

[npins/sources.json]
insert_final_newline = unset
3 changes: 3 additions & 0 deletions .github/typos.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@

default.extend-ignore-words-re = ["(?i)(noice)", "befores", "annote", "viw"]
files.extend-exclude = [
"npins/sources.json"
]
2 changes: 1 addition & 1 deletion docs/manual/configuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
```{=include=} chapters
configuring/custom-package.md
configuring/custom-plugins.md
configuring/custom-inputs.md
configuring/overriding-plugins.md
configuring/languages.md
configuring/dags.md
configuring/dag-entries.md
Expand Down
53 changes: 0 additions & 53 deletions docs/manual/configuring/custom-inputs.md

This file was deleted.

35 changes: 35 additions & 0 deletions docs/manual/configuring/overriding-plugins.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Overriding plugins {#ch-overriding-plugins}

The [additional plugins section](#sec-additional-plugins) details the addition
of new plugins to nvf under regular circumstances, i.e. while making a pull
request to the project. You may _override_ those plugins in your config
to change source versions, e.g., to use newer versions of plugins
that are not yet updated in **nvf**.

```nix
vim.pluginOverrides = {
lazydev-nvim = pkgs.fetchFromGitHub {
owner = "folke";
repo = "lazydev.nvim";
rev = "";
hash = "";
};
# It's also possible to use a flake input
lazydev-nvim = inputs.lazydev-nvim;
# Or a local path
lazydev-nvim = ./lazydev;
# Or a npins pin... etc
};
```

This will override the source for the `neodev.nvim` plugin that is used in nvf
with your own plugin.

::: {.warning}

While updating plugin inputs, make sure that any configuration that has been
deprecated in newer versions is changed in the plugin's `setupOpts`. If you
depend on a new version, requesting a version bump in the issues section is a
more reliable option.

:::
39 changes: 14 additions & 25 deletions docs/manual/hacking/additional-plugins.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,25 @@
# 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, use `npins`

```nix
{
inputs = {
# ...
plugin-neodev-nvim = {
url = "github:folke/neodev.nvim";
flake = false;
};
# ...
};
}
```
Use:

`nix-shell -p npins` or `nix shell nixpkgs#npins`

Then run:

`npins add --name <plugin name> github <owner> <repo> -b <branch>`

Be sure to replace any non-alphanumeric characters with `-` for `--name`

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`
For example

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`
`npins add --name lazydev-nvim github folke lazydev.nvim -b main`

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**.
You can now reference this plugin as a **string**.

```nix
config.vim.startPlugins = ["neodev-nvim"];
config.vim.startPlugins = ["lazydev-nvim"];
```

## Modular setup options {#sec-modular-setup-options}
Expand Down
32 changes: 15 additions & 17 deletions docs/manual/installation/custom-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ An example flake that exposes your custom Neovim configuration might look like
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 = [{
outputs = {nixpkgs, ...} @ inputs: {
packages.x86_64-linux = {
# 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 =
(inputs.nvf.lib.neovimConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
{
config.vim = {
# Enable custom theming options
theme.enable = true;
Expand All @@ -43,14 +45,10 @@ An example flake that exposes your custom Neovim configuration might look like
# 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;
}
];
})
.neovim;
};
};
}
Expand Down
7 changes: 2 additions & 5 deletions docs/manual/installation/modules/home-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,10 @@ Followed by importing the home-manager module somewhere in your configuration.
nvf.url = "github:notashelf/nvf";
};
outputs = { nixpkgs, home-manager, nvf, ... }: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
outputs = { nixpkgs, home-manager, nvf, ... }: {
# ↓ this is your home output in the flake schema, expected by home-manager
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
nvf.homeManagerModules.default # <- this imports the home-manager module that provides the options
./home.nix # <- your home entrypoint, `programs.nvf.*` may be defined here
Expand Down
52 changes: 30 additions & 22 deletions docs/manual/installation/standalone/nixos.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,46 @@ the default theme enabled. You may use other options inside `config.vim` in
nvf.url = "github:notashelf/nvf";
};
outputs = {nixpkgs, nvf, ...}: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
configModule = {
# Add any custom options (and do feel free to upstream them!)
# options = { ... };
config.vim = {
theme.enable = true;
# and more options as you see fit...
};
};
customNeovim = nvf.lib.neovimConfiguration {
inherit pkgs;
modules = [configModule];
};
in {
outputs = {
nixpkgs,
nvf,
self,
...
}: {
# This will make the package available as a flake output under 'packages'
packages.${system}.my-neovim = customNeovim.neovim;
packages.x86_64-linux.my-neovim =
(nvf.lib.neovimConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
# Or move this to a separate file and add it's path here instead
# IE: ./nvf_module.nix
(
{pkgs, ...}: {
# Add any custom options (and do feel free to upstream them!)
# options = { ... };
config.vim = {
theme.enable = true;
# and more options as you see fit...
};
}
)
];
})
.neovim;
# Example nixosConfiguration using the configured Neovim package
nixosConfigurations = {
yourHostName = nixpkgs.lib.nixosSystem {
# ...
modules = [
# This will make wrapped neovim available in your system packages
{environment.systemPackages = [customNeovim.neovim];}
# Can also move this to another config file if you pass inputs/self around with specialArgs
({pkgs, ...}: {
environment.systemPackages = [self.packages.${pkgs.stdenv.system}.neovim];
})
];
# ...
};
};
};
}
```
}```
18 changes: 18 additions & 0 deletions docs/release-notes/rl-0.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@

- Add Haskell support under `vim.languages.haskell` using [haskell-tools.nvim].

[horriblename](https://github.com/horriblename):

[blink.cmp]: https://github.com/saghen/blink.cmp

- Add [blink.cmp] support

[diniamo](https://github.com/diniamo):

- Add Odin support under `vim.languages.odin`.
Expand Down Expand Up @@ -150,3 +156,15 @@
available plugins, under `vim.utility.multicursors`.
- Add [hydra.nvim](https://github.com/nvimtools/hydra.nvim) as dependency for
`multicursors.nvim` and lazy loads by default.
[folospior](https://github.com/folospior)

- Fix plugin name for lsp/lspkind.

[iynaix](https://github.com/iynaix)

- Add lsp options support for [nixd](https://github.com/nix-community/nixd)
language server.

[Mr-Helpful](https://github.com/Mr-Helpful)

- Corrects pin names used for nvim themes
Loading

0 comments on commit 6d868dc

Please sign in to comment.