diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-06-09 17:22:31 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-06-09 17:22:31 +0200 |
commit | 80dad48c5095d30873a42ec82628bdb213125d8e (patch) | |
tree | 4b90c651f4f6f7cd45d18c5aa53c8b4b6fc3291f /runtime | |
parent | 954bb0636390751c0665d7d730a13d86dc5bc6e6 (diff) |
patch 8.1.1510: a plugin cannot easily expand a command like done internallyv8.1.1510
Problem: A plugin cannot easily expand a command like done internally.
Solution: Add the expandcmd() function. (Yegappan Lakshmanan, closes #4514)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 9 | ||||
-rw-r--r-- | runtime/doc/usr_41.txt | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index d1f6824b6d..b5df67cc60 100644 --- 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}]]) *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 719f015d79..ee3423cddf 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1,4 +1,4 @@ -*usr_41.txt* For Vim version 8.1. Last change: 2019 May 29 +*usr_41.txt* For Vim version 8.1. Last change: 2019 Jun 09 VIM USER MANUAL - by Bram Moolenaar @@ -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 |