Skip to content

Commit 5f148ec

Browse files
committed
Update runtime files.
1 parent 304563c commit 5f148ec

8 files changed

Lines changed: 229 additions & 183 deletions

File tree

runtime/doc/channel.txt

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*channel.txt* For Vim version 7.4. Last change: 2016 Mar 03
1+
*channel.txt* For Vim version 7.4. Last change: 2016 Mar 06
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -467,6 +467,9 @@ For example, to start a job and write its output in buffer "dummy": >
467467
\ {'out-io': 'buffer', 'out-name': 'dummy'})
468468
sbuf dummy
469469
470+
471+
Job input from a buffer ~
472+
470473
To run a job that reads from a buffer: >
471474
let job = job_start({command},
472475
\ {'in-io': 'buffer', 'in-name': 'mybuffer'})
@@ -478,10 +481,10 @@ be loaded when job_start() is called.
478481
By default this reads the whole buffer. This can be changed with the "in-top"
479482
and "in-bot" options.
480483

481-
TODO
482-
A special mode is when "in-top" is set to zero and "in-bot" is not set: The
483-
last-but-one line will be send to the job stdin. This allows for editing the
484-
last line and sending it when pressing Enter.
484+
A special mode is when "in-top" is set to zero and "in-bot" is not set: Every
485+
time a line is added to the buffer, the last-but-one line will be send to the
486+
job stdin. This allows for editing the last line and sending it when pressing
487+
Enter.
485488

486489
TODO:
487490
To run a job and read its output once it is done: >
@@ -568,7 +571,7 @@ TODO: *job-term*
568571
"in-io": "buffer" stdin reads from a buffer
569572
"in-top": number when using "buffer": first line to send (default: 1)
570573
"in-bot": number when using "buffer": last line to send (default: last)
571-
"in-name": "/path/file" the name of he file or buffer to read from
574+
"in-name": "/path/file" the name of the file or buffer to read from
572575
"in-buf": number the number of the buffer to read from TODO
573576

574577
*job-out-io*
@@ -588,8 +591,12 @@ TODO: *job-term*
588591
"err-name": "/path/file" the name of the file or buffer to write to
589592
"err-buf": number the number of the buffer to write to TODO
590593

591-
When the IO mode is "buffer" and there is a callback, the text is appended to
592-
the buffer before invoking the callback.
594+
When the out-io or err-io mode is "buffer" and there is a callback, the text
595+
is appended to the buffer before invoking the callback.
596+
597+
When a buffer is used both for input and output, the output lines are put
598+
above the last line, since the last line is what is written to the channel
599+
input. Otherwise lines are appened below the last line.
593600

594601
When using JS or JSON mode with "buffer", only messages with zero or negative
595602
ID will be added to the buffer, after decoding + encoding. Messages with a

runtime/doc/eval.txt

