ex-mode icon indicating copy to clipboard operation
ex-mode copied to clipboard

Feature proposal: Command specific autocompletion

Open cldwalker opened this issue 4 years ago • 0 comments

Hi. Thanks for the handy library. I've written a couple of commands that take package names. I would like those commands to autocomplete with package names. Would you be open to allowing users to define command-specific completions? If so, some thoughts on how this could work:

  • Commands would be registered with a basic api like Ex.registerCommandCompletions('command_name', completionFn). completionFn would be a function that takes one argument, the string of text after a command. For example, if a user typed command foo bar, the completionFn would receive 'foo bar'.
  • If a command doesn't have a completionFn registered, default to the excellent file completion introduced in #29

Let me know your thoughts. Can create a PR if interested. Cheers, Gabriel

cldwalker avatar Jul 29 '19 23:07 cldwalker