-*autocmd.txt* For Vim version 8.1. Last change: 2019 Jun 26
+*autocmd.txt* For Vim version 8.1. Last change: 2019 Sep 16
VIM REFERENCE MANUAL by Bram Moolenaar
ColorSchemePre Before loading a color scheme. |:colorscheme|
Useful to setup removing things added by a
color scheme, before another one is loaded.
-CompleteChanged *CompleteChanged*
+CompleteChanged *CompleteChanged*
After each time the Insert mode completion
menu changed. Not fired on popup menu hide,
use |CompleteDone| for that. Never triggered
current buffer. The following values of
|v:event| can be used to determine the operation
that triggered this autocmd:
- operator The operation performed.
- regcontents Text that was stored in the
+ operator The operation performed.
+ regcontents Text that was stored in the
register, as a list of lines,
like with: >
getreg(r, 1, 1)
if v:vim_did_enter
call s:init()
else
- au VimEnter * call s:init()
+ au VimEnter * call s:init()
endif
< *VimLeave*
VimLeave Before exiting Vim, just after writing the
-*eval.txt* For Vim version 8.1. Last change: 2019 Sep 15
+*eval.txt* For Vim version 8.1. Last change: 2019 Sep 19
VIM REFERENCE MANUAL by Bram Moolenaar
pathshorten({expr}) String shorten directory names in a path
perleval({expr}) any evaluate |Perl| expression
popup_atcursor({what}, {options}) Number create popup window near the cursor
-popup_beval({what}, {options}) Number create popup window for 'ballooneval'
+popup_beval({what}, {options}) Number create popup window for 'ballooneval'
popup_clear() none close all popup windows
popup_close({id} [, {result}]) none close popup window {id}
popup_create({what}, {options}) Number create a popup window
current state. Mostly useful in callbacks that want to do
work that may not always be safe. Roughly this works like:
- callback uses state() to check if work is safe to do.
- If yes, then do it right away.
- Otherwise add to work queue and add SafeState and/or
- SafeStateAgain autocommand.
- - When SafeState or SafeStateAgain is triggered, check with
- state() if the work can be done now, and if yes remove it
- from the queue and execute.
+ Yes: then do it right away.
+ No: add to work queue and add a |SafeState| and/or
+ |SafeStateAgain| autocommand (|SafeState| triggers at
+ toplevel, |SafeStateAgain| triggers after handling
+ messages and callbacks).
+ - When SafeState or SafeStateAgain is triggered and executes
+ your autocommand, check with `state()` if the work can be
+ done now, and if yes remove it from the queue and execute.
+ Remove the autocommand if the queue is now empty.
Also see |mode()|.
When {what} is given only characters in this string will be
added. E.g, this checks if the screen has scrolled: >
- if state('s') != ''
+ if state('s') == ''
+ " screen has not scrolled
<
These characters indicate the state, generally indicating that
something is busy:
- m halfway a mapping, :normal command, feedkeys() or
- stuffed command
- o operator pending or waiting for a command argument
- a Insert mode autocomplete active
- x executing an autocommand
- w blocked on waiting, e.g. ch_evalexpr() and
- ch_read(), ch_readraw() when reading json.
- S not triggering SafeState or SafeStateAgain
- c callback invoked, including timer (repeats for
- recursiveness up to "ccc")
- s screen has scrolled for messages
+ m halfway a mapping, :normal command, feedkeys() or
+ stuffed command
+ o operator pending or waiting for a command argument,
+ e.g. after |f|
+ a Insert mode autocomplete active
+ x executing an autocommand
+ w blocked on waiting, e.g. ch_evalexpr() and
+ ch_read(), ch_readraw() when reading json.
+ S not triggering SafeState or SafeStateAgain
+ c callback invoked, including timer (repeats for
+ recursiveness up to "ccc")
+ s screen has scrolled for messages
str2float({expr}) *str2float()*
Convert String {expr} to a Float. This mostly works the same
-*options.txt* For Vim version 8.1. Last change: 2019 Sep 09
+*options.txt* For Vim version 8.1. Last change: 2019 Sep 18
VIM REFERENCE MANUAL by Bram Moolenaar
":map <BS> X" to make backspace delete the character in front of the
cursor.
When 'l' is included and it is used after an operator at the end of a
- line then it will not move to the next line. This makes "dl", "cl",
- "yl" etc. work normally.
+ line (not an empty line) then it will not move to the next line. This
+ makes "dl", "cl", "yl" etc. work normally.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
-*repeat.txt* For Vim version 8.1. Last change: 2019 Jun 14
+*repeat.txt* For Vim version 8.1. Last change: 2019 Sep 20
VIM REFERENCE MANUAL by Bram Moolenaar
When {file} contains wildcards it is expanded to all
matching files. Example: >
- :runtime! plugin/*.vim
+ :runtime! plugin/**/*.vim
< This is what Vim uses to load the plugin files when
starting up. This similar command: >
- :runtime plugin/*.vim
+ :runtime plugin/**/*.vim
< would source the first file only.
When 'verbose' is one or higher, there is a message
-*syntax.txt* For Vim version 8.1. Last change: 2019 Jul 15
+*syntax.txt* For Vim version 8.1. Last change: 2019 Sep 19
VIM REFERENCE MANUAL by Bram Moolenaar
number is that redrawing can become slow.
+JSON *json.vim* *ft-json-syntax*
+
+The json syntax file provides syntax highlighting with conceal support by
+default. To disable concealment: >
+ let g:vim_json_conceal = 0
+
+To disable syntax highlighting of errors: >
+ let g:vim_json_warnings = 0
+
+
LACE *lace.vim* *ft-lace-syntax*
Lace (Language for Assembly of Classes in Eiffel) is case insensitive, but the
'go-a' options.txt /*'go-a'*
'go-b' options.txt /*'go-b'*
'go-c' options.txt /*'go-c'*
+'go-d' options.txt /*'go-d'*
'go-e' options.txt /*'go-e'*
'go-f' options.txt /*'go-f'*
'go-g' options.txt /*'go-g'*
SHELL starting.txt /*SHELL*
SQLGetType ft_sql.txt /*SQLGetType*
SQLSetType ft_sql.txt /*SQLSetType*
+SafeState autocmd.txt /*SafeState*
+SafeStateAgain autocmd.txt /*SafeStateAgain*
Select visual.txt /*Select*
Select-mode visual.txt /*Select-mode*
Select-mode-mapping visual.txt /*Select-mode-mapping*
ft-inform-syntax syntax.txt /*ft-inform-syntax*
ft-java-syntax syntax.txt /*ft-java-syntax*
ft-javascript-omni insert.txt /*ft-javascript-omni*
+ft-json-syntax syntax.txt /*ft-json-syntax*
ft-ksh-syntax syntax.txt /*ft-ksh-syntax*
ft-lace-syntax syntax.txt /*ft-lace-syntax*
ft-lex-syntax syntax.txt /*ft-lex-syntax*
js_decode() eval.txt /*js_decode()*
js_encode() eval.txt /*js_encode()*
jsbterm-mouse options.txt /*jsbterm-mouse*
+json.vim syntax.txt /*json.vim*
json_decode() eval.txt /*json_decode()*
json_encode() eval.txt /*json_encode()*
jtags tagsrch.txt /*jtags*
scriptversion-1 eval.txt /*scriptversion-1*
scriptversion-2 eval.txt /*scriptversion-2*
scriptversion-3 eval.txt /*scriptversion-3*
+scriptversion-4 eval.txt /*scriptversion-4*
scroll-binding scroll.txt /*scroll-binding*
scroll-cursor scroll.txt /*scroll-cursor*
scroll-down scroll.txt /*scroll-down*
startup starting.txt /*startup*
startup-options starting.txt /*startup-options*
startup-terminal term.txt /*startup-terminal*
+state() eval.txt /*state()*
static-tag tagsrch.txt /*static-tag*
status-line windows.txt /*status-line*
statusmsg-variable eval.txt /*statusmsg-variable*
-*terminal.txt* For Vim version 8.1. Last change: 2019 Sep 08
+*terminal.txt* For Vim version 8.1. Last change: 2019 Sep 20
VIM REFERENCE MANUAL by Bram Moolenaar
`:Run` [args] run the program with [args] or the previous arguments
`:Arguments` {args} set arguments for the next `:Run`
- *:Break* set a breakpoint at the current line; a sign will be displayed
- *:Clear* delete the breakpoint at the current line
+ *:Break* set a breakpoint at the cursor position
+ :Break {position}
+ set a breakpoint at the specified position
+ *:Clear* delete the breakpoint at the cursor position
*:Step* execute the gdb "step" command
*:Over* execute the gdb "next" command (`:Next` is a Vim command)
-*todo.txt* For Vim version 8.1. Last change: 2019 Sep 10
+*todo.txt* For Vim version 8.1. Last change: 2019 Sep 19
VIM REFERENCE MANUAL by Bram Moolenaar
*known-bugs*
-------------------- Known bugs and current work -----------------------
-Split off part of option.c: #4918
+Add test for state().
+Add test for using SafeState and SafeStateAgain autocommand.
+Then plugin can:
+- When callback is invoked and state() returns non-empty, add to work queue
+- When SafeState autocommand event triggers, process work queue
+
+Fix for "x" should be done by fixing "dl" ? 8.1.2052
+
+'completeopt' "popup" variant that uses a callback after the popup has been
+created, so the contents can be changed. Make it hidden, callback
+or later has to make it visible. #4924 Setting the buffer contents later
+doesn't work well.
Popup windows:
+- Use popup (or popup menu) for command line completion
- Implement flip option
- Why does 'nrformats' leak from the popup window buffer???
Happens in Test_simple_popup() at the second screendump.
E453, E454, E460, E489, E491, E565, E578, E610, E611, E653,
E654, E856, E857, E860, E861, E863, E889, E900
+Improve running tests on MS-Windows: #4922
+
+Patch to properly break CJK lines: #3875
+Ready to include now?
+
Remove check for cmd_silent when calling search_stat()? (Gary Johnson)
undo result wrong: Masato Nishihata, #4798
Difference between two regexp engines: #3373
-Patch to properly break CJK lines: #3875
-Requires more tests. dbcs_ functions are not implemented.
-
Patch to add ch_listen() (Yasuhiro Matsumoto, 2018 Nov 26, #3639)
What is the practical use for this?
MS-Windows: buffer completion doesn't work when using backslash (or slash)
for a path separator. (xtal8, #2201)
-Would be nice for insert mode completion to highlight the text that was added
+Would be nice for Insert mode completion to highlight the text that was added
(and may change when picking another completion).
Test runtime files.
only one of the two ends gets the cchar displayed. (Brett Stahlman, 2010 Aug
21, Ben Fritz, 2010 Sep 14)
-'cursorline' works on a text line only. Add 'cursorscreenline' for
-highlighting the screen line. (Christian Brabandt, 2012 Mar 31)
-
Win32: Patch to use task dialogs when available. (Sergiu Dotenco, 2011 Sep 17)
New feature, requires testing. Made some remarks.
func s:StartDebug_term(dict)
" Open a terminal window without a job, to run the debugged program in.
let s:ptybuf = term_start('NONE', {
- \ 'term_name': 'debugged program',
- \ 'vertical': s:vertical,
- \ })
+ \ 'term_name': 'debugged program',
+ \ 'vertical': s:vertical,
+ \ })
if s:ptybuf == 0
echoerr 'Failed to open the program terminal window'
return
" Create a hidden terminal window to communicate with gdb
let s:commbuf = term_start('NONE', {
- \ 'term_name': 'gdb communication',
- \ 'out_cb': function('s:CommOutput'),
- \ 'hidden': 1,
- \ })
+ \ 'term_name': 'gdb communication',
+ \ 'out_cb': function('s:CommOutput'),
+ \ 'hidden': 1,
+ \ })
if s:commbuf == 0
echoerr 'Failed to open the communication terminal window'
exe 'bwipe! ' . s:ptybuf
let cmd = [g:termdebugger, '-quiet', '-tty', pty] + gdb_args
call ch_log('executing "' . join(cmd) . '"')
let s:gdbbuf = term_start(cmd, {
- \ 'term_finish': 'close',
- \ })
+ \ 'term_finish': 'close',
+ \ })
if s:gdbbuf == 0
echoerr 'Failed to open the gdb terminal window'
call s:CloseBuffers()
let line1 = term_getline(s:gdbbuf, lnum)
let line2 = term_getline(s:gdbbuf, lnum + 1)
if line1 =~ 'new-ui mi '
- " response can be in the same line or the next line
- let response = line1 . line2
- if response =~ 'Undefined command'
- echoerr 'Sorry, your gdb is too old, gdb 7.12 is required'
+ " response can be in the same line or the next line
+ let response = line1 . line2
+ if response =~ 'Undefined command'
+ echoerr 'Sorry, your gdb is too old, gdb 7.12 is required'
call s:CloseBuffers()
- return
- endif
- if response =~ 'New UI allocated'
- " Success!
- break
- endif
+ return
+ endif
+ if response =~ 'New UI allocated'
+ " Success!
+ break
+ endif
elseif line1 =~ 'Reading symbols from' && line2 !~ 'new-ui mi '
" Reading symbols might take a while, try more times
let try_count -= 1
call ch_log('executing "' . join(cmd) . '"')
let s:gdbjob = job_start(cmd, {
- \ 'exit_cb': function('s:EndPromptDebug'),
- \ 'out_cb': function('s:GdbOutCallback'),
- \ })
+ \ 'exit_cb': function('s:EndPromptDebug'),
+ \ 'out_cb': function('s:GdbOutCallback'),
+ \ })
if job_status(s:gdbjob) != "run"
echoerr 'Failed to start gdb'
exe 'bwipe! ' . s:promptbuf
" Unix: Run the debugged program in a terminal window. Open it below the
" gdb window.
belowright let s:ptybuf = term_start('NONE', {
- \ 'term_name': 'debugged program',
- \ })
+ \ 'term_name': 'debugged program',
+ \ })
if s:ptybuf == 0
echoerr 'Failed to open the program terminal window'
call job_stop(s:gdbjob)
if a:quotedText[i] == '\'
let i += 1
if a:quotedText[i] == 'n'
- " drop \n
- let i += 1
- continue
+ " drop \n
+ let i += 1
+ continue
+ elseif a:quotedText[i] == 't'
+ " append \t
+ let i += 1
+ let result .= "\t"
+ continue
endif
endif
let result .= a:quotedText[i]
endif
if msg != ''
if msg =~ '^\(\*stopped\|\*running\|=thread-selected\)'
- call s:HandleCursor(msg)
+ call s:HandleCursor(msg)
elseif msg =~ '^\^done,bkpt=' || msg =~ '^=breakpoint-created,'
- call s:HandleNewBreakpoint(msg)
+ call s:HandleNewBreakpoint(msg)
elseif msg =~ '^=breakpoint-deleted,'
- call s:HandleBreakpointDelete(msg)
+ call s:HandleBreakpointDelete(msg)
elseif msg =~ '^=thread-group-started'
- call s:HandleProgramRun(msg)
+ call s:HandleProgramRun(msg)
elseif msg =~ '^\^done,value='
- call s:HandleEvaluate(msg)
+ call s:HandleEvaluate(msg)
elseif msg =~ '^\^error,msg='
- call s:HandleError(msg)
+ call s:HandleError(msg)
endif
endif
endfor
endfunc
+func s:GotoProgram()
+ if has('win32')
+ if executable('powershell')
+ call system(printf('powershell -Command "add-type -AssemblyName microsoft.VisualBasic;[Microsoft.VisualBasic.Interaction]::AppActivate(%d);"', s:pid))
+ endif
+ else
+ win_gotoid(s:ptywin)
+ endif
+endfunc
+
" Install commands in the current window to control the debugger.
func s:InstallCommands()
let save_cpo = &cpo
set cpo&vim
- command Break call s:SetBreakpoint()
+ command -nargs=? Break call s:SetBreakpoint(<q-args>)
command Clear call s:ClearBreakpoint()
command Step call s:SendCommand('-exec-step')
command Over call s:SendCommand('-exec-next')
command -range -nargs=* Evaluate call s:Evaluate(<range>, <q-args>)
command Gdb call win_gotoid(s:gdbwin)
- command Program call win_gotoid(s:ptywin)
+ command Program call s:GotoProgram()
command Source call s:GotoSourcewinOrCreateIt()
command Winbar call s:InstallWinbar()
let curwinid = win_getid(winnr())
for winid in s:winbar_winids
if win_gotoid(winid)
- aunmenu WinBar.Step
- aunmenu WinBar.Next
- aunmenu WinBar.Finish
- aunmenu WinBar.Cont
- aunmenu WinBar.Stop
- aunmenu WinBar.Eval
+ aunmenu WinBar.Step
+ aunmenu WinBar.Next
+ aunmenu WinBar.Finish
+ aunmenu WinBar.Cont
+ aunmenu WinBar.Stop
+ aunmenu WinBar.Eval
endif
endfor
call win_gotoid(curwinid)
endfunc
" :Break - Set a breakpoint at the cursor position.
-func s:SetBreakpoint()
+func s:SetBreakpoint(at)
" Setting a breakpoint may not work while the program is running.
" Interrupt to make it work.
let do_continue = 0
endif
sleep 10m
endif
+
" Use the fname:lnum format, older gdb can't handle --source.
- call s:SendCommand('-break-insert '
- \ . fnameescape(expand('%:p')) . ':' . line('.'))
+ let at = empty(a:at) ?
+ \ fnameescape(expand('%:p')) . ':' . line('.') : a:at
+ call s:SendCommand('-break-insert ' . at)
if do_continue
call s:SendCommand('-exec-continue')
endif
let idx = 0
for id in s:breakpoint_locations[bploc]
if has_key(s:breakpoints, id)
- " Assume this always works, the reply is simply "^done".
- call s:SendCommand('-break-delete ' . id)
- for subid in keys(s:breakpoints[id])
- exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
- endfor
- unlet s:breakpoints[id]
- unlet s:breakpoint_locations[bploc][idx]
- break
+ " Assume this always works, the reply is simply "^done".
+ call s:SendCommand('-break-delete ' . id)
+ for subid in keys(s:breakpoints[id])
+ exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
+ endfor
+ unlet s:breakpoints[id]
+ unlet s:breakpoint_locations[bploc][idx]
+ break
else
let idx += 1
endif
if lnum =~ '^[0-9]*$'
call s:GotoSourcewinOrCreateIt()
if expand('%:p') != fnamemodify(fname, ':p')
- if &modified
- " TODO: find existing window
- exe 'split ' . fnameescape(fname)
- let s:sourcewin = win_getid(winnr())
- call s:InstallWinbar()
- else
- exe 'edit ' . fnameescape(fname)
- endif
+ if &modified
+ " TODO: find existing window
+ exe 'split ' . fnameescape(fname)
+ let s:sourcewin = win_getid(winnr())
+ call s:InstallWinbar()
+ else
+ exe 'edit ' . fnameescape(fname)
+ endif
endif
exe lnum
exe 'sign unplace ' . s:pc_id
if has_key(s:breakpoints, id)
for [subid, entry] in items(s:breakpoints[id])
if has_key(entry, 'placed')
- exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
- unlet entry['placed']
+ exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
+ unlet entry['placed']
endif
endfor
unlet s:breakpoints[id]
for [id, entries] in items(s:breakpoints)
for [subid, entry] in items(entries)
if entry['fname'] == fname
- call s:PlaceSign(id, subid, entry)
+ call s:PlaceSign(id, subid, entry)
endif
endfor
endfor
for [id, entries] in items(s:breakpoints)
for [subid, entry] in items(entries)
if entry['fname'] == fname
- let entry['placed'] = 0
+ let entry['placed'] = 0
endif
endfor
endfor
" netrwPlugin.vim: Handles file transfer and remote directory listing across a network
" PLUGIN SECTION
-" Date: Feb 08, 2016
+" Date: Feb 08, 2016 (update for gx 2019 Sep 20)
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2013 Charles E. Campbell {{{1
au FileReadCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(1,expand("<amatch>"))|exe "sil doau FileReadPost ".fnameescape(expand("<amatch>"))
au BufWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufWritePre ".fnameescape(expand("<amatch>"))|exe 'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau BufWritePost ".fnameescape(expand("<amatch>"))
au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileWritePre ".fnameescape(expand("<amatch>"))|exe "'[,']".'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau FileWritePost ".fnameescape(expand("<amatch>"))
- try
+ try
au SourceCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("<amatch>"))
- catch /^Vim\%((\a\+)\)\=:E216/
+ catch /^Vim\%((\a\+)\)\=:E216/
au SourcePre ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("<amatch>"))
endtry
augroup END
if !hasmapto('<Plug>NetrwBrowseX')
nmap <unique> gx <Plug>NetrwBrowseX
endif
- nno <silent> <Plug>NetrwBrowseX :call netrw#BrowseX(netrw#GX(),netrw#CheckIfRemote(netrw#GX()))<cr>
+ nno <silent> <Plug>NetrwBrowseX :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())<cr>
endif
if maparg('gx','v') == ""
if !hasmapto('<Plug>NetrwBrowseXVis')
" Unfortunate interaction -- only DechoMsg debugging calls can be safely used here.
" Otherwise, the BufEnter event gets triggered when attempts to write to
" the DBG buffer are made.
-
+
if !exists("s:vimentered")
" If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will,
" and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined.
" Language: JSON
" Maintainer: vacancy
" Previous Maintainer: Eli Parra <eli@elzr.com>
-" Last Change: 2019 Jul 08
+" Last Change: 2019 Sep 17
" Version: 0.12
if !exists("main_syntax")
" Syntax: JSON Keywords
" Separated into a match and region because a region by itself is always greedy
syn match jsonKeywordMatch /"\([^"]\|\\\"\)\+"[[:blank:]\r\n]*\:/ contains=jsonKeyword
-if has('conceal')
+if has('conceal') && (!exists("g:vim_json_conceal") || g:vim_json_conceal==1)
syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ concealends contained
else
syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ contained
" Needs to come after keywords or else a json encoded string will break the
" syntax
syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString
-if has('conceal')
+if has('conceal') && (!exists("g:vim_json_conceal") || g:vim_json_conceal==1)
syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ concealends contains=jsonEscape contained
else
syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=jsonEscape contained