Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否增加对 ex command ranges 的支持 #46

Closed
zbinlin opened this issue Mar 30, 2017 · 6 comments
Closed

能否增加对 ex command ranges 的支持 #46

zbinlin opened this issue Mar 30, 2017 · 6 comments

Comments

@zbinlin
Copy link

zbinlin commented Mar 30, 2017

如果可以直接使用 :%AsyncRun 来运行当前 buffer 区里的命令,这样对于需要修改重复运行的命令的方便多了,毕竟在 vim 里比在 shell 里容易编辑命令 :)

@skywind3000
Copy link
Owner

我不太清楚你的需求,buffer里面的命令是python命令?shell命令?bash/sh/zsh ?perl?以什么确定?文件头一行?还是扩展名?运行buffer命令的目录是?当前目录?

这个很个人化的东西,你可以自己实现这条命令,把缓存里的东西保存到临时文件里面,然后调用AsyncRun去执行它,因为即便我做我也得这么做的。

@zbinlin
Copy link
Author

zbinlin commented Mar 30, 2017

就是普通的 shell 命令,比如我需要使用 curl 来测试一个 API,如果这条命令太长,直接在 shell 里修改起来比较麻烦。如果可以这样:直接打开 vim,然后在 vim 里输入这条命令,然后直接使用 :%AsyncRun 来运行这条命令,这样如果需要修改命令,然后运行,直接在 vim 里编辑比 shell 里方便多了。

@zbinlin
Copy link
Author

zbinlin commented Mar 30, 2017

这个功能有点像 :AsyncRun! man -S 3:2:1 <cword>,只是把 <cword> 换成整个 buffer 的内容

@zbinlin
Copy link
Author

zbinlin commented Apr 1, 2017

已找到类似的 plugin: https://github.com/JarrodCTaylor/vim-shell-executor

@zbinlin zbinlin closed this as completed Apr 1, 2017
@skywind3000
Copy link
Owner

嗯,你看的这个插件并不能异步执行,它要把你整个vim停下来去执行东西去,完了你才能继续。

@zbinlin
Copy link
Author

zbinlin commented Apr 1, 2017

所以如果你这边可以实现就最好啦 :)

这里还有一个类似:https://github.com/krisajenkins/vim-pipe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants