-2

I build a huge zsh completion file for my program using clap_complete. To activate it, I added in my ~/.zshrc the lines:

fpath+=(~/.zsh/completion) # adding my completion directory to the fpath
compinit # running completion

However, the compinit line doubles the load time of each new terminal (opened with Ctrl+Shift+T for instance).

Is there a way to somehow cache the compinit call so it's only run once?

Hugo Trentesaux
  • 1,584
  • 1
  • 16
  • 30

1 Answers1

0

Each time you open the terminal, it starts the whole process over again. So even if you tried to cache compinit, and then opened a new one, then it would skip component and you wouldn't have your autocomplete setup.

KaliMachine
  • 191
  • 9