dotfiles/config/automatrop/roles/vim/tasks/main.yml

56 lines
1.4 KiB
YAML
Raw Normal View History

2023-11-02 19:51:54 +01:00
---
2021-07-03 14:13:25 +02:00
- name: Set vim variants to use
2023-11-02 19:51:54 +01:00
ansible.builtin.set_fact:
2021-07-03 14:13:25 +02:00
vim_variants:
- vim
- nvim
# TODO vim-minimal for bsh
# TODO Select those in a clever way
- name: Create vim configuration directory
2023-11-02 19:51:54 +01:00
ansible.builtin.file:
state: directory
path: "{{ ansible_user_dir }}/.config/{{ item }}"
2023-11-02 19:51:54 +01:00
mode: u=rwx,g=rx,o=rx
2021-07-03 14:13:25 +02:00
loop: "{{ vim_variants }}"
- name: Install vim-plug
2023-11-02 19:51:54 +01:00
ansible.builtin.get_url:
2021-07-03 14:13:25 +02:00
url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
dest: "{{ ansible_user_dir }}/.config/vim/plug.vim"
2023-11-02 19:51:54 +01:00
mode: u=rw,g=r,o=r
2021-07-03 14:13:25 +02:00
- name: Install loader
2023-11-02 19:51:54 +01:00
ansible.builtin.template:
2021-07-03 14:13:25 +02:00
src: loader.j2
dest: "{{ ansible_user_dir }}/.config/vim/loader.vim"
2023-11-02 19:51:54 +01:00
mode: u=rw,g=r,o=r
- name: Install theme
2023-11-02 19:51:54 +01:00
ansible.builtin.template:
src: theme.j2
dest: "{{ ansible_user_dir }}/.config/vim/theme.vim"
2023-11-02 19:51:54 +01:00
mode: u=rw,g=r,o=r
tags:
- color
2021-07-03 14:13:25 +02:00
- name: Configure vim plugin list
2023-11-02 19:51:54 +01:00
ansible.builtin.template:
2021-07-03 14:13:25 +02:00
src: plugininstall.j2
dest: "{{ ansible_user_dir }}/.config/{{ variant }}/plugininstall.vim"
2023-11-02 19:51:54 +01:00
mode: u=rw,g=r,o=r
2021-07-03 14:13:25 +02:00
notify:
- "{{ variant }} plugins changed"
loop: "{{ vim_variants }}"
loop_control:
loop_var: variant
2021-07-03 14:13:25 +02:00
- name: Configure vim
2023-11-02 19:51:54 +01:00
ansible.builtin.template:
2021-07-03 14:13:25 +02:00
src: init.vim.j2
dest: "{{ ansible_user_dir }}/.config/{{ variant }}/init.vim"
2023-11-02 19:51:54 +01:00
mode: u=rw,g=r,o=r
2021-07-03 14:13:25 +02:00
loop: "{{ vim_variants }}"
loop_control:
loop_var: variant