summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorAdrian Hesketh <a-h@users.noreply.github.com>2021-04-20 21:28:06 +0100
committerGitHub <noreply@github.com>2021-04-20 21:28:06 +0100
commitf86b57d708878c671bc19346db3d9f124b75c4da (patch)
treecbc2b2e8c49070f953bb33610e29c564bf89e5d8 /doc
parent20e0c6d5837527906a74ec5513cb9e5a2c0a73b7 (diff)
Include custom package in vim docs (#92811)
Describe how to package a plugin that doesn't exist in nixpkgs (and also how to include an external file). Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/languages-frameworks/vim.section.md38
1 files changed, 38 insertions, 0 deletions
diff --git a/doc/languages-frameworks/vim.section.md b/doc/languages-frameworks/vim.section.md
index 22b5e6f3013b..5316db9a1375 100644
--- a/doc/languages-frameworks/vim.section.md
+++ b/doc/languages-frameworks/vim.section.md
@@ -116,6 +116,44 @@ The resulting package can be added to `packageOverrides` in `~/.nixpkgs/config.n
After that you can install your special grafted `myVim` or `myNeovim` packages.
+### What if your favourite Vim plugin isn't already packaged?
+
+If one of your favourite plugins isn't packaged, you can package it yourself:
+
+```
+{ config, pkgs, ... }:
+
+let
+ easygrep = pkgs.vimUtils.buildVimPlugin {
+ name = "vim-easygrep";
+ src = pkgs.fetchFromGitHub {
+ owner = "dkprice";
+ repo = "vim-easygrep";
+ rev = "d0c36a77cc63c22648e792796b1815b44164653a";
+ sha256 = "0y2p5mz0d5fhg6n68lhfhl8p4mlwkb82q337c22djs4w5zyzggbc";
+ };
+ };
+in
+{
+ environment.systemPackages = [
+ (
+ pkgs.neovim.override {
+ configure = {
+ packages.myPlugins = with pkgs.vimPlugins; {
+ start = [
+ vim-go # already packaged plugin
+ easygrep # custom package
+ ];
+ opt = [];
+ };
+ # ...
+ };
+ }
+ )
+ ];
+}
+```
+
## Managing plugins with vim-plug
To use [vim-plug](https://github.com/junegunn/vim-plug) to manage your Vim