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

58 lines
1.3 KiB
YAML
Raw Normal View History

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