aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/eval.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/eval.txt')
-rw-r--r--runtime/doc/eval.txt68
1 files changed, 44 insertions, 24 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 1f1dc71f28..6bdfa8dc8a 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -65,14 +65,16 @@ the Number. Examples:
Number 0 --> String "0" ~
Number -1 --> String "-1" ~
*octal*
-Conversion from a String to a Number is done by converting the first digits
-to a number. Hexadecimal "0xf9" and Octal "017" numbers are recognized. If
-the String doesn't start with digits, the result is zero. Examples:
+Conversion from a String to a Number is done by converting the first digits to
+a number. Hexadecimal "0xf9", Octal "017", and Binary "0b10" numbers are
+recognized. If the String doesn't start with digits, the result is zero.
+Examples:
String "456" --> Number 456 ~
String "6bar" --> Number 6 ~
String "foo" --> Number 0 ~
String "0xf1" --> Number 241 ~
String "0100" --> Number 64 ~
+ String "0b101" --> Number 5 ~
String "-8" --> Number -8 ~
String "+8" --> Number 0 ~
@@ -522,7 +524,7 @@ Funcref to a Dictionary, but the "self" variable is not available then.
To avoid the extra name for the function it can be defined and directly
assigned to a Dictionary in this way: >
:let mydict = {'data': [0, 1, 2, 3]}
- :function mydict.len() dict
+ :function mydict.len()
: return len(self.data)
:endfunction
:echo mydict.len()
@@ -1860,10 +1862,10 @@ getwinposx() Number X coord in pixels of GUI Vim window
getwinposy() Number Y coord in pixels of GUI Vim window
getwinvar( {nr}, {varname} [, {def}])
any variable {varname} in window {nr}
-glob( {expr} [, {nosuf} [, {list}]])
+glob( {expr} [, {nosuf} [, {list} [, {alllinks}]]])
any expand file wildcards in {expr}
glob2regpat( {expr}) String convert a glob pat into a search pat
-globpath( {path}, {expr} [, {nosuf} [, {list}]])
+globpath( {path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]])
String do glob({expr}) for all dirs in {path}
has( {feature}) Number TRUE if feature {feature} supported
has_key( {dict}, {key}) Number TRUE if {dict} has entry {key}
@@ -1894,6 +1896,7 @@ 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}
jobclose({job}[, {stream}]) Number Closes a job stream(s)
+jobpid({job}) Number Returns pid of a job.
jobresize({job}, {width}, {height})
Number Resize {job}'s pseudo terminal window
jobsend({job}, {data}) Number Writes {data} to {job}'s stdin
@@ -3751,7 +3754,7 @@ getwinvar({winnr}, {varname} [, {def}]) *getwinvar()*
:let list_is_on = getwinvar(2, '&list')
:echo "myvar = " . getwinvar(1, 'myvar')
<
-glob({expr} [, {nosuf} [, {list}]]) *glob()*
+glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()*
Expand the file wildcards in {expr}. See |wildcards| for the
use of special characters.
@@ -3768,8 +3771,11 @@ glob({expr} [, {nosuf} [, {list}]]) *glob()*
matches, they are separated by <NL> characters.
If the expansion fails, the result is an empty String or List.
+
A name for a non-existing file is not included. A symbolic
link is only included if it points to an existing file.
+ However, when the {alllinks} argument is present and it is
+ non-zero then all symbolic links are included.
For most systems backticks can be used to get files names from
any external command. Example: >
@@ -3789,7 +3795,8 @@ glob2regpat({expr}) *glob2regpat()*
< This is equivalent to: >
if filename =~ '^Make.*\.mak$'
<
-globpath({path}, {expr} [, {nosuf} [, {list}]]) *globpath()*
+ *globpath()*
+globpath({path}, {expr} [, {nosuf} [, {list} [, {allinks}]]])
Perform glob() on all directories in {path} and concatenate
the results. Example: >
:echo globpath(&rtp, "syntax/c.vim")
@@ -3815,6 +3822,8 @@ globpath({path}, {expr} [, {nosuf} [, {list}]]) *globpath()*
they are separated by <NL> characters. Example: >
:echo globpath(&rtp, "syntax/c.vim", 0, 1)
<
+ {allinks} is used as with |glob()|.
+
The "**" item can be used to search in a directory tree.
For example, to find all "README.txt" files in the directories
in 'runtimepath' and below: >
@@ -4157,6 +4166,9 @@ jobclose({job}[, {stream}]) {Nvim} *jobclose()*
Close {job}'s {stream}, which can be one "stdin", "stdout" or
"stderr". If {stream} is omitted, all streams are closed.
+jobpid({job}) {Nvim} *jobpid()*
+ Return the pid (process id) of {job}.
+
jobresize({job}, {width}, {height}) {Nvim} *jobresize()*
Resize {job}'s pseudo terminal window to {width} and {height}.
This function will fail if used on jobs started without the
@@ -4194,6 +4206,10 @@ jobstart({cmd}[, {opts}]) {Nvim} *jobstart()*
- width: Width of the terminal screen(only if pty is set)
- height: Height of the terminal screen(only if pty is set)
- TERM: $TERM environment variable(only if pty is set)
+ - detach: Detach the job process from the nvim process. The
+ process won't get killed when nvim exists. If the process
+ dies before nvim exits, on_exit will still be invoked.
+ This option is only allowed for non-pty jobs.
Either funcrefs or function names can be passed as event
handlers. The {opts} object is also used as the "self"
argument for the callback, so the caller may pass arbitrary
@@ -4911,6 +4927,9 @@ printf({fmt}, {expr1} ...) *printf()*
%c single byte
%d decimal number
%5d decimal number padded with spaces to 5 characters
+ %b binary number
+ %08b binary number padded with zeros to at least 8 characters
+ %B binary number using upper case letters
%x hex number
%04x hex number padded with zeros to at least 4 characters
%X hex number using upper case letters
@@ -4997,20 +5016,19 @@ printf({fmt}, {expr1} ...) *printf()*
The conversion specifiers and their meanings are:
- *printf-d* *printf-o* *printf-x* *printf-X*
- doxX The Number argument is converted to signed decimal
- (d), unsigned octal (o), or unsigned hexadecimal (x
- and X) notation. The letters "abcdef" are used for
- x conversions; the letters "ABCDEF" are used for X
- conversions.
- The precision, if any, gives the minimum number of
- digits that must appear; if the converted value
- requires fewer digits, it is padded on the left with
- zeros.
- In no case does a non-existent or small field width
- cause truncation of a numeric field; if the result of
- a conversion is wider than the field width, the field
- is expanded to contain the conversion result.
+ *printf-d* *printf-b* *printf-B* *printf-o* *printf-x* *printf-X*
+ dbBoxX The Number argument is converted to signed decimal (d),
+ unsigned binary (b and B), unsigned octal (o), or
+ unsigned hexadecimal (x and X) notation. The letters
+ "abcdef" are used for x conversions; the letters
+ "ABCDEF" are used for X conversions. The precision, if
+ any, gives the minimum number of digits that must
+ appear; if the converted value requires fewer digits, it
+ is padded on the left with zeros. In no case does a
+ non-existent or small field width cause truncation of a
+ numeric field; if the result of a conversion is wider
+ than the field width, the field is expanded to contain
+ the conversion result.
*printf-c*
c The Number argument is converted to a byte, and the
@@ -6126,12 +6144,14 @@ str2float( {expr}) *str2float()*
str2nr( {expr} [, {base}]) *str2nr()*
Convert string {expr} to a number.
- {base} is the conversion base, it can be 8, 10 or 16.
+ {base} is the conversion base, it can be 2, 8, 10 or 16.
When {base} is omitted base 10 is used. This also means that
a leading zero doesn't cause octal conversion to be used, as
with the default String to Number conversion.
When {base} is 16 a leading "0x" or "0X" is ignored. With a
- different base the result will be zero.
+ different base the result will be zero. Similarly, when {base}
+ is 8 a leading "0" is ignored, and when {base} is 2 a leading
+ "0b" or "0B" is ignored.
Text after the number is silently ignored.