Signed-off-by: Anna (cybertailor) Vyalkova <[email protected]>
---
 eclass/vim-plugin.eclass | 119 +++++++++++++++++++++++++++------------
 1 file changed, 83 insertions(+), 36 deletions(-)

diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
index 668999eefd6..a03af8c53f7 100644
--- a/eclass/vim-plugin.eclass
+++ b/eclass/vim-plugin.eclass
@@ -429,7 +429,6 @@ fi
 
 if ! _using_vim_pack; then
 # @FUNCTION: update_vim_afterscripts
-# @USAGE:
 # @DESCRIPTION:
 # Creates scripts in /usr/share/vim/vimfiles/after/*
 # comprised of the snippets in /usr/share/vim/vimfiles/after/*/*.d
@@ -465,58 +464,106 @@ update_vim_afterscripts() {
 }
 fi
 
+# @ECLASS_VARIABLE: VIM_PLUGIN_HELPFILES
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Space-separated list of Vim help files to be printed at first
+# package installation.
+#
+# Example:
+# @CODE
+# VIM_PLUGIN_HELPFILES="foo.txt bar.txt"
+# @CODE
+
+# @ECLASS_VARIABLE: VIM_PLUGIN_HELPTEXT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# The information to print at first package installation.
+#
+# Example:
+# @CODE
+# VIM_PLUGIN_HELPTEXT=\
+# "This plugin provides syntax highlighting for ebuilds."
+# @CODE
+
+# @ECLASS_VARIABLE: VIM_PLUGIN_HELPURI
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# URL address where users can find the plugin documentation.
+# It will be displayed at first package installation.
+#
+# Example:
+# @CODE
+# VIM_PLUGIN_HELPURI="https://wiki.gentoo.org/wiki/Vim";
+# @CODE
+
+# @ECLASS_VARIABLE: VIM_PLUGIN_MESSAGES
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Space-separated list of keywords that trigger display of special
+# post-installation messages.
+#
+# Currently, the only recognized keyword is "filetype".
+#
+# Example:
+# @CODE
+# VIM_PLUGIN_MESSAGES="filetype"
+# @CODE
+
 # @FUNCTION: display_vim_plugin_help
-# @USAGE:
 # @DESCRIPTION:
-# Displays a message with the plugin's help file if one is available. Uses the
-# VIM_PLUGIN_HELPFILES env var. If multiple help files are available, they
-# should be separated by spaces. If no help files are available, but the env
-# var VIM_PLUGIN_HELPTEXT is set, that is displayed instead. Finally, if we
-# have nothing else, this functions displays a link to VIM_PLUGIN_HELPURI. An
-# extra message regarding enabling filetype plugins is displayed if
+# Displays a message with the plugin's help file if one is available.
+#
+# First of all, this function tries to uses the VIM_PLUGIN_HELPFILES variable.
+# If multiple help files are available, they should be separated by spaces.
+#
+# If no help files are available, but the VIM_PLUGIN_HELPTEXT variable is set,
+# that text is displayed instead.
+#
+# Finally, if we have nothing else, this functions displays a link to
+# VIM_PLUGIN_HELPURI.
+#
+# An extra message regarding enabling filetype plugins is displayed if
 # VIM_PLUGIN_MESSAGES includes the word "filetype".
 display_vim_plugin_help() {
        debug-print-function ${FUNCNAME} "$@"
 
-       local h
-
        if _using_vim_pack && [[ ! ${VIM_PLUGIN_AUTOLOAD} ]]; then
-               elog "This plugin will not be loaded automatically. To enable 
it,"
-               elog "add the following line to your ~/.vimrc file:"
+               elog "This plugin will not be loaded automatically."
+               elog "To enable it, add the following line to your vimrc file:"
                elog "  packadd! ${VIM_PLUGIN_NAME}"
        fi
 
-       if [[ -z ${REPLACING_VERSIONS} ]]; then
-               if [[ -n ${VIM_PLUGIN_HELPFILES} ]]; then
-                       elog " "
-                       elog "This plugin provides documentation via vim's help 
system. To"
-                       elog "view it, use:"
+       local h
+       if [[ ! ${REPLACING_VERSIONS} ]]; then
+               if [[ ${VIM_PLUGIN_HELPFILES} ]]; then
+                       elog
+                       elog "This plugin provides documentation via vim's help 
system."
+                       elog "To view it, use:"
                        for h in ${VIM_PLUGIN_HELPFILES}; do
-                               elog "    :help ${h}"
+                               elog "  :help ${h}"
                        done
-                       elog " "
-
-               elif [[ -n ${VIM_PLUGIN_HELPTEXT} ]]; then
-                       elog " "
-                       while read h ; do
-                               elog "$h"
+                       elog
+               elif [[ ${VIM_PLUGIN_HELPTEXT} ]]; then
+                       elog
+                       while read h; do
+                               elog "${h}"
                        done <<<"${VIM_PLUGIN_HELPTEXT}"
-                       elog " "
-
-               elif [[ -n ${VIM_PLUGIN_HELPURI} ]]; then
-                       elog " "
+                       elog
+               elif [[ ${VIM_PLUGIN_HELPURI} ]]; then
+                       elog
                        elog "Documentation for this plugin is available online 
at:"
-                       elog "    ${VIM_PLUGIN_HELPURI}"
-                       elog " "
+                       elog "  ${VIM_PLUGIN_HELPURI}"
+                       elog
                fi
 
                if has filetype ${VIM_PLUGIN_MESSAGES}; then
-                       elog "This plugin makes use of filetype settings. To 
enable these,"
-                       elog "add lines like:"
-                       elog "    filetype plugin on"
-                       elog "    filetype indent on"
-                       elog "to your ~/.vimrc file."
-                       elog " "
+                       elog "This plugin makes use of filetype settings."
+                       elog "To enable these, add lines like:"
+                       elog "  filetype plugin on"
+                       elog "  filetype indent on"
+                       elog "to your vimrc file."
+                       elog
                fi
        fi
 }
-- 
2.52.0


Reply via email to