aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-02-21 22:05:59 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-03-01 03:57:58 -0500
commiteba8a9ca1d94f43b7fe2e92d5a2caa144dd68d0d (patch)
treed5c809a9f32cdcab47a8ebd974ecffbafc7ce13a /runtime
parent5e0c435ca1b711e80f78429431b4d400d789c618 (diff)
downloadrneovim-eba8a9ca1d94f43b7fe2e92d5a2caa144dd68d0d.tar.gz
rneovim-eba8a9ca1d94f43b7fe2e92d5a2caa144dd68d0d.tar.bz2
rneovim-eba8a9ca1d94f43b7fe2e92d5a2caa144dd68d0d.zip
vim-patch:8.1.1510: a plugin cannot easily expand a command like done internally
Problem: A plugin cannot easily expand a command like done internally. Solution: Add the expandcmd() function. (Yegappan Lakshmanan, closes vim/vim#4514) https://github.com/vim/vim/commit/80dad48c5095d30873a42ec82628bdb213125d8e
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/eval.txt9
-rw-r--r--runtime/doc/usr_41.txt1
2 files changed, 10 insertions, 0 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index ce0218f1dd..c687d15689 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2110,6 +2110,7 @@ extend({expr1}, {expr2} [, {expr3}])
exp({expr}) Float exponential of {expr}
expand({expr} [, {nosuf} [, {list}]])
any expand special keywords in {expr}
+expandcmd({expr}) String expand {expr} like with `:edit`
feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer
filereadable({file}) Number |TRUE| if {file} is a readable file
filewritable({file}) Number |TRUE| if {file} is a writable file
@@ -3733,6 +3734,14 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()*
See |glob()| for finding existing files. See |system()| for
getting the raw output of an external command.
+expandcmd({expr}) *expandcmd()*
+ Expand special items in {expr} like what is done for an Ex
+ command such as `:edit`. This expands special keywords, like
+ with |expand()|, and environment variables, anywhere in
+ {expr}. Returns the expanded string.
+ Example: >
+ :echo expandcmd('make %<.o')
+<
extend({expr1}, {expr2} [, {expr3}]) *extend()*
{expr1} and {expr2} must be both |Lists| or both
|Dictionaries|.
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 5f9253cbd0..234f7801ab 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -609,6 +609,7 @@ String manipulation: *string-functions*
strcharpart() get part of a string using char index
strgetchar() get character from a string using char index
expand() expand special keywords
+ expandcmd() expand a command like done for `:edit`
iconv() convert text from one encoding to another
byteidx() byte index of a character in a string
byteidxcomp() like byteidx() but count composing characters