Lines changed: 49 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 7.4. Last change: 2016 Mar 03
1+
*eval.txt* For Vim version 7.4. Last change: 2016 Mar 07
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1817,24 +1817,24 @@ byteidxcomp( {expr}, {nr}) Number byte index of {nr}'th char in {expr}
18171817
call( {func}, {arglist} [, {dict}])
18181818
any call {func} with arguments {arglist}
18191819
ceil( {expr}) Float round {expr} up
1820-
ch_close( {channel}) none close {channel}
1821-
ch_evalexpr( {channel}, {expr} [, {options}])
1822-
any evaluate {expr} on JSON {channel}
1823-
ch_evalraw( {channel}, {string} [, {options}])
1824-
any evaluate {string} on raw {channel}
1825-
ch_getbufnr( {channel}, {what}) Number get buffer number for {channel}/{what}
1820+
ch_close( {handle}) none close {handle}
1821+
ch_evalexpr( {handle}, {expr} [, {options}])
1822+
any evaluate {expr} on JSON {handle}
1823+
ch_evalraw( {handle}, {string} [, {options}])
1824+
any evaluate {string} on raw {handle}
1825+
ch_getbufnr( {handle}, {what}) Number get buffer number for {handle}/{what}
18261826
ch_getjob( {channel}) Job get the Job of {channel}
1827-
ch_log( {msg} [, {channel}]) none write {msg} in the channel log file
1827+
ch_log( {msg} [, {handle}]) none write {msg} in the channel log file
18281828
ch_logfile( {fname} [, {mode}]) none start logging channel activity
18291829
ch_open( {address} [, {options}]) Channel open a channel to {address}
1830-
ch_read( {channel} [, {options}]) String read from {channel}
1831-
ch_readraw( {channel} [, {options}]) String read raw from {channel}
1832-
ch_sendexpr( {channel}, {expr} [, {options}])
1833-
any send {expr} over JSON {channel}
1834-
ch_sendraw( {channel}, {string} [, {options}])
1835-
any send {string} over raw {channel}
1836-
ch_setoptions( {channel}, {options}) none set options for {channel}
1837-
ch_status( {channel}) String status of {channel}
1830+
ch_read( {handle} [, {options}]) String read from {handle}
1831+
ch_readraw( {handle} [, {options}]) String read raw from {handle}
1832+
ch_sendexpr( {handle}, {expr} [, {options}])
1833+
any send {expr} over JSON {handle}
1834+
ch_sendraw( {handle}, {string} [, {options}])
1835+
any send {string} over raw {handle}
1836+
ch_setoptions( {handle}, {options}) none set options for {handle}
1837+
ch_status( {handle}) String status of {handle}
18381838
changenr() Number current change number
18391839
char2nr( {expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr}
18401840
cindent( {lnum}) Number C indent for line {lnum}
@@ -2693,8 +2693,9 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
26932693
don't fit, a vertical layout is used anyway. For some systems
26942694
the horizontal layout is always used.
26952695

2696-
ch_close({channel}) *ch_close()*
2697-
Close {channel}. See |channel-close|.
2696+
ch_close({handle}) *ch_close()*
2697+
Close {handle}. See |channel-close|.
2698+
{handle} can be Channel or a Job that has a Channel.
26982699

26992700
Note that a channel is closed in three stages:
27002701
- The I/O ends, log message: "Closing channel". There can
@@ -2705,10 +2706,11 @@ ch_close({channel}) *ch_close()*
27052706

27062707
{only available when compiled with the |+channel| feature}
27072708

2708-
ch_evalexpr({channel}, {expr} [, {options}]) *ch_evalexpr()*
2709-
Send {expr} over {channel}. The {expr} is encoded
2709+
ch_evalexpr({handle}, {expr} [, {options}]) *ch_evalexpr()*
2710+
Send {expr} over {handle}. The {expr} is encoded
27102711
according to the type of channel. The function cannot be used
27112712
with a raw channel. See |channel-use|.
2713+
{handle} can be Channel or a Job that has a Channel.
27122714
*E917*
27132715
{options} must be a Dictionary. It must not have a "callback"
27142716
entry. It can have a "timeout" entry.
@@ -2719,8 +2721,10 @@ ch_evalexpr({channel}, {expr} [, {options}]) *ch_evalexpr()*
27192721

27202722
{only available when compiled with the |+channel| feature}
27212723

2722-
ch_evalraw({channel}, {string} [, {options}]) *ch_evalraw()*
2723-
Send {string} over {channel}.
2724+
ch_evalraw({handle}, {string} [, {options}]) *ch_evalraw()*
2725+
Send {string} over {handle}.
2726+
{handle} can be Channel or a Job that has a Channel.
2727+
27242728
Works like |ch_evalexpr()|, but does not encode the request or
27252729
decode the response. The caller is responsible for the
27262730
correct contents. Also does not add a newline for a channel
@@ -2730,8 +2734,9 @@ ch_evalraw({channel}, {string} [, {options}]) *ch_evalraw()*
27302734

27312735
{only available when compiled with the |+channel| feature}
27322736

2733-
ch_getbufnr({channel}, {what}) *ch_getbufnr()*
2734-
Get the buffer number that {channel} is using for {what}.
2737+
ch_getbufnr({handle}, {what}) *ch_getbufnr()*
2738+
Get the buffer number that {handle} is using for {what}.
2739+
{handle} can be Channel or a Job that has a Channel.
27352740
{what} can be "err" for stderr, "out" for stdout or empty for
27362741
socket output.
27372742
Returns -1 when there is no buffer.
@@ -2745,11 +2750,13 @@ ch_getjob({channel}) *ch_getjob()*
27452750
{only available when compiled with the |+channel| and
27462751
|+job| features}
27472752

2748-
ch_log({msg} [, {channel}]) *ch_log()*
2753+
ch_log({msg} [, {handle}]) *ch_log()*
27492754
Write {msg} in the channel log file, if it was opened with
27502755
|ch_logfile()|.
2751-
When {channel} is passed the channel number is used for the
2752-
message. {channel} must be an open channel.
2756+
When {handle} is passed the channel number is used for the
2757+
message.
2758+
{handle} can be Channel or a Job that has a Channel. The
2759+
Channel must open.
27532760

27542761
ch_logfile({fname} [, {mode}]) *ch_logfile()*
27552762
Start logging channel activity to {fname}.
@@ -2785,8 +2792,9 @@ ch_open({address} [, {options}]) *ch_open()*
27852792
Default: 2000.
27862793
{only available when compiled with the |+channel| feature}
27872794

2788-
ch_read({channel} [, {options}]) *ch_read()*
2789-
Read from {channel} and return the received message.
2795+
ch_read({handle} [, {options}]) *ch_read()*
2796+
Read from {handle} and return the received message.
2797+
{handle} can be Channel or a Job that has a Channel.
27902798

27912799
This uses the channel timeout. When there is nothing to read
27922800
within that time an empty string is returned. To specify a
@@ -2806,14 +2814,15 @@ ch_read({channel} [, {options}]) *ch_read()*
28062814
For a JS or JSON channel this returns one decoded message.
28072815
This includes any sequence number.
28082816

2809-
ch_readraw({channel} [, {options}]) *ch_readraw()*
2817+
ch_readraw({handle} [, {options}]) *ch_readraw()*
28102818
Like ch_read() but for a JS and JSON channel does not decode
28112819
the message.
28122820

2813-
ch_sendexpr({channel}, {expr} [, {options}]) *ch_sendexpr()*
2814-
Send {expr} over {channel}. The {expr} is encoded
2821+
ch_sendexpr({handle}, {expr} [, {options}]) *ch_sendexpr()*
2822+
Send {expr} over {handle}. The {expr} is encoded
28152823
according to the type of channel. The function cannot be used
28162824
with a raw channel. See |channel-use|. *E912*
2825+
{handle} can be Channel or a Job that has a Channel.
28172826

28182827
{options} must be a Dictionary. The "callback" item is a
28192828
Funcref or the name of a function it is invoked when the
@@ -2823,8 +2832,8 @@ ch_sendexpr({channel}, {expr} [, {options}]) *ch_sendexpr()*
28232832

28242833
{only available when compiled with the |+channel| feature}
28252834

2826-
ch_sendraw({channel}, {string} [, {options}]) *ch_sendraw()*
2827-
Send {string} over {channel}.
2835+
ch_sendraw({handle}, {string} [, {options}]) *ch_sendraw()*
2836+
Send {string} over {handle}.
28282837
Works like |ch_sendexpr()|, but does not encode the request or
28292838
decode the response. The caller is responsible for the
28302839
correct contents. Also does not add a newline for a channel
@@ -2834,24 +2843,26 @@ ch_sendraw({channel}, {string} [, {options}]) *ch_sendraw()*
28342843

28352844
{only available when compiled with the |+channel| feature}
28362845

2837-
ch_setoptions({channel}, {options}) *ch_setoptions()*
2838-
Set options on {channel}:
2846+
ch_setoptions({handle}, {options}) *ch_setoptions()*
2847+
Set options on {handle}:
28392848
"callback" the channel callback
28402849
"timeout" default read timeout in msec
28412850
"mode" mode for the whole channel
28422851
See |ch_open()| for more explanation.
2852+
{handle} can be Channel or a Job that has a Channel.
28432853

28442854
Note that changing the mode may cause queued messages to be
28452855
lost.
28462856

28472857
These options cannot be changed:
28482858
"waittime" only applies to "ch_open()|
28492859

2850-
ch_status({channel}) *ch_status()*
2851-
Return the status of {channel}:
2860+
ch_status({handle}) *ch_status()*
2861+
Return the status of {handle}:
28522862
"fail" failed to open the channel
28532863
"open" channel can be used
28542864
"closed" channel can not be used
2865+
{handle} can be Channel or a Job that has a Channel.
28552866

28562867
*copy()*
28572868
copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't

runtime/doc/os_win32.txt

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*os_win32.txt* For Vim version 7.4. Last change: 2014 Sep 25
1+
*os_win32.txt* For Vim version 7.4. Last change: 2016 Mar 05
22

33

44
VIM REFERENCE MANUAL by George Reilly
@@ -96,6 +96,31 @@ The directory of the Vim executable is appended to $PATH. This is mostly to
9696
make "!xxd" work, as it is in the Tools menu. And it also means that when
9797
executable() returns 1 the executable can actually be executed.
9898

99+
Quotes in file names *win32-quotes*
100+
101+
Quotes inside a file name (or any other command line argument) can be escaped
102+
with a backslash. E.g. >
103+
vim -c "echo 'foo\"bar'"
104+
105+
Alternatively use three quotes to get one: >
106+
vim -c "echo 'foo"""bar'"
107+
108+
The quotation rules are:
109+
110+
1. A `"` starts quotation.
111+
2. Another `"` or `""` ends quotation. If the quotation ends with `""`, a `"`
112+
is produced at the end of the quoted string.
113+
114+
Examples, with [] around an argument:
115+
"foo" -> [foo]
116+
"foo"" -> [foo"]
117+
"foo"bar -> [foobar]
118+
"foo" bar -> [foo], [bar]
119+
"foo""bar -> [foo"bar]
120+
"foo"" bar -> [foo"], [bar]
121+
"foo"""bar" -> [foo"bar]
122+
123+
99124
==============================================================================
100125
3. Restore screen contents *win32-restore*
101126

