When do I have to call compinit
manually?
#61
-
But I need to run it manually after e.g.
or
otherwise, completions don't work there. I don't know much about how Zsh or completions work, could somebody explain what the README section really means and when I still need to run UPDATE: there was a bug that is now fixed, see #61 (comment). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Short answer: Never. With Znap, you really never have to call Longer answer: Well, theoretically, you'd have to run So, long story short, for your case, just put the following into your znap source agkozak/zsh-z
fpath+=( ~[zsh-users/zsh-completions]/src ) I just tested it and the completions work fine that way. (If it doesn't for you, please open a bug report for it.) |
Beta Was this translation helpful? Give feedback.
-
A question not to bury it in the sibling thread: Znap seems to overwrite # Last line of my `.zshrc:
autoload -U compinit && compinit Would this make completions any safer? Like, if there are "bugs" in Znap (like before fixes) |
Beta Was this translation helpful? Give feedback.
Short answer: Never. With Znap, you really never have to call
compinit
manually. Any completions added to your$fpath
while executing the code inside your.zshrc
file will be automatically passed tocompinit
.Longer answer: Well, theoretically, you'd have to run
compinit
manually if you would add completions to your$fpath
after your shell has started up. But there is no practical reason to ever do that. As long as you add your completions to your$fpath
inside your.zshrc
file only, then there really is no reason to ever bother runningcompinit
manually when using Znap.So, long story short, for your case, just put the following into your
.zshrc
file: