Vim の :command で再帰

まさに誰得。

[ソース]

command! -nargs=+ Factorial 
\   execute [<f-args>][1] == 0
\       ? 'echo [ <f-args> ][0]'
\       : 'Factorial '.([<f-args>][0]*[<f-args>][1]).' '.([<f-args>][1]-1)

[コマンド]

:Factorial 1 4

[出力]

24


command だと値が返せない(返す方法が思いつかなかった)ので引数が2つになっています。
まぁこれは消せそうですが。
素直に関数書け、って気がするけど何かに使えるかしら。