runtime/doc/repeat.txt

Lines changed: 52 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*repeat.txt* For Vim version 7.4. Last change: 2016 Mar 04
1+
*repeat.txt* For Vim version 7.4. Last change: 2016 Mar 07
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -420,57 +420,79 @@ Rationale:
420420
A Vim package is a directory that contains one or more plugins. The
421421
advantages over normal plugins:
422422
- A package can be downloaded as an archive and unpacked in its own directory.
423-
That makes it easy to updated and/or remove.
423+
Thus the files are not mixed with files of other plugins. That makes it
424+
easy to update and remove.
424425
- A package can be a git, mercurial, etc. repository. That makes it really
425426
easy to update.
426427
- A package can contain multiple plugins that depend on each other.
427428
- A package can contain plugins that are automatically loaded on startup and
428-
ones that are only loaded when needed with `:loadplugin`.
429+
ones that are only loaded when needed with `:packadd`.
430+
431+
432+
Using a package and loading automatically ~
429433

430434
Let's assume your Vim files are in the "~/.vim" directory and you want to add a
431-
package from a zip archive "/tmp/mypack.zip":
432-
% mkdir -p ~/.vim/pack/my
433-
% cd ~/.vim/pack/my
434-
% unzip /tmp/mypack.zip
435+
package from a zip archive "/tmp/foopack.zip":
436+
% mkdir -p ~/.vim/pack/foo
437+
% cd ~/.vim/pack/foo
438+
% unzip /tmp/foopack.zip
435439

