| is used to separate commands, I thought I could just do this:
:function! SomeFunc() | return 0 | endfunction
It works fine when I type it on separate lines (entering the first line causes it to prompt for the remaining lines):
:function! SomeFunc() return 0 endfunction
I now see this caveat at
These commands see the '|' as their argument, and can therefore not be followed by another Vim command:
Is there any way around that?
I see where it says...
You can also use to separate commands in the same way as with '|'. To insert a use CTRL-V CTRL-J. "^@" will be shown.
But this doesn't work either:
:function! SomeFunc() <NL> return 0 <NL> endfunction
It gives this error:
E488: Trailing characters
This works if I manually type in the CTRL-V CTRL-J sequence:
:function! SomeFunc() ^@ return 0 ^@ endfunction
But that still isn't a acceptable solution because I want to be able to simply copy and paste the
function! command and press Enter...