139 lines
3.9 KiB
YAML
139 lines
3.9 KiB
YAML
---
|
|
- name: Fail if still using init.vim
|
|
stat:
|
|
path: ~/.config/nvim/init.vim
|
|
register: init_vim
|
|
failed_when: init_vim.stat.exists
|
|
|
|
- name: Install (Archlinux)
|
|
block:
|
|
- name: Install things with pacman (Archlinux)
|
|
become: true
|
|
pacman:
|
|
name:
|
|
- neovim
|
|
- python-pynvim
|
|
- base-devel
|
|
- cmake
|
|
- clang
|
|
- npm
|
|
- ripgrep
|
|
- rsync # for 'synchronize' module
|
|
- ansible-lint
|
|
- flake8
|
|
- mypy
|
|
- python-pylint
|
|
- python-black
|
|
- shellcheck
|
|
- bash-language-server
|
|
- jedi-language-server
|
|
- lua-language-server
|
|
- texlab
|
|
- name: Install things with npm (Archlinux)
|
|
become: true
|
|
npm:
|
|
name: '@ansible/ansible-language-server'
|
|
global: true
|
|
when:
|
|
ansible_facts['distribution'] == 'Archlinux'
|
|
|
|
- name: Grab neovim deb package (Debian)
|
|
block:
|
|
- name: Find latest neovim version
|
|
uri:
|
|
url: https://github.com/neovim/neovim/releases/latest
|
|
register: latest_http_content
|
|
- name: Set latest neovim version
|
|
set_fact:
|
|
neovim_version: "{{ latest_http_content.url | split('/') | last }}"
|
|
# TODO: Find if latest neovim is installed (dpkg command)
|
|
- name: Get latest neovim deb package
|
|
get_url:
|
|
url: "https://github.com/neovim/neovim/releases/download/{{ neovim_version }}/nvim-linux64.deb"
|
|
checksum: "sha256:https://github.com/neovim/neovim/releases/download/{{ neovim_version }}/nvim-linux64.deb.sha256sum"
|
|
dest: /tmp/nvim-linux64.deb
|
|
mode: 0644
|
|
when:
|
|
ansible_facts['distribution'] == 'Debian'
|
|
|
|
- name: Install (Debian)
|
|
block:
|
|
- name: Install neovim deb package (Debian)
|
|
become: true
|
|
apt:
|
|
deb: /tmp/nvim-linux64.deb
|
|
- name: Install things with apt (Debian)
|
|
become: true
|
|
apt:
|
|
name:
|
|
- python3-pynvim
|
|
- build-essential
|
|
- python3-dev
|
|
- cmake
|
|
- clang
|
|
- npm
|
|
- ripgrep
|
|
- rsync # for 'synchronize' module
|
|
- flake8
|
|
- mypy
|
|
- pylint3
|
|
- shellcheck
|
|
- name: Install things with pip (Debian)
|
|
pip:
|
|
name:
|
|
- ansible-lint
|
|
- jedi-language-server
|
|
extra_args: --user
|
|
- name: Install things with npm (Debian)
|
|
become: true
|
|
npm:
|
|
name: "{{ item }}"
|
|
global: true
|
|
with_items:
|
|
- bash-language-server
|
|
- '@ansible/ansible-language-server'
|
|
# TODO:
|
|
# - lua-language-server
|
|
# - texlab
|
|
when:
|
|
ansible_facts['distribution'] == 'Debian'
|
|
|
|
- name: Grab marksman (LSP server) binary
|
|
block:
|
|
- name: Find latest marksman version
|
|
uri:
|
|
url: https://github.com/artempyanykh/marksman/releases/latest
|
|
register: latest_http_content
|
|
- name: Set latest marksman version
|
|
set_fact:
|
|
marksman_version: "{{ latest_http_content.url | split('/') | last }}"
|
|
- name: Get latest marksman binary
|
|
get_url:
|
|
url: "https://github.com/artempyanykh/marksman/releases/download/{{ marksman_version }}/marksman-linux"
|
|
dest: ~/.local/bin/marksman
|
|
mode: 0755
|
|
|
|
- name: Make sure needed directories exist
|
|
file: path={{ item.path }} state=directory mode={{ item.mode }}
|
|
with_items:
|
|
- {path: '~/.config/nvim', mode: '0755'}
|
|
- {path: '~/.config/nvim/lua', mode: '0755'}
|
|
|
|
- name: Copy configs
|
|
copy: src={{ item.src }} dest={{ item.dest }} mode=0644
|
|
with_items:
|
|
- {src: 'init.lua', dest: '~/.config/nvim/init.lua'}
|
|
- {src: 'flake8', dest: '~/.flake8'}
|
|
- {src: 'pylintrc', dest: '~/.pylintrc'}
|
|
|
|
- name: Copy lua configs
|
|
synchronize:
|
|
src: lua
|
|
dest: ~/.config/nvim/
|
|
recursive: true
|
|
delete: true
|
|
|
|
- name: Run PackerSync
|
|
command: nvim --headless -c 'autocmd User PackerComplete quitall' -c PackerSync
|
|
# TODO: changed_when
|
|
changed_when: false
|