0

While I'm familiar with a few of the options Zsh provides for autocompletions (i.e. the standard Tab menu-complete and the Ctrl+i completion option), but I've been spoiled with the type of search/completion you can get out of PhpStorm.

For example, in a stock Laravel project in PhpStorm you are able bring up the Search Everywhere dialogue (Double Shift), type in wbp, and have the editor complete that to "welcome.blade.php". The closest I can get to that functionality with Zsh would be to type in wb, place the cursor between the two letters (w|b), and use Ctrl+i.

I have searched around and found a few custom completion scripts, but none that have this type of functionality.

So the big questions are:

1. Is it possible to have smart completion functionality in Zsh like it exists in PhpStorm?

2. If so, how does one go about enabling it?

If it's relevant, I'm using OhMyZsh on OS X 10.12.

xuhdev
  • 8,018
  • 2
  • 41
  • 69

1 Answers1

0

The following setup works for me (put them in ~/.zshrc):

zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
unsetopt CASE_GLOB
zstyle ':completion:*' completer _complete _match _approximate
zstyle ':completion:*:match:*' original only
zstyle ':completion:*:approximate:*' max-errors 2 numeric

Reference: zprezto

xuhdev
  • 8,018
  • 2
  • 41
  • 69