如何使gvim与Visual Studio 2010完美搭配? [英] How to get gvim to play nicely with Visual Studio 2010?

查看:109
本文介绍了如何使gvim与Visual Studio 2010完美搭配?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在上一份工作中,他们使用了Visual Studio 2005(偶尔使用Visual Studio 97),为了方便命令行,我使用vim来编辑诸如Mercurial版本控制配置文件(例如hgrc和.hgignore)之类的文件

On my last job, they used Visual Studio 2005 (and occasionally Visual Studio 97), and for command line convenience I used vim for editing things like Mercurial version control configuration files like hgrc and .hgignore

但是我的同事很快就开始抱怨vim会更改文件的编码,并会在Visual Studio中弹出一条消息,告诉他们有关编码的区别.

However my coworkers soon began to complain that vim would change the encoding of the files, and would cause a message to popup in Visual Studio telling them about the encoding difference.

此后,我停止使用vim,最终在Visual Studio中编辑了文件.

After that I stopped using vim and just ended up editing the files in Visual Studio.

我可以对vim的配置进行任何更改,以免发生这种情况吗?

Are there any changes to vim's configuration I can make so that this does not occur?

我会使用记事本来编辑文件,但是它总是将讨厌的.txt扩展名放在文件的末尾.

I'd use notepad to edit my files but it always puts that pesky .txt extension on the ends of my files.

我也知道诸如Notepad ++之类的解决方案,但我只是想知道vim中是否有针对此的解决方案.

I'm also aware of solutions like Notepad++, but I just wondered if there was a solution for this in vim.

推荐答案

如果是因为默认情况下将它们的VS文件保存为UTF-8,并且您的vim正在执行ISO-8859-1或ASCII,请尝试更改文件编码:

If it is because their VS files are being saved as UTF-8 by default and your vim is doing ISO-8859-1 or ASCII, try changing your file encoding:

" Encoding displayed
:set encoding=utf-8

" Encoding written to file.
:set fileencoding=utf-8

这篇关于如何使gvim与Visual Studio 2010完美搭配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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