aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-08-27 01:31:57 +0200
committerJustin M. Keyes <justinkz@gmail.com>2018-08-27 01:35:58 +0200
commita8b4d76a0a2c59a3a368932ae111265c15b8dccb (patch)
tree2fea87f408c30d84329251e4eb533fb06bd8f398
parentcbc8c0c625aa8a607367f54f8a3da0bd5e65f406 (diff)
downloadrneovim-a8b4d76a0a2c59a3a368932ae111265c15b8dccb.tar.gz
rneovim-a8b4d76a0a2c59a3a368932ae111265c15b8dccb.tar.bz2
rneovim-a8b4d76a0a2c59a3a368932ae111265c15b8dccb.zip
health.vim: Detect missing init.vim
closes #4877
-rw-r--r--runtime/autoload/health/nvim.vim8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/autoload/health/nvim.vim b/runtime/autoload/health/nvim.vim
index d09a714719..93660d05dc 100644
--- a/runtime/autoload/health/nvim.vim
+++ b/runtime/autoload/health/nvim.vim
@@ -4,6 +4,14 @@ function! s:check_config() abort
let ok = v:true
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 !empty($VIM) && !filereadable($VIM.'/runtime/doc/nvim.txt')
let ok = v:false