How can I list / show all built-in functions, similar to the :function
command which lists all (non-builtin?) functions?
2 Answers
Try this:
new | put! =getcompletion('*', 'function')->filter({_, v -> v =~# '^[a-z][^#]*$'})
Broken down:
new
- Create a new window and start editing an empty file in itput!
- Put the text from a register before the current line=
- The expression registergetcompletion('*', 'function')
- Return a list of command-line completion for all functions->filter({lambda})
- filter results from the returned list ofgetcompletion(...)
based on the return value of{lambda}
{_, v -> v =~# '{pattern}'}
- Lambda function that returns 1 ifv
case sensitively matches{pattern}
, else 0^[a-z][^#]*$'
^
- Start of string[a-z]
- Any lowercase letter[^#]*
- Any non-#
character, 0 or more times$
- End of String
For more info, see:
I found a list in :help functions
(plural) which is sufficient if there is no command. But it would be nice to find a corollary command to :function
-- is there one?
The functions list is also grouped by use here: h: function-list
. Eg. it lists string-functions
, cursor-functions
, and so on.
-
3is there anything missing from the help function list or why are you looking for an additional command? Commented Oct 7, 2020 at 5:41
-
It's nice to see a list in isolation, outside the context of help. Also, I was curious if there was a corollary function to ":functions" Commented Oct 11, 2020 at 0:32