Mercurial > vim
diff runtime/doc/eval.txt @ 17020:1841c03a9b5e v8.1.1510
patch 8.1.1510: a plugin cannot easily expand a command like done internally
commit https://github.com/vim/vim/commit/80dad48c5095d30873a42ec82628bdb213125d8e
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 9 17:22:31 2019 +0200
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 https://github.com/vim/vim/issues/4514)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 09 Jun 2019 17:30:04 +0200 |
parents | 353ed7ef78df |
children | 905e1b154058 |
line wrap: on
line diff
--- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2326,6 +2326,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 @@ -4218,6 +4219,14 @@ expand({expr} [, {nosuf} [, {list}]]) 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|.