summaryrefslogtreecommitdiffstats
path: root/roles/vim
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2025-11-10 11:44:08 +0100
committerAhmed Abdelhalim <[email protected]>2025-11-10 11:44:08 +0100
commit60f92a26d2a8bc706ad8a1b9afe2453ea528b355 (patch)
tree31062c053b31e600998cf375c5cceac871068c89 /roles/vim
parent72f14a15b69d771a61c28f281940a6f0a7f56f5a (diff)
Refactor vimrc to accept custom setup script
Diffstat (limited to 'roles/vim')
-rw-r--r--roles/vim/meta/argument_specs.yml4
-rw-r--r--roles/vim/tasks/main.yml14
2 files changed, 10 insertions, 8 deletions
diff --git a/roles/vim/meta/argument_specs.yml b/roles/vim/meta/argument_specs.yml
index 71533908..b69b745d 100644
--- a/roles/vim/meta/argument_specs.yml
+++ b/roles/vim/meta/argument_specs.yml
@@ -8,3 +8,7 @@ argument_specs:
type: "str"
description: "The vimrc git repo URL"
required: true
+ vimrc_setup_script:
+ type: "str"
+ description: "The vimrc setup script"
+ required: true
diff --git a/roles/vim/tasks/main.yml b/roles/vim/tasks/main.yml
index a0859f5c..03059eec 100644
--- a/roles/vim/tasks/main.yml
+++ b/roles/vim/tasks/main.yml
@@ -12,7 +12,7 @@
clone: true
update: false
single_branch: true
- version: main
+ version: "main"
- name: "Ensure .vimrc is linked"
ansible.builtin.file:
@@ -20,13 +20,11 @@
dest: "{{ ansible_env.HOME }}/.vimrc"
state: "link"
-# NOTE: based on https://stackoverflow.com/a/33734425/1769515
+# We don't care much if vim failed to install all plugins
+# this can be manually fixed later when needed
- name: "Setup vim plugins"
- ansible.builtin.command:
- cmd: vim -E -s -u ~/.vimrc +PlugInstall +qall
+ ansible.builtin.shell:
+ cmd: "{{ vimrc_setup_script }}"
+ executable: "/bin/bash"
creates: "{{ ansible_env.HOME }}/.vim/bundle/"
- environment:
- TERM: dumb
- # We don't care much if vim failed to install all plugins
- # this can be manually fixed later when needed
failed_when: false