aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload/health/nvim.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/autoload/health/nvim.vim')
-rw-r--r--runtime/autoload/health/nvim.vim45
1 files changed, 36 insertions, 9 deletions
diff --git a/runtime/autoload/health/nvim.vim b/runtime/autoload/health/nvim.vim
index a1bf9b21cf..58033f0405 100644
--- a/runtime/autoload/health/nvim.vim
+++ b/runtime/autoload/health/nvim.vim
@@ -1,15 +1,31 @@
-let s:suggest_faq = 'See https://github.com/neovim/neovim/wiki/FAQ'
+let s:suggest_faq = 'https://github.com/neovim/neovim/wiki/FAQ'
function! s:check_config() abort
+ let ok = v:true
call health#report_start('Configuration')
- if !get(g:, 'loaded_sensible', 0)
+
+ " 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
+ call health#report_error("$VIM is invalid: ".$VIM)
+ endif
+
+ if exists('$NVIM_TUI_ENABLE_CURSOR_SHAPE')
+ let ok = v:false
+ call health#report_warn("$NVIM_TUI_ENABLE_CURSOR_SHAPE is ignored in Nvim 0.2+",
+ \ [ "Use the 'guicursor' option to configure cursor shape. :help 'guicursor'",
+ \ 'https://github.com/neovim/neovim/wiki/Following-HEAD#20170402' ])
+ endif
+
+ if &paste
+ let ok = v:false
+ call health#report_error("'paste' is enabled. This option is only for pasting text.\nIt should not be set in your config.",
+ \ [ 'Remove `set paste` from your init.vim, if applicable.',
+ \ 'Check `:verbose set paste?` to see if a plugin or script set the option.', ])
+ endif
+
+ if ok
call health#report_ok('no issues found')
- else
- let sensible_pi = globpath(&runtimepath, '**/sensible.vim', 1, 1)
- call health#report_info("found sensible.vim plugin:\n".join(sensible_pi, "\n"))
- call health#report_error("sensible.vim plugin is not needed; Nvim has the same defaults built-in."
- \ ." Also, sensible.vim sets 'ttimeoutlen' to a sub-optimal value.",
- \ ["Remove sensible.vim plugin, or wrap it in a `if !has('nvim')` check."])
endif
endfunction
@@ -42,7 +58,7 @@ function! s:check_rplugin_manifest() abort
let contents = join(readfile(script))
if contents =~# '\<\%(from\|import\)\s\+neovim\>'
if script =~# '[\/]__init__\.py$'
- let script = fnamemodify(script, ':h')
+ let script = tr(fnamemodify(script, ':h'), '\', '/')
endif
if !has_key(existing_rplugins, script)
@@ -118,6 +134,12 @@ function! s:check_tmux() abort
let cmd = 'tmux show-option -qvg default-terminal'
let out = system(cmd)
let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g')
+ if empty(tmux_default_term)
+ let cmd = 'tmux show-option -qvgs default-terminal'
+ let out = system(cmd)
+ let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g')
+ endif
+
if v:shell_error
call health#report_error('command failed: '.cmd."\n".out)
elseif tmux_default_term !=# $TERM
@@ -151,6 +173,11 @@ function! s:check_terminal() abort
call health#report_info('key_dc (kdch1) terminfo entry: '
\ .(empty(kbs_entry) ? '? (not found)' : kdch1_entry))
endif
+ for env_var in ['XTERM_VERSION', 'VTE_VERSION', 'TERM_PROGRAM', 'COLORTERM', 'SSH_TTY']
+ if !exists('$'.env_var)
+ call health#report_info(printf("$%s='%s'", env_var, eval('$'.env_var)))
+ endif
+ endfor
endfunction
function! health#nvim#check() abort