From e271247d015e7c5ee317721aed8e411da88ace3d Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 28 Jul 2023 09:04:49 +0000 Subject: [PATCH] deploy: f11912c48f2fb2141db9532d46c9c82f1772c0a9 --- index.html | 45 +- options.html | 1476 +++++++++++++++++++++++++------------------------- 2 files changed, 770 insertions(+), 751 deletions(-) diff --git a/index.html b/index.html index 12dc8f5..d515470 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ -neovim-flake Manual

neovim-flake Manual


Preface

+neovim-flake Manual

Chapter 4. Custom Plugins

You can use custom plugins, before they are implemented in the flake. -To add a plugin, you need to add it to your config’s config.vim.startPlugins array. -This is an example of adding the FrenzyExists/aquarium-vim plugin:

{
+To add a plugin, you need to add it to your config’s config.vim.startPlugins array.

4.1. New Method

As of version 0.5, we have a more extensive API for configuring plugins, under vim.extraPlugins.

Instead of using DAGs exposed by the library, you may use the extra plugin module as follows:

{
+  config.vim.extraPlugins = with pkgs.vimPlugins; {
+    aerial = {
+      package = aerial-nvim;
+      setup = ''
+        require('aerial').setup {
+          -- some lua configuration here
+        }
+      '';
+    };
+
+    harpoon = {
+      package = harpoon;
+      setup = "require('harpoon').setup {}";
+      after = ["aerial"];
+    };
+  };
+}

4.2. Old Method

Users who have not yet updated to 0.5, or prefer a more hands-on approach may use the old method where the load orderof the plugins is determined by DAGs.

{
+  # fetch plugin source from GitHub and add it to startPlugins
   config.vim.startPlugins = [
     (pkgs.fetchFromGitHub {
       owner = "FrenzyExists";
@@ -53,7 +70,7 @@ This is an example of adding the FrenzyExists/aquarium-vim plugin:

However, just making the plugin available might not be enough. In that case, you can write custom vimscript or lua config, using config.vim.configRC or config.vim.luaConfigRC respectively. These options are attribute sets, and you need to give the configuration you’re adding some name, like this:

{
   config.vim.configRC.aquarium = "colorscheme aquiarum";
-}

Note: If your configuration needs to be put in a specific place in the config, you can use functions from inputs.neovim-flake.lib.nvim.dag to order it. Refer to https://github.com/nix-community/home-manager/blob/master/modules/lib/dag.nix.

Also, if you successfully made your plugin work, please make a PR to add it to the flake, or open an issue with your findings so that we can make it available for everyone easily.

Chapter 5. Home Manager

The Home Manager module allows us to customize the different vim options. To use it, we first add the input flake.

{
+}

Note: If your configuration needs to be put in a specific place in the config, you can use functions from inputs.neovim-flake.lib.nvim.dag to order it. Refer to https://github.com/nix-community/home-manager/blob/master/modules/lib/dag.nix.

Also, if you successfully made your plugin work, please make a PR to add it to the flake, or open an issue with your findings so that we can make it available for everyone easily.

Chapter 5. Home Manager

The Home Manager module allows us to customize the different vim options. To use it, we first add the input flake.

{
   neovim-flake = {
     url = github:notashelf/neovim-flake;
     # you can override input nixpkgs
@@ -74,25 +91,7 @@ These options are attribute sets, and you need to give the configuration you’r
       };
     };
   };
-}

5.1. Custom vim/neovim plugins

It is possible to add custom plugins to your configuration by using the vim.startPlugins option and the this flake’s lua DAG library.

Start by adding it to startPlugins. This example uses nvim-surround, but the process will be similar for other plugins as well.

{
-  programs.neovim-flake = {
-    enable = true;
-    settings = {
-      vim.startPlugins = [ pkgs.vimPlugins.nvim-surround ];
-    };
-  };
-}

Followed by requiring the plugin, should it need one, in the lua DAG. Please note that you’re able to name the DAG to however you want, the name will add a --SECTION <name> in the init.vim, under which it will be initialized. lib.nvim.dag.entryAfter ["name"] could also be used to initialize a plugin only after a previous plugin has beeni initialize -Your final setup will likely look like this, where nvim-flake refers to your flake input or fetch.

{
-  programs.neovim-flake = {
-    enable = true;
-    settings = {
-      vim.startPlugins = [ pkgs.vimPlugins.nvim-surround ];
-      luaConfigRC.nvim-surround = nvim-flake.lib.nvim.dag.entryAnywhere '' # nvim-flake is a reference to the flake. Please change this accordingly to your config.
-        require("nvim-surround").setup()
-      '';
-    };
-  };
-}

Chapter 6. Language Support

Language specific support means there is a combination of language specific plugins, treesitter support, nvim-lspconfig language servers, and null-ls integration. This gets you capabilities ranging from autocompletion to formatting to diagnostics. The following languages have sections under the vim.languages attribute. See the configuration docs for details.

  • +}

Chapter 6. Language Support

Language specific support means there is a combination of language specific plugins, treesitter support, nvim-lspconfig language servers, and null-ls integration. This gets you capabilities ranging from autocompletion to formatting to diagnostics. The following languages have sections under the vim.languages attribute. See the configuration docs for details.