How can I list / show all built-in functions, similar to the :function command which lists all (non-builtin?) functions?
Asked
Active
Viewed 1,697 times
6
Rob Bednark
- 371
- 1
- 13
2 Answers
6
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 ifvcase 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:
Jake Grossman
- 1,643
- 1
- 4
- 16
user938271
- 5,947
- 1
- 15
- 24
3
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.
markling
- 359
- 1
- 10
Rob Bednark
- 371
- 1
- 13
-
3is there anything missing from the help function list or why are you looking for an additional command? – Christian Brabandt Oct 07 '20 at 05: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" – Rob Bednark Oct 11 '20 at 00:32