diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-02-28 18:40:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-28 18:40:24 +0800 |
commit | 77626ed7fd369b797dcb2ad0714a84bfd9afff36 (patch) | |
tree | fce024d2f065017d40f1536fa4d948676da54a76 /runtime | |
parent | 9b25c68db21c4a2c1edc0d9eb2cdb80cf249193a (diff) | |
parent | b66f395ff444643852e3539b849267658e885bf4 (diff) | |
download | rneovim-77626ed7fd369b797dcb2ad0714a84bfd9afff36.tar.gz rneovim-77626ed7fd369b797dcb2ad0714a84bfd9afff36.tar.bz2 rneovim-77626ed7fd369b797dcb2ad0714a84bfd9afff36.zip |
Merge pull request #28486 from zeertzjq/vim-8.2.4603
vim-patch:8.2.{4594,4603,4607,4647,4974}
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/repeat.txt | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index e65caa72ed..158ea6a4a1 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -192,14 +192,23 @@ Using Vim scripts *using-scripts* For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|. *:so* *:source* *load-vim-script* -:[range]so[urce] [file] Runs |Ex-commands| or Lua code (".lua" files) from - [file]. - If no [file], the current buffer is used and treated - as Lua code if 'filetype' is "lua" or its filename - ends with ".lua". +:so[urce] {file} Runs |Ex-commands| or Lua code (".lua" files) from + {file}. Triggers the |SourcePre| autocommand. + +:[range]so[urce] Read Ex commands or Lua code from the [range] of lines + in the current buffer. When [range] is omitted read + all lines. The buffer is treated as Lua code if its + 'filetype' is "lua" or its filename ends with ".lua". + + When sourcing commands or Lua code from the current + buffer, the same script-ID |<SID>| is used even if the + buffer is sourced multiple times. If a buffer is + sourced more than once, then the functions in the + buffer are defined again. + *:source!* -:[range]so[urce]! {file} +:so[urce]! {file} Runs |Normal-mode| commands from {file}. When used after |:global|, |:argdo|, |:windo|, |:bufdo|, in a loop or when another command follows the display @@ -389,10 +398,10 @@ An alternative is to put the commands in a file, and execute them with the ':source!' command. Useful for long command sequences. Can be combined with the ':map' command to put complicated commands under a function key. -The ':source' command reads Ex commands from a file line by line. You will -have to type any needed keyboard input. The ':source!' command reads from a -script file character by character, interpreting each character as if you -typed it. +The ':source' command reads Ex commands from a file or a buffer line by line. +You will have to type any needed keyboard input. The ':source!' command reads +from a script file character by character, interpreting each character as if +you typed it. Example: When you give the ":!ls" command you get the |hit-enter| prompt. If you ':source' a file with the line "!ls" in it, you will have to type the |