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
commited3ddb93cba0b7bfc4b4e990dc2aaba88e6b30d3 (patch)
tree31062c053b31e600998cf375c5cceac871068c89 /roles/vim
parent97d32965651fe47e8f2e66e32a557b6115503147 (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