防止 vim-go 插件在保存时调用 ‘less’ 命令。

huangapple go评论81阅读模式
英文:

Prevent vim-go plugin from calling 'less' on save

问题

我正在玩弄"Go"编程语言,并使用带有vim-go插件的Vim。每次保存时,这个插件似乎会将文件的内容传输到less中,当文件变得更大时,这变得非常烦人。即使在"w"后面加上"!"也没有帮助。按下Q键可以移除"less"部分,这样就不需要一直按住回车键直到到达文件末尾,但我不想一直这样做。

有没有人使用这个插件,并知道如何在保存时阻止调用"less"呢?

英文:

I am playing around with the "Go" programming language and using Vim with the vim-go plugin. Every time I save, this plugin seems to pipe the contents of the file to less and this gets really annoying as the file becomes larger. Even putting a ! after the w is not helping. Pressing Q removes the 'less' part which removes the need to hold in the enter key til the end of the file is reached but I don't want to keep doing that.

Anyone using this plugin and knows a way to prevent 'less' from being called on save?

答案1

得分: 1

<span class="comment-copy"><code>let g:go_fmt_fail_silently = 1</code> 和 <code>let g:go_fmt_autosave = 0</code> 似乎起到了作用。当我分别测试它们时,它们都可以独立工作。但我只是同时添加了它们,因为我没有什么可失去的。只是在尝试不同的设置。</span>
&ndash;&nbsp;<a href="/users/2090926/touch"
title="1,117 声望"
class="comment-user owner">Touch</a>

英文:

<span class="comment-copy"><code>let g:go_fmt_fail_silently = 1</code> and <code>let g:go_fmt_autosave = 0</code> seem to have done the trick. When I test each one separately, both work independently. But I just added them both because I have nothing to loosse. Just playing with the language.</span>
&ndash;&nbsp;<a href="/users/2090926/touch"
title="1,117 reputation"
class="comment-user owner">Touch</a>

huangapple
  • 本文由 发表于 2014年12月10日 19:26:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/27399841.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定