diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-02-28 13:40:26 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2025-02-28 18:21:07 +0800 |
commit | a3a9f86d4a11029542a94b00044b5a181a68c9cd (patch) | |
tree | a7c1400e2cf08609baa4ade617e6fcd1f617d6e9 /runtime | |
parent | 9b25c68db21c4a2c1edc0d9eb2cdb80cf249193a (diff) | |
download | rneovim-a3a9f86d4a11029542a94b00044b5a181a68c9cd.tar.gz rneovim-a3a9f86d4a11029542a94b00044b5a181a68c9cd.tar.bz2 rneovim-a3a9f86d4a11029542a94b00044b5a181a68c9cd.zip |
vim-patch:8.2.4594: need to write script to a file to be able to source them
Problem: Need to write script to a file to be able to source them.
Solution: Make ":source" use lines from the current buffer. (Yegappan
Lakshmanan et al., closes vim/vim#9967)
https://github.com/vim/vim/commit/36a5b6867bb6c0bd69c8da7d788000ab8a0b0ab0
Most code and test changes are reverted or modified again in patch
8.2.4603, so only port parts that are untouched in patch 8.2.4603.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/repeat.txt | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index e65caa72ed..4c95066998 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -192,14 +192,19 @@ 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. The buffer is treated as Lua + code if '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. + *: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 |