0

I'm using Vim on Windows, and in order to "change" the vimrc file location I have just the following line in the _vimrc file that is in my home directory:

source $HOME\.vim\.vimrc

I thought everything worked just fine that way but when I tried changing the symbol for a plugin (tagbar) to a certain fancy one like this:

let g:tagbar_iconchars = ['▸', '▾']

the plugin symbol didn't show the glyph but a <br> character instead. I noticed that the same problem appeared when attempting to change the symbol in several other plugins (vimfiler, airline, etc) and found out that if I changed those symbols in the _vimrc file rather than in the new .vimrc file the issue was fixed.

Is there some encoding being set with the source command in the _vimrc file that is triggering my problem? I thought that "changing" the vimrc file location the way I did was fine, are there other problems with that method?

4

2 回答 2

1

在 7.4 之前的 Vim 中,vimrc从默认用户级别vimrc( $HOME/_vimrc(windows) 或$HOME/.vimrc(unix)) 获取“真实”的最干净的方法是将其放在$HOME/vimfiles/(windows) 或$HOME/.vim/(unix) 中并在默认值中使用此行用户级别vimrc

runtime vimrc

从 7.4 开始,Vim 会自动尝试获取源代码$HOME/.vimrc $HOME/.vim/vimrc因此,如果您只使用运行 7.4 的机器,您可以安全地停止做您正在尝试做的事情。

此外,在 Windows 上,您的配置的规范位置是$HOME/vimfiles,而不是$HOME/.vim.

于 2013-08-13T07:26:08.603 回答
1

如果您在 Vim 脚本中使用任何特殊字符,建议将:scriptencoding命令放在文件顶部(或附近),例如

:scriptencoding utf-8
于 2013-08-13T07:52:57.820 回答