Skip to content

How to define external Vim functions? #1041

Answered by citizenmatt
jphalip asked this question in Q&A
Discussion options

You must be logged in to vote

If you're writing an extension to IdeaVim, you'll most likely implement VimExtension to register mappings, etc. You can also export functions here, using the VimExtensionFacade.exportScriptFunction method.

Here's the method signature:

fun exportScriptFunction(
scope: Scope?,
name: String,
args: List<String>,
defaultArgs: List<Pair<String, Expression>>,
hasOptionalArguments: Boolean,
flags: EnumSet<FunctionFlag>,
function: ScriptFunction
) {

This essentially corresponds to the :function command and defines the function, with name…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jphalip
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants