mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge #5493 from justinmk/checkhealth
CheckHealth: check tmux, terminfo
This commit is contained in:
commit
fbd6b10e1b
@ -13,6 +13,9 @@ function! s:enhance_syntax() abort
|
|||||||
|
|
||||||
syntax keyword healthSuggestion SUGGESTIONS
|
syntax keyword healthSuggestion SUGGESTIONS
|
||||||
highlight link healthSuggestion String
|
highlight link healthSuggestion String
|
||||||
|
|
||||||
|
" We do not care about markdown syntax errors in :CheckHealth output.
|
||||||
|
highlight! link markdownError Normal
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Runs the specified healthchecks.
|
" Runs the specified healthchecks.
|
||||||
|
@ -57,6 +57,57 @@ function! s:check_manifest() abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
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! s:check_terminfo() abort
|
||||||
|
if !executable('infocmp')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
call health#report_start('terminfo')
|
||||||
|
let suggestions = [
|
||||||
|
\ "Set key_backspace to \\177 (ASCII BACKSPACE). Run these commands:\n"
|
||||||
|
\ .'infocmp $TERM | sed ''s/kbs=^[hH]/kbs=\\177/'' > $TERM.ti'
|
||||||
|
\ ."\n"
|
||||||
|
\ .'tic $TERM.ti',
|
||||||
|
\ 'See https://github.com/neovim/neovim/wiki/FAQ']
|
||||||
|
let cmd = 'infocmp -L'
|
||||||
|
let out = system(cmd)
|
||||||
|
let kbs_entry = matchstr(out, 'key_backspace=\S*')
|
||||||
|
|
||||||
|
if v:shell_error
|
||||||
|
call health#report_error('command failed: '.cmd."\n".out)
|
||||||
|
elseif !empty(matchstr(out, '\Vkey_backspace=^H'))
|
||||||
|
call health#report_error('key_backspace (kbs) entry is ^H (ASCII DELETE): '
|
||||||
|
\ .kbs_entry, suggestions)
|
||||||
|
else
|
||||||
|
call health#report_info('key_backspace terminfo entry: '
|
||||||
|
\ .(empty(kbs_entry) ? '? (not found)' : kbs_entry))
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! health#nvim#check() abort
|
function! health#nvim#check() abort
|
||||||
call s:check_manifest()
|
call s:check_manifest()
|
||||||
|
call s:check_tmux()
|
||||||
|
call s:check_terminfo()
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
|
|
||||||
Nvim *deprecated*
|
Nvim *deprecated*
|
||||||
|
|
||||||
|
The items listed below are "deprecated". This means they will be removed in
|
||||||
|
the future. They should not be used in new scripts, and old scripts should be
|
||||||
|
updated.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
Normal commands ~
|
Normal commands ~
|
||||||
|
@ -76,6 +76,15 @@ Python plugins |provider-python|
|
|||||||
Clipboard integration |provider-clipboard|
|
Clipboard integration |provider-clipboard|
|
||||||
|
|
||||||
|
|
||||||
|
USER EXPERIENCE ~
|
||||||
|
|
||||||
|
A major goal of Nvim is to work intuitively and consistently. For example,
|
||||||
|
Nvim does not have `-X`, a platform-specific option available in some Vim
|
||||||
|
builds (with potential surprises: http://stackoverflow.com/q/14635295). Nvim
|
||||||
|
avoids features that cannot be provided on all platforms--instead that is
|
||||||
|
delegated to external plugins/extensions.
|
||||||
|
|
||||||
|
|
||||||
OTHER FEATURES ~
|
OTHER FEATURES ~
|
||||||
|
|
||||||
|bracketed-paste-mode| is built-in and enabled by default.
|
|bracketed-paste-mode| is built-in and enabled by default.
|
||||||
|
@ -5,6 +5,14 @@
|
|||||||
" Version: 7.4-45
|
" Version: 7.4-45
|
||||||
" Automatically generated keyword lists: {{{1
|
" Automatically generated keyword lists: {{{1
|
||||||
|
|
||||||
|
" #############################################################################
|
||||||
|
" #############################################################################
|
||||||
|
" Note: Be careful when merging the upstream version of this file.
|
||||||
|
" Much of this is generated by scripts/genvimvim.lua (result is installed
|
||||||
|
" to: $VIMRUNTIME/syntax/vim/generated.vim)
|
||||||
|
" #############################################################################
|
||||||
|
" #############################################################################
|
||||||
|
|
||||||
" Quit when a syntax file was already loaded {{{2
|
" Quit when a syntax file was already loaded {{{2
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
|
@ -2652,14 +2652,13 @@ void intro_message(int colon)
|
|||||||
N_(NVIM_VERSION_LONG),
|
N_(NVIM_VERSION_LONG),
|
||||||
"",
|
"",
|
||||||
N_("by Bram Moolenaar et al."),
|
N_("by Bram Moolenaar et al."),
|
||||||
N_("Vim is open source and freely distributable"),
|
N_("Nvim is open source and freely distributable"),
|
||||||
"",
|
N_("https://neovim.io/community"),
|
||||||
N_("Type \":Tutor\" or \":help nvim\" to get started!"),
|
|
||||||
"",
|
|
||||||
N_("Still have questions? https://neovim.io/community"),
|
|
||||||
"",
|
"",
|
||||||
|
N_("type :help nvim<Enter> if you are new! "),
|
||||||
|
N_("type :CheckHealth<Enter> to optimize Nvim"),
|
||||||
N_("type :q<Enter> to exit "),
|
N_("type :q<Enter> to exit "),
|
||||||
N_("type :help<Enter> or <F1> for on-line help"),
|
N_("type :help<Enter> for help "),
|
||||||
"",
|
"",
|
||||||
N_("Help poor children in Uganda!"),
|
N_("Help poor children in Uganda!"),
|
||||||
N_("type :help iccf<Enter> for information "),
|
N_("type :help iccf<Enter> for information "),
|
||||||
|
Loading…
Reference in New Issue
Block a user