gantsign / ansible-role-oh-my-zsh

Ansible role for installing and configuring oh-my-zsh
https://galaxy.ansible.com/gantsign/oh-my-zsh
MIT License
165 stars 41 forks source link

What should I do to make zsh-autosuggestions work? #161

Closed mac-lucky closed 1 year ago

mac-lucky commented 1 year ago

Hi, Here is my play book

- name: run role for each user
  include_role:
    name: gantsign.oh-my-zsh
  vars:
    users:
      - username: root
        oh_my_zsh:
          theme: gnzh
          plugins:
            - git
            - zsh-syntax-highlighting
            - zsh-autosuggestions
            - docker

The zsh-autosuggestions is in plugins but it does not autocomplete. Do I need to install something else beside the playbook?

YacineSahli commented 1 year ago

Hi, Did you source the plugins at the end of your .zshrc or in your custom .oh-my-zsh/custom/custom-file.zsh ?

mac-lucky commented 1 year ago

No, I didnt. So I need to place the sources at the end of the file and it is not done by this role?

If so, How to automate it to place all the plugins in playbook to .zshrc with sources?

mac-lucky commented 1 year ago

You need to clone the git repo so it looks like this:

- name: run role for each user
  include_role:
    name: gantsign.oh-my-zsh
  vars:
    users:
      - username: root
        oh_my_zsh:
          theme: gnzh
          plugins:
            - git
            - zsh-syntax-highlighting
            - zsh-autosuggestions
            - docker

- name: Clone zsh-autosuggestions
  git:
    repo: https://github.com/zsh-users/zsh-autosuggestions.git
    dest: "/root/.oh-my-zsh/plugins/zsh-autosuggestions"
    version: master

- name: Clone zsh-syntax-highlighting
  git:
    repo: https://github.com/zsh-users/zsh-syntax-highlighting.git
    dest: "/root/.oh-my-zsh/plugins/zsh-syntax-highlighting"
    version: masterc