aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-10-16 20:14:14 +0200
committerGitHub <noreply@github.com>2016-10-16 20:14:14 +0200
commitfbd6b10e1b5b68fdec70e8ae8a2ad8ac2221a710 (patch)
tree3dcdc5476f133c009d4ba43f0c820e7adae78e26
parent0fa4f98a05bbcb60b5c317fac0e70da3821688fe (diff)
parentacdc0b1955e531cd5a365066e1ce3a3fe22eefb9 (diff)
downloadrneovim-fbd6b10e1b5b68fdec70e8ae8a2ad8ac2221a710.tar.gz
rneovim-fbd6b10e1b5b68fdec70e8ae8a2ad8ac2221a710.tar.bz2
rneovim-fbd6b10e1b5b68fdec70e8ae8a2ad8ac2221a710.zip
Merge #5493 from justinmk/checkhealth
CheckHealth: check tmux, terminfo
-rw-r--r--runtime/autoload/health.vim3
-rw-r--r--runtime/autoload/health/nvim.vim51
-rw-r--r--runtime/doc/deprecated.txt4
-rw-r--r--runtime/doc/vim_diff.txt9
-rw-r--r--runtime/syntax/vim.vim8
-rw-r--r--src/nvim/version.c11
6 files changed, 80 insertions, 6 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..60e56034e1 100644
--- a/runtime/autoload/health/nvim.vim
+++ b/runtime/autoload/health/nvim.vim
@@ -57,6 +57,57 @@ 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! 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
call s:check_manifest()
+ call s:check_tmux()
+ call s:check_terminfo()
endfunction
diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt
index 2b69929cfe..6997d331e4 100644
--- a/runtime/doc/deprecated.txt
+++ b/runtime/doc/deprecated.txt
@@ -6,6 +6,10 @@
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 ~
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 249208911b..f036b4427e 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -76,6 +76,15 @@ Python plugins |provider-python|
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 ~
|bracketed-paste-mode| is built-in and enabled by default.
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index d056e5b7bf..34fdae0ffc 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -5,6 +5,14 @@
" Version: 7.4-45
" 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
if exists("b:current_syntax")
finish
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 5bcd5ee8e3..0bc55df585 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -2652,14 +2652,13 @@ void intro_message(int colon)
N_(NVIM_VERSION_LONG),
"",
N_("by Bram Moolenaar et al."),
- N_("Vim is open source and freely distributable"),
- "",
- N_("Type \":Tutor\" or \":help nvim\" to get started!"),
- "",
- N_("Still have questions? https://neovim.io/community"),
+ N_("Nvim is open source and freely distributable"),
+ N_("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 :help<Enter> or <F1> for on-line help"),
+ N_("type :help<Enter> for help "),
"",
N_("Help poor children in Uganda!"),
N_("type :help iccf<Enter> for information "),