aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-10-16 17:01:19 +0200
committerJustin M. Keyes <justinkz@gmail.com>2016-10-16 18:08:53 +0200
commitc40b3b680d1e4d6c727e77c98817fe39485e2963 (patch)
treebd8c74e506fb4914ad0944d19f541c0b65374e69
parent6fc122e600bae630ccf768baece84fbd17eda81e (diff)
downloadrneovim-c40b3b680d1e4d6c727e77c98817fe39485e2963.tar.gz
rneovim-c40b3b680d1e4d6c727e77c98817fe39485e2963.tar.bz2
rneovim-c40b3b680d1e4d6c727e77c98817fe39485e2963.zip
CheckHealth: check tmux configuration
-rw-r--r--runtime/autoload/health.vim3
-rw-r--r--runtime/autoload/health/nvim.vim24
2 files changed, 27 insertions, 0 deletions
diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim
index 783c30cbf6..336adc65e5 100644
--- a/runtime/autoload/health.vim
+++ b/runtime/autoload/health.vim
@@ -13,6 +13,9 @@ function! s:enhance_syntax() abort
syntax keyword healthSuggestion SUGGESTIONS
highlight link healthSuggestion String
+
+ " We do not care about markdown syntax errors in :CheckHealth output.
+ highlight! link markdownError Normal
endfunction
" Runs the specified healthchecks.
diff --git a/runtime/autoload/health/nvim.vim b/runtime/autoload/health/nvim.vim
index d769525373..922cf2717b 100644
--- a/runtime/autoload/health/nvim.vim
+++ b/runtime/autoload/health/nvim.vim
@@ -57,6 +57,30 @@ function! s:check_manifest() abort
endif
endfunction
+function! s:check_tmux() abort
+ if empty($TMUX) || !executable('tmux')
+ return
+ endif
+ call health#report_start('tmux configuration')
+ let suggestions = ["Set escape-time in ~/.tmux.conf: set-option -sg escape-time 10",
+ \ 'See https://github.com/neovim/neovim/wiki/FAQ']
+ let cmd = 'tmux show-option -qvgs escape-time'
+ let out = system(cmd)
+ let tmux_esc_time = substitute(out, '\v(\s|\r|\n)', '', 'g')
+
+ if v:shell_error
+ call health#report_error('command failed: '.cmd."\n".out)
+ elseif empty(tmux_esc_time)
+ call health#report_error('escape-time is not set', suggestions)
+ elseif tmux_esc_time > 500
+ call health#report_error(
+ \ 'escape-time ('.tmux_esc_time.') is higher than 300ms', suggestions)
+ else
+ call health#report_ok('escape-time = '.tmux_esc_time.'ms')
+ endif
+endfunction
+
function! health#nvim#check() abort
call s:check_manifest()
+ call s:check_tmux()
endfunction