aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/health.vim27
-rw-r--r--runtime/autoload/health/nvim.vim4
-rw-r--r--runtime/autoload/health/provider.vim123
-rw-r--r--runtime/autoload/man.vim27
-rw-r--r--runtime/autoload/provider/clipboard.vim73
-rw-r--r--runtime/autoload/provider/pythonx.vim39
-rw-r--r--runtime/doc/Makefile2
-rw-r--r--runtime/doc/autocmd.txt10
-rw-r--r--runtime/doc/diff.txt8
-rw-r--r--runtime/doc/eval.txt142
-rw-r--r--runtime/doc/intro.txt2
-rw-r--r--runtime/doc/mbyte.txt88
-rw-r--r--runtime/doc/message.txt13
-rw-r--r--runtime/doc/msgpack_rpc.txt5
-rw-r--r--runtime/doc/options.txt154
-rw-r--r--runtime/doc/provider.txt16
-rw-r--r--runtime/doc/quickfix.txt4
-rw-r--r--runtime/doc/syntax.txt12
-rw-r--r--runtime/doc/usr_41.txt1
-rw-r--r--runtime/doc/various.txt12
-rw-r--r--runtime/doc/vim_diff.txt43
-rw-r--r--runtime/ftplugin/man.vim20
-rw-r--r--runtime/syntax/man.vim3
-rw-r--r--runtime/syntax/vim.vim7
24 files changed, 460 insertions, 375 deletions
diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim
index cbfd7c76a1..a63eebae13 100644
--- a/runtime/autoload/health.vim
+++ b/runtime/autoload/health.vim
@@ -1,19 +1,31 @@
function! s:enhance_syntax() abort
+ syntax case match
+
syntax keyword healthError ERROR
+ \ containedin=markdownCodeBlock,mkdListItemLine
highlight link healthError Error
syntax keyword healthWarning WARNING
+ \ containedin=markdownCodeBlock,mkdListItemLine
highlight link healthWarning WarningMsg
syntax keyword healthInfo INFO
+ \ containedin=markdownCodeBlock,mkdListItemLine
highlight link healthInfo ModeMsg
syntax keyword healthSuccess SUCCESS
- highlight link healthSuccess Function
+ \ containedin=markdownCodeBlock,mkdListItemLine
+ highlight link healthSuccess ModeMsg
syntax keyword healthSuggestion SUGGESTIONS
+ \ containedin=markdownCodeBlock,mkdListItemLine
highlight link healthSuggestion String
+ syntax match healthHelp "|.\{-}|" contains=healthBar
+ \ containedin=markdownCodeBlock,mkdListItemLine
+ syntax match healthBar "|" contained conceal
+ highlight link healthHelp Identifier
+
" We do not care about markdown syntax errors in :CheckHealth output.
highlight! link markdownError Normal
endfunction
@@ -28,6 +40,8 @@ function! health#check(plugin_names) abort
tabnew
setlocal wrap breakindent
setlocal filetype=markdown bufhidden=wipe
+ setlocal conceallevel=2 concealcursor=nc
+ setlocal keywordprg=:help
call s:enhance_syntax()
if empty(healthchecks)
@@ -49,7 +63,7 @@ function! health#check(plugin_names) abort
let output = execute(
\ 'call health#report_error(''Failed to run healthcheck for "'
\ .s:to_plugin_name(c)
- \ .'" plugin. Exception:''."\n".v:exception)')
+ \ .'" plugin. Exception:''."\n".v:throwpoint."\n".v:exception)')
endif
endtry
call append('$', split(output, "\n") + [''])
@@ -57,6 +71,8 @@ function! health#check(plugin_names) abort
endfor
endif
+ " needed for plasticboy/vim-markdown, because it uses fdm=expr
+ normal! zR
setlocal nomodified
redraw|echo ''
endfunction
@@ -78,6 +94,11 @@ function! s:indent_after_line1(s, columns) abort
return join(lines, "\n")
endfunction
+" Changes ':h clipboard' to ':help |clipboard|'.
+function! s:help_to_link(s) abort
+ return substitute(a:s, '\v[''"]?:h%[elp] ([^''"]+)[''"]?', '":help |\1|"', 'g')
+endfunction
+
" Format a message for a specific report item
function! s:format_report_message(status, msg, ...) abort " {{{
let output = ' - ' . a:status . ': ' . s:indent_after_line1(a:msg, 4)
@@ -99,7 +120,7 @@ function! s:format_report_message(status, msg, ...) abort " {{{
let output .= "\n - " . s:indent_after_line1(suggestion, 10)
endfor
- return output
+ return s:help_to_link(output)
endfunction " }}}
" Use {msg} to report information in the current section
diff --git a/runtime/autoload/health/nvim.vim b/runtime/autoload/health/nvim.vim
index ea87e4b3ac..85c17fa660 100644
--- a/runtime/autoload/health/nvim.vim
+++ b/runtime/autoload/health/nvim.vim
@@ -2,10 +2,10 @@ let s:suggest_faq = 'See https://github.com/neovim/neovim/wiki/FAQ'
function! s:check_config() abort
call health#report_start('Configuration')
- let sensible_pi = globpath(&runtimepath, '**/sensible.vim', 1, 1)
- if empty(sensible_pi)
+ if !get(g:, 'loaded_sensible', 0)
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.",
diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim
index d4b2f07a17..dce0abd671 100644
--- a/runtime/autoload/health/provider.vim
+++ b/runtime/autoload/health/provider.vim
@@ -1,5 +1,7 @@
+let s:shell_error = 0
+
function! s:is_bad_response(s) abort
- return a:s =~? '\v(^unable)|(^error)'
+ return a:s =~? '\v(^unable)|(^error)|(^outdated)'
endfunction
function! s:trim(s) abort
@@ -8,13 +10,13 @@ endfunction
" Simple version comparison.
function! s:version_cmp(a, b) abort
- let a = split(a:a, '\.')
- let b = split(a:b, '\.')
+ let a = split(a:a, '\.', 0)
+ let b = split(a:b, '\.', 0)
for i in range(len(a))
- if a[i] > b[i]
+ if str2nr(a[i]) > str2nr(b[i])
return 1
- elseif a[i] < b[i]
+ elseif str2nr(a[i]) < str2nr(b[i])
return -1
endif
endfor
@@ -22,11 +24,64 @@ function! s:version_cmp(a, b) abort
return 0
endfunction
+" Handler for s:system() function.
+function! s:system_handler(jobid, data, event) abort
+ if a:event == 'stdout' || a:event == 'stderr'
+ let self.output .= join(a:data, '')
+ elseif a:event == 'exit'
+ let s:shell_error = a:data
+ endif
+endfunction
+
+" Run a system command and timeout after 30 seconds.
+function! s:system(cmd, ...) abort
+ let stdin = a:0 ? a:1 : ''
+ let opts = {
+ \ 'output': '',
+ \ 'on_stdout': function('s:system_handler'),
+ \ 'on_stderr': function('s:system_handler'),
+ \ 'on_exit': function('s:system_handler'),
+ \ }
+ let jobid = jobstart(a:cmd, opts)
+
+ if jobid < 1
+ call health#report_error(printf('Command error %d: %s', jobid,
+ \ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd)))
+ let s:shell_error = 1
+ return opts.output
+ endif
+
+ if !empty(stdin)
+ call jobsend(jobid, stdin)
+ endif
+
+ let res = jobwait([jobid], 30000)
+ if res[0] == -1
+ call health#report_error(printf('Command timed out: %s',
+ \ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd))
+ call jobstop(jobid)
+ elseif s:shell_error != 0
+ call health#report_error(printf("Command error (%d) %s: %s", jobid,
+ \ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd,
+ \ opts.output))
+ endif
+
+ return opts.output
+endfunction
+
+function! s:systemlist(cmd, ...) abort
+ let stdout = split(s:system(a:cmd, a:0 ? a:1 : ''), "\n")
+ if a:0 > 1 && !empty(a:2)
+ return filter(stdout, '!empty(v:val)')
+ endif
+ return stdout
+endfunction
+
" Fetch the contents of a URL.
function! s:download(url) abort
if executable('curl')
- let rv = system(['curl', '-sL', a:url])
- return v:shell_error ? 'curl error: '.v:shell_error : rv
+ let rv = s:system(['curl', '-sL', a:url])
+ return s:shell_error ? 'curl error: '.s:shell_error : rv
elseif executable('python')
let script = "
\try:\n
@@ -37,14 +92,27 @@ function! s:download(url) abort
\response = urlopen('".a:url."')\n
\print(response.read().decode('utf8'))\n
\"
- let rv = system(['python', '-c', script])
- return empty(rv) && v:shell_error
- \ ? 'python urllib.request error: '.v:shell_error
+ let rv = s:system(['python', '-c', script])
+ return empty(rv) && s:shell_error
+ \ ? 'python urllib.request error: '.s:shell_error
\ : rv
endif
return 'missing `curl` and `python`, cannot make pypi request'
endfunction
+" Check for clipboard tools.
+function! s:check_clipboard() abort
+ call health#report_start('Clipboard')
+
+ let clipboard_tool = provider#clipboard#Executable()
+ if empty(clipboard_tool)
+ call health#report_warn(
+ \ "No clipboard tool found. Using the system clipboard won't work.",
+ \ ['See ":help clipboard".'])
+ else
+ call health#report_ok('Clipboard tool found: '. clipboard_tool)
+ endif
+endfunction
" Get the latest Neovim Python client version from PyPI.
function! s:latest_pypi_version() abort
@@ -73,7 +141,7 @@ endfunction
" ]
function! s:version_info(python) abort
let pypi_version = s:latest_pypi_version()
- let python_version = s:trim(system([
+ let python_version = s:trim(s:system([
\ a:python,
\ '-c',
\ 'import sys; print(".".join(str(x) for x in sys.version_info[:3]))',
@@ -83,11 +151,11 @@ function! s:version_info(python) abort
let python_version = 'unable to parse python response'
endif
- let nvim_path = s:trim(system([
+ let nvim_path = s:trim(s:system([
\ a:python,
\ '-c',
\ 'import neovim; print(neovim.__file__)']))
- let nvim_path = v:shell_error ? '' : nvim_path
+ let nvim_path = s:shell_error ? '' : nvim_path
if empty(nvim_path)
return [python_version, 'unable to find nvim executable', pypi_version, 'unable to get nvim executable']
@@ -147,7 +215,6 @@ function! s:check_python(version) abort
let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : 'n'
let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : ''
let host_prog_var = python_bin_name.'_host_prog'
- let host_skip_var = python_bin_name.'_host_skip_check'
let python_bin = ''
let python_multiple = []
@@ -162,10 +229,6 @@ function! s:check_python(version) abort
if !empty(pythonx_errs)
call health#report_warn(pythonx_errs)
endif
- let old_skip = get(g:, host_skip_var, 0)
- let g:[host_skip_var] = 1
- let [python_bin_name, pythonx_errs] = provider#pythonx#Detect(a:version)
- let g:[host_skip_var] = old_skip
endif
if !empty(python_bin_name)
@@ -195,7 +258,7 @@ function! s:check_python(version) abort
call health#report_ok(printf('pyenv found: "%s"', pyenv))
endif
- let python_bin = s:trim(system(
+ let python_bin = s:trim(s:system(
\ printf('"%s" which %s 2>/dev/null', pyenv, python_bin_name)))
if empty(python_bin)
@@ -272,7 +335,7 @@ function! s:check_python(version) abort
if exists('$VIRTUAL_ENV')
if !empty(pyenv)
- let pyenv_prefix = resolve(s:trim(system([pyenv, 'prefix'])))
+ let pyenv_prefix = resolve(s:trim(s:system([pyenv, 'prefix'])))
if $VIRTUAL_ENV != pyenv_prefix
let virtualenv_inactive = 1
endif
@@ -310,7 +373,7 @@ function! s:check_python(version) abort
endif
call health#report_info('Python'.a:version.' version: ' . pyversion)
- call health#report_info(printf('%s-neovim Version: %s', python_bin_name, current))
+ call health#report_info(printf('%s-neovim version: %s', python_bin_name, current))
if s:is_bad_response(current)
let suggestions = [
@@ -328,9 +391,11 @@ function! s:check_python(version) abort
endif
if s:is_bad_response(status)
- call health#report_warn('Latest Neovim Python client version: ('.latest.')')
+ call health#report_warn(printf('Latest %s-neovim is NOT installed: %s',
+ \ python_bin_name, latest))
elseif !s:is_bad_response(latest)
- call health#report_ok('Latest Neovim Python client is installed: ('.status.')')
+ call health#report_ok(printf('Latest %s-neovim is installed: %s',
+ \ python_bin_name, latest))
endif
endif
@@ -338,7 +403,10 @@ endfunction
function! s:check_ruby() abort
call health#report_start('Ruby provider')
- let ruby_version = systemlist('ruby -v')[0]
+ let ruby_version = 'not found'
+ if executable('ruby')
+ let ruby_version = s:systemlist('ruby -v')[0]
+ endif
let ruby_prog = provider#ruby#Detect()
let suggestions =
\ ['Install or upgrade the neovim RubyGem using `gem install neovim`.']
@@ -348,13 +416,13 @@ function! s:check_ruby() abort
let prog_vers = 'not found'
call health#report_error('Missing Neovim RubyGem', suggestions)
else
- silent let latest_gem = get(systemlist("gem list -ra '^neovim$' 2>/dev/null | " .
+ silent let latest_gem = get(s:systemlist("gem list -ra '^neovim$' 2>/dev/null | " .
\ "awk -F'[()]' '{print $2}' | " .
\ 'cut -d, -f1'), 0, 'not found')
let latest_desc = ' (latest: ' . latest_gem . ')'
- silent let prog_vers = systemlist(ruby_prog . ' --version')[0]
- if v:shell_error
+ silent let prog_vers = s:systemlist(ruby_prog . ' --version')[0]
+ if s:shell_error
let prog_vers = 'not found' . latest_desc
call health#report_warn('Neovim RubyGem is not up-to-date.', suggestions)
elseif s:version_cmp(prog_vers, latest_gem) == -1
@@ -371,6 +439,7 @@ function! s:check_ruby() abort
endfunction
function! health#provider#check() abort
+ call s:check_clipboard()
call s:check_python(2)
call s:check_python(3)
call s:check_ruby()
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim
index bac88fc99e..563180c79b 100644
--- a/runtime/autoload/man.vim
+++ b/runtime/autoload/man.vim
@@ -52,9 +52,9 @@ function! man#open_page(count, count1, mods, ...) abort
call s:push_tag()
let bufname = 'man://'.name.(empty(sect)?'':'('.sect.')')
if a:mods !~# 'tab' && s:find_man()
- noautocmd execute 'silent edit' bufname
+ noautocmd execute 'silent edit' fnameescape(bufname)
else
- noautocmd execute 'silent' a:mods 'split' bufname
+ noautocmd execute 'silent' a:mods 'split' fnameescape(bufname)
endif
let b:man_sect = sect
call s:read_page(path)
@@ -81,7 +81,7 @@ function! s:read_page(path) abort
let cmd = 'env MANPAGER=cat'.(empty($MANWIDTH) ? ' MANWIDTH='.winwidth(0) : '')
let cmd .= ' '.s:man_cmd.' '.shellescape(a:path)
silent put =system(cmd)
- " remove all the backspaced text
+ " Remove all backspaced characters.
execute 'silent keeppatterns keepjumps %substitute,.\b,,e'.(&gdefault?'':'g')
while getline(1) =~# '^\s*$'
silent keepjumps 1delete _
@@ -157,7 +157,7 @@ endfunction
function! man#pop_tag() abort
if !empty(s:tag_stack)
let tag = remove(s:tag_stack, -1)
- silent execute tag['buf'].'buffer'
+ execute 'silent' tag['buf'].'buffer'
call cursor(tag['lnum'], tag['col'])
endif
endfunction
@@ -259,3 +259,22 @@ function! s:format_candidate(path, sect) abort
return name.'('.sect.')'
endif
endfunction
+
+function! man#init_pager() abort
+ " Remove all backspaced characters.
+ execute 'silent keeppatterns keepjumps %substitute,.\b,,e'.(&gdefault?'':'g')
+ if getline(1) =~# '^\s*$'
+ silent keepjumps 1delete _
+ else
+ keepjumps 1
+ endif
+ " This is not perfect. See `man glDrawArraysInstanced`. Since the title is
+ " all caps it is impossible to tell what the original capitilization was.
+ let ref = tolower(matchstr(getline(1), '^\S\+'))
+ try
+ let b:man_sect = man#extract_sect_and_name_ref(ref)[0]
+ catch
+ let b:man_sect = ''
+ endtry
+ execute 'silent file man://'.fnameescape(ref)
+endfunction
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim
index 0f4aa78ddd..f63ad5730b 100644
--- a/runtime/autoload/provider/clipboard.vim
+++ b/runtime/autoload/provider/clipboard.vim
@@ -31,34 +31,51 @@ function! s:try_cmd(cmd, ...)
endfunction
let s:cache_enabled = 1
-if executable('pbcopy')
- let s:copy['+'] = 'pbcopy'
- let s:paste['+'] = 'pbpaste'
- let s:copy['*'] = s:copy['+']
- let s:paste['*'] = s:paste['+']
- let s:cache_enabled = 0
-elseif exists('$DISPLAY') && executable('xsel')
- let s:copy['+'] = 'xsel --nodetach -i -b'
- let s:paste['+'] = 'xsel -o -b'
- let s:copy['*'] = 'xsel --nodetach -i -p'
- let s:paste['*'] = 'xsel -o -p'
-elseif exists('$DISPLAY') && executable('xclip')
- let s:copy['+'] = 'xclip -quiet -i -selection clipboard'
- let s:paste['+'] = 'xclip -o -selection clipboard'
- let s:copy['*'] = 'xclip -quiet -i -selection primary'
- let s:paste['*'] = 'xclip -o -selection primary'
-elseif executable('lemonade')
- let s:copy['+'] = 'lemonade copy'
- let s:paste['+'] = 'lemonade paste'
- let s:copy['*'] = 'lemonade copy'
- let s:paste['*'] = 'lemonade paste'
-elseif executable('doitclient')
- let s:copy['+'] = 'doitclient wclip'
- let s:paste['+'] = 'doitclient wclip -r'
- let s:copy['*'] = s:copy['+']
- let s:paste['*'] = s:paste['+']
-else
- echom 'clipboard: No clipboard tool available. See :help clipboard'
+let s:err = ''
+
+function! provider#clipboard#Error() abort
+ return s:err
+endfunction
+
+function! provider#clipboard#Executable() abort
+ if executable('pbcopy')
+ let s:copy['+'] = 'pbcopy'
+ let s:paste['+'] = 'pbpaste'
+ let s:copy['*'] = s:copy['+']
+ let s:paste['*'] = s:paste['+']
+ let s:cache_enabled = 0
+ return 'pbcopy'
+ elseif exists('$DISPLAY') && executable('xsel')
+ let s:copy['+'] = 'xsel --nodetach -i -b'
+ let s:paste['+'] = 'xsel -o -b'
+ let s:copy['*'] = 'xsel --nodetach -i -p'
+ let s:paste['*'] = 'xsel -o -p'
+ return 'xsel'
+ elseif exists('$DISPLAY') && executable('xclip')
+ let s:copy['+'] = 'xclip -quiet -i -selection clipboard'
+ let s:paste['+'] = 'xclip -o -selection clipboard'
+ let s:copy['*'] = 'xclip -quiet -i -selection primary'
+ let s:paste['*'] = 'xclip -o -selection primary'
+ return 'xclip'
+ elseif executable('lemonade')
+ let s:copy['+'] = 'lemonade copy'
+ let s:paste['+'] = 'lemonade paste'
+ let s:copy['*'] = 'lemonade copy'
+ let s:paste['*'] = 'lemonade paste'
+ return 'lemonade'
+ elseif executable('doitclient')
+ let s:copy['+'] = 'doitclient wclip'
+ let s:paste['+'] = 'doitclient wclip -r'
+ let s:copy['*'] = s:copy['+']
+ let s:paste['*'] = s:paste['+']
+ return 'doitclient'
+ endif
+
+ let s:err = 'clipboard: No clipboard tool available. See :help clipboard'
+ return ''
+endfunction
+
+if empty(provider#clipboard#Executable())
finish
endif
diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim
index 6d6b38978c..f46c260fa3 100644
--- a/runtime/autoload/provider/pythonx.vim
+++ b/runtime/autoload/provider/pythonx.vim
@@ -47,32 +47,27 @@ function! provider#pythonx#Require(host) abort
endfunction
function! provider#pythonx#Detect(major_ver) abort
- let host_var = (a:major_ver == 2) ?
- \ 'g:python_host_prog' : 'g:python3_host_prog'
- let skip_var = (a:major_ver == 2) ?
- \ 'g:python_host_skip_check' : 'g:python3_host_skip_check'
- let skip = exists(skip_var) ? {skip_var} : 0
- if exists(host_var)
- " Disable auto detection.
- let [result, err] = s:check_interpreter({host_var}, a:major_ver, skip)
- if result
- return [{host_var}, err]
+ if a:major_ver == 2
+ if exists('g:python_host_prog')
+ return [g:python_host_prog, '']
+ else
+ let progs = ['python2', 'python2.7', 'python2.6', 'python']
+ endif
+ else
+ if exists('g:python3_host_prog')
+ return [g:python3_host_prog, '']
+ else
+ let progs = ['python3', 'python3.5', 'python3.4', 'python3.3', 'python']
endif
- return ['', 'provider/pythonx: Could not load Python ' . a:major_ver
- \ . ' from ' . host_var . ': ' . err]
endif
- let prog_suffixes = (a:major_ver == 2) ?
- \ ['2', '2.7', '2.6', '']
- \ : ['3', '3.5', '3.4', '3.3', '']
-
let errors = []
- for prog in map(prog_suffixes, "'python' . v:val")
- let [result, err] = s:check_interpreter(prog, a:major_ver, skip)
+
+ for prog in progs
+ let [result, err] = s:check_interpreter(prog, a:major_ver)
if result
return [prog, err]
endif
-
" Accumulate errors in case we don't find
" any suitable Python interpreter.
call add(errors, err)
@@ -83,16 +78,12 @@ function! provider#pythonx#Detect(major_ver) abort
\ . ":\n" . join(errors, "\n")]
endfunction
-function! s:check_interpreter(prog, major_ver, skip) abort
+function! s:check_interpreter(prog, major_ver) abort
let prog_path = exepath(a:prog)
if prog_path ==# ''
return [0, a:prog . ' not found in search path or not executable.']
endif
- if a:skip
- return [1, '']
- endif
-
let min_version = (a:major_ver == 2) ? '2.6' : '3.3'
" Try to load neovim module, and output Python version.
diff --git a/runtime/doc/Makefile b/runtime/doc/Makefile
index 3d10d0ea98..dabbcd08d9 100644
--- a/runtime/doc/Makefile
+++ b/runtime/doc/Makefile
@@ -36,5 +36,5 @@ tags.ref tags.html: tags
$(AWK) -f maketags.awk tags >tags.html
clean:
- -rm -f *.html tags.ref $(HTMLS) errors.log
+ -rm -f *.html tags.ref $(HTMLS) errors.log tags
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 76dd3c7d4c..4f23aee83d 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -940,7 +940,15 @@ VimEnter After doing all the startup stuff, including
loading vimrc files, executing the "-c cmd"
arguments, creating all windows and loading
the buffers in them.
- *VimLeave*
+ Just before this event is triggered the
+ |v:vim_did_enter| variable is set, so that you
+ can do: >
+ if v:vim_did_enter
+ call s:init()
+ else
+ au VimEnter * call s:init()
+ endif
+< *VimLeave*
VimLeave Before exiting Vim, just after writing the
.shada file. Executed only once, like
VimLeavePre.
diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt
index 12bc655edc..6b45f8552f 100644
--- a/runtime/doc/diff.txt
+++ b/runtime/doc/diff.txt
@@ -1,12 +1,12 @@
-*diff.txt* For Vim version 7.4. Last change: 2015 Nov 01
+*diff.txt* For Vim version 7.4. Last change: 2016 Aug 24
VIM REFERENCE MANUAL by Bram Moolenaar
*diff* *diff-mode*
-This file describes |diff-mode|, which shows the differences between two,
-three, or four versions of the same file.
+This file describes the |+diff| feature: Showing differences between two to
+eight versions of the same file.
The basics are explained in section |08.7| of the user manual.
@@ -109,7 +109,7 @@ To make these commands use a vertical split, prepend |:vertical|. Examples: >
If you always prefer a vertical split include "vertical" in 'diffopt'.
*E96*
-There can be up to four buffers with 'diff' set.
+There can be up to eight buffers with 'diff' set.
Since the option values are remembered with the buffer, you can edit another
file for a moment and come back to the same file and be in diff mode again.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 3ce0d1cd87..53f14c7d47 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 7.4. Last change: 2016 May 20
+*eval.txt* For Vim version 7.4. Last change: 2016 Jun 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1029,8 +1029,8 @@ A string constant accepts these special characters:
\x. byte specified with one hex number (must be followed by non-hex char)
\X.. same as \x..
\X. same as \x.
-\u.... character specified with up to 4 hex numbers, stored according to the
- current value of 'encoding' (e.g., "\u02a4")
+\u.... character specified with up to 4 hex numbers, stored as UTF-8
+ (e.g., "\u02a4")
\U.... same as \u but allows up to 8 hex numbers.
\b backspace <BS>
\e escape <Esc>
@@ -1045,8 +1045,7 @@ A string constant accepts these special characters:
utf-8 character, use \uxxxx as mentioned above.
Note that "\xff" is stored as the byte 255, which may be invalid in some
-encodings. Use "\u00ff" to store character 255 according to the current value
-of 'encoding'.
+encodings. Use "\u00ff" to store character 255 correctly as UTF-8.
Note that "\000" and "\x00" force the end of the string.
@@ -1306,6 +1305,10 @@ v:beval_winnr The number of the window, over which the mouse pointer is. Only
window has number zero (unlike most other places where a
window gets a number).
+ *v:beval_winid* *beval_winid-variable*
+v:beval_winid The window ID of the window, over which the mouse pointer is.
+ Otherwise like v:beval_winnr.
+
*v:char* *char-variable*
v:char Argument for evaluating 'formatexpr' and used for the typed
character when using <expr> in an abbreviation |:map-<expr>|.
@@ -1380,6 +1383,9 @@ v:dying Normally zero. When a deadly signal is caught it's set to
< Note: if another deadly signal is caught when v:dying is one,
VimLeave autocommands will not be executed.
+ *v:exiting* *exiting-variable*
+v:exiting The exit value Nvim will use. Before exiting, it is |v:null|.
+
*v:errmsg* *errmsg-variable*
v:errmsg Last given error message. It's allowed to set this variable.
Example: >
@@ -1555,6 +1561,10 @@ v:mouse_win Window number for a mouse click obtained with |getchar()|.
First window has number 1, like with |winnr()|. The value is
zero when there was no mouse button click.
+ *v:mouse_winid* *mouse_winid-variable*
+v:mouse_winid Window ID for a mouse click obtained with |getchar()|.
+ The value is zero when there was no mouse button click.
+
*v:mouse_lnum* *mouse_lnum-variable*
v:mouse_lnum Line number for a mouse click obtained with |getchar()|.
This is the text line number, not the screen line number. The
@@ -1711,6 +1721,21 @@ v:swapcommand Normal mode command to be executed after a file has been
example, when jumping to a tag the value is ":tag tagname\r".
For ":edit +cmd file" the value is ":cmd\r".
+ *v:t_TYPE* *v:t_bool* *t_bool-varialble*
+v:t_bool Value of Boolean type. Read-only. See: |type()|
+ *v:t_dict* *t_dict-varialble*
+v:t_dict Value of Dictionary type. Read-only. See: |type()|
+ *v:t_float* *t_float-varialble*
+v:t_float Value of Float type. Read-only. See: |type()|
+ *v:t_func* *t_func-varialble*
+v:t_func Value of Funcref type. Read-only. See: |type()|
+ *v:t_list* *t_list-varialble*
+v:t_list Value of List type. Read-only. See: |type()|
+ *v:t_number* *t_number-varialble*
+v:t_number Value of Number type. Read-only. See: |type()|
+ *v:t_string* *t_string-varialble*
+v:t_string Value of String type. Read-only. See: |type()|
+
*v:termresponse* *termresponse-variable*
v:termresponse The escape sequence returned by the terminal for the |t_RV|
termcap entry. It is set when Vim receives an escape sequence
@@ -1766,13 +1791,17 @@ v:version Version number of Vim: Major version number times 100 plus
version 5.0 and 5.1 may have a patch 123, but these are
completely different.
+ *v:vim_did_enter* *vim_did_enter-variable*
+v:vim_did_enter Zero until most of startup is done. It is set to one just
+ before |VimEnter| autocommands are triggered.
+
*v:warningmsg* *warningmsg-variable*
v:warningmsg Last given warning message. It's allowed to set this variable.
*v:windowid* *windowid-variable* {Nvim}
v:windowid Application-specific window ID ("window handle" in MS-Windows)
which may be set by any attached UI. Defaults to zero.
- Note: for windows inside Vim use |winnr()|.
+ Note: for windows inside Vim use |winnr()| or |win_getid()|.
==============================================================================
4. Builtin Functions *functions*
@@ -2003,6 +2032,8 @@ matchlist({expr}, {pat}[, {start}[, {count}]])
List match and submatches of {pat} in {expr}
matchstr({expr}, {pat}[, {start}[, {count}]])
String {count}'th match of {pat} in {expr}
+matchstrpos( {expr}, {pat}[, {start}[, {count}]])
+ List {count}'th match of {pat} in {expr}
max({list}) Number maximum value of items in {list}
min({list}) Number minimum value of items in {list}
mkdir({name} [, {path} [, {prot}]])
@@ -2532,8 +2563,6 @@ byteidxcomp({expr}, {nr}) *byteidxcomp()*
< The first and third echo result in 3 ('e' plus composing
character is 3 bytes), the second echo results in 1 ('e' is
one byte).
- Only works different from byteidx() when 'encoding' is set to
- a Unicode encoding.
call({func}, {arglist} [, {dict}]) *call()* *E699*
Call function {func} with the items in |List| {arglist} as
@@ -2568,11 +2597,11 @@ char2nr({expr}[, {utf8}]) *char2nr()*
Return number value of the first char in {expr}. Examples: >
char2nr(" ") returns 32
char2nr("ABC") returns 65
-< When {utf8} is omitted or zero, the current 'encoding' is used.
- Example for "utf-8": >
char2nr("á") returns 225
char2nr("á"[0]) returns 195
-< With {utf8} set to 1, always treat as utf-8 characters.
+< Non-ASCII characters are always treated as UTF-8 characters.
+ {utf8} has no effect, and exists only for
+ backwards-compatibility.
A combining character is a separate character.
|nr2char()| does the opposite.
@@ -3553,8 +3582,8 @@ getchar([expr]) *getchar()*
When the user clicks a mouse button, the mouse event will be
returned. The position can then be found in |v:mouse_col|,
- |v:mouse_lnum| and |v:mouse_win|. This example positions the
- mouse as it would normally happen: >
+ |v:mouse_lnum|, |v:mouse_winid| and |v:mouse_win|. This
+ example positions the mouse as it would normally happen: >
let c = getchar()
if c == "\<LeftMouse>" && v:mouse_win > 0
exe v:mouse_win . "wincmd w"
@@ -4225,11 +4254,7 @@ iconv({expr}, {from}, {to}) *iconv()*
Most conversions require Vim to be compiled with the |+iconv|
feature. Otherwise only UTF-8 to latin1 conversion and back
can be done.
- This can be used to display messages with special characters,
- no matter what 'encoding' is set to. Write the message in
- UTF-8 and use: >
- echo iconv(utf8_str, "utf-8", &enc)
-< Note that Vim uses UTF-8 for all Unicode encodings, conversion
+ Note that Vim uses UTF-8 for all Unicode encodings, conversion
from/to UCS-2 is automatically changed to use UTF-8. You
cannot use UCS-2 in a string anyway, because of the NUL bytes.
{only available when compiled with the |+multi_byte| feature}
@@ -4406,7 +4431,8 @@ jobclose({job}[, {stream}]) {Nvim} *jobclose()*
Close {job}'s {stream}, which can be one of "stdin", "stdout",
"stderr" or "rpc" (closes the rpc channel for a job started
with the "rpc" option.) If {stream} is omitted, all streams
- are closed.
+ are closed. If the job is a pty job, this will then close the
+ pty master, sending SIGHUP to the job process.
jobpid({job}) {Nvim} *jobpid()*
Return the pid (process id) of {job}.
@@ -4513,9 +4539,7 @@ join({list} [, {sep}]) *join()*
json_decode({expr}) *json_decode()*
Convert {expr} from JSON object. Accepts |readfile()|-style
list as the input, as well as regular string. May output any
- Vim value. When 'encoding' is not UTF-8 string is converted
- from UTF-8 to 'encoding', failing conversion fails
- json_decode(). In the following cases it will output
+ Vim value. In the following cases it will output
|msgpack-special-dict|:
1. Dictionary contains duplicate key.
2. Dictionary contains empty key.
@@ -4523,33 +4547,22 @@ json_decode({expr}) *json_decode()*
dictionary and for string will be emitted in case string
with NUL byte was a dictionary key.
- Note: function treats its input as UTF-8 always regardless of
- 'encoding' value. This is needed because JSON source is
- supposed to be external (e.g. |readfile()|) and JSON standard
- allows only a few encodings, of which UTF-8 is recommended and
- the only one required to be supported. Non-UTF-8 characters
- are an error.
+ Note: function treats its input as UTF-8 always. The JSON
+ standard allows only a few encodings, of which UTF-8 is
+ recommended and the only one required to be supported.
+ Non-UTF-8 characters are an error.
json_encode({expr}) *json_encode()*
Convert {expr} into a JSON string. Accepts
- |msgpack-special-dict| as the input. Converts from 'encoding'
- to UTF-8 when encoding strings. Will not convert |Funcref|s,
+ |msgpack-special-dict| as the input. Will not convert |Funcref|s,
mappings with non-string keys (can be created as
|msgpack-special-dict|), values with self-referencing
containers, strings which contain non-UTF-8 characters,
pseudo-UTF-8 strings which contain codepoints reserved for
surrogate pairs (such strings are not valid UTF-8 strings).
- When converting 'encoding' is taken into account, if it is not
- "utf-8", then conversion is performed before encoding strings.
Non-printable characters are converted into "\u1234" escapes
or special escapes like "\t", other are dumped as-is.
- Note: all characters above U+0079 are considered non-printable
- when 'encoding' is not UTF-8. This function always outputs
- UTF-8 strings as required by the standard thus when 'encoding'
- is not unicode resulting string will look incorrect if
- "\u1234" notation is not used.
-
keys({dict}) *keys()*
Return a |List| with all the keys of {dict}. The |List| is in
arbitrary order.
@@ -4651,9 +4664,9 @@ line2byte({lnum}) *line2byte()*
Return the byte count from the start of the buffer for line
{lnum}. This includes the end-of-line character, depending on
the 'fileformat' option for the current buffer. The first
- line returns 1. 'encoding' matters, 'fileencoding' is ignored.
- This can also be used to get the byte count for the line just
- below the last line: >
+ line returns 1. UTF-8 encoding is used, 'fileencoding' is
+ ignored. This can also be used to get the byte count for the
+ line just below the last line: >
line2byte(line("$") + 1)
< This is the buffer size plus one. If 'fileencoding' is empty
it is the file size plus one.
@@ -5008,6 +5021,24 @@ matchstr({expr}, {pat}[, {start}[, {count}]]) *matchstr()*
When {expr} is a |List| then the matching item is returned.
The type isn't changed, it's not necessarily a String.
+matchstrpos({expr}, {pat}[, {start}[, {count}]]) *matchstrpos()*
+ Same as |matchstr()|, but return the matched string, the start
+ position and the end position of the match. Example: >
+ :echo matchstrpos("testing", "ing")
+< results in ["ing", 4, 7].
+ When there is no match ["", -1, -1] is returned.
+ The {start}, if given, has the same meaning as for |match()|. >
+ :echo matchstrpos("testing", "ing", 2)
+< results in ["ing", 4, 7]. >
+ :echo matchstrpos("testing", "ing", 5)
+< result is ["", -1, -1].
+ When {expr} is a |List| then the matching item, the index
+ of first item where {pat} matches, the start position and the
+ end position of the match are returned. >
+ :echo matchstrpos([1, '__x'], '\a')
+< result is ["x", 1, 2, 3].
+ The type isn't changed, it's not necessarily a String.
+
*max()*
max({list}) Return the maximum value of all items in {list}.
If {list} is not a list or one of the items in {list} cannot
@@ -5077,7 +5108,7 @@ msgpackdump({list}) {Nvim} *msgpackdump()*
(dictionary with zero items is represented by 0x80 byte in
messagepack).
- Limitations: *E951* *E952* *E953*
+ Limitations: *E5004* *E5005*
1. |Funcref|s cannot be dumped.
2. Containers that reference themselves cannot be dumped.
3. Dictionary keys are always dumped as STR strings.
@@ -5172,10 +5203,10 @@ nr2char({expr}[, {utf8}]) *nr2char()*
value {expr}. Examples: >
nr2char(64) returns "@"
nr2char(32) returns " "
-< When {utf8} is omitted or zero, the current 'encoding' is used.
- Example for "utf-8": >
+< Example for "utf-8": >
nr2char(300) returns I with bow character
-< With {utf8} set to 1, always return utf-8 characters.
+< UTF-8 encoding is always used, {utf8} option has no effect,
+ and exists only for backwards-compatibility.
Note that a NUL character in the file is specified with
nr2char(10), because NULs are represented with newline
characters. nr2char(0) is a real NUL and terminates the
@@ -5417,7 +5448,7 @@ py3eval({expr}) *py3eval()*
converted to Vim data structures.
Numbers and strings are returned as they are (strings are
copied though, Unicode strings are additionally converted to
- 'encoding').
+ UTF-8).
Lists are represented as Vim |List| type.
Dictionaries are represented as Vim |Dictionary| type with
keys converted to strings.
@@ -5467,8 +5498,7 @@ readfile({fname} [, {binary} [, {max}]])
Otherwise:
- CR characters that appear before a NL are removed.
- Whether the last line ends in a NL or not does not matter.
- - When 'encoding' is Unicode any UTF-8 byte order mark is
- removed from the text.
+ - Any UTF-8 byte order mark is removed from the text.
When {max} is given this specifies the maximum number of lines
to be read. Useful if you only want to check the first ten
lines of a file: >
@@ -6175,10 +6205,15 @@ setqflist({list} [, {action}[, {title}]]) *setqflist()*
*E927*
If {action} is set to 'a', then the items from {list} are
added to the existing quickfix list. If there is no existing
- list, then a new list is created. If {action} is set to 'r',
- then the items from the current quickfix list are replaced
- with the items from {list}. If {action} is not present or is
- set to ' ', then a new list is created.
+ list, then a new list is created.
+
+ If {action} is set to 'r', then the items from the current
+ quickfix list are replaced with the items from {list}. This
+ can also be used to clear the list: >
+ :call setqflist([], 'r')
+<
+ If {action} is not present or is set to ' ', then a new list
+ is created.
If {title} is given, it will be used to set |w:quickfix_title|
after opening the quickfix window.
@@ -6621,8 +6656,7 @@ string({expr}) Return {expr} converted to a String. If {expr} is a Number,
for infinite and NaN floating-point values representations
which use |str2float()|. Strings are also dumped literally,
only single quote is escaped, which does not allow using YAML
- for parsing back binary strings (including text when
- 'encoding' is not UTF-8). |eval()| should always work for
+ for parsing back binary strings. |eval()| should always work for
strings and floats though and this is the only official
method, use |msgpackdump()| or |json_encode()| if you need to
share data with other application.
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt
index cbe017e051..786097dd74 100644
--- a/runtime/doc/intro.txt
+++ b/runtime/doc/intro.txt
@@ -450,7 +450,7 @@ notation meaning equivalent decimal value(s) ~
<k0> - <k9> keypad 0 to 9 *keypad-0* *keypad-9*
<S-...> shift-key *shift* *<S-*
<C-...> control-key *control* *ctrl* *<C-*
-<M-...> alt-key or meta-key *meta* *alt* *<M-*
+<M-...> alt-key or meta-key *META* *meta* *alt* *<M-*
<A-...> same as <M-...> *<A-*
<D-...> command-key or "super" key *<D-*
<t_xx> key with "xx" entry in termcap
diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt
index c87ed317d4..3bdb682a31 100644
--- a/runtime/doc/mbyte.txt
+++ b/runtime/doc/mbyte.txt
@@ -70,29 +70,24 @@ See |mbyte-locale| for details.
ENCODING
-If your locale works properly, Vim will try to set the 'encoding' option
-accordingly. If this doesn't work you can overrule its value: >
+Nvim always uses UTF-8 internally. Thus 'encoding' option is always set
+to "utf-8" and cannot be changed.
- :set encoding=utf-8
+All the text that is used inside Vim will be in UTF-8. Not only the text in
+the buffers, but also in registers, variables, etc.
-See |encoding-values| for a list of acceptable values.
-
-The result is that all the text that is used inside Vim will be in this
-encoding. Not only the text in the buffers, but also in registers, variables,
-etc. 'encoding' is read-only after startup because changing it would make the
-existing text invalid.
-
-You can edit files in another encoding than what 'encoding' is set to. Vim
+You can edit files in different encodings than UTF-8. Nvim
will convert the file when you read it and convert it back when you write it.
See 'fileencoding', 'fileencodings' and |++enc|.
DISPLAY AND FONTS
-If you are working in a terminal (emulator) you must make sure it accepts the
-same encoding as which Vim is working with.
+If you are working in a terminal (emulator) you must make sure it accepts
+UTF-8, the encoding which Vim is working with. Otherwise only ASCII can
+be displayed and edited correctly.
-For the GUI you must select fonts that work with the current 'encoding'. This
+For the GUI you must select fonts that work with UTF-8. This
is the difficult part. It depends on the system you are using, the locale and
a few other things. See the chapters on fonts: |mbyte-fonts-X11| for
X-Windows and |mbyte-fonts-MSwin| for MS-Windows.
@@ -216,10 +211,9 @@ You could make a small shell script for this.
==============================================================================
3. Encoding *mbyte-encoding*
-Vim uses the 'encoding' option to specify how characters are identified and
-encoded when they are used inside Vim. This applies to all the places where
-text is used, including buffers (files loaded into memory), registers and
-variables.
+In Nvim UTF-8 is always used internally to encode characters.
+ This applies to all the places where text is used, including buffers (files
+ loaded into memory), registers and variables.
*charset* *codeset*
Charset is another name for encoding. There are subtle differences, but these
@@ -240,7 +234,7 @@ matter what language is used. Thus you might see the right text even when the
encoding was set wrong.
*encoding-names*
-Vim can use many different character encodings. There are three major groups:
+Vim can edit files in different character encodings. There are three major groups:
1 8bit Single-byte encodings, 256 different characters. Mostly used
in USA and Europe. Example: ISO-8859-1 (Latin1). All
@@ -255,11 +249,10 @@ u Unicode Universal encoding, can replace all others. ISO 10646.
Millions of different characters. Example: UTF-8. The
relation between bytes and screen cells is complex.
-Other encodings cannot be used by Vim internally. But files in other
+Only UTF-8 is used by Vim internally. But files in other
encodings can be edited by using conversion, see 'fileencoding'.
-Note that all encodings must use ASCII for the characters up to 128.
-Supported 'encoding' values are: *encoding-values*
+Recognized 'fileencoding' values include: *encoding-values*
1 latin1 8-bit characters (ISO 8859-1, also used for cp1252)
1 iso-8859-n ISO_8859 variant (n = 2 to 15)
1 koi8-r Russian
@@ -311,11 +304,11 @@ u ucs-4 32 bit UCS-4 encoded Unicode (ISO/IEC 10646-1)
u ucs-4le like ucs-4, little endian
The {name} can be any encoding name that your system supports. It is passed
-to iconv() to convert between the encoding of the file and the current locale.
+to iconv() to convert between UTF-8 and the encoding of the file.
For MS-Windows "cp{number}" means using codepage {number}.
Examples: >
- :set encoding=8bit-cp1252
- :set encoding=2byte-cp932
+ :set fileencoding=8bit-cp1252
+ :set fileencoding=2byte-cp932
The MS-Windows codepage 1252 is very similar to latin1. For practical reasons
the same encoding is used and it's called latin1. 'isprint' can be used to
@@ -337,8 +330,7 @@ u ucs-2be same as ucs-2 (big endian)
u ucs-4be same as ucs-4 (big endian)
u utf-32 same as ucs-4
u utf-32le same as ucs-4le
- default stands for the default value of 'encoding', depends on the
- environment
+ default the encoding of the current locale.
For the UCS codes the byte order matters. This is tricky, use UTF-8 whenever
you can. The default is to use big-endian (most significant byte comes
@@ -363,13 +355,12 @@ or when conversion is not possible:
CONVERSION *charset-conversion*
Vim will automatically convert from one to another encoding in several places:
-- When reading a file and 'fileencoding' is different from 'encoding'
-- When writing a file and 'fileencoding' is different from 'encoding'
+- When reading a file and 'fileencoding' is different from "utf-8"
+- When writing a file and 'fileencoding' is different from "utf-8"
- When displaying messages and the encoding used for LC_MESSAGES differs from
- 'encoding' (requires a gettext version that supports this).
+ "utf-8" (requires a gettext version that supports this).
- When reading a Vim script where |:scriptencoding| is different from
- 'encoding'.
-- When reading or writing a |shada| file.
+ "utf-8".
Most of these require the |+iconv| feature. Conversion for reading and
writing files may also be specified with the 'charconvert' option.
@@ -408,11 +399,11 @@ Useful utilities for converting the charset:
*mbyte-conversion*
-When reading and writing files in an encoding different from 'encoding',
+When reading and writing files in an encoding different from "utf-8",
conversion needs to be done. These conversions are supported:
- All conversions between Latin-1 (ISO-8859-1), UTF-8, UCS-2 and UCS-4 are
handled internally.
-- For MS-Windows, when 'encoding' is a Unicode encoding, conversion from and
+- For MS-Windows, conversion from and
to any codepage should work.
- Conversion specified with 'charconvert'
- Conversion with the iconv library, if it is available.
@@ -468,8 +459,6 @@ and you will have a working UTF-8 terminal emulator. Try both >
with the demo text that comes with ucs-fonts.tar.gz in order to see
whether there are any problems with UTF-8 in your xterm.
-For Vim you may need to set 'encoding' to "utf-8".
-
==============================================================================
5. Fonts on X11 *mbyte-fonts-X11*
@@ -864,11 +853,11 @@ between two keyboard settings.
The value of the 'keymap' option specifies a keymap file to use. The name of
this file is one of these two:
- keymap/{keymap}_{encoding}.vim
+ keymap/{keymap}_utf-8.vim
keymap/{keymap}.vim
-Here {keymap} is the value of the 'keymap' option and {encoding} of the
-'encoding' option. The file name with the {encoding} included is tried first.
+Here {keymap} is the value of the 'keymap' option.
+The file name with "utf-8" included is tried first.
'runtimepath' is used to find these files. To see an overview of all
available keymap files, use this: >
@@ -950,7 +939,7 @@ this is unusual. But you can use various ways to specify the character: >
A <char-0141> octal value
x <Space> special key name
-The characters are assumed to be encoded for the current value of 'encoding'.
+The characters are assumed to be encoded in UTF-8.
It's possible to use ":scriptencoding" when all characters are given
literally. That doesn't work when using the <char-> construct, because the
conversion is done on the keymap file, not on the resulting character.
@@ -1170,21 +1159,13 @@ Useful commands:
message is truncated, use ":messages").
- "g8" shows the bytes used in a UTF-8 character, also the composing
characters, as hex numbers.
-- ":set encoding=utf-8 fileencodings=" forces using UTF-8 for all files. The
- default is to use the current locale for 'encoding' and set 'fileencodings'
- to automatically detect the encoding of a file.
+- ":set fileencodings=" forces using UTF-8 for all files. The
+ default is to automatically detect the encoding of a file.
STARTING VIM
-If your current locale is in an utf-8 encoding, Vim will automatically start
-in utf-8 mode.
-
-If you are using another locale: >
-
- set encoding=utf-8
-
-You might also want to select the font used for the menus. Unfortunately this
+You might want to select the font used for the menus. Unfortunately this
doesn't always work. See the system specific remarks below, and 'langmenu'.
@@ -1245,10 +1226,9 @@ not everybody is able to type a composing character.
These options are relevant for editing multi-byte files. Check the help in
options.txt for detailed information.
-'encoding' Encoding used for the keyboard and display. It is also the
- default encoding for files.
+'encoding' Internal text encoding, always "utf-8".
-'fileencoding' Encoding of a file. When it's different from 'encoding'
+'fileencoding' Encoding of a file. When it's different from "utf-8"
conversion is done when reading or writing the file.
'fileencodings' List of possible encodings of a file. When opening a file
diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt
index d3eeecaf7c..fd66a5dafb 100644
--- a/runtime/doc/message.txt
+++ b/runtime/doc/message.txt
@@ -19,6 +19,15 @@ The ":messages" command can be used to view previously given messages. This
is especially useful when messages have been overwritten or truncated. This
depends on the 'shortmess' option.
+ :messages Show all messages.
+
+ :{count}messages Show the {count} most recent messages.
+
+ :messages clear Clear all messages.
+
+ :{count}messages clear Clear messages, keeping only the {count} most
+ recent ones.
+
The number of remembered messages is fixed at 20 for the tiny version and 200
for other versions.
@@ -58,9 +67,9 @@ If you are lazy, it also works without the shift key: >
When an error message is displayed, but it is removed before you could read
it, you can see it again with: >
:echo errmsg
-or view a list of recent messages with: >
+Or view a list of recent messages with: >
:messages
-
+See `:messages` above.
LIST OF MESSAGES
*E222* *E228* *E232* *E256* *E293* *E298* *E304* *E317*
diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt
index 757f5574d4..c074eb43ff 100644
--- a/runtime/doc/msgpack_rpc.txt
+++ b/runtime/doc/msgpack_rpc.txt
@@ -390,8 +390,9 @@ of update.
The menu mappings changed.
["mode_change", mode]
- The mode changed. Currently sent when "insert", "replace" and "normal"
- modes are entered. A client could for instance change the cursor shape.
+ The mode changed. Currently sent when "insert", "replace", "cmdline" and
+ "normal" modes are entered. A client could for instance change the cursor
+ shape.
["popupmenu_show", items, selected, row, col]
When `popupmenu_external` is set to true, nvim will not draw the
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 5a5999e64c..7cfc55ed79 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -52,7 +52,6 @@ achieve special effects. These options come in three forms:
:se[t] all& Set all options to their default value. The values of
these options are not changed:
'columns'
- 'encoding'
'lines'
Warning: This may have a lot of side effects.
@@ -615,7 +614,6 @@ A jump table for the options with a short description can be found at |Q_op|.
global
{only available when compiled with the |+multi_byte|
feature}
- Only effective when 'encoding' is "utf-8" or another Unicode encoding.
Tells Vim what to do with characters with East Asian Width Class
Ambiguous (such as Euro, Registered Sign, Copyright Sign, Greek
letters, Cyrillic letters).
@@ -668,7 +666,6 @@ A jump table for the options with a short description can be found at |Q_op|.
- Set the 'keymap' option to "arabic"; in Insert mode CTRL-^ toggles
between typing English and Arabic key mapping.
- Set the 'delcombine' option
- Note that 'encoding' must be "utf-8" for working with Arabic text.
Resetting this option will:
- Reset the 'rightleft' option.
@@ -1078,8 +1075,7 @@ A jump table for the options with a short description can be found at |Q_op|.
{not available when compiled without the |+linebreak|
feature}
This option lets you choose which characters might cause a line
- break if 'linebreak' is on. Only works for ASCII and also for 8-bit
- characters when 'encoding' is an 8-bit encoding.
+ break if 'linebreak' is on. Only works for ASCII characters.
*'breakindent'* *'bri'*
'breakindent' 'bri' boolean (default off)
@@ -1159,21 +1155,14 @@ A jump table for the options with a short description can be found at |Q_op|.
*'buftype'* *'bt'* *E382*
'buftype' 'bt' string (default: "")
local to buffer
- {not available when compiled without the |+quickfix|
- feature}
The value of this option specifies the type of a buffer:
<empty> normal buffer
- nofile buffer which is not related to a file and will not be
- written
- nowrite buffer which will not be written
- acwrite buffer which will always be written with BufWriteCmd
- autocommands.
- quickfix quickfix buffer, contains list of errors |:cwindow|
- or list of locations |:lwindow|
- help help buffer (you are not supposed to set this
- manually)
- terminal terminal buffer, this is set automatically when a
- terminal is created. |terminal-emulator|
+ acwrite buffer will always be written with |BufWriteCmd|s
+ help help buffer (do not set this manually)
+ nofile buffer is not related to a file, will not be written
+ nowrite buffer will not be written
+ quickfix list of errors |:cwindow| or locations |:lwindow|
+ terminal |terminal-emulator| buffer
This option is used together with 'bufhidden' and 'swapfile' to
specify special kinds of buffers. See |special-buffers|.
@@ -1214,11 +1203,9 @@ A jump table for the options with a short description can be found at |Q_op|.
Specifies details about changing the case of letters. It may contain
these words, separated by a comma:
internal Use internal case mapping functions, the current
- locale does not change the case mapping. This only
- matters when 'encoding' is a Unicode encoding,
- "latin1" or "iso-8859-15". When "internal" is
- omitted, the towupper() and towlower() system library
- functions are used when available.
+ locale does not change the case mapping. When
+ "internal" is omitted, the towupper() and towlower()
+ system library functions are used when available.
keepascii For the ASCII characters (0x00 to 0x7f) use the US
case mapping, the current locale is not effective.
This probably only matters for Turkish.
@@ -1271,13 +1258,12 @@ A jump table for the options with a short description can be found at |Q_op|.
file to convert from. You will have to save the text in a file first.
The expression must return zero or an empty string for success,
non-zero for failure.
- The possible encoding names encountered are in 'encoding'.
+ See |encoding-names| for possible encoding names.
Additionally, names given in 'fileencodings' and 'fileencoding' are
used.
Conversion between "latin1", "unicode", "ucs-2", "ucs-4" and "utf-8"
is done internally by Vim, 'charconvert' is not used for this.
- 'charconvert' is also used to convert the shada file, if 'encoding' is
- not "utf-8". Also used for Unicode conversion.
+ Also used for Unicode conversion.
Example: >
set charconvert=CharConvert()
fun CharConvert()
@@ -1292,8 +1278,6 @@ A jump table for the options with a short description can be found at |Q_op|.
v:fname_in name of the input file
v:fname_out name of the output file
Note that v:fname_in and v:fname_out will never be the same.
- Note that v:charconvert_from and v:charconvert_to may be different
- from 'encoding'. Vim internally uses UTF-8 instead of UCS-2 or UCS-4.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@@ -2140,44 +2124,14 @@ A jump table for the options with a short description can be found at |Q_op|.
*'encoding'* *'enc'* *E543*
-'encoding' 'enc' string (default: "utf-8")
- global
- {only available when compiled with the |+multi_byte|
- feature}
- Sets the character encoding used inside Vim. It applies to text in
- the buffers, registers, Strings in expressions, text stored in the
- shada file, etc. It sets the kind of characters which Vim can work
- with. See |encoding-names| for the possible values.
-
- 'encoding' cannot be changed after startup, because (1) it causes
- non-ASCII text inside Vim to become invalid, and (2) it complicates
- runtime logic. The recommended 'encoding' is "utf-8". Remote plugins
- and GUIs only support utf-8. See |multibyte|.
+'encoding' 'enc' Removed. |vim-differences| {Nvim}
+ Nvim always uses UTF-8 internally. RPC communication
+ (remote plugins/GUIs) must use UTF-8 strings.
- The character encoding of files can be different from 'encoding'.
+ The character encoding of files can be different than UTF-8.
This is specified with 'fileencoding'. The conversion is done with
iconv() or as specified with 'charconvert'.
- If you need to know whether 'encoding' is a multi-byte encoding, you
- can use: >
- if has("multi_byte_encoding")
-<
- When you set this option, it fires the |EncodingChanged| autocommand
- event so that you can set up fonts if necessary.
-
- When the option is set, the value is converted to lowercase. Thus
- you can set it with uppercase values too. Underscores are translated
- to '-' signs.
- When the encoding is recognized, it is changed to the standard name.
- For example "Latin-1" becomes "latin1", "ISO_88592" becomes
- "iso-8859-2" and "utf8" becomes "utf-8".
-
- When "unicode", "ucs-2" or "ucs-4" is used, Vim internally uses utf-8.
- You don't notice this while editing, but it does matter for the
- |shada-file|. And Vim expects the terminal to use utf-8 too. Thus
- setting 'encoding' to one of these values instead of utf-8 only has
- effect for encoding used for files when 'fileencoding' is empty.
-
*'endofline'* *'eol'* *'noendofline'* *'noeol'*
'endofline' 'eol' boolean (default on)
local to buffer
@@ -2304,20 +2258,14 @@ A jump table for the options with a short description can be found at |Q_op|.
feature}
Sets the character encoding for the file of this buffer.
- When 'fileencoding' is different from 'encoding', conversion will be
+ When 'fileencoding' is different from "utf-8", conversion will be
done when writing the file. For reading see below.
- When 'fileencoding' is empty, the same value as 'encoding' will be
- used (no conversion when reading or writing a file).
- Conversion will also be done when 'encoding' and 'fileencoding' are
- both a Unicode encoding and 'fileencoding' is not utf-8. That's
- because internally Unicode is always stored as utf-8.
- WARNING: Conversion can cause loss of information! When
- 'encoding' is "utf-8" or another Unicode encoding, conversion
- is most likely done in a way that the reverse conversion
- results in the same text. When 'encoding' is not "utf-8" some
- characters may be lost!
-
- See 'encoding' for the possible values. Additionally, values may be
+ When 'fileencoding' is empty, the file will be saved with utf-8
+ encoding. (no conversion when reading or writing a file).
+ WARNING: Conversion to a non-Unicode encoding can cause loss of
+ information!
+
+ See |encoding-names| for the possible values. Additionally, values may be
specified that can be handled by the converter, see
|mbyte-conversion|.
@@ -2330,8 +2278,8 @@ A jump table for the options with a short description can be found at |Q_op|.
Prepending "8bit-" and "2byte-" has no meaning here, they are ignored.
When the option is set, the value is converted to lowercase. Thus
you can set it with uppercase values too. '_' characters are
- replaced with '-'. If a name is recognized from the list for
- 'encoding', it is replaced by the standard name. For example
+ replaced with '-'. If a name is recognized from the list at
+ |encoding-names|, it is replaced by the standard name. For example
"ISO8859-2" becomes "iso-8859-2".
When this option is set, after starting to edit a file, the 'modified'
@@ -2354,12 +2302,8 @@ A jump table for the options with a short description can be found at |Q_op|.
mentioned character encoding. If an error is detected, the next one
in the list is tried. When an encoding is found that works,
'fileencoding' is set to it. If all fail, 'fileencoding' is set to
- an empty string, which means the value of 'encoding' is used.
- WARNING: Conversion can cause loss of information! When
- 'encoding' is "utf-8" (or one of the other Unicode variants)
- conversion is most likely done in a way that the reverse
- conversion results in the same text. When 'encoding' is not
- "utf-8" some non-ASCII characters may be lost! You can use
+ an empty string, which means that UTF-8 is used.
+ WARNING: Conversion can cause loss of information! You can use
the |++bad| argument to specify what is done with characters
that can't be converted.
For an empty file or a file with only ASCII characters most encodings
@@ -2385,11 +2329,11 @@ A jump table for the options with a short description can be found at |Q_op|.
because Vim cannot detect an error, thus the encoding is always
accepted.
The special value "default" can be used for the encoding from the
- environment. It is useful when 'encoding' is set to "utf-8" and
- your environment uses a non-latin1 encoding, such as Russian.
- When 'encoding' is "utf-8" and a file contains an illegal byte
- sequence it won't be recognized as UTF-8. You can use the |8g8|
- command to find the illegal byte sequence.
+ environment. It is useful when your environment uses a non-latin1
+ encoding, such as Russian.
+ When a file contains an illegal UTF-8 byte sequence it won't be
+ recognized as "utf-8". You can use the |8g8| command to find the
+ illegal byte sequence.
WRONG VALUES: WHAT'S WRONG:
latin1,utf-8 "latin1" will always be used
utf-8,ucs-bom,latin1 BOM won't be recognized in an utf-8
@@ -3048,8 +2992,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Note: The size of these fonts must be exactly twice as wide as the one
specified with 'guifont' and the same height.
- 'guifontwide' is only used when 'encoding' is set to "utf-8" and
- 'guifontset' is empty or invalid.
+ 'guifontwide' is only used when 'guifontset' is empty or invalid.
When 'guifont' is set and a valid font is found in it and
'guifontwide' is empty Vim will attempt to find a matching
double-width font and set 'guifontwide' to it.
@@ -3466,6 +3409,18 @@ A jump table for the options with a short description can be found at |Q_op|.
The value is set to 1 when it is not -1 and setting the 'keymap'
option to a valid keymap name.
+ *'inccommand'* *'icm'*
+'inccommand' 'icm' string (default "")
+ global
+
+ "nosplit": Shows the effects of a command incrementally, as you type.
+ "split" : Also shows partial off-screen results in a preview window.
+
+ Works for |:substitute|, |:smagic|, |:snomagic|. |hl-Substitute|
+
+ If the preview is too slow (exceeds 'redrawtime') then 'inccommand' is
+ automatically disabled until |Command-line-mode| is done.
+
*'include'* *'inc'*
'include' 'inc' string (default "^\s*#\s*include")
global or local to buffer |global-local|
@@ -3702,7 +3657,7 @@ A jump table for the options with a short description can be found at |Q_op|.
128 - 159 "~@" - "~_"
160 - 254 "| " - "|~"
255 "~?"
- When 'encoding' is a Unicode one, illegal bytes from 128 to 255 are
+ Illegal bytes from 128 to 255 (invalid UTF-8) are
displayed as <xx>, with the hexadecimal value of the byte.
When 'display' contains "uhex" all unprintable characters are
displayed as <xx>.
@@ -3946,6 +3901,7 @@ A jump table for the options with a short description can be found at |Q_op|.
global
Strings to use in 'list' mode and for the |:list| command. It is a
comma separated list of string settings.
+
*lcs-eol*
eol:c Character to show at the end of each line. When
omitted, there is no extra character at the end of the
@@ -3980,8 +3936,7 @@ A jump table for the options with a short description can be found at |Q_op|.
omitted.
The characters ':' and ',' should not be used. UTF-8 characters can
- be used when 'encoding' is "utf-8", otherwise only printable
- characters are allowed. All characters must be single width.
+ be used. All characters must be single width.
Examples: >
:set lcs=tab:>-,trail:-
@@ -4078,7 +4033,6 @@ A jump table for the options with a short description can be found at |Q_op|.
{only available when compiled with the |+multi_byte|
feature}
The maximum number of combining characters supported for displaying.
- Only used when 'encoding' is "utf-8".
The default is OK for most languages. Hebrew may require 4.
Maximum value is 6.
Even when this option is set to 2 you can still edit text with more
@@ -4782,8 +4736,8 @@ A jump table for the options with a short description can be found at |Q_op|.
global
{only available when compiled with the |+reltime|
feature}
- The time in milliseconds for redrawing the display. This applies to
- searching for patterns for 'hlsearch' and |:match| highlighting.
+ Time in milliseconds for redrawing the display. Applies to
+ 'hlsearch', 'inccommand' and |:match| highlighting.
When redrawing takes more than this many milliseconds no further
matches will be highlighted. This is used to avoid that Vim hangs
when using a very complicated pattern.
@@ -5455,8 +5409,7 @@ A jump table for the options with a short description can be found at |Q_op|.
The |FilterReadPre|, |FilterReadPost| and |FilterWritePre|,
|FilterWritePost| autocommands event are not triggered when
'shelltemp' is off.
- The `system()` function does not respect this option and always uses
- temp files.
+ |system()| does not respect this option, it always uses pipes.
*'shellxescape'* *'sxe'*
'shellxescape' 'sxe' string (default: "";
@@ -5825,9 +5778,6 @@ A jump table for the options with a short description can be found at |Q_op|.
(_xx is an underscore, two letters and followed by a non-letter).
This is mainly for testing purposes. You must make sure the correct
encoding is used, Vim doesn't check it.
- When 'encoding' is set the word lists are reloaded. Thus it's a good
- idea to set 'spelllang' after setting 'encoding' to avoid loading the
- files twice.
How the related spell files are found is explained here: |spell-load|.
If the |spellfile.vim| plugin is active and you use a language name
@@ -6561,7 +6511,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'ttyfast'* *'tf'* *'nottyfast'* *'notf'*
'ttyfast' 'tf' Removed. |vim-differences| {Nvim}
- *'undodir'* *'udir'* *E926*
+ *'undodir'* *'udir'* *E5003*
'undodir' 'udir' string (default "$XDG_DATA_HOME/nvim/undo")
global
{only when compiled with the |+persistent_undo| feature}
diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt
index a8b5966950..3cd53e3e50 100644
--- a/runtime/doc/provider.txt
+++ b/runtime/doc/provider.txt
@@ -48,11 +48,9 @@ Note: The `--upgrade` flag ensures you have the latest version even if
PYTHON PROVIDER CONFIGURATION ~
*g:python_host_prog*
-Set `g:python_host_prog` to point Nvim to a specific Python 2 interpreter: >
- let g:python_host_prog = '/path/to/python'
-<
*g:python3_host_prog*
-Set `g:python3_host_prog` to point Nvim to a specific Python 3 interpreter: >
+Program to use for evaluating Python code. Setting this makes startup faster. >
+ let g:python_host_prog = '/path/to/python'
let g:python3_host_prog = '/path/to/python3'
<
*g:loaded_python_provider*
@@ -62,16 +60,6 @@ To disable Python 2 support: >
*g:loaded_python3_provider*
To disable Python 3 support: >
let g:loaded_python3_provider = 1
-<
- *g:python_host_skip_check*
-Set `g:python_host_skip_check` to disable the Python 2 interpreter check.
-Note: This requires you to install the python-neovim module properly. >
- let g:python_host_skip_check = 1
-<
- *g:python3_host_skip_check*
-Set `g:python3_host_skip_check` to disable the Python 3 interpreter check.
-Note: This requires you to install the python3-neovim module properly. >
- let g:python3_host_skip_check = 1
==============================================================================
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt
index 44d68c7b38..7c1fc30eba 100644
--- a/runtime/doc/quickfix.txt
+++ b/runtime/doc/quickfix.txt
@@ -53,6 +53,10 @@ command with 'l'.
If the current window was closed by an |autocommand| while processing a
location list command, it will be aborted.
+ *E925* *E926*
+If the current quickfix or location list was changed by an |autocommand| while
+processing a quickfix or location list command, it will be aborted.
+
*:cc*
:cc[!] [nr] Display error [nr]. If [nr] is omitted, the same
error is displayed again. Without [!] this doesn't
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 308fa90ab3..4030c7a681 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1570,15 +1570,6 @@ as Fvwm2 configuration files, add the following: >
:au! BufNewFile,BufRead /etc/X11/fvwm2/* let b:fvwm_version = 2 |
\ set filetype=fvwm
-If you'd like Vim to highlight all valid color names, tell it where to
-find the color database (rgb.txt) on your system. Do this by setting
-"rgb_file" to its location. Assuming your color database is located
-in /usr/X11/lib/X11/, you should add the line >
-
- :let rgb_file = "/usr/X11/lib/X11/rgb.txt"
-
-to your vimrc file.
-
GSP *gsp.vim* *ft-gsp-syntax*
@@ -4852,6 +4843,9 @@ SignColumn column where |signs| are displayed
*hl-IncSearch*
IncSearch 'incsearch' highlighting; also used for the text replaced with
":s///c"
+ *hl-Substitute*
+Substitute |:substitute| replacement text highlighting
+
*hl-LineNr*
LineNr Line number for ":number" and ":#" commands, and when 'number'
or 'relativenumber' option is set.
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 4d3ad49f1f..2896611274 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -592,6 +592,7 @@ String manipulation: *string-functions*
match() position where a pattern matches in a string
matchend() position where a pattern match ends in a string
matchstr() match of a pattern in a string
+ matchstrpos() match and postions of a pattern in a string
matchlist() like matchstr() and also return submatches
stridx() first index of a short string in a long string
strridx() last index of a short string in a long string
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index a1bf379d86..3c1472446d 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -255,14 +255,20 @@ g8 Print the hex values of the bytes used in the
backslashes are before the newline, only one is
removed.
- On Unix the command normally runs in a non-interactive
- shell. If you want an interactive shell to be used
- (to use aliases) set 'shellcmdflag' to "-ic".
+ The command runs in a non-interactive shell connected
+ to a pipe (not a terminal). Use |:terminal| to run an
+ interactive shell connected to a terminal.
+
For Win32 also see |:!start|.
After the command has been executed, the timestamp and
size of the current file is checked |timestamp|.
+ If the command produces too much output some lines may
+ be skipped so the command can execute quickly. No
+ data is lost, this only affects the display. The last
+ few lines are always displayed (never skipped).
+
Vim redraws the screen after the command is finished,
because it may have printed any text. This requires a
hit-enter prompt, so that you can read any messages.
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index f1adffc30e..7ccdfd2bdd 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -40,7 +40,6 @@ these differences.
- 'complete' doesn't include "i"
- 'directory' defaults to ~/.local/share/nvim/swap// (|xdg|), auto-created
- 'display' defaults to "lastline"
-- 'encoding' defaults to "utf-8"
- 'formatoptions' defaults to "tcqj"
- 'history' defaults to 10000 (the maximum)
- 'hlsearch' is set by default
@@ -64,7 +63,7 @@ these differences.
3. New Features *nvim-features*
-MAJOR FEATURES ~
+MAJOR COMPONENTS ~
Embedded terminal emulator |terminal-emulator|
RPC API |RPC|
@@ -85,25 +84,29 @@ avoids features that cannot be provided on all platforms--instead that is
delegated to external plugins/extensions.
-OTHER FEATURES ~
+ARCHITECTURE ~
+
+External plugins run in separate processes. |remote-plugin| This improves
+stability and allows those plugins to perform tasks without blocking the
+editor. Even "legacy" Python and Ruby plugins which use the old Vim interfaces
+(|if_py| and |if_ruby|) run out-of-process.
-|bracketed-paste-mode| is built-in and enabled by default.
-Meta (alt) chords are recognized (even in the terminal).
- <M-1>, <M-2>, ...
- <M-BS>, <M-Del>, <M-Ins>, ...
- <M-/>, <M-\>, ...
- <M-Space>, <M-Enter>, <M-=>, <M-->, <M-?>, <M-$>, ...
+FEATURES ~
+
+|bracketed-paste-mode| is built-in and enabled by default.
- Note: Meta chords are case-sensitive (<M-a> is distinguished from <M-A>).
+|META| (ALT) chords are recognized, even in the terminal. Any |<M-| mapping
+will work. Some examples: <M-1>, <M-2>, <M-BS>, <M-Del>, <M-Ins>, <M-/>,
+<M-\>, <M-Space>, <M-Enter>, <M-=>, <M-->, <M-?>, <M-$>, ...
+META chords are case-sensitive: <M-a> and <M-A> are two different keycodes.
Some `CTRL-SHIFT-...` key chords are distinguished from `CTRL-...` variants
(even in the terminal). Specifically, the following are known to work:
- <C-Tab>, <C-S-Tab>
- <C-BS>, <C-S-BS>
- <C-Enter>, <C-S-Enter>
+ <C-Tab>, <C-S-Tab>, <C-BS>, <C-S-BS>, <C-Enter>, <C-S-Enter>
Options:
+ 'inccommand' shows results while typing a |:substitute| command
'statusline' supports unlimited alignment sections
'tabline' %@Func@foo%X can call any function on mouse-click
@@ -123,16 +126,14 @@ Functions:
|msgpackdump()|, |msgpackparse()| provide msgpack de/serialization
Events:
- |TabNew|
|TabNewEntered|
- |TabClosed|
- |TermOpen|
|TermClose|
+ |TermOpen|
|TextYankPost|
Highlight groups:
- |hl-EndOfBuffer|
|hl-QuickFixLine|
+ |hl-Substitute|
|hl-TermCursor|
|hl-TermCursorNC|
@@ -154,6 +155,10 @@ are always available and may be used simultaneously in separate plugins. The
|system()| does not support writing/reading "backgrounded" commands. |E5677|
+Nvim may throttle (skip) messages from shell commands (|:!|, |:grep|, |:make|)
+if there is too much output. No data is lost, this only affects display and
+makes things faster. |:terminal| output is never throttled.
+
|mkdir()| behaviour changed:
1. Assuming /tmp/foo does not exist and /tmp can be written to
mkdir('/tmp/foo/bar', 'p', 0700) will create both /tmp/foo and /tmp/foo/bar
@@ -162,7 +167,7 @@ are always available and may be used simultaneously in separate plugins. The
'p')) mkdir() will silently exit. In Vim this was an error.
3. mkdir() error messages now include strerror() text when mkdir fails.
-'encoding' cannot be changed after startup.
+'encoding' is always "utf-8".
|string()| and |:echo| behaviour changed:
1. No maximum recursion depth limit is applied to nested container
@@ -269,6 +274,7 @@ Highlight groups:
Other options:
'antialias'
'cpoptions' ("g", "w", "H", "*", "-", "j", and all POSIX flags were removed)
+ 'encoding' ("utf-8" is always used)
'guioptions' "t" flag was removed
*'guipty'* (Nvim uses pipes and PTYs consistently on all platforms.)
*'imactivatefunc'* *'imaf'*
@@ -298,6 +304,7 @@ Other commands:
:mode (no longer accepts an argument)
:open
:shell
+ :smile
:tearoff
Other compile-time features:
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim
index f6fefd0155..63bafa1925 100644
--- a/runtime/ftplugin/man.vim
+++ b/runtime/ftplugin/man.vim
@@ -6,22 +6,10 @@ if exists('b:did_ftplugin') || &filetype !=# 'man'
endif
let b:did_ftplugin = 1
-let s:pager = 0
-
-if has('vim_starting')
- let s:pager = 1
- " remove all those backspaces
- silent execute 'keeppatterns keepjumps %substitute,.\b,,e'.(&gdefault?'':'g')
- if getline(1) =~# '^\s*$'
- silent keepjumps 1delete _
- else
- keepjumps 1
- endif
- " This is not perfect. See `man glDrawArraysInstanced`. Since the title is
- " all caps it is impossible to tell what the original capitilization was.
- let ref = tolower(matchstr(getline(1), '^\S\+'))
- let b:man_sect = man#extract_sect_and_name_ref(ref)[0]
- execute 'silent file man://'.ref
+let s:pager = !exists('b:man_sect')
+
+if s:pager
+ call man#init_pager()
endif
setlocal buftype=nofile
diff --git a/runtime/syntax/man.vim b/runtime/syntax/man.vim
index 4a527dd350..819b2adc31 100644
--- a/runtime/syntax/man.vim
+++ b/runtime/syntax/man.vim
@@ -18,6 +18,9 @@ highlight default link manOptionDesc Constant
highlight default link manReference PreProc
highlight default link manSubHeading Function
+if !exists('b:man_sect')
+ call man#init_pager()
+endif
if b:man_sect =~# '^[23]'
syntax include @c $VIMRUNTIME/syntax/c.vim
syntax match manCFuncDefinition display '\<\h\w*\>\ze\(\s\|\n\)*(' contained
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index 32e871ea79..9c827b426e 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -1,9 +1,4 @@
" Vim syntax file
-" Language: Vim 7.4 script
-" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: March 29, 2016
-" Version: 7.4-45
-" Automatically generated keyword lists: {{{1
" #############################################################################
" #############################################################################
@@ -61,7 +56,7 @@ syn keyword vimGroup contained Comment Constant String Character Number Boolean
syn keyword vimHLGroup contained ColorColumn Cursor CursorColumn CursorIM CursorLine CursorLineNr DiffAdd DiffChange DiffDelete DiffText Directory ErrorMsg FoldColumn Folded IncSearch LineNr MatchParen Menu ModeMsg MoreMsg NonText Normal Pmenu PmenuSbar PmenuSel PmenuThumb Question Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC TabLine TabLineFill TabLineSel Title Tooltip VertSplit Visual WarningMsg WildMenu
syn match vimHLGroup contained "Conceal"
syn keyword vimOnlyHLGroup contained VisualNOS
-syn keyword nvimHLGroup contained EndOfBuffer TermCursor TermCursorNC QuickFixLine
+syn keyword nvimHLGroup contained EndOfBuffer Substitute TermCursor TermCursorNC QuickFixLine
"}}}2
syn case match
" Special Vim Highlighting (not automatic) {{{1