summary refs log tree commit diff
path: root/pkgs/applications/editors/vim/plugins/vim-gen-doc-hook.sh
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@protonmail.com>2022-02-16 11:55:43 -0300
committerAndersonTorres <torres.anderson.85@protonmail.com>2022-02-24 20:26:07 -0300
commit3f19fc37a3557d31b242b220b52c7a1358572f57 (patch)
tree5b7f91299e0f8633512862c96755fb483349fc57 /pkgs/applications/editors/vim/plugins/vim-gen-doc-hook.sh
parenta2122813921a74f1c6f04f113b07f89484376765 (diff)
downloadnixpkgs-3f19fc37a3557d31b242b220b52c7a1358572f57.tar
nixpkgs-3f19fc37a3557d31b242b220b52c7a1358572f57.tar.gz
nixpkgs-3f19fc37a3557d31b242b220b52c7a1358572f57.tar.bz2
nixpkgs-3f19fc37a3557d31b242b220b52c7a1358572f57.tar.lz
nixpkgs-3f19fc37a3557d31b242b220b52c7a1358572f57.tar.xz
nixpkgs-3f19fc37a3557d31b242b220b52c7a1358572f57.tar.zst
nixpkgs-3f19fc37a3557d31b242b220b52c7a1358572f57.zip
Move misc/vim-plugins to applications/editors/vim/plugins
Diffstat (limited to 'pkgs/applications/editors/vim/plugins/vim-gen-doc-hook.sh')
-rw-r--r--pkgs/applications/editors/vim/plugins/vim-gen-doc-hook.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/pkgs/applications/editors/vim/plugins/vim-gen-doc-hook.sh b/pkgs/applications/editors/vim/plugins/vim-gen-doc-hook.sh
new file mode 100644
index 00000000000..d5f0a00ebcc
--- /dev/null
+++ b/pkgs/applications/editors/vim/plugins/vim-gen-doc-hook.sh
@@ -0,0 +1,30 @@
+echo "Sourcing vim-gen-doc-hook"
+
+# the doc folder is copied via the copy_directories entry of the rockspec
+# in the folder gitsigns.nvim-scm-1-rocks/gitsigns.nvim/scm-1
+vimPluginGenTags() {
+    echo "Executing vimPluginGenTags"
+
+    target="$out/@rtpPath@"
+    mkdir -p $out/@rtpPath@
+
+    # build help tags
+    if [ -d "$target/doc" ]; then
+        echo "Building help tags"
+        if ! @vimBinary@ -N -u NONE -i NONE -n -E -s -V1 -c "helptags $target/doc" +quit!; then
+        echo "Failed to build help tags!"
+        exit 1
+        fi
+    else
+        echo "No docs available for $target"
+    fi
+
+    if [ -n "$addonInfo" ]; then
+        echo "$addonInfo" > $target/addon-info.json
+    fi
+
+    echo "Finished executing vimPluginInstallPhase"
+}
+
+preFixupHooks+=(vimPluginGenTags)
+