>:redir适用于ex命令,而不适用于外部命令(afaik)>:r!运行外部命令,但直接插入输出当前缓冲区
:let @a = system(“ls -l”)
要使用光标下的文件作为参数运行命令:
:let @a = system(“ls -l”。shellescape(expand(‘< cfile>‘)))