---
- name: Install neovim
  package:
    name: neovim
    state: present
  become: true
  when: ansible_system == 'Linux'

- name: Install neovim
  package:
    name: neovim
    state: present
  when: ansible_system == 'Darwin'

- name: Clean neovim directory
  file:
    path: "{{ lookup('env', 'HOME') }}/.config/nvim"
    state: absent
  when: cleanup | default(false) | bool

- name: Clone nvim repo
  git:
    repo: git@github.com:arxcruz/nvim.git
    dest: "{{ ansible_user_dir }}/.config/nvim"

- name: Create neovim virtualenv
  shell: virtualenv -p `which python` "{{ ansible_user_dir }}/.virtualenvs/neovim"

- name: Setup neovim python bindigns
  pip:
    name: ['neovim', 'flake8', 'pep8', 'pyflakes', 'pycodestyle']
    virtualenv: "{{ ansible_user_dir }}/.virtualenvs/neovim"
    state: present

---
- name: Install neovim
  package:
    name: neovim
    state: present
  become: true
  when: ansible_system == 'Linux'

- name: Install neovim
  package:
    name: neovim
    state: present
  when: ansible_system == 'Darwin'

- name: Clean neovim directory
  file:
    path: "{{ lookup('env', 'HOME') }}/.config/nvim"
    state: absent
  when: cleanup | default(false) | bool

- name: Clone nvim repo
  git:
    repo: git@github.com:arxcruz/nvim.git
    dest: "{{ ansible_user_dir }}/.config/nvim"

- name: Create neovim virtualenv
  shell: virtualenv -p `which python3` "{{ ansible_user_dir }}/.virtualenvs/neovim"

- name: Setup neovim python bindigns
  pip:
    name: ['neovim', 'flake8', 'pep8', 'pyflakes', 'pycodestyle']
    virtualenv: "{{ ansible_user_dir }}/.virtualenvs/neovim"
    state: present

Update virtualenv to use python3
Update virtualenv to use python3

On the mac machine this was having problems because python is
pointing to python 2.7 instead of python3.8