436-
The directory name "my" is arbitrary, you can pick anything you like.
440+
The directory name "foo" is arbitrary, you can pick anything you like.
437441

438442
You would now have these files under ~/.vim:
439-
pack/my/README.txt
440-
pack/my/ever/always/plugin/always.vim
441-
pack/my/ever/always/syntax/always.vim
442-
pack/my/opt/mydebug/plugin/debugger.vim
443+
pack/foo/README.txt
444+
pack/foo/ever/foobar/plugin/foo.vim
445+
pack/foo/ever/foobar/syntax/some.vim
446+
pack/foo/opt/foodebug/plugin/debugger.vim
447+
448+
When Vim starts up, after processing your .vimrc, it scans all directories in
449+
'packpath' for plugins under the "pack/*/ever" directory and loads them. The
450+
directory is added to 'runtimepath'.
451+
452+
In the example Vim will find "pack/foo/ever/foobar/plugin/foo.vim" and adds
453+
"~/.vim/pack/foo/ever/foobar" to 'runtimepath'.
454+
455+
If the "foobar" plugin kicks in and sets the 'filetype' to "some", Vim will
456+
find the syntax/some.vim file, because its directory is in 'runtimepath'.
457+
458+
Vim will also load ftdetect files, if there are any.
459+
460+
Note that the files under "pack/foo/opt" or not loaded automatically, only the
461+
ones under "pack/foo/ever". See |pack-add| below for how the "opt" directory
462+
is used.
463+
464+
Loading packages will not happen if loading plugins is disabled, see
465+
|load-plugins|.
466+
467+
468+
Using a single plugin and loading it automatically ~
443469

444470
If you don't have a package but a single plugin, you need to create the extra
445471
directory level:
446-
% mkdir -p ~/.vim/pack/my/ever/always
447-
% cd ~/.vim/pack/my/ever/always
448-
% unzip /tmp/myplugin.zip
449-
450-
When Vim starts up it scans all directories in 'packpath' for plugins under the
451-
"ever" directory and loads them. When found that directory is added to
452-
'runtimepath'.
472+
% mkdir -p ~/.vim/pack/foo/ever/foobar
473+
% cd ~/.vim/pack/foo/ever/foobar
474+
% unzip /tmp/someplugin.zip
453475

454-
In the example Vim will find "my/ever/always/plugin/always.vim" and adds
455-
"~/.vim/pack/my/ever/always" to 'runtimepath'.
476+
You would now have these files:
477+
pack/foo/ever/foobar/plugin/foo.vim
478+
pack/foo/ever/foobar/syntax/some.vim
456479

457-
If the "always" plugin kicks in and sets the 'filetype' to "always", Vim will
458-
find the syntax/always.vim file, because its directory is in 'runtimepath'.
480+
From here it works like above.
459481

460-
Vim will also load ftdetect files, like with |:packadd|.
461482

483+
Optional plugins ~
462484
*pack-add*
463485
To load an optional plugin from a pack use the `:packadd` command: >
464-
:packadd mydebug
465-
This could be done inside always.vim, if some conditions are met.
466-
Or you could add this command to your |.vimrc|.
486+
:packadd foodebug
487+
This searches for "pack/*/opt/foodebug" in 'packpath' and will find
488+
~/.vim/pack/foo/opt/foodebug/plugin/debugger.vim and source it.
489+
490+
This could be done inside always.vim, if some conditions are met. Or you
491+
could add this command to your |.vimrc|.
467492

468493
It is perfectly normal for a package to only have files in the "opt"
469494
directory. You then need to load each plugin when you want to use it.
470495

471-
Loading packages will not happen if loading plugins is disabled, see
472-
|load-plugins|.
473-
474496
==============================================================================
475497
6. Debugging scripts *debug-scripts*
476498

0 commit comments

Comments
 (0)