summaryrefslogtreecommitdiff
path: root/doc/vim-ai.txt
diff options
context:
space:
mode:
authorKonfekt <Konfekt@users.noreply.github.com>2024-03-10 21:29:32 +0100
committerKonfekt <Konfekt@users.noreply.github.com>2024-03-11 08:05:47 +0100
commit881fd24a6d2c0de387256b4d6e05f5d0a53cc8e2 (patch)
tree3ff148f263f708ee6861a8a4671b8675be6a678d /doc/vim-ai.txt
parentaf52f039513b11e9820ce0bf1e46596a454ebd44 (diff)
downloadvim-ai-881fd24a6d2c0de387256b4d6e05f5d0a53cc8e2.tar.gz
optionally supplement roles dict by vim function source
The application was restricted to loading role configurations only from a predefined config file, which limited extensibility. Enable dynamic role configuration by invoking a custom Vim function if it is defined. This allows users to extend the role configurations beyond the static file. diff --git a/doc/vim-ai.txt b/doc/vim-ai.txt: -The roles in g:vim_ai_roles_config_file are converted to a Vim dictionary. -Optionally, additional roles can be added by defining a function VimAIRoleParser() -whose output is a dictionary of the same format as g:vim_ai_roles_config_file. - diff --git a/py/roles.py b/py/roles.py: -if vim.eval('exists("*VimAIRoleParser")'): - roles.update(vim.eval('VimAIRoleParser()')) - diff --git a/py/utils.py b/py/utils.py: - if vim.eval('exists("*VimAIRoleParser")'): - roles.update(vim.eval('VimAIRoleParser()')) -
Diffstat (limited to '')
-rw-r--r--doc/vim-ai.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/vim-ai.txt b/doc/vim-ai.txt
index 5d06fc7..c7aefde 100644
--- a/doc/vim-ai.txt
+++ b/doc/vim-ai.txt
@@ -177,6 +177,11 @@ Example of a role: >
See roles-example.ini for more examples.
+The roles in g:vim_ai_roles_config_file are converted to a Vim dictionary whose
+labels are the names of the roles. Optionally, roles can be added by setting
+g:vim_ai_roles_config_function to the name of a Vimscript function returning a
+dictionary of the same format as g:vim_ai_roles_config_file.
+
KEY BINDINGS
Examples how configure key bindings and customize commands: >