plugins.cmp-git.settings.trigger_actions
If you want specific behaviour for a trigger or new behaviour for a trigger, you need to
add an entry in the trigger_actions
list of the config.
The two necessary fields are the trigger_character
and the action
.
Type: null or (list of ((submodule) or raw lua code))
Default:
null
Plugin default:
[
{
action = ''
function(sources, trigger_char, callback, params, git_info)
return sources.git:get_commits(callback, params, trigger_char)
end
'';
debug_name = "git_commits";
trigger_character = ":";
}
{
action = ''
function(sources, trigger_char, callback, params, git_info)
return sources.gitlab:get_issues(callback, git_info, trigger_char)
end
'';
debug_name = "gitlab_issues";
trigger_character = "#";
}
{
action = ''
function(sources, trigger_char, callback, params, git_info)
return sources.gitlab:get_mentions(callback, git_info, trigger_char)
end
'';
debug_name = "gitlab_mentions";
trigger_character = "@";
}
{
action = ''
function(sources, trigger_char, callback, params, git_info)
return sources.gitlab:get_merge_requests(callback, git_info, trigger_char)
end
'';
debug_name = "gitlab_mrs";
trigger_character = "!";
}
{
action = ''
function(sources, trigger_char, callback, params, git_info)
return sources.github:get_issues_and_prs(callback, git_info, trigger_char)
end
'';
debug_name = "github_issues_and_pr";
trigger_character = "#";
}
{
action = ''
function(sources, trigger_char, callback, params, git_info)
return sources.github:get_mentions(callback, git_info, trigger_char)
end
'';
debug_name = "github_mentions";
trigger_character = "@";
}
]
Declared by:
plugins.cmp-git.settings.trigger_actions.*.action
The parameters to the action function are the different sources (currently git
,
gitlab
and github
), the completion callback, the trigger character, the
parameters passed to complete from nvim-cmp, and the current git info.
Type: lua function string
Example:
''
function(sources, trigger_char, callback, params, git_info)
return sources.git:get_commits(callback, params, trigger_char)
end
''
plugins.cmp-git.settings.trigger_actions.*.debug_name
Debug name.
Type: null or string or raw lua code
Default:
null
plugins.cmp-git.settings.trigger_actions.*.trigger_character
The trigger character. Has to be a single character
Type: string
Example:
":"