Apply autocompletion without appending a space to the completed word

complete

  • Provides argument autocompletion to shell commands.
    More information: <https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

complete -o nospace -F {{function}} {{command}}

click the source code to copy