Windows 上的 gVIM:使用空格执行缓冲区和路径 [英] gVIM on Windows: execute buffer and paths with spaces

查看:49
本文介绍了Windows 上的 gVIM:使用空格执行缓冲区和路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Windows 的 gVim 中,可以通过 :!% 命令执行当前缓冲区.但是,不幸的是,提供给 cmd.exe 的缓冲区文件名没有引号,因此如果文件路径有空格,gVim 将无法执行它.

In gVim for windows it's possible to execute current buffer via :!% command. But, unfortunately, the buffer file name is supplied to cmd.exe without quotes, so if file path has spaces gVim will not be able to execute it.

是否有任何简单的方法可以修复它以便能够在 gVim 中执行 .bat、.py 等?

Is it any easy way to fix it in order to be able execute .bat, .py etc from within gVim?

推荐答案

这是我的猜测,我没有 Windows 机器可以尝试.试试

This's my guess, I don't have windows machine to try. Try

:!python "%"

:!"%"

信用:地狱之眼

这篇关于Windows 上的 gVIM:使用空格执行缓冲区和路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