dotfiles/roles/neovim/tasks/main.yaml

68 lines
1.4 KiB
YAML

---
- name: Dependencies
ansible.builtin.package:
name:
- autoconf
- automake
- cmake
- curl
- doxygen
- g++
- gettext
- libtool
- libtool-bin
- ninja-build
- pkg-config
- unzip
state: latest
become: yes
- name: Clone
ansible.builtin.git:
clone: yes
depth: 1
dest: "{{ ansible_user_dir }}/build/neovim"
repo: https://github.com/neovim/neovim.git
# single_branch: yes
update: yes
version: "{{ neovim_version | default('master') }}"
register: clone
- name: Build
make:
chdir: "{{ ansible_user_dir }}/build/neovim"
params:
CMAKE_BUILD_TYPE: RelWithDebInfo
when: clone.changed
- name: Install
make:
chdir: "{{ ansible_user_dir }}/build/neovim"
target: install
become: yes
when: clone.changed
- name: Remove build folder
ansible.builtin.file:
path: "{{ ansible_user_dir }}/build/neovim/build"
state: absent
become: yes
- name: Create .config/nvim directory
ansible.builtin.file:
path: "{{ ansible_user_dir }}/.config/nvim"
state: directory
- name: Configuration files
ansible.builtin.file:
src: "{{ role_path }}/files/{{ neovim_config_item }}"
dest: "{{ ansible_user_dir }}/.config/nvim/{{ neovim_config_item }}"
state: link
loop_control:
loop_var: neovim_config_item
with_items:
- after
- autoload
- init.lua
- lua