summaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-02-15 22:07:32 +0100
committerBram Moolenaar <Bram@vim.org>2016-02-15 22:07:32 +0100
commit38a55639d603823efcf2d2fdf542dbffdeb60b75 (patch)
treecaf0a634ab061f45cb038e1ef179eab58ac6b902 /runtime/doc
parentd807036d10615b960c814ef3890ecad335b57f56 (diff)
downloadvim-git-38a55639d603823efcf2d2fdf542dbffdeb60b75.tar.gz
Update runtime files.
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/change.txt10
-rw-r--r--runtime/doc/channel.txt346
-rw-r--r--runtime/doc/editing.txt25
-rw-r--r--runtime/doc/eval.txt32
-rw-r--r--runtime/doc/options.txt9
-rw-r--r--runtime/doc/repeat.txt4
-rw-r--r--runtime/doc/tags34
-rw-r--r--runtime/doc/todo.txt155
-rw-r--r--runtime/doc/usr_41.txt7
-rw-r--r--runtime/doc/various.txt3
-rw-r--r--runtime/doc/vi_diff.txt4
11 files changed, 481 insertions, 148 deletions
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index ad80a3781..ae8f4c6e2 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1,4 +1,4 @@
-*change.txt* For Vim version 7.4. Last change: 2016 Jan 31
+*change.txt* For Vim version 7.4. Last change: 2016 Feb 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -98,10 +98,10 @@ These commands delete text. You can repeat them with the `.` command
An exception for the d{motion} command: If the motion is not linewise, the
start and end of the motion are not in the same line, and there are only
-blanks before the start and after the end of the motion, the delete becomes
-linewise. This means that the delete also removes the line of blanks that you
-might expect to remain. Use the |o_v| operator to force the motion to be
-characterwise.
+blanks before the start and there are no non-blanks after the end of the
+motion, the delete becomes linewise. This means that the delete also removes
+the line of blanks that you might expect to remain. Use the |o_v| operator to
+force the motion to be characterwise.
Trying to delete an empty region of text (e.g., "d0" in the first column)
is an error when 'cpoptions' includes the 'E' flag.
diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt
index 236875051..7938087b1 100644
--- a/runtime/doc/channel.txt
+++ b/runtime/doc/channel.txt
@@ -1,4 +1,4 @@
-*channel.txt* For Vim version 7.4. Last change: 2016 Feb 07
+*channel.txt* For Vim version 7.4. Last change: 2016 Feb 15
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -9,36 +9,72 @@
DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT
Vim uses channels to communicate with other processes.
-A channel uses a socket. *socket-interface*
+A channel uses a socket or pipes *socket-interface*
+Jobs can be used to start processes and communicate with them.
Vim current supports up to 10 simultaneous channels.
The Netbeans interface also uses a channel. |netbeans|
-1. Demo |channel-demo|
-2. Opening a channel |channel-open|
-3. Using a JSON or JS channel |channel-use|
-4. Vim commands |channel-commands|
-5. Using a raw channel |channel-use|
-6. Job control |job-control|
+1. Overview |job-channel-overview|
+2. Channel demo |channel-demo|
+3. Opening a channel |channel-open|
+4. Using a JSON or JS channel |channel-use|
+5. Channel commands |channel-commands|
+6. Using a RAW or NL channel |channel-raw|
+7. More channel functions |channel-more|
+8. Starting a job with a channel |job-start|
+9. Starting a job without a channel |job-start-nochannel|
+10. Job options |job-options|
+11. Controlling a job |job-control|
{Vi does not have any of these features}
-{only available when compiled with the |+channel| feature}
+{only when compiled with the |+channel| feature for channel stuff}
+{only when compiled with the |+job| feature for job stuff}
==============================================================================
-1. Demo *channel-demo*
+1. Overview *job-channel-overview*
+
+There are four main types of jobs:
+1. A deamon, serving several Vim instances.
+ Vim connects to it with a socket.
+2. One job working with one Vim instance, asynchronously.
+ Uses a socket or pipes.
+3. A job performing some work for a short time, asynchronously.
+ Uses a socket or pipes.
+4. Running a filter, synchronously.
+ Uses pipes.
+
+For when using sockets See |job-start|, |job-may-start| and |channel-open|.
+For 2 and 3, one or more jobs using pipes, see |job-start|.
+For 4 use the ":{range}!cmd" command, see |filter|.
+
+Over the socket and pipes these protocols are available:
+RAW nothing known, Vim cannot tell where a message ends
+NL every message ends in a NL (newline) character
+JSON JSON encoding |json_encode()|
+JS JavaScript style JSON-like encoding |js_encode()|
+
+Common combination are:
+- Using a job connected through pipes in NL mode. E.g., to run a style
+ checker and receive errors and warnings.
+- Using a deamon, connecting over a socket in JSON mode. E.g. to lookup
+ crosss-refrences in a database.
+
+==============================================================================
+2. Channel demo *channel-demo*
This requires Python. The demo program can be found in
$VIMRUNTIME/tools/demoserver.py
Run it in one terminal. We will call this T1.
Run Vim in another terminal. Connect to the demo server with: >
- let handle = ch_open('localhost:8765')
+ let channel = ch_open('localhost:8765')
In T1 you should see:
=== socket opened === ~
You can now send a message to the server: >
- echo ch_sendexpr(handle, 'hello!')
+ echo ch_sendexpr(channel, 'hello!')
The message is received in T1 and a response is sent back to Vim.
You can see the raw messages in T1. What Vim sends is:
@@ -54,47 +90,63 @@ And you should see the message in Vim. You can move the cursor a word forward:
["normal","w"] ~
To handle asynchronous communication a callback needs to be used: >
- func MyHandler(handle, msg)
+ func MyHandler(channel, msg)
echo "from the handler: " . a:msg
endfunc
- call ch_sendexpr(handle, 'hello!', "MyHandler")
+ call ch_sendexpr(channel, 'hello!', "MyHandler")
+Vim will not wait for a response. Now the server can send the response later
+and MyHandler will be invoked.
Instead of giving a callback with every send call, it can also be specified
when opening the channel: >
- call ch_close(handle)
- let handle = ch_open('localhost:8765', {'callback': "MyHandler"})
- call ch_sendexpr(handle, 'hello!', 0)
+ call ch_close(channel)
+ let channel = ch_open('localhost:8765', {'callback': "MyHandler"})
+ call ch_sendexpr(channel, 'hello!', 0)
==============================================================================
-2. Opening a channel *channel-open*
+3. Opening a channel *channel-open*
To open a channel: >
- let handle = ch_open({address} [, {argdict}])
+ let channel = ch_open({address} [, {options}])
+
+Use |ch_status()| to see if the channel could be opened.
{address} has the form "hostname:port". E.g., "localhost:8765".
-{argdict} is a dictionary with optional entries:
+{options} is a dictionary with optional entries:
"mode" can be: *channel-mode*
"json" - Use JSON, see below; most convenient way. Default.
"js" - Use JavaScript encoding, more efficient than JSON.
+ "nl" - Use messages that end in a NL character
"raw" - Use raw messages
*channel-callback*
-"callback" is a function that is called when a message is received that is not
-handled otherwise. It gets two arguments: the channel handle and the received
-message. Example: >
- func Handle(handle, msg)
+"callback" A function that is called when a message is received that is
+ not handled otherwise. It gets two arguments: the channel
+ handle and the received message. Example: >
+ func Handle(channel, msg)
echo 'Received: ' . a:msg
endfunc
- let handle = ch_open("localhost:8765", {"callback": "Handle"})
-
-"waittime" is the time to wait for the connection to be made in milliseconds.
-The default is zero, don't wait, which is useful if the server is supposed to
-be running already. A negative number waits forever.
-
-"timeout" is the time to wait for a request when blocking, using
-ch_sendexpr(). Again in milliseconds. The default is 2000 (2 seconds).
+ let channel = ch_open("localhost:8765", {"callback": "Handle"})
+<
+ TODO:
+"err-cb" A function like "callback" but used for stderr. Only for when
+ the channel uses pipes.
+
+ TODO:
+"close-cb" A function that is called when the channel gets closed, other
+ than by calling ch_close(). It should be defined like this: >
+ func MyCloseHandler(channel)
+
+"waittime" The time to wait for the connection to be made in
+ milliseconds. The default is zero, don't wait, which is
+ useful if the server is supposed to be running already. A
+ negative number waits forever.
+
+"timeout" The time to wait for a request when blocking, using
+ ch_sendexpr(). Again in milliseconds. The default is 2000 (2
+ seconds).
When "mode" is "json" or "js" the "msg" argument is the body of the received
message, converted to Vim types.
@@ -103,18 +155,26 @@ When "mode" is "raw" the "msg" argument is the whole message as a string.
When "mode" is "json" or "js" the "callback" is optional. When omitted it is
only possible to receive a message after sending one.
-The handler can be added or changed later: >
- call ch_setcallback(handle, {callback})
+TODO:
+To change the channel options after opening it use ch_setoptions(). The
+arguments are similar to what is passed to ch_open(), but "waittime" cannot be
+given, since that only applies to opening the channel.
+
+The handler can be added or changed: >
+ call ch_setoptions(channel, {'callback': callback})
When "callback" is empty (zero or an empty string) the handler is removed.
-NOT IMPLEMENTED YET
-The timeout can be changed later: >
- call ch_settimeout(handle, {msec})
-NOT IMPLEMENTED YET
+The timeout can be changed: >
+ call ch_setoptions(channel, {'timeout': msec})
+<
*E906*
Once done with the channel, disconnect it like this: >
- call ch_close(handle)
+ call ch_close(channel)
+When a socket is used this will close the socket for both directions. When
+pipes are used (stdin/stdout/stderr) they are all closed. This might not be
+what you want! Stopping the job with job_stop() might be better.
+TODO:
Currently up to 10 channels can be in use at the same time. *E897*
When the channel can't be opened you will get an error message. There is a
@@ -126,21 +186,26 @@ If there is an error reading or writing a channel it will be closed.
*E896* *E630* *E631*
==============================================================================
-3. Using a JSON or JS channel *channel-use*
+4. Using a JSON or JS channel *channel-use*
If {mode} is "json" then a message can be sent synchronously like this: >
- let response = ch_sendexpr(handle, {expr})
+ let response = ch_sendexpr(channel, {expr})
This awaits a response from the other side.
When {mode} is "js" this works the same, except that the messages use
-JavaScript encoding. See |jsencode()| for the difference.
+JavaScript encoding. See |js_encode()| for the difference.
To send a message, without handling a response: >
- call ch_sendexpr(handle, {expr}, 0)
+ call ch_sendexpr(channel, {expr}, 0)
To send a message and letting the response handled by a specific function,
asynchronously: >
- call ch_sendexpr(handle, {expr}, {callback})
+ call ch_sendexpr(channel, {expr}, {callback})
+
+Vim will match the response with the request using the message ID. Once the
+response is received the callback will be invoked. Further responses with the
+same ID will be ignored. If your server sends back multiple responses you
+need to send them with ID zero, they will be passed to the channel callback.
The {expr} is converted to JSON and wrapped in an array. An example of the
message that the receiver will get when {expr} is the string "hello":
@@ -175,9 +240,7 @@ It is also possible to use ch_sendraw() on a JSON or JS channel. The caller
is then completely responsible for correct encoding and decoding.
==============================================================================
-4. Vim commands *channel-commands*
-
-PARTLY IMPLEMENTED: only "ex" and "normal" work
+5. Channel commands *channel-commands*
With a "json" channel the process can send commands to Vim that will be
handled by Vim internally, it does not require a handler for the channel.
@@ -251,43 +314,202 @@ Example:
["expr","setline('$', ['one', 'two', 'three'])"] ~
==============================================================================
-5. Using a raw channel *channel-raw*
+6. Using a RAW or NL channel *channel-raw*
If {mode} is "raw" then a message can be send like this: >
- let response = ch_sendraw(handle, {string})
+ let response = ch_sendraw(channel, {string})
The {string} is sent as-is. The response will be what can be read from the
channel right away. Since Vim doesn't know how to recognize the end of the
-message you need to take care of it yourself.
+message you need to take care of it yourself. The timeout applies for reading
+the first byte, after that it will not wait for anything more.
+
+If {mode} is "nl" you can send a message in a similar way. You are expected
+to put in the NL after each message. Thus you can also send several messages
+ending in a NL at once. The response will be the text up to and including the
+first NL. This can also be just the NL for an empty response.
+If no NL was read before the channel timeout an empty string is returned.
To send a message, without expecting a response: >
- call ch_sendraw(handle, {string}, 0)
+ call ch_sendraw(channel, {string}, 0)
The process can send back a response, the channel handler will be called with
it.
To send a message and letting the response handled by a specific function,
asynchronously: >
- call ch_sendraw(handle, {string}, {callback})
+ call ch_sendraw(channel, {string}, {callback})
-This {string} can also be JSON, use |jsonencode()| to create it and
-|jsondecode()| to handle a received JSON message.
+This {string} can also be JSON, use |json_encode()| to create it and
+|json_decode()| to handle a received JSON message.
It is not possible to use |ch_sendexpr()| on a raw channel.
==============================================================================
-6. Job control *job-control*
+7. More channel functions *channel-more*
+
+To obtain the status of a channel: ch_status(channel). The possible results
+are:
+ "fail" Failed to open the channel.
+ "open" The channel can be used.
+ "closed" The channel was closed.
+
+TODO:
+To objain the job associated with a channel: ch_getjob(channel)
+
+TODO:
+To read one message from a channel: >
+ let output = ch_read(channel)
+This uses the channel timeout. To read without a timeout, just get any
+message that is available: >
+ let output = ch_read(channel, 0)
+When no message was available then the result is v:none for a JSON or JS mode
+channels, an empty string for a RAW or NL channel.
+
+To read all output from a RAW or NL channel that is available: >
+ let output = ch_readall(channel)
+To read the error output: >
+ let output = ch_readall(channel, "err")
+TODO: use channel timeout, no timeout or specify timeout?
+
+==============================================================================
+8. Starting a job with a channel *job-start* *job*
+
+To start a job and open a channel for stdin/stdout/stderr: >
+ let job = job_start(command, {options})
+
+You can get the channel with: >
+ let channel = job_getchannel(job)
-NOT IMPLEMENTED YET
+The channel will use NL mode. If you want another mode it's best to specify
+this in {options}. When changing the mode later some text may have already
+been received and not parsed correctly.
-To start another process: >
- call startjob({command})
+If the command produces a line of output that you want to deal with, specify
+a handler for stdout: >
+ let job = job_start(command, {"out-cb": "MyHandler"})
+The function will be called with the channel and a message. You would define
+it like this: >
+ func MyHandler(channel, msg)
-This does not wait for {command} to exit.
+Without the handler you need to read the output with ch_read().
+
+The handler defined for "out-cb" will also receive stderr. If you want to
+handle that separately, add an "err-cb" handler: >
+ let job = job_start(command, {"out-cb": "MyHandler",
+ \ "err-cb": "ErrHandler"})
+
+You can send a message to the command with ch_sendraw(). If the channel is in
+JSON or JS mode you can use ch_sendexpr().
+
+There are several options you can use, see |job-options|.
TODO:
+To run a job and read its output once it is done: >
+
+ let job = job_start({command}, {'exit-cb': 'MyHandler'})
+ func MyHandler(job, status)
+ let channel = job_getchannel()
+ let output = ch_readall(channel)
+ " parse output
+ endfunc
+
+==============================================================================
+9. Starting a job without a channel *job-start-nochannel*
+
+To start another process without creating a channel: >
+ let job = job_start(command, {"in-io": "null", "out-io": "null"})
+
+This starts {command} in the background, Vim does not wait for it to finish.
+
+TODO:
+When Vim sees that neither stdin, stdout or stderr are connected, no channel
+will be created. Often you will want to include redirection in the command to
+avoid it getting stuck.
+
+There are several options you can use, see |job-options|.
+
+TODO: *job-may-start*
+To start a job only when connecting to an address does not work use
+job_maystart('command', {address}, {options}), For Example: >
+ let job = job_maystart(command, address, {"waittime": 1000})
+ let channel = job_gethandle(job)
+
+This comes down to: >
+ let channel = ch_open(address, {"waittime": 0})
+ if ch_status(channel) == "fail"
+ let job = job_start(command)
+ let channel = ch_open(address, {"waittime": 1000})
+ call job_sethandle(channel)
+ endif
+Note that the specified waittime applies to when the job has been started.
+This gives the job some time to make the port available.
+
+==============================================================================
+10. Job options *job-options*
+
+The {options} argument in job_start() is a dictionary. All entries are
+optional. The same options can be used with job_setoptions(job, {options}).
+
+TODO: *job-out-cb*
+"out-cb": handler Callback for when there is something to read on
+ stdout.
+TODO: *job-err-cb*
+"err-cb": handler Callback for when there is something to read on
+ stderr. Defaults to the same callback as "out-cb".
+TODO: *job-close-cb*
+"close-cb": handler Callback for when the channel is closed. Same as
+ "close-cb" on ch_open().
+TODO: *job-exit-cb*
+"exit-cb": handler Callback for when the job ends. The arguments are the
+ job and the exit status.
+TODO: *job-killonexit*
+"killonexit": 1 Stop the job when Vim exits.
+"killonexit": 0 Do not stop the job when Vim exits.
+ The default is 1.
+TODO: *job-term*
+"term": "open" Start a terminal and connect the job
+ stdin/stdout/stderr to it.
+
+TODO: *job-in-io*
+"in-io": "null" disconnect stdin
+"in-io": "pipe" stdin is connected to the channel (default)
+"in-io": "file" stdin reads from a file
+"in-file": "/path/file" the file to read from
+
+TODO: *job-out-io*
+"out-io": "null" disconnect stdout
+"out-io": "pipe" stdout is connected to the channel (default)
+"out-io": "file" stdout writes to a file
+"out-file": "/path/file" the file to write to
+"out-io": "buffer" stdout appends to a buffer
+"out-buffer": "name" buffer to append to
+
+TODO: *job-err-io*
+"err-io": "out" same as stdout (default)
+"err-io": "null" disconnect stderr
+"err-io": "pipe" stderr is connected to the channel
+"err-io": "file" stderr writes to a file
+"err-file": "/path/file" the file to write to
+"err-io": "buffer" stderr appends to a buffer
+"err-buffer": "name" buffer to append to
+
+TODO: more options
+
+
+==============================================================================
+11. Controlling a job *job-control*
+
+To get the status of a job: >
+ echo job_status(job)
+
+To make a job stop running: >
+ job_stop(job)
+
+This is the normal way to end a job. On Unix it sends a SIGTERM to the job.
+It is possible to use other ways to stop the job, or even send arbitrary
+signals. E.g. to force a job to stop, "kill it": >
+ job_stop(job, "kill")
- let handle = startjob({command}, 's') # uses stdin/stdout
- let handle = startjob({command}, '', {address}) # uses socket
- let handle = startjob({command}, 'd', {address}) # start if connect fails
+For more options see |job_stop()|.
vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index c8cb5981e..7fa1008bd 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1,4 +1,4 @@
-*editing.txt* For Vim version 7.4. Last change: 2016 Feb 01
+*editing.txt* For Vim version 7.4. Last change: 2016 Feb 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -403,16 +403,21 @@ Note there are some commands where this works slightly differently, see
Example: >
:n **/*.txt
Finds files:
- ttt.txt
- subdir/ttt.txt
- a/b/c/d/ttt.txt
-When non-wildcard characters are used these are only matched in the first
-directory. Example: >
- :n /usr/inc**/*.h
+ aaa.txt ~
+ subdir/bbb.txt ~
+ a/b/c/d/ccc.txt ~
+When non-wildcard characters are used right before or after "**" these are
+only matched in the top directory. They are not used for directories further
+down in the tree. For example: >
+ :n /usr/inc**/types.h
Finds files:
- /usr/include/types.h
- /usr/include/sys/types.h
- /usr/inc_old/types.h
+ /usr/include/types.h ~
+ /usr/include/sys/types.h ~
+ /usr/inc/old/types.h ~
+Note that the path with "/sys" is included because it does not need to match
+"/inc". Thus it's like matching "/usr/inc*/*/*...", not
+"/usr/inc*/inc*/inc*".
+
*backtick-expansion* *`-expansion*
On Unix and a few other systems you can also use backticks for the file name
argument, for example: >
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 63438c921..5a03fcf29 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -37,7 +37,7 @@ done, the features in this document are not available. See |+eval| and
1.1 Variable types ~
*E712*
-There are eight types of variables:
+There are nine types of variables:
Number A 32 or 64 bit signed number. |expr-number| *Number*
Examples: -123 0x10 0177
@@ -61,7 +61,9 @@ Funcref A reference to a function |Funcref|.
Special v:false, v:true, v:none and v:null
-Job Used for job control, see |job_start()|.
+Job Used for a job, see |job_start()|.
+
+Channel Used for a channel, see |ch_open()|.
The Number and String types are converted automatically, depending on how they
are used.
@@ -100,7 +102,7 @@ Note that in the command >
use empty(): >
:if !empty("foo")
<
- *E745* *E728* *E703* *E729* *E730* *E731* *E908* *E910*
+ *E745* *E728* *E703* *E729* *E730* *E731* *E908* *E910* *E913*
List, Dictionary, Funcref and Job types are not automatically converted.
*E805* *E806* *E808*
@@ -108,7 +110,7 @@ When mixing Number and Float the Number is converted to Float. Otherwise
there is no automatic conversion of Float. You can use str2float() for String
to Float, printf() for Float to String and float2nr() for Float to Number.
- *E891* *E892* *E893* *E894* *E907* *E911*
+ *E891* *E892* *E893* *E894* *E907* *E911* *E914*
When expecting a Float a Number can also be used, but nothing else.
*E706* *sticky-type-checking*
@@ -1823,6 +1825,7 @@ ch_sendexpr( {handle}, {expr} [, {callback}])
any send {expr} over JSON channel {handle}
ch_sendraw( {handle}, {string} [, {callback}])
any send {string} over raw channel {handle}
+ch_status( {handle}) String status of channel {handle}
changenr() Number current change number
char2nr( {expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr}
cindent( {lnum}) Number C indent for line {lnum}
@@ -1955,6 +1958,7 @@ invert( {expr}) Number bitwise invert
isdirectory( {directory}) Number TRUE if {directory} is a directory
islocked( {expr}) Number TRUE if {expr} is locked
items( {dict}) List key-value pairs in {dict}
+job_getchannel( {job}) Number get the channel handle for {job}
job_start( {command} [, {options}]) Job start a job
job_status( {job}) String get the status of a job
job_stop( {job} [, {how}]) Number stop a job
@@ -2684,9 +2688,13 @@ ch_close({handle}) *ch_close()*
ch_logfile( {fname} [, {mode}]) *ch_logfile()*
Start logging channel activity to {fname}.
+ When {fname} is an empty string: stop logging.
+
When {mode} is omitted or "a" append to the file.
When {mode} is "w" start with an empty file.
- When {fname} is an empty string: stop logging.
+
+ The file is flushed after every message, on Unix you can use
+ "tail -f" to see what is going on in real time.
ch_open({address} [, {argdict}]) *ch_open()*
Open a channel to {address}. See |channel|.
@@ -2742,6 +2750,12 @@ ch_sendraw({handle}, {string} [, {callback}]) *ch_sendraw()*
{only available when compiled with the |+channel| feature}
+ch_status({handle}) *ch_status()*
+ Return the status of channel {handle}:
+ "fail" failed to open the channel
+ "open" channel can be used
+ "closed" channel can not be used
+
*copy()*
copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't
different from using {expr} directly.
@@ -2938,6 +2952,7 @@ empty({expr}) *empty()*
- A Number and Float is empty when its value is zero.
- |v:false|, |v:none| and |v:null| are empty, |v:true| is not.
- A Job is empty when it failed to start.
+ - A Channel is empty when it is closed.
For a long |List| this is much faster than comparing the
length with zero.
@@ -4334,7 +4349,11 @@ items({dict}) *items()*
order.
-job_start({command} [, {options}]) *job_start()*
+job_getchannel({job}) *job_getchannel()*
+ Get the channel handle that {job} is using.
+ {only available when compiled with the |+job| feature}
+
+job_start({command} [, {options}]) *job_start()*
Start a job and return a Job object. Unlike |system()| and
|:!cmd| this does not wait for the job to finish.
@@ -6838,6 +6857,7 @@ type({expr}) The result is a Number, depending on the type of {expr}:
Boolean: 6 (v:false and v:true)
None 7 (v:null and v:none)
Job 8
+ Channel 9
To avoid the magic numbers it should be used this way: >
:if type(myvar) == type(0)
:if type(myvar) == type("")
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 9afabed23..9f7f50d2e 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 7.4. Last change: 2016 Feb 01
+*options.txt* For Vim version 7.4. Last change: 2016 Feb 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -3096,17 +3096,17 @@ A jump table for the options with a short description can be found at |Q_op|.
item default Used for ~
stl:c ' ' or '^' statusline of the current window
- stlnc:c ' ' or '-' statusline of the non-current windows
+ stlnc:c ' ' or '=' statusline of the non-current windows
vert:c '|' vertical separators |:vsplit|
fold:c '-' filling 'foldtext'
diff:c '-' deleted lines of the 'diff' option
Any one that is omitted will fall back to the default. For "stl" and
- "stlnc" the space will be used when there is highlighting, '^' or '-'
+ "stlnc" the space will be used when there is highlighting, '^' or '='
otherwise.
Example: >
- :set fillchars=stl:^,stlnc:-,vert:\|,fold:-,diff:-
+ :set fillchars=stl:^,stlnc:=,vert:\|,fold:-,diff:-
< This is similar to the default, except that these characters will also
be used when there is highlighting.
@@ -7571,6 +7571,7 @@ A jump table for the options with a short description can be found at |Q_op|.
non-keyword characters (white space is preferred). Maximum line
length is 510 bytes.
To obtain a file to be used here, check out this ftp site:
+ [Sorry this link doesn't work anymore, do you know the right one?]
ftp://ftp.ox.ac.uk/pub/wordlists/ First get the README file.
To include a comma in a file name precede it with a backslash. Spaces
after a comma are ignored, otherwise spaces are included in the file
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index b3132a900..04aaa19db 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -1,4 +1,4 @@
-*repeat.txt* For Vim version 7.4. Last change: 2016 Jan 16
+*repeat.txt* For Vim version 7.4. Last change: 2016 Feb 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -490,7 +490,7 @@ Additionally, these commands can be used:
bt
where
*>frame*
- frame N Goes to N bactrace level. + and - signs make movement
+ frame N Goes to N backtrace level. + and - signs make movement
relative. E.g., ":frame +3" goes three frames up.
*>up*
up Goes one level up from call stacktrace.
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 66b0aa673..d07934438 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -9,6 +9,7 @@ $MYVIMRC starting.txt /*$MYVIMRC*
$VIM starting.txt /*$VIM*
$VIM-use version5.txt /*$VIM-use*
$VIMRUNTIME starting.txt /*$VIMRUNTIME*
+$VIM_POSIX vi_diff.txt /*$VIM_POSIX*
% motion.txt /*%*
%:. cmdline.txt /*%:.*
%:8 cmdline.txt /*%:8*
@@ -1218,6 +1219,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
+iconv various.txt /*+iconv*
+iconv/dyn various.txt /*+iconv\/dyn*
+insert_expand various.txt /*+insert_expand*
++job various.txt /*+job*
+jumplist various.txt /*+jumplist*
+keymap various.txt /*+keymap*
+langmap various.txt /*+langmap*
@@ -4443,6 +4445,8 @@ E91 options.txt /*E91*
E910 eval.txt /*E910*
E911 eval.txt /*E911*
E912 eval.txt /*E912*
+E913 eval.txt /*E913*
+E914 eval.txt /*E914*
E92 message.txt /*E92*
E93 windows.txt /*E93*
E94 windows.txt /*E94*
@@ -5164,9 +5168,12 @@ cc change.txt /*cc*
ceil() eval.txt /*ceil()*
ch.vim syntax.txt /*ch.vim*
ch_close() eval.txt /*ch_close()*
+ch_logfile() eval.txt /*ch_logfile()*
ch_open() eval.txt /*ch_open()*
+ch_readraw() eval.txt /*ch_readraw()*
ch_sendexpr() eval.txt /*ch_sendexpr()*
ch_sendraw() eval.txt /*ch_sendraw()*
+ch_status() eval.txt /*ch_status()*
change-list-jumps motion.txt /*change-list-jumps*
change-name tips.txt /*change-name*
change-tabs change.txt /*change-tabs*
@@ -5197,6 +5204,7 @@ channel-callback channel.txt /*channel-callback*
channel-commands channel.txt /*channel-commands*
channel-demo channel.txt /*channel-demo*
channel-mode channel.txt /*channel-mode*
+channel-more channel.txt /*channel-more*
channel-open channel.txt /*channel-open*
channel-raw channel.txt /*channel-raw*
channel-use channel.txt /*channel-use*
@@ -5564,6 +5572,7 @@ dip motion.txt /*dip*
dircolors.vim syntax.txt /*dircolors.vim*
dis motion.txt /*dis*
disable-menus gui.txt /*disable-menus*
+disable_char_avail_for_testing() eval.txt /*disable_char_avail_for_testing()*
discard editing.txt /*discard*
distribute-script usr_41.txt /*distribute-script*
distribution intro.txt /*distribution*
@@ -6817,16 +6826,32 @@ java-indenting indent.txt /*java-indenting*
java.vim syntax.txt /*java.vim*
javascript-cinoptions indent.txt /*javascript-cinoptions*
javascript-indenting indent.txt /*javascript-indenting*
+job channel.txt /*job*
+job-channel-overview channel.txt /*job-channel-overview*
+job-close-cb channel.txt /*job-close-cb*
job-control channel.txt /*job-control*
+job-err-cb channel.txt /*job-err-cb*
+job-err-io channel.txt /*job-err-io*
+job-exit-cb channel.txt /*job-exit-cb*
+job-in-io channel.txt /*job-in-io*
+job-killonexit channel.txt /*job-killonexit*
+job-may-start channel.txt /*job-may-start*
+job-options channel.txt /*job-options*
+job-out-cb channel.txt /*job-out-cb*
+job-out-io channel.txt /*job-out-io*
+job-start channel.txt /*job-start*
+job-start-nochannel channel.txt /*job-start-nochannel*
+job-term channel.txt /*job-term*
+job_getchannel() eval.txt /*job_getchannel()*
job_start() eval.txt /*job_start()*
job_status() eval.txt /*job_status()*
job_stop() eval.txt /*job_stop()*
join() eval.txt /*join()*
+js_decode() eval.txt /*js_decode()*
+js_encode() eval.txt /*js_encode()*
jsbterm-mouse options.txt /*jsbterm-mouse*
-jsdecode() eval.txt /*jsdecode()*
-jsencode() eval.txt /*jsencode()*
-jsondecode() eval.txt /*jsondecode()*
-jsonencode() eval.txt /*jsonencode()*
+json_decode() eval.txt /*json_decode()*
+json_encode() eval.txt /*json_encode()*
jtags tagsrch.txt /*jtags*
jump-motions motion.txt /*jump-motions*
jumplist motion.txt /*jumplist*
@@ -8582,6 +8607,7 @@ undo-tree undo.txt /*undo-tree*
undo-two-ways undo.txt /*undo-two-ways*
undo.txt undo.txt /*undo.txt*
undo_ftplugin usr_41.txt /*undo_ftplugin*
+undo_indent usr_41.txt /*undo_indent*
undofile() eval.txt /*undofile()*
undotree() eval.txt /*undotree()*
unicode mbyte.txt /*unicode*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index a6faab3f3..11ee79fbc 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 7.4. Last change: 2016 Feb 07
+*todo.txt* For Vim version 7.4. Last change: 2016 Feb 15
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -34,6 +34,100 @@ not be repeated below, unless there is extra information.
*known-bugs*
-------------------- Known bugs and current work -----------------------
++channel:
+- Move netbeans NL handling to channel.c, use it for NL mode channel
+- ch_open fails when socket isn't present yet. (Marcin Szamotulski)
+ Retry when error is "connection refused".
+- channel test waittime is disabled for MS-Windows, causes a crash.
+- channel needs both stdout and stderr (GUI implementation)
+- implement TODO items in ":help channel":
+ - implement ch_setoptions(handle, {options})
+ - job_setoptions(job, {options})
+ - ch_close() closes stdin/stdout/stderr
+ - out-cb
+ - err-cb
+ - exit-cb move code from mch_clear_job()
+ - job argument: killonexit
+ - ch_read() for stderr
+ - ch_getjob(handle)
+ - ch_read(handle [, timeout])
+ - ch_readall(handle [, timeout])
+ - job_info() should remove usable info: process ID, run/dead, etc.
+ - job_maystart()
+ - job_gethandle(), job_sethandle()
+ - add ch_status(): Whether channel is open. Perhaps also mode, timeout.
+ - When channel closes invoke "close-cb".
+- Move more details from eval.txt to channel.txt. Add tags in eval.txt.
+- When receiving malformed json starting with a quote it doesn't get
+ discarded.
+- When message in queue but there is no callback, drop it after a while?
+- Crash when closing channel after ch_sendexpr() with callback and outstanding
+ request (Christian Robinson).
+- cleanup on exit? in mch_getout() and getout().
+- On Mac a 1 msec waittime is needed in ch_open(), why?
+- Add more log calls, basically at every branch, before every callback, etc.
+- Add timestamp to queued messages and callbacks with ID, remove after a
+ minute.
+- add remark about undo sync, is there a way to force it?
+- When starting a job, have an option to open the server socket, so we know
+ the port, and pass it to the command with --socket-fd {nr}. (Olaf Dabrunz,
+ Feb 9) How to do this on MS-Windows?
+- Add more unit-testing in json_test.c
+- Add a test where ["eval","getline(123)"] gets a line with special
+ characters (NUL, 0x80, etc.). Check that it isn't garbled.
+- make sure errors lead to a useful error msg. ["ex","foobar"]
+- json: implement UTF-16 surrogate pair.
+- For connection to server, a "keep open" flag would be useful. Retry
+ connecting in the main loop with zero timeout.
+More plugin support:
+- Have a way to install a callback from the main loop. Called every second or
+ so.
+- Need way to uniquely identify a window, no matter how windows are
+ rearranged. Same for tab pages.
+ getwinid() ID of current winow
+ getwinid({nr}) ID of window {nr}
+ getwinid({nr}, {tab}) ID of window {nr} in tab page {tab}
+ getwinnr({id}) window nr of {id} or -1 if not open
+ gettabnr({id}) tab page nr of {id} or -1 if not open
+ gotowin({id})
+ Make it so that the window ID can be used where currently a window nr is used
+
+Patch on #608: (Ken Takata)
+https://bitbucket.org/k_takata/vim-ktakata-mq/src/479934b94fd56b064c9e4bd8737585c5df69d56a/fix-gvimext-loadlibrary.patch?fileviewer=file-view-default
+
+This difference is unexpected:
+ echo v:true == 1
+ 1
+ echo [v:true] == [1]
+ 0
+It's because tv_equal() works different.
+
+Add "runtime/bundles" ?
+ runtime/bundles/netrw/spec.vim
+ runtime/bundles/netrw/autoload/netrw.vim
+ runtime/bundles/netrw/syntax/netrw.vim
+ etc.
+Need an alternative for 'runtimepath' that tells where bundles are to be
+found. 'bundlepath' ?
+The plugins under 'bundlepath' would always be loaded. Also have a path for
+optional plugins? 'optbundlepath'? Or have directories "bundlesdef" and
+"bundlesopt"?
+Then use a command "loadplugin" to find a plugin in "optional".
+"bundles" is used by some plugin managers, need another name. "packages"?
+Add a "requires" / "provides" mechanism?
+ if my_feature_enabled
+ require +python
+ endif
+ require my_other_plugin
+~/vim/packages/netrw/def/netrw/plugin/netrw.vim
+~/vim/packages/netrw/opt/nwdebug/plugin/nwdebug.vim
+
+Why does this: echo "a" . 1.1
+result in: a11
+Should recognize float (so long as it's not ".1.1").
+
+Allow for an empty dictionary key.
+
Regexp problems:
- The regexp engines are not reentrant, causing havoc when interrupted by a
remote expression or something else. Move global variables onto the stack
@@ -76,53 +170,8 @@ Regexp problems:
matches the empty string. (Dominique Pelle, 2015 Oct 2, Nov 24)
- Search for \\~ causes error E874.
-- "\%1l^#.*" does not match on a line starting with "#". The zero-width match
- clears the start-of-line flag.
- Patch by Christian, 2016 Jan 29.
-
-+channel:
-- implement job control:
- job argument: redirect stdin/stdout
- job argument: killonexit
- let job = job_maystart('command', {address}, {options})
-- When receiving malformed json starting with a quote it doesn't get
- discarded.
-- add ch_status(): Whether channel is open. Perhaps also mode, timeout.
- When channel closes invoke channel callback.
-- add ch_setcallback()
-- add ch_settimeout()
-- cleanup on exit? in mch_getout() and getout().
-- Add a test for the channel callback.
-- implement debug log
-- Add timestamp to queued messages and callbacks with ID, remove after a
- minute.
-- add remark about undo sync, is there a way to force it?
-- Add more testing in json_test.c
-- make sure errors lead to a useful error msg. ["ex","foobar"]
-- json: implement UTF-16 surrogate pair.
-- Need way to uniquely identify a window, no matter how windows are
- rearranged. Same for tab pages.
- getwinid() ID of current winow
- getwinid({nr}) ID of window {nr}
- getwinid({nr}, {tab}) ID of window {nr} in tab page {tab}
- getwinnr({id}) window nr of {id} or -1 if not open
- gettabnr({id}) tab page nr of {id} or -1 if not open
- gotowin({id})
- Make it so that the window ID can be used where currently a window nr is used
-- For connection to server, a "keep open" flag would be useful. Retry
- connecting in the main loop with zero timeout.
-
-Patch on #608: (Ken Takata)
-https://bitbucket.org/k_takata/vim-ktakata-mq/src/479934b94fd56b064c9e4bd8737585c5df69d56a/fix-gvimext-loadlibrary.patch?fileviewer=file-view-default
-
-This difference is unexpected:
- echo v:true == 1
- 1
- echo [v:true] == [1]
- 0
-It's because tv_equal() works different.
-
-Allow for an empty dictionary key.
+Also include update_curswant() fix for getcurpos(). (Christian Brabandt, 2016
+Feb 9)
Patch to put undo options together in undo window.
(Gary Johnson, 2016 Jan 28)
@@ -221,8 +270,14 @@ Patch to fix display of listchars on the cursorline. (Nayuri Aohime, 2013)
Update suggested by Yasuhiro Matsumoto, 2014 Nov 25:
https://gist.github.com/presuku/d3d6b230b9b6dcfc0477
+Patch to make the behavior of "w" more straightforward, but not Vi compatible.
+With a 'cpo' flag. (Christian Brabandt, 2016 Feb 8)
+
Patch to add TagNotFound autocommand. (Anton Lindqvist, 2016 Feb 3)
+Patch to add Error autocommand. (Anton Lindqvist, 2016 Feb 14)
+Only remembers one error.
+
Illegal memory access, requires ASAN to see. (Dominique Pelle, 2015 Jul 28)
Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab.
@@ -271,7 +326,7 @@ Can we cache the syntax attributes, so that updates for 'relativenumber' and
Build with Python on Mac does not always use the right library.
(Kazunobu Kuriyama, 2015 Mar 28)
-Patch to add GTK 3 support. (Kazunobu Kuriyama, 2016 Feb 6)
+Patch to add GTK 3 support. (Kazunobu Kuriyama, 2016 Feb 13)
Does not fully work yet.
Need a Vim equivalent of Python's None and a way to test for it.
@@ -497,7 +552,7 @@ Bug: Autocompleting ":tag/pat" replaces "/pat" with a match but does not
insert a space. (Micha Mos, 2014 Nov 7)
Patch to add the :bvimgrep command. (Christian Brabandt, 2014 Nov 12)
-Update Dec 6.
+Updated 2016 Feb 10
Patch to add argument to :cquit. (Thinca, 2014 Oct 12)
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 583bf99db..7ef466d16 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -1,4 +1,4 @@
-*usr_41.txt* For Vim version 7.4. Last change: 2016 Feb 02
+*usr_41.txt* For Vim version 7.4. Last change: 2016 Feb 14
VIM USER MANUAL - by Bram Moolenaar
@@ -2235,7 +2235,7 @@ This construct makes sure the function is only defined once: >
:endif
<
-UNDO *undo_ftplugin*
+UNDO *undo_indent* *undo_ftplugin*
When the user does ":setfiletype xyz" the effect of the previous filetype
should be undone. Set the b:undo_ftplugin variable to the commands that will
@@ -2250,6 +2250,9 @@ global value. That is mostly the best way to reset the option value.
This does require removing the "C" flag from 'cpoptions' to allow line
continuation, as mentioned above |use-cpo-save|.
+For undoing the effect of an indent script, the b:undo_indent variable should
+be set accordingly.
+
FILE NAME
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index 7dbfb4ad9..3c2ea59a5 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -1,4 +1,4 @@
-*various.txt* For Vim version 7.4. Last change: 2016 Jan 31
+*various.txt* For Vim version 7.4. Last change: 2016 Feb 15
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -358,6 +358,7 @@ m *+hangul_input* Hangul input support |hangul|
*+iconv* Compiled with the |iconv()| function
*+iconv/dyn* Likewise |iconv-dynamic| |/dyn|
N *+insert_expand* |insert_expand| Insert mode completion
+m *+job* starting and stopping jobs |job|
N *+jumplist* |jumplist|
B *+keymap* |'keymap'|
B *+langmap* |'langmap'|
diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt
index 2a7bbe467..4619b5056 100644
--- a/runtime/doc/vi_diff.txt
+++ b/runtime/doc/vi_diff.txt
@@ -1,4 +1,4 @@
-*vi_diff.txt* For Vim version 7.4. Last change: 2015 Nov 01
+*vi_diff.txt* For Vim version 7.4. Last change: 2016 Feb 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -960,7 +960,7 @@ Only Vim is able to accept options in between and after the file names.
In 2005 the POSIX test suite was run to check the compatibility of Vim. Most
of the test was executed properly. There are the few things where Vim
is not POSIX compliant, even when run in Vi compatibility mode.
-
+ *$VIM_POSIX*
Set the $VIM_POSIX environment variable to have 'cpoptions' include the POSIX
flags when Vim starts up. This makes Vim run as POSIX as it can. That's
a bit different from being Vi compatible.