为什么我的Vim.vimrc设置在Windows上不起作用



我使用命令type NUL > .vimrc在\~\.vim目录中创建了一个.vimrc文件,并用vim编辑了该文件。

我在.virc文件中放入了以下设置,以设置病原体和Syntastic以及其他一些小设置。这些是我的设置:

execute pathogen#infect()
syntax on
filetype plugin indent on
set number
set tabstop=4
set colorcolumn=110
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

然而,当我退出并再次打开vim时,我的设置不起作用。

Windows上配置文件的路径不同。你可以用:help .vimrc看到这些路径是什么,它说:

"$HOME/_vimrc"     (for MS-DOS and Win32) (*)
"$HOME/vimfiles/vimrc" (for MS-DOS and Win32) (*)
"$VIM/_vimrc"      (for MS-DOS and Win32) (*)
Note: For MS-DOS and Win32, "$HOME" is checked first.  If no
"_vimrc" or ".vimrc" is found there, "$VIM" is tried.
See |$VIM| for when $VIM is not set.

这意味着您应该在C:UsersYourUserName_vimrcC:Program Files (x86)Vim_vimrc中创建配置文件(通常在后一种情况下,一些默认的_vimrc已经存在(。

最新更新