voronkovich / gitignore.plugin.zsh

ZSH plugin for creating .gitignore files.
MIT License
53 stars 5 forks source link

autocompletion not working on macOS #7

Closed mlcsthor closed 4 years ago

mlcsthor commented 4 years ago

Hello, I don't know if my problem comes from the plugin or from my configuration, but the autocompletion lists my files instead of the available templates.

Capture d’écran 2020-03-10 à 15 34 31
voronkovich commented 4 years ago

@mlcsthor, try to fix autocompletion by executing this commands on your terminal:

$ compaudit | xargs -I % chmod g-w "%";
$ compaudit | xargs -I % chown $USER "%";
$ rm ~/.zcompdump*;
$ compinit;

BTW, Sometimes ZSH autocompletion suddenly stops to work, so I have this function on my .zshrc

fix-autocompletion() {
    compaudit | xargs -I % chmod g-w "%";
    compaudit | xargs -I % chown $USER "%";
    rm ~/.zcompdump*;
    compinit;
}
mlcsthor commented 4 years ago

I've tried but unfortunately it doesn't work :/ I even tried to redo a complete installation of zsh, oh-my-zsh, antigen and the plugin under macOS and Windows with WSL, I get the same result.

voronkovich commented 4 years ago

@mlcsthor, I think the problem is caused by Antigen (See: https://github.com/zsh-users/antigen/issues/698 and https://github.com/zsh-users/antigen/issues/701).

Try to install the plugin manually:

$ cd /tmp
$ git clone --recursive https://github.com/voronkovich/gitignore.plugin.zsh
$ source gitignore.plugin.zsh/gitignore.plugin.zsh
$ gi <TAB> # Should work fine
mlcsthor commented 4 years ago

It works on Windows but not on macOS, strangely enough. It's like it freezes while searching for completions.

voronkovich commented 4 years ago

@mlcsthor, Sorry, I have no MacOS (I use Linux), so I can't help you with this issue. Try to find the solution here: https://github.com/ohmyzsh/ohmyzsh/issues/5651 and here: https://stackoverflow.com/a/26479426

I'm closing this issue because it's not related to the plugin.

ajanian commented 4 years ago

I figured out why. This will work if you try to prepend everything with an "L" so Lvis [TAB] will work I believe. The solution is in issue #8 and it has to do with the sed expression.