3

How can I list / show all built-in functions, similar to the :function command which lists all (non-builtin?) functions?

5

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 it
  • put! - Put the text from a register before the current line
  • = - The expression register
  • getcompletion('*', 'function') - Return a list of command-line completion for all functions
  • ->filter({lambda}) - filter results from the returned list of getcompletion(...) based on the return value of {lambda}
  • {_, v -> v =~# '{pattern}'} - Lambda function that returns 1 if v 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:

2

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?

2
  • 3
    is there anything missing from the help function list or why are you looking for an additional command? Oct 7 '20 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" Oct 11 '20 at 0:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.