health.vim: Detect missing init.vim

closes #4877
This commit is contained in:
Justin M. Keyes 2018-08-27 01:31:57 +02:00
parent cbc8c0c625
commit a8b4d76a0a

View File

@ -4,6 +4,14 @@ function! s:check_config() abort
let ok = v:true let ok = v:true
call health#report_start('Configuration') call health#report_start('Configuration')
let vimrc = empty($MYVIMRC) ? stdpath('config').'/init.vim' : $MYVIMRC
if !filereadable(vimrc)
let ok = v:false
let has_vim = filereadable(expand('~/.vimrc'))
call health#report_warn('Missing user config file: '.vimrc,
\[ has_vim ? ':help nvim-from-vim' : ':help init.vim' ])
endif
" If $VIM is empty we don't care. Else make sure it is valid. " If $VIM is empty we don't care. Else make sure it is valid.
if !empty($VIM) && !filereadable($VIM.'/runtime/doc/nvim.txt') if !empty($VIM) && !filereadable($VIM.'/runtime/doc/nvim.txt')
let ok = v:false let ok = v:false