This is just my own curiosity speaking here, but would it be possible (if it's even possible by default in normal vim, without any additional plugins etc) to call a function inside a vimscript function without having to use call?
I'm thinking of emulating or doing things like when special function/keywords like echo and other builtin are called:
function! Test()
echo something
endfunction
above we can see we do not need to use call to run echo. Would it be possible to do the same on a function we make ourselves? eg: replace echo above with Myfunction but without having to use call.
To make myself more clear: I already know this is possible for function defined as commandline or user defined commands, where one can just do :Myfunction in Ex mode, but that isn't what I want to do, although it is similar in that it does not need the use of call.
P.S: While I mentioned earlier wanting to know if it's possible in normal vim (eg: without plugins etc) I wouldn't mind knowing if it's still possible using plugins either, but the main point here is still knowing if it's possible without them.
echoworks withoutcallbecause it's an Ex command and not a function. You can define functions, that you then can use with:callor:evalor within Vimscript expressions (for example, as arguments to:echoor to:let). You can define new Ex commands as user-defined commands (though with the restriction they need to start with uppercase.) So you can either use:callon functions, or create a user-defined command, either would accomplish what you're asking here... – filbranden Mar 14 '22 at 16:52:substituteandsubstitute(),insert... https://vi.stackexchange.com/questions/19142/why-do-functions-in-vimscript-require-a-call-statement – Luc Hermitte Mar 15 '22 at 11:23