vim 配置文件中exec 执行多个命令

45 views
Skip to first unread message

Eric Wang

unread,
Mar 29, 2014, 3:34:59 AM3/29/14
to beihang-open...@googlegroups.com
对于metapost 文件, 使用mpost 命令编译成mps 文件后, 然后把它转换为pdf 文件进行查看.
可以使用下面两个命令: epstopdf %<.mps 与 sumatrapdf %<.pdf, 但是这是两个命令放在一起出错, 
而在vim 中的配置文件单个命令是可以运行的.
比如:
if &filetype == "mp"
      exec "!epstopdf %<.mps"
endif

我尝试过: 
exec "!epstopdf %<.mps | !sumatrapdf %<.pdf", 但是不行.

不知道正确的写法是什么样的?

duyue

unread,
Mar 29, 2014, 11:39:18 PM3/29/14
to beihang-open...@googlegroups.com

竖线的问题吗?换成&&

Eric Wang

unread,
Mar 30, 2014, 2:52:22 AM3/30/14
to beihang-open...@googlegroups.com


在 2014年3月30日星期日UTC+8上午11时39分18秒,Elyes Du写道:

竖线的问题吗?换成&&

       > 试过不行, 同时也试过单个&, 也不行.

 

李欣越 Labi Kyo

unread,
Mar 30, 2014, 3:08:38 AM3/30/14
to beihang-open...@googlegroups.com
vim里面应该就是用|(bar)来执行多个命令,详情参见 :h :bar

你的写法可能有点问题,改成

exec "!epstopdf %<.mps" | "!sumatrapdf %<.pdf"

试一试 


--
-- Beihang Open Source Club
beihang-open...@googlegroups.com
https://groups.google.com/d/forum/beihang-open-source-club
---
您收到此邮件是因为您订阅了Google网上论坛中的“北航开源俱乐部”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到beihang-open-sourc...@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout

Eric Wang

unread,
Mar 30, 2014, 3:17:27 AM3/30/14
to beihang-open...@googlegroups.com


在 2014年3月30日星期日UTC+8下午3时08分38秒,李欣越 Labi Kyo写道:
vim里面应该就是用|(bar)来执行多个命令,详情参见 :h :bar

你的写法可能有点问题,改成

exec "!epstopdf %<.mps" | "!sumatrapdf %<.pdf"

试一试 
>  需要再加一个exec. 
>  exec "!epstopdf %<.mps" |  exec "!sumatrapdf %<.pdf"
>  谢谢!


2014-03-29 15:34 GMT+08:00 Eric Wang <wangcha...@gmail.com>:
对于metapost 文件, 使用mpost 命令编译成mps 文件后, 然后把它转换为pdf 文件进行查看.
可以使用下面两个命令: epstopdf %<.mps 与 sumatrapdf %<.pdf, 但是这是两个命令放在一起出错, 
而在vim 中的配置文件单个命令是可以运行的.
比如:
if &filetype == "mp"
      exec "!epstopdf %<.mps"
endif

我尝试过: 
exec "!epstopdf %<.mps | !sumatrapdf %<.pdf", 但是不行.

不知道正确的写法是什么样的?

--
-- Beihang Open Source Club
beihang-open...@googlegroups.com
https://groups.google.com/d/forum/beihang-open-source-club
---
您收到此邮件是因为您订阅了Google网上论坛中的“北航开源俱乐部”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到beihang-open-source-club+unsub...@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout

Reply all
Reply to author
Forward
0 new messages