aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/builtin.txt13
-rw-r--r--runtime/doc/if_pyth.txt20
-rw-r--r--runtime/doc/map.txt4
-rw-r--r--runtime/doc/options.txt3
-rw-r--r--runtime/doc/pi_netrw.txt48
-rw-r--r--runtime/doc/repeat.txt2
-rw-r--r--runtime/doc/testing.txt25
-rw-r--r--runtime/doc/usr_01.txt2
8 files changed, 61 insertions, 56 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 39448e23a6..7acc764644 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1888,7 +1888,7 @@ execute({command} [, {silent}]) *execute()*
The default is "silent". Note that with "silent!", unlike
`:redir`, error messages are dropped.
- To get a list of lines use |split()| on the result: >
+ To get a list of lines use `split()` on the result: >
execute('args')->split("\n")
< This function is not available in the |sandbox|.
@@ -6137,17 +6137,20 @@ prompt_setcallback({buf}, {expr}) *prompt_setcallback()*
that was entered at the prompt. This can be an empty string
if the user only typed Enter.
Example: >
- call prompt_setcallback(bufnr(''), function('s:TextEntered'))
func s:TextEntered(text)
if a:text == 'exit' || a:text == 'quit'
stopinsert
+ " Reset 'modified' to allow the buffer to be closed.
+ " We assume there is nothing useful to be saved.
+ set nomodified
close
else
+ " Do something useful with "a:text". In this example
+ " we just repeat it.
call append(line('$') - 1, 'Entered: "' .. a:text .. '"')
- " Reset 'modified' to allow the buffer to be closed.
- set nomodified
endif
endfunc
+ call prompt_setcallback(bufnr(), function('s:TextEntered'))
< Can also be used as a |method|: >
GetBuffer()->prompt_setcallback(callback)
@@ -9294,7 +9297,7 @@ win_execute({id}, {command} [, {silent}]) *win_execute()*
The window will temporarily be made the current window,
without triggering autocommands or changing directory. When
executing {command} autocommands will be triggered, this may
- have unexpected side effects. Use |:noautocmd| if needed.
+ have unexpected side effects. Use `:noautocmd` if needed.
Example: >
call win_execute(winid, 'syntax enable')
< Doing the same with `setwinvar()` would not trigger
diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt
index 7b20bab0d4..a96c9fcc0a 100644
--- a/runtime/doc/if_pyth.txt
+++ b/runtime/doc/if_pyth.txt
@@ -110,26 +110,16 @@ to the next, just like the Python REPL.
*script-here*
When using a script language in-line, you might want to skip this when the
-language isn't supported. Note that this mechanism doesn't work:
+language isn't supported.
>vim
if has('python')
python << EOF
- this will NOT work!
+ print("python works")
EOF
endif
-
-Instead, put the Python command in a function and call that function:
->vim
- if has('python')
- function DefPython()
- python << EOF
- this works
- EOF
- endfunction
- call DefPython()
- endif
-
-Note that "EOF" must be at the start of the line.
+<
+Note that "EOF" must be at the start of the line without preceding white
+space.
==============================================================================
The vim module *python-vim*
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 37158e2e76..ad7901b962 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1730,8 +1730,12 @@ remains unmodified. Also see |f-args-example| below. Overview:
XX a\\\ b 'a\ b'
XX a\\\\b 'a\\b'
XX a\\\\ b 'a\\', 'b'
+ XX [nothing]
+Note that if the "no arguments" situation is to be handled, you have to make
+sure that the function can be called without arguments.
+
Examples for user commands: >
" Delete everything after here to the end
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 9f5a089434..c1e0bccfd3 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -706,6 +706,9 @@ A jump table for the options with a short description can be found at |Q_op|.
'autowriteall' for that.
Some buffers will not be written, specifically when 'buftype' is
"nowrite", "nofile", "terminal" or "prompt".
+ USE WITH CARE: If you make temporary changes to a buffer that you
+ don't want to be saved this option may cause it to be saved anyway.
+ Renaming the buffer with ":file {name}" may help avoid this.
*'autowriteall'* *'awa'* *'noautowriteall'* *'noawa'*
'autowriteall' 'awa' boolean (default off)
diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt
index 78e2035ad1..276041caac 100644
--- a/runtime/doc/pi_netrw.txt
+++ b/runtime/doc/pi_netrw.txt
@@ -208,7 +208,7 @@ EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2
http: g:netrw_http_cmd = "links" elseif links is available
http: g:netrw_http_cmd = "curl" elseif curl is available
http: g:netrw_http_cmd = "wget" elseif wget is available
- http: g:netrw_http_cmd = "fetch" elseif fetch is available
+ http: g:netrw_http_cmd = "fetch" elseif fetch is available
http: *g:netrw_http_put_cmd* = "curl -T"
rcp: *g:netrw_rcp_cmd* = "rcp"
rsync: *g:netrw_rsync_cmd* = "rsync" (see |g:netrw_rsync_sep|)
@@ -968,7 +968,7 @@ itself:
fun! NetReadFixup(method, line1, line2)
if method == 3 " ftp (no <.netrc>)
let fourblanklines= line2 - 3
- silent fourblanklines.",".line2."g/^\s*/d"
+ silent fourblanklines .. "," .. line2 .. "g/^\s*/d"
endif
endfunction
endif
@@ -1625,8 +1625,10 @@ A further approach is to delete files which match a pattern.
This will cause the matching files to be marked. Then,
press "D".
-Please note that only empty directories may be deleted with the "D" mapping.
-Regular files are deleted with |delete()|, too.
+If your vim has 7.4 with patch#1107, then |g:netrw_localrmdir| no longer
+is used to remove directories; instead, vim's |delete()| is used with
+the "d" option. Please note that only empty directories may be deleted
+with the "D" mapping. Regular files are deleted with |delete()|, too.
The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are
used to control the attempts to remove remote files and directories. The
@@ -1645,7 +1647,8 @@ to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
|g:netrw_rmf_cmd|: ssh HOSTNAME rm -f
Related topics: |netrw-d|
-Associated setting variable: |g:netrw_rm_cmd| |g:netrw_ssh_cmd|
+Associated setting variable: |g:netrw_localrmdir| |g:netrw_rm_cmd|
+ |g:netrw_rmdir_cmd| |g:netrw_ssh_cmd|
*netrw-explore* *netrw-hexplore* *netrw-nexplore* *netrw-pexplore*
@@ -1688,11 +1691,7 @@ DIRECTORY EXPLORATION COMMANDS {{{2
to 2; edits will thus preferentially be made in window#2.
The [N] specifies a |g:netrw_winsize| just for the new :Lexplore
- window. That means that
- if [N] < 0 : use |N| columns for the Lexplore window
- if [N] = 0 : a normal split is made
- if [N] > 0 : use N% of the current window will be used for the
- new window
+ window.
Those who like this method often also like tree style displays;
see |g:netrw_liststyle|.
@@ -1976,7 +1975,7 @@ To use this function, simply assign its output to |g:netrw_list_hide| option. >
Example: let g:netrw_list_hide= netrw_gitignore#Hide('my_gitignore_file')
Function can take additional files with git-ignore patterns.
- Example: g:netrw_list_hide= netrw_gitignore#Hide() . '.*\.swp$'
+ Example: let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$'
Combining 'netrw_gitignore#Hide' with custom patterns.
<
@@ -2854,6 +2853,14 @@ your browsing preferences. (see also: |netrw-settings|)
=" /c move" Windows
Options for |g:netrw_localmovecmd|
+ *g:netrw_localrmdir* ="rmdir" Linux/Unix/MacOS/Cygwin
+ =expand("$COMSPEC") Windows
+ Remove directory command (rmdir)
+ This variable is only used if your vim is
+ earlier than 7.4 or if your vim doesn't
+ have patch#1107. Otherwise, |delete()|
+ is used with the "d" option.
+
*g:netrw_maxfilenamelen* =32 by default, selected so as to make long
listings fit on 80 column displays.
If your screen is wider, and you have file
@@ -3764,7 +3771,7 @@ Example: Clear netrw's marked file list via a mapping on gu >
Netrw uses several system level commands to do things (see
|g:netrw_localcopycmd|, |g:netrw_localmovecmd|,
- |g:netrw_mkdir_cmd|).
+ |g:netrw_localrmdir|, |g:netrw_mkdir_cmd|).
You may need to adjust the default commands for one or more of
these commands by setting them properly in your .vimrc. Another
@@ -3890,13 +3897,8 @@ netrw:
==============================================================================
12. History *netrw-history* {{{1
- v172: Sep 02, 2021 * (Bram Moolenaar) Changed "l:go" to "go"
- * (Bram Moolenaar) no need for "b" in
- netrw-safe guioptions
- Nov 15, 2021 * removed netrw_localrm and netrw_localrmdir
- references
- Aug 18, 2022 * (Miguel Barro) improving compatability with
- powershell
+ v172: Apr 22, 2023 * removed g:netrw_localrmdiropt
+ removed g:netrw_localrmdir
v171: Oct 09, 2020 * included code in s:NetrwOptionsSafe()
to allow |'bh'| to be set to delete when
rather than hide when g:netrw_fastbrowse
@@ -3981,8 +3983,10 @@ netrw:
Nov 09, 2016 * Broke apart the command from the options,
mostly for Windows. Introduced new netrw
settings: |g:netrw_localcopycmdopt|
- |g:netrw_localcopydircmdopt| |g:netrw_localmkdiropt|
- |g:netrw_localmovecmdopt| g:netrw_localrmdiropt
+ |g:netrw_localcopydircmdopt|
+ |g:netrw_localmkdiropt|
+ |g:netrw_localmovecmdopt|
+ g:netrw_localrmdiropt
Nov 21, 2016 * (mattn) provided a patch for preview; swapped
winwidth() with winheight()
Nov 22, 2016 * (glacambre) reported that files containing
@@ -4042,7 +4046,7 @@ netrw:
refreshes. However, inside a |:map-<expr>|,
tab and window changes are disallowed. Fixed.
(affects netrw's s:LocalBrowseRefresh())
- * g:netrw_localrmdir not used any more, but
+ * |g:netrw_localrmdir| not used any more, but
the relevant patch that causes |delete()| to
take over was #1107 (not #1109).
* |expand()| is now used on |g:netrw_home|;
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index 8644ce4b38..b6cb126c3b 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -56,7 +56,7 @@ Using the underscore after `:d` avoids clobbering registers or the clipboard.
This also makes it faster.
Instead of the '/' which surrounds the {pattern}, you can use any other
-single byte character, but not an alphabetic character, '\', '"' or '|'.
+single byte character, but not an alphabetic character, '\', '"', '|' or '!'.
This is useful if you want to include a '/' in the search pattern or
replacement string.
diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt
index ef5e179c86..2c1c77a51d 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -54,13 +54,14 @@ assert_beeps({cmd}) *assert_beeps()*
assert_equal({expected}, {actual} [, {msg}])
When {expected} and {actual} are not equal an error message is
added to |v:errors| and 1 is returned. Otherwise zero is
- returned |assert-return|.
+ returned. |assert-return|
+ The error is in the form "Expected {expected} but got
+ {actual}". When {msg} is present it is prefixed to that.
+
There is no automatic conversion, the String "4" is different
from the Number 4. And the number 4 is different from the
Float 4.0. The value of 'ignorecase' is not used here, case
always matters.
- When {msg} is omitted an error in the form "Expected
- {expected} but got {actual}" is produced.
Example: >
assert_equal('foo', 'bar')
< Will result in a string to be added to |v:errors|:
@@ -134,11 +135,12 @@ assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]])
assert_false({actual} [, {msg}]) *assert_false()*
When {actual} is not false an error message is added to
|v:errors|, like with |assert_equal()|.
+ The error is in the form "Expected False but got {actual}".
+ When {msg} is present it is prepended to that.
Also see |assert-return|.
+
A value is false when it is zero. When {actual} is not a
number the assert fails.
- When {msg} is omitted an error in the form
- "Expected False but got {actual}" is produced.
Can also be used as a |method|: >
GetResult()->assert_false()
@@ -147,14 +149,16 @@ assert_inrange({lower}, {upper}, {actual} [, {msg}]) *assert_inrange()*
This asserts number and |Float| values. When {actual} is lower
than {lower} or higher than {upper} an error message is added
to |v:errors|. Also see |assert-return|.
- When {msg} is omitted an error in the form
- "Expected range {lower} - {upper}, but got {actual}" is
- produced.
+ The error is in the form "Expected range {lower} - {upper},
+ but got {actual}". When {msg} is present it is prefixed to
+ that.
*assert_match()*
assert_match({pattern}, {actual} [, {msg}])
When {pattern} does not match {actual} an error message is
added to |v:errors|. Also see |assert-return|.
+ The error is in the form "Pattern {pattern} does not match
+ {actual}". When {msg} is present it is prefixed to that.
{pattern} is used as with |expr-=~|: The matching is always done
like 'magic' was set and 'cpoptions' is empty, no matter what
@@ -164,8 +168,6 @@ assert_match({pattern}, {actual} [, {msg}])
Use "^" and "$" to match with the start and end of the text.
Use both to match the whole text.
- When {msg} is omitted an error in the form
- "Pattern {pattern} does not match {actual}" is produced.
Example: >
assert_match('^f.*o$', 'foobar')
< Will result in a string to be added to |v:errors|:
@@ -215,8 +217,7 @@ assert_true({actual} [, {msg}]) *assert_true()*
Also see |assert-return|.
A value is |TRUE| when it is a non-zero number or |v:true|.
When {actual} is not a number or |v:true| the assert fails.
- When {msg} is omitted an error in the form "Expected True but
- got {actual}" is produced.
+ When {msg} is given it precedes the default message.
Can also be used as a |method|: >
GetResult()->assert_true()
diff --git a/runtime/doc/usr_01.txt b/runtime/doc/usr_01.txt
index f0e2462fae..6b94806941 100644
--- a/runtime/doc/usr_01.txt
+++ b/runtime/doc/usr_01.txt
@@ -81,7 +81,7 @@ from within nvim. The tutorial will lead you from that point. Have fun!
==============================================================================
*01.4* Copyright *manual-copyright*
-The Vim user manual and reference manual are Copyright (c) 1988-2003 by Bram
+The Vim user manual and reference manual are Copyright (c) 1988 by Bram
Moolenaar. This material may be distributed only subject to the terms and
conditions set forth in the Open Publication License, v1.0 or later. The
latest version is presently available at: