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
1. Try it out
1.1. Nix
1.2. Tidal
1.3. Maximal
1.4. Using Prebuilt Configs
2. Default Configs
2.1. Tidal Cycles
2.2. Nix
2.3. Maximal
3. Custom Configuration
4. Custom Plugins
5. Home Manager
5.1. Custom vim/neovim plugins
6. Language Support
A. Configuration Options
B. Release Notes
B.1. Release 0.1
B.1.1. Changelog
B.2. Release 0.2
B.2.1. Changelog
B.3. Release 0.3
B.3.1. Changelog
B.4. Release 0.4
B.4.1. Changelog

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.