Category Archives: 12-4.テキストエディタ(Vimやその他)





:h extecute(
execute({command} [, {silent}])                                 *execute()*
                Execute an Ex command or commands and return the output as a
                {command} can be a string or a List.  In case of a List the
                lines are executed one by one.
                This is equivalent to:
                        redir => var
                        redir END       
                The optional {silent} argument can have these values:
                        ""              no `:silent` used
                        "silent"        `:silent` used 
                        "silent!"       `:silent!` used
                The default is "silent".  Note that with "silent!", unlike
                `:redir`, error messages are dropped.  When using an external
                command the screen may be messed up, use `system()` instead.
                It is not possible to use `:redir` anywhere in {command}.

                To get a list of lines use |split()| on the result:
                        split(execute('args'), "\n") 

                To execute a command in another window than the current one
                use `win_execute()`.

                When used recursively the output of the recursive call is not
                included in the output of the higher level call.


/tmp $ touch test_{1..5}.txt
/tmp $ vim test_*.txt


:echo execute("args")