Search code examples
shellzshoh-my-zshtab-completionzsh-completion

Autocompletion for my shell function, using oh-my-zsh


I have a shell function that lets me quickly cd to a project:

p() {
  cd "$HOME/projects/$1"
}

However, it isn't very useful without autocomplete. I'm using oh-my-zsh, any idea how best to add oh-my-zsh's standard cd autocomplete to my function p?


Solution

  • I suggest two cool plugins, both add some amazing features that will blow your mind.

    1. https://github.com/clvv/fasd
    2. https://github.com/zsh-users/zsh-autosuggestions