Mercurial > vim
diff runtime/doc/eval.txt @ 23853:a9ed31ab85c3 v8.2.2468
patch 8.2.2468: not easy to get the full command name from a shortened one
Commit: https://github.com/vim/vim/commit/038e09ee7645731de0296d255aabb17603276443
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 6 12:38:51 2021 +0100
patch 8.2.2468: not easy to get the full command name from a shortened one
Problem: Not easy to get the full command name from a shortened one.
Solution: Add fullcommand(). (Martin Tournoij, closes https://github.com/vim/vim/issues/7777)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 06 Feb 2021 12:45:04 +0100 |
parents | 525c9e218c69 |
children | 5b37a0bf7e3a |
line wrap: on
line diff
--- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2562,6 +2562,7 @@ foldlevel({lnum}) Number fold level at foldtext() String line displayed for closed fold foldtextresult({lnum}) String text for closed fold at {lnum} foreground() Number bring the Vim window to the foreground +fullcommand({name}) String get full command from {name} funcref({name} [, {arglist}] [, {dict}]) Funcref reference to function {name} function({name} [, {arglist}] [, {dict}]) @@ -4902,6 +4903,21 @@ foreground() Move the Vim window to the {only in the Win32, Athena, Motif and GTK GUI versions and the Win32 console version} +fullcommand({name}) *fullcommand()* + Get the full command name from a short abbreviated command + name; see |20.2| for details on command abbreviations. + + {name} may start with a `:` and can include a [range], these + are skipped and not returned. + Returns an empty string if a command doesn't exist or if it's + ambiguous (for user-defined functions). + + For example `fullcommand('s')`, `fullcommand('sub')`, + `fullcommand(':%substitute')` all return "substitute". + + Can also be used as a |method|: > + GetName()->fullcommand() +< *funcref()* funcref({name} [, {arglist}] [, {dict}]) Just like |function()|, but the returned Funcref will lookup