aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorckelsel <ckelsel@hotmail.com>2017-07-16 08:22:49 +0800
committerckelsel <ckelsel@hotmail.com>2017-07-16 08:22:49 +0800
commitcb95f71f71f665b21848cf25780d83278cd1dcf0 (patch)
tree4ebdf96b731ae839f8beb326e36dcb0b429bc453 /runtime/doc
parent8cc49f9f1ad4edface62284c32f05ef1140d8220 (diff)
parent4dee942e732d41ad62b732c0a39719d9405bc928 (diff)
downloadrneovim-cb95f71f71f665b21848cf25780d83278cd1dcf0.tar.gz
rneovim-cb95f71f71f665b21848cf25780d83278cd1dcf0.tar.bz2
rneovim-cb95f71f71f665b21848cf25780d83278cd1dcf0.zip
merge upstream/master
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/intro.txt3
-rw-r--r--runtime/doc/job_control.txt40
-rw-r--r--runtime/doc/nvim.txt2
3 files changed, 20 insertions, 25 deletions
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt
index 88d04aa76b..b9cc94ce5f 100644
--- a/runtime/doc/intro.txt
+++ b/runtime/doc/intro.txt
@@ -249,8 +249,7 @@ Vi "the original". Without further remarks this is the version
of Vi that appeared in Sun OS 4.x. ":version" returns
"Version 3.7, 6/7/85". Sometimes other versions are referred
to. Only runs under Unix. Source code only available with a
- license. More information on Vi can be found through:
- http://vi-editor.org [doesn't currently work...]
+ license.
*Nvi*
Nvi The "New" Vi. The version of Vi that comes with BSD 4.4 and FreeBSD.
Very good compatibility with the original Vi, with a few extensions.
diff --git a/runtime/doc/job_control.txt b/runtime/doc/job_control.txt
index da592d6eb0..edbc1bca81 100644
--- a/runtime/doc/job_control.txt
+++ b/runtime/doc/job_control.txt
@@ -102,36 +102,30 @@ function. Here's a more object-oriented version of the above:
>
let Shell = {}
- function Shell.on_stdout(job_id, data) dict
- call append(line('$'), self.get_name().' stdout: '.join(a:data))
+ function Shell.on_stdout(_job_id, data, event)
+ call append(line('$'),
+ \ printf('[%s] %s: %s', a:event, self.name, join(a:data[:-2])))
endfunction
- function Shell.on_stderr(job_id, data) dict
- call append(line('$'), self.get_name().' stderr: '.join(a:data))
- endfunction
-
- function Shell.on_exit(job_id, data) dict
- call append(line('$'), self.get_name().' exited')
- endfunction
+ let Shell.on_stderr = function(Shell.on_stdout)
- function Shell.get_name() dict
- return 'shell '.self.name
+ function Shell.on_exit(job_id, _data, event)
+ let msg = printf('job %d ("%s") finished', a:job_id, self.name)
+ call append(line('$'), printf('[%s] BOOM!', a:event))
+ call append(line('$'), printf('[%s] %s!', a:event, msg))
endfunction
- function Shell.new(name, ...) dict
- let instance = extend(copy(g:Shell), {'name': a:name})
- let argv = ['bash']
- if a:0 > 0
- let argv += ['-c', a:1]
- endif
- let instance.id = jobstart(argv, instance)
- return instance
+ function Shell.new(name, cmd)
+ let object = extend(copy(g:Shell), {'name': a:name})
+ let object.cmd = ['sh', '-c', a:cmd]
+ let object.id = jobstart(object.cmd, object)
+ $
+ return object
endfunction
- let s1 = Shell.new('1')
- let s2 = Shell.new('2', 'for i in {1..10}; do echo hello $i!; sleep 1; done')
-
-
+ let instance = Shell.new('bomb',
+ \ 'for i in $(seq 9 -1 1); do echo $i 1>&$((i % 2 + 1)); sleep 1; done')
+<
To send data to the job's stdin, one can use the |jobsend()| function, like
this:
>
diff --git a/runtime/doc/nvim.txt b/runtime/doc/nvim.txt
index 29059f83d9..f3f4305ad5 100644
--- a/runtime/doc/nvim.txt
+++ b/runtime/doc/nvim.txt
@@ -6,6 +6,8 @@
Nvim *nvim* *nvim-intro*
+Nvim is based on Vim by Bram Moolenaar.
+
If you are new to Vim see |help.txt|, or type ":Tutor".
If you already use Vim see |nvim-from-vim| for a quickstart